Blade Posted October 6, 2014 Share Posted October 6, 2014 Anyone know how the map data is stored in the bin file for sole survivor? I take it its not a one to one mapping of two bytes to every cell like C&C maps since the files are all different sizes? Link to comment Share on other sites More sharing options...
Nyerguds Posted October 7, 2014 Share Posted October 7, 2014 No clue... there's a converter out there though, so someone seems to have cracked it, at some point. Link to comment Share on other sites More sharing options...
Myg Posted October 7, 2014 Share Posted October 7, 2014 I think it was every 4 bytes, two byes position, two bytes cell info. Link to comment Share on other sites More sharing options...
CCHyper Posted October 7, 2014 Share Posted October 7, 2014 Do not hold me to this, but from my old notes (that is seriously outdated, Dec 2010...), it should be; I used "short" as the game handles pretty much everything as a byte, though that might have been a compiler optimization and I'm sure they coded it as a "int". struct CoordStruct{ short X; short Y; }; struct MapPackStruct{ CoordStruct Coord; TemplateType Template; short TemplateTileIndex; }; Also, SS can load C&C95 maps when you set a internal integer "INIFormat to "0", its +0x28 from the static MapClass Map. Link to comment Share on other sites More sharing options...
Blade Posted October 7, 2014 Author Share Posted October 7, 2014 Looking at an actual file, Myg's explanation looks closest to what I see, short containing x*y pos, byte identifying tileset, byte identifying tile. struct MapPackStruct { short CellNumber; byte Template; byte TemplateTileIndex; }; This also explains why the files are different sizes, clear tiles aren't recorded. Link to comment Share on other sites More sharing options...
CCHyper Posted October 8, 2014 Share Posted October 8, 2014 OK, so I was on the right track, just needed to change the "short"' to "byte". The game handles the first two bytes as a struct, and the basic common format for coords or position in C&C games is CoordStruct, weather the data be byte, short or int. EDIT: All BIN's are formatted as if the map is 128x128. So 0xFF/255 means ignore/skip, while anything less that 128 means a valid cell coord and thus loads the data into the internal hardcoded map struct. So CoordStruct should be CellCoordStruct and the entry's represent the XY location of the cell in the internal 128x128 map structure. Correct me if I am wrong as I'm new to the map formats of Pre-TS games... Link to comment Share on other sites More sharing options...
Blade Posted October 8, 2014 Author Share Posted October 8, 2014 That sounds about right, but the Sole Survivor bin files don't appear to record the 0xFF, 0x00 pairs in the file itself, preferring the record the coords of the none clear tiles only unlike the TD ones that record an entry for all cells and rely on the position in the file to dictate what coord the entry pertains to. Link to comment Share on other sites More sharing options...
Nyerguds Posted October 9, 2014 Share Posted October 9, 2014 So, it's basically just like a C&C map, but prefixed with the size? Interesting. Link to comment Share on other sites More sharing options...
Iran Posted October 9, 2014 Share Posted October 9, 2014 .bin for C&C95 is two bytes per cell, first byte is the template and the second byte is the tile of the template. For sole survivor you can use a hex editor and modify the maps. Try changing the first few bytes of the file and check what happens to the top north west of the map. Link to comment Share on other sites More sharing options...
Nyerguds Posted October 10, 2014 Share Posted October 10, 2014 uh, Iran, they already figured it out... editing the first few bytes will just mess up the map dimensions. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now