re4-research icon indicating copy to clipboard operation
re4-research copied to clipboard

RE4 Technical Question

Open yuushiGit opened this issue 2 years ago • 0 comments

Hello! Thank you for developing re4_tweaks and other useful tools. First, I understand that this is a place to report issues with re4-research and not a place to ask questions like this. However, since I have contacted you via email and ko-hi and have received no response, I am asking my question here. I know this is rude, but thank you in advance.

I am a speedrunner for Resident Evil 4 UHD and am developing an autosplitter for the timer. An autosplitter is a script written in a proprietary language called "Auto Splitting Language (ASL)", which in the case of RE4 works by reading RAM and interpreting its values. I need the memory addresses related with the loads used in RE4 UHD for the development of that ASL, do you know anything about this? (Door Loading, Inventory Loading, etc.) Because the most games then use this ASL to read the In Game Time (IGT) address from the game and update the timer, but IGT in RE4 cannot be used because it includes loading time (which causes hardware differences), and we have not found any addresses related with loading.

So, I contacted you because I thought you might know something about it since you have been doing reverse engineering and other analyses of RE4. Sorry if my English isn't great.

ASL documentation and my ASL is here.

yuushiGit avatar Feb 19 '23 11:02 yuushiGit

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