:
The first mine has the position ID 1015 0101 (0x01011015) in the save file. The second one has 2C15 0101. The difference between them is 1C, which is exactly the difference between them in bytes in the path file, which means position ID is some kind of an offset.
So far, given a Path file without any previous information, we could parse the screen array and the collision map (although we don't know where it ends). I believe the next step is to find the delimiter for the collision map.
Edit: Figured it out! The last short in the collision mask structure is mostly random, but when it's 6400, it means "end". Right after that comes your list, in your format. You can see five Muds over there (And the LCD sign, which also includes its position and other data btw, and the ledges.)! This is screen MIP1C36 BTW, the topmost and leftmost screen in the path.
|
Seems I already wrote an app that does most of this path stuff, this is how it calcs where to start for a given screen
// S1 to S2
std::cout << "\nS1 to S2\n";
ParsePath( &data[0], 0, 3, 1, -1 );
ParsePath( &data[0], 0, 2, 1, -1 );
// S2 to S3
std::cout << "\nS2 to S3\n";
ParsePath( &data[0], 0, 4, 1, -1 );
ParsePath( &data[0], 0, 3, 1, -1 );
// S3 to S4
std::cout << "\nS3 to S4\n";
ParsePath( &data[0], 0, 5, 1, -1 );
ParsePath( &data[0], 0, 4, 1, -1 );
The 2nd arg is most important, this is used with a magic offset to get the starting pos in the path for the objects in the current screen. The game seems to always load one ahead which must be why you hear sounds for things in the next screen
Edit: the screen number seems to be the index into the array of screen names too, for 0 in R1 in AO it gets no objects, since the first screen is null
Edit: Confirmed that is certainly it
That means I can figure out which objects are where for which screen but it requires the hard coded offset data. I guess the main thing to figure out is where does the array of screens end, unless its just a case of checking for null and then none null / none valid screen?
Edit: Boom headshot!
To know where the index table starts, subtract the cam name array size from the end of the file, to know where the end of the collision data is use the "lowest" offset from the index table
I can certainly write a path file parser now
Woo!
Final edit: Well.. it looks like the collision data will be the only way to know how the screens fit together.. no idea how you know which collision data is for what screen, I think this is the final missing link (besides the params for each game object).