View Single Post
  #1    
Old April 5th, 2010 (11:58 AM). Edited April 5th, 2010 by smurph717.
smurph717
Programmer
 
Join Date: Apr 2010
Location: Santa Clara
Gender: Male
Nature: Bold
Hey all, so I've been playing around with the land_data files (the narc is at a/0/6/5 in the rom, for those interested), and found an interesting change from the DPP format (I'm assuming it's a change because it apparently wasn't an issue with maps from DPP, but I'm not certain because I don't have those roms). Some of you may be aware of the PG4Map tool that SentryAlphaOmega made recently (it's in this forum), and how it can't open many of the HG/SS map files. After snooping around in a few with a hex editor, I noticed a "magic number" of sorts placed after the 4 sizes in the header. It looks like after the movement permissions, 3d models, BMD0, and BDHC section sizes are given, there's a 0x1234 and then another size of something (it's zero for the maps that PG4Map can open). I'll look into this more and post later, but the size given here is always the offset from where the program expects the BMD0 data to start and where it actually starts. What's weird is it doesn't take this into account for the size of the header; even though there's this magic number and mystery size, the BMD0 offset is still computed as if the header is 16 bytes. For example, in land_data_release_004, the sizes of the two sections before BMD0 are 0x800 and 0x0 and the size of the header is 0x10, so PG4Map looks at 0x810 for the BMD0 data and fails. In actuality, it starts at 0x850, and after the 0x1234 "magic number" there's an 0x40. I modified the tool to take that into account, and now it opens all the maps (I'm having some serious texture issues, however, but at least the models load). If someone could point me in the direction of more documentation on the map file format, I'd appreciate it. For all I know, I figured out something someone already knows, but probably not because the tool didn't know about it. Anyway, enjoy!
Attached Files
File Type: zip PG4Map_R1.zip‎ (915.9 KB, 85 views) (Save to Dropbox)
Reply With Quote