MBINCompiler icon indicating copy to clipboard operation
MBINCompiler copied to clipboard

List of globals templates still unmapped

Open emoose opened this issue 8 years ago • 9 comments

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:

  • [ ] GcPlayerGlobals : 0x990
  • [ ] GcUIGlobals : 0x3DE0

Templates with skeletons created, but not many named fields:

  • [ ] GcAISpaceshipGlobals : 0x8C0
  • [ ] GcAudioGlobals : 0xC4
  • [ ] GcBuildingGlobals : 0x110
  • [ ] GcCameraGlobals : 0x1500
  • [ ] GcCreatureGlobals : 0x690
  • [ ] GcEnvironmentGlobals : 0x328
  • [ ] GcGalaxyGlobals : 0xC10
  • [ ] GcGameplayGlobals : 0xBD0
  • [ ] GcGraphicsGlobals : 0x820
  • [ ] GcPlacementGlobals : 0x30 (values don't seem to be used by the game?)
  • [ ] GcRobotGlobals : 0x360
  • [ ] GcSceneOptions : 0x2B0
  • [ ] GcSkyGlobals : 0x890
  • [ ] GcSmokeTestOptions : 0x28
  • [ ] GcSolarGenerationGlobals : 0x180
  • [ ] GcSpaceshipGlobals : 0x770
  • [ ] GcTerrainGlobals : 0x80

Templates with a majority of fields named:

  • [x] GcAtlasGlobals : 0x10 (fully mapped, besides one unused(?) field)
  • [x] GcDebugOptions : 0xCC0 (mapped via debug command-args reader function)
  • [x] GcSimulationGlobals : 0x1988 (mostly strings, one unknown int64 which might be a default seed?)
  • [x] GcWaterGlobals : 0x1 (single named bool)

emoose avatar Aug 28 '16 02:08 emoose

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

brcly avatar Aug 28 '16 02:08 brcly

@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.

emoose avatar Aug 28 '16 19:08 emoose

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?

brcly avatar Aug 28 '16 19:08 brcly

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)

emoose avatar Aug 29 '16 22:08 emoose

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.

TRX-0 avatar Aug 31 '16 23:08 TRX-0

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

Lo2k avatar Sep 09 '16 08:09 Lo2k

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.

lobolmart avatar Sep 09 '16 09:09 lobolmart

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.

Lo2k avatar Sep 09 '16 17:09 Lo2k

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

lobolmart avatar Sep 09 '16 18:09 lobolmart