nipkownix / re4_tweaks

Fixes and tweaks for the "UHD" port of Resident Evil 4
zlib License
340 stars 32 forks source link

Making .ESL file for each room #350

Open Corazon-SA opened 1 year ago

Corazon-SA commented 1 year ago

"I wonder if letting it use seperate ESLs per-room could be a way around it? I'm not really sure why it doesn't use that already, are enemies ever able to cross into different areas at all maybe? (or I guess maybe keeping the per-chapter-ish ESL in GLOBAL_WK could be how they store the state of enemies across rooms...)

_Originally posted by @emoose in https://github.com/nipkownix/re4_tweaks/issues/349#issuecomment-1280684488_"

Corazon-SA commented 1 year ago

Here is something intersting, actually in Razor DLL we can use ESL per room, by naming them like r100.ESL, r105.ESL, rXXX.ESL, however entering some room with new ESL and get back the previous room could break ESL files and start useing ESL files randomly, I wish if we could make it always gives priority to the last ESL file, this will make much stability if you could make this work it will be great!!!

Thanks!! @emoose

kTeo-0 commented 1 year ago

the thing is that using this method won't allow for backtracking. For example, going back to areas from emleon00 while emleon01 is loaded would not use enemies from emleon01. I don't know how the whole thing works, but maybe this whole priority thing exists exactly for avoiding past ESLs to load again. Maybe instead of breaking this we could add new ESL files and customize their priorities? For example, make all esl have a set amount of 8 characters, and then make an INI of some sorts like this: (order goes as ESL name, priority, area that triggers it) emleon00 00 r100 emleon01 01 r11b custom00 02 r110 emleon02 03 r200 emleon03 04 r205 custom01 05 r117 custom02 06 r003 and so on...

that way we could make more complex routes while maintaing the ability to backtrack to previous areas. A little management in ITA/AEV indexes could make this work wonderfully for every mod.

Mister-Curious commented 1 year ago

It is possible to already load new sets of enemies when going back to a room that has already been visited. You just need to add ITA enemy spawns (linked to AEV) that are disabled the first time you go through the room (using an AEV chained event, so that the ITA spwan gets disabled by one AEV trigger). I use this religiously to repopulate rooms with enemies when returning back to the room. This technique has essentially doubled my enemy spawns..

Using this method also allows for 'enemy groups' to be created, with each group assigned to a unique AEV trigger. Its kind of limitless AFAIK because ITA enemy spawns don't take up ESL slots. This method is also compatible with the enemy_swap.ini so health values can still be set.

The way it works is like this: image

then we return to the room from the other direction, we activate the enemy spawn BEFORE passing through the event that cancels it:

image

kTeo-0 commented 1 year ago

@Mister-Curious this won't be enough to work on what we're planning, since enemies would disappear on checkpoint and this can't be used paired with adding their own ITA items or using them in conjunction to AEV.

kTeo-0 commented 1 year ago

anyways, i hope we see some news on making the whole .esl system more flexible like adding our own custom .esl and custom triggers on any map. With that in hand we can basically do what we want in a mod, in any map order.

Mister-Curious commented 1 year ago

@Mister-Curious this won't be enough to work on what we're planning, since enemies would disappear on checkpoint and this can't be used paired with adding their own ITA items or using them in conjunction to AEV.

I had a conversation with @kTeo-0 last night where he explained things to me a little more in depth, and it seems while the scenario I pointed to out above is handy in some situations, it is very limited in some circumstances.

I see the value of what he is requesting here, especially with mods that have lots of enemies.