emoose / MBINCompiler

Now maintained by monkeyman192: https://github.com/monkeyman192/MBINCompiler
Other
43 stars 69 forks source link

List of globals templates still unmapped #62

Open emoose opened 7 years ago

emoose commented 7 years ago

Since the exe doesn't contain templates for these globals I've decided to move them from #13 to a new issue.

The exe does contain functions for them which AFAIK set them to default values, we can use these functions to work out the types/offsets of fields, but sadly there's no names for the fields :-1:

IMO we should create skeleton templates using those "default functions", with all the assumed types and offsets, then when someone finds out what a field does they can easily update the skeleton with a field name describing it.

Globals are listed with their name and size of the data.

Templates with no skeleton / named fields:

Templates with skeletons created, but not many named fields:

Templates with a majority of fields named:

BarclayXO commented 7 years ago

GcGraphicsGlobals doesn't appear to be used by the game, IF they actually set anything?

I once deleted it on accident when running unpacked and the game loads and plays fine.

If someone else could test and confirm then would be nice to know

emoose commented 7 years ago

@SirBarclay The game might have been using defaults baked into the exe, not all globals have them though, I'll have a look whether it does now.

EDIT: Looks like it has defaults in the exe, at 0x140151BB0 in GoG 1.0.

Also did you notice any difference in the graphics after you removed it? I heard before that deleting SpaceshipGlobals makes your ship move faster, which I guess is the defaults in the exe having different values to the MBIN.

BarclayXO commented 7 years ago

No difference in graphics, literally nothing changed at all.

It might pre-load some default then load values from an mbin, just like doing

int aylmao = 42;

void main(){ aylmao = 69; }

Which would explain making the ship faster.

Wont know until they're mapped and edited though I guess?

emoose commented 7 years ago

BTW for anyone looking into globals, if you're looking into the defaults func for a global and it calls another sub (child template) inside it (eg. GcGraphicsGlobals calls two different subs), look for xrefs to the sub and you should find an xref that calls a bunch of sce* functions, that xref should also have the name for that child template, which you can then use to find the xml template stuff inside the exe. (which is how c90ea4318743be9f4101ae896e15defe5c5a8e48 was done)

TRX-0 commented 7 years ago

GcWaterGlobals (And its one bool) seems to add or remove the wave formations on water. Setting it to false causes the water to render as just a straight plain blue surface.

Lo2k commented 7 years ago

I just tried to decompile all of them today and if most of them worked perfectly, it seems the following files can't be decompiled at all : GCAISPACESHIPGLOBALS.GLOBAL.MBIN GCCAMERAGLOBALS.GLOBAL.MBIN GCCREATUREGLOBALS.MBIN GCENVIRONMENTGLOBALS.GLOBAL.MBIN GCGAMEPLAYGLOBALS.GLOBAL.MBIN GCPLAYERGLOBALS.GLOBAL.MBIN GCROBOTGLOBALS.MBIN GCSKYGLOBALS.GLOBALS.MBIN GCSPACESHIPGLOBALS.GLOBAL.MBIN GCUIGLOBALS.GLOBAL.MBIN

Is this something known and still in development ? Regards

lobolmart commented 7 years ago

hi,

Is this something known and still in development ?

yes, these are the so called global templates and they are WIP. one major issue with them is that they don't have names for their properties, so even if compiler support is enabled for them, all properties would be in the lines of "UnknownPropXX", each property needs to be tested to see what it does and be given a name.

Lo2k commented 7 years ago

OK, On my side I passed the whole day testing GCSOLARGENERATIONGLOBALS.GLOBAL.MBIN and I found a few unknown fields meaning. I will post my results if it can help.

lobolmart commented 7 years ago

thanks! probably best to create a new "Issue" with your findings.