Skip to content

Investigate MBIN.PC / TkGeometryData oddities #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
emoose opened this issue Aug 26, 2016 · 2 comments
Open

Investigate MBIN.PC / TkGeometryData oddities #52

emoose opened this issue Aug 26, 2016 · 2 comments

Comments

@emoose
Copy link
Owner

emoose commented Aug 26, 2016

So far what I've noticed:

  • Magic set to 0xDDDDDDDD instead of 0xCCCCCCCC
  • Data at 0x8-0x10 set to 0xFFFF... (normally 00, but some files have data here which looks to be a build date, e.g. inside GCDEBUGOPTIONS.GLOBAL.MBIN this data is 06 C3 B9 F0 2E 00 00 00, which as an int64 becomes 201607201542)
  • Data at 0x58-0x60 set to 0xFEFE... (normally 00)
  • List magic set to 01 00 00 00 instead of 01 AA AA AA

Probably some other differences too, will have to look into these further.

EDIT: cc29d10 should fix reading lists that use 01 00 00 00 magic, though it doesn't write lists using that magic yet, need to check if we actually need to or whether the game will still work with us using 01 AA AA AA inside MBIN.PC files.

@yretenai
Copy link
Contributor

yretenai commented Aug 26, 2016

What if the list magic is actually 1 byte and 3 padding bytes?

Do "normal" lists still load normally by the client with the AAAAAA bytes set to 000000?

The templates seem to skip over the last four bytes entirely.

@emoose
Copy link
Owner Author

emoose commented Aug 26, 2016

Hmm, well if the AA AA AA part was padding I'm not sure why that'd be set to AA AA AA while other padding bytes in the same file are 00, could be a compiler quirk I guess.

I've got a feeling that the compiler for models is different to the compiler for the other files, mostly because of the MBIN header differences, perhaps the plugin they use for exporting models to MBIN is from a different codebase than their main MBIN compiler.

Do "normal" lists still load normally by the client with the AAAAAA bytes set to 000000?

Haven't tried that but it might be worth a go, like you said it doesn't seem like this "magic" gets checked by the game, though MBINCompiler checks it just to make sure it's not reading an invalid list, helps a lot to get template structures right.

EDIT: Actually you might be onto something with the data being padding, in TkAnimMetadata it uses 01 FE FE FE instead of the others, and it looks like FE is being used as padding throughout the file too, hmm..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants