emoose / re4-research

Various tools & modding research for Resident Evil 4
BSD 3-Clause "New" or "Revised" License
38 stars 4 forks source link

R7xx #18

Open emoose opened 2 years ago

emoose commented 2 years ago

Made a comment on re4hd mentioning how R7xx could be connected to EM_LIST_BIO5 found in the PS2 symbols: https://www.re4hd.com/?p=9649#comment-202588

Also made another comment there but not sure if it went through, maybe blog software/anti-spam swallowed it up:


Might have found a definite link between R7XX & BIO5, looks like that EM_LIST enum is actually included in the executable too as strings (you can even find them in the UHD exe): image

Seems to match with all the EM_LIST entries I posted before, except BIO5 is changed to "biox" there, guess they probably didn't want it to show up as a string in the EXE :p

BIO5/biox are at index 9 into the list, seems there's also a function "checkEmListNo" in the game which takes a room number and returns the list index for it - you can maybe guess where I'm heading :)

Anyway, for room 6xx & 7xx: image

So 6xx falls under 18 PS2ETC/ps2-tgs, and 7xx is under 9 BIO5/biox, pretty neat!

My guess is that maybe RE5 was being prototyped on the RE4 engine during the time between GC & PS2 release, and the files for that prototype ended up being left inside the RE4 source tree (original devs probably knew they could remove them before shipping the final PS2/Wii builds, but luckily for us X360/PS3 was done by a new team 😄)


Also found out that EM_LIST_BIO5 is tied to the emleon09.esl file, on GC/UHD that file seems to just contain enemies for some R1XX rooms, but the PS2 version of emleon09.esl actually seems to have enemies linked to both R703 & R702! Might be worth exploring some more once we can load in the R7XX maps properly.

emoose commented 2 years ago

Yep, looks like the PS2 emleon09 does go with those maps :) Spawns like 30 enemies on the ground, with some also on the roofs as seen here:

20220818161954_1

For that copy st0.rel as st7_0.rel, remove emleon09.esl.lfs, and copy in emleon09.esl from PS2 version in its place, then use CE and set (byte, 1.1.0) bio4.exe+813CD0+18 to 1 (maybe backup your savegame first though), and then area-jump to R702 (edit AREAJUMP_MAX_STAGE to 7 inside UI_DebugWindows.cpp first) (shouldn't be needed with latest re4_tweaks trainer build)

That should let you load into R702 fine, sadly R703 is currently crashing inside calcModelAddr, something to do with Smd::setObj called by gameRoomInit, but that does seem to have some different Em ID spawned inside it.

E: looks like R703 crash is caused by first 32-bits inside the SMD contained in R703.udas, endian-swapping it seems to let game load in, but level is all black with no geometry, not sure if that's something caused by the SMD edit, or maybe the level just sucks... (same for the R700/R701 files too, but R703 did load some enemies from the ESL at least)


R6xx maps seem to load in fine with St6_data_tbl save_flg set, so hopefully adding a dummy buffer like PS2 would probably help fix all those too.

Atomoksetin1996 commented 1 year ago

The emleom09.esl file is also present in the gamecube version, in which there were no St5,6,7 yet. Judging by the IDs of the enemies and their subtypes, we can conclude that this file was saved in a very early build of RE 4. This file was last modified no later than the American trial version. For example, the value 15 01 spawns a ganado in a blue shirt, already in the Japanese trial version, it was replaced by a female ganado with the identifier 15 0B, so the value 15 01 does not exist in the final version. The same can be said about other enemy IDs, for example, 16 00 in this file is not a ganado, but another unknown enemy type. In earlier versions of RE 4, each individual ganado had its own unique ID. Ganados were later grouped into groups within the same archive with the same ID, but sometimes old enemy IDs are mentioned in the game.

Let's say the textures and folders of opponents in the PS2 version are numbered according to the old enemy numbering.