nipkownix / re4_tweaks

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

Added NTSC mode #369

Closed pas-de-2 closed 1 year ago

pas-de-2 commented 2 years ago

Unlocks the NTSC exclusive difficulty adjustments for RE4 UHD.

Quoting my post in https://github.com/nipkownix/re4_tweaks/issues/183 as a summary of what this is supposed to do:

  • Normal mode and Separate Ways start at 5500 difficulty instead of 3500.
  • Assignment Ada is fixed to 6500 difficulty instead of 4500.
  • Easy difficulty is removed as an option from the title menu.
  • Shooting range requirements are 3000 per bottle cap instead of 1000.
  • The village stage in Mercenaries has a unique dynamic difficulty mode. In PAL the difficulty is fixed at 5500, but in NTSC it's unlocked, and you also gain 30 difficulty points every second. ***This requires a 60fps fix, because it's just calling GameAddPoint(LVADD_TIMECOUNT) every frame in R400Main(). At 60fps, you gain difficulty twice as fast!

TODO:

Not sure how to fix the shooting range note. I checked inside ss_file_01.MDT and found the 1,000 and 3,000 score requirement strings are already there, so the question becomes how to change the message ID of this particular object.

emoose commented 2 years ago

(E: older discussion about these changes is at https://github.com/emoose/re4_tweaks/pull/6)

Looks like file_msg_tbl defines the start MDT entry number for each file, file_pages also says how many pages/MDT entries are in each file (with different values per language), seems it starts with the MDT entry number inside file_msg_tbl entry and reads through that entry number up to the count inside file_pages.

file_msg_tbl[0xE] seems to be one for the target practice note, that sets start MDT entry as 0x3F/63, editing that to use the MDT entry num for the 3000 point msg (0x9D/157) seems to work, bio4.exe+0x81BFF4 (byte) -> 0x9D in 1.1.0 using CE.

Probably wouldn't be too hard to pattern match that table, maybe should let it fail silently (or with a log warning?) if it can't find the pattern though, in case some kind of EXE mod is installed.

E: maybe need to check if the MDTs for other langs also have the 3000 point messages too, might only exist in the english file...

pas-de-2 commented 2 years ago

Good stuff. It seems only eng, jpn, and chs ss_file_01.MDT have the additional entries at line 157, and the Japanese/Chinese entries are just duplicates of the line 63 entries, so the note still says 1000 in-game.

Maybe we could sideload replacement .MDTs for the non-English languages? I suppose we should also verify that the original files haven't been edited, in case of mods.

Will need to decipher what characters correspond to numbers in the Japanese/Chinese encodings.

Edit: here's a version that will at least only load the string if you're playing on language_8==2

nipkownix commented 1 year ago

Nice job with this! A question, though, since I haven't been following discussions related to this: I see you're manipulating checks that check if pSys->language_8 is SYS_LANG_ENG_NTSC, right? Have you tried just changing language_8 to ENG_NTSC instead? Just curious to know if the game works just fine with that changed, since I imagine you're doing it differently to allow these changes to work on different langs as well.

pas-de-2 commented 1 year ago

Yeah, the game seemed to run fine with language_8 = 1. Only issue I noticed is that the English subtitles patch doesn't work.

pas-de-2 commented 1 year ago

image

Managed to hunt down the texID of the START texture and swap it for NEW GAME 🥳

nipkownix commented 1 year ago

With the clarified bottle cap requirements, I think we're safe to merge this? Very nice job, btw. Just tested this a bit. I thought I was good at this game.. but we'll see if I'm still decent with these changes :p

pas-de-2 commented 1 year ago

Should be good to go 👍

emoose commented 1 year ago

BTW just found a doc that goes through the changes between different regions/releases of the game pretty extensively, a lot of it seems like it's probably just dynamic difficulty related, but maybe there's some surprises there too: https://docs.google.com/document/d/1aXN-Kxt0jbt9HQk_YrUNEn4WalTyiw18u2XBeuhqMts/edit

pas-de-2 commented 1 year ago

Most of that tracks with what I've researched. Main thing I'm trying to figure out right now is how they buffed the knife. Testing in the village on Professional, Ganados take the same number of handgun shots to kill in NTSC GC and UHD, but 5\~10 knife swings to kill in NTSC GC and only 4\~5 knife swings on UHD.

I think the knife's damage value is set somewhere in the em**SetDmVal functions. Unfortunately, it looks like the GC DB is missing those functions to compare.

emoose commented 1 year ago

Does changing UHD to 30FPS make any difference? IIRC most people assumed the increased damage was because of the framerate increase, hadn't really tried looking into it that much yet though. (I do know playing in 60FPS increases rate/accuracy of collision checks though, if that's related at all, which broke some speedrunning movement strats iirc)

Those em funcs are probably separated into the em rel files in GC (which are stored inside the em**.drs files for some reason), got some IDBs for most of them, but could be some missing here: re4_gcdebug_drs-rel-idbs.zip

pas-de-2 commented 1 year ago

Nah, same thing at 30FPS. I know people have made reports about the knife doing multihits at 60fps, so I made sure that wasn't the issue. I also tested the GC PAL version in the same scenario, and that has the buffed knife, too. It looks like an intentional balance change that was made to go along with the other weapon buffs from that build.

Thanks for the rel IDBs! I'll take a look.

pas-de-2 commented 1 year ago

Found it in GetWepDmVal. There's a switch at the top of this function where the game retrieves base weapon damage values for each em type. Knife damage vs Ganados is stored in Dmg_tbl_em10[16], with a value of 100 on NTSC Gamecube, and 200 on UHD. It turns out that the knife was buffed to do double damage like this vs almost every em type.

These tables also show that the TMP received a 40% damage buff vs Ganados (!), and damage for most weapons was actually nerfed by 33% vs Regenerators.

Next, I found this stuck to the end of GetWepDmVal:

  else if ( v3 == 16 )
  {
    Wep_7D8 = pPL->Wep_7D8; 
    if ( Wep_7D8 )
    {
      if ( Wep_7D8->field_42 <= 0 )
        return (int)((double)wep_nob * 1.3);
    }
  }

It looks like the Wii port added a further 30% damage buff to the knife, except when using auto-knife, presumably to make manually aiming the knife feel stronger than spamming waggle.

The net result of all this is the knife in UHD actually does 160% more damage than it did on NTSC Gamecube.

For some reason I felt like the knife also had reduced range in the NTSC version, but after looking for evidence, I'm pretty sure I made that up. Ganados have the same hitbox radius values assigned in em10_R0_Init, and the knife looks like it has the same hit_len value in GetWepTargetList2.

pas-de-2 commented 1 year ago

Last major thing I have to do is parse the differences in RandomItemCk. People have said that ammo drops more often in the NTSC GC version, and it's true. Right away I've noticed that the dynamic assist for low ammo kicks in more often, because the game is weighting shotgun and TMP ammo less when it calculates your inventory's total ammo value in GetBulletPoints.

It's interesting that GetBulletPoints is still checking for Chicago Typewriter ammo in the Gamecube version. Capcom clearly just gave up on this weapon at some point and turned it into a bonus gimmick. It'd be fun to try and mod in a balanced version one day.

nipkownix commented 1 year ago

@pas-de-2 Just noticed this seems to be crashing with the 1.0.6 debug .exe. Seems it is unable to find the pattern for file_msg_tbl_35.

pas-de-2 commented 1 year ago

Huh, it looks like file_msg_tbl[14].top_0 is already set to 9F in the debug exe, so there's no 3F 00 01 00 entry to be found. If you comment out that code and go to pick up the note, it says that bottle caps require 3000 points, and if you set the language to something other than English/Japanese/Chinese, the game crashes when you try to pick it up, so I'm guessing this exe was built in some kind of NTSC configuration.

That's not the only thing it doesn't like, it's also upset about my title menu edits... this exe is a pain in the ass.

nipkownix commented 1 year ago

I mean, I'm not opposed to outright disabling this feature on 1.0.6 debug if supporting it turns out to be too much work..

pas-de-2 commented 1 year ago

It's no problem to keep supporting NTSC mode with this, but I might have problems with the Separate Ways difficulty menu feature in my other PR. Do we have a 1.06 debug IDB uploaded somewhere?

nipkownix commented 1 year ago

I don't think we have much about 1.06 debug, actually. Unless @emoose has something locally?

pas-de-2 commented 1 year ago

Oh that wasn't too bad at all. I pushed fixes for everything to the Separate Ways PR.

emoose commented 1 year ago

@pas-de-2 do you know if the NTSC/dynamic difficulty stuff affects QTEs at all? Someone on steam forums mentioned they might have been different in the original release:

I was also just thinking that it would be interesting to have the option to disallow both dodge command inputs like in the original GCN -- do you happen to know if this option exists? (in other versions of the game, you can spam all four dodge input commands and it will succeed, but in the original GCN it would fail if you put in the wrong one first, so effectively you couldn't spam)


I don't think we have much about 1.06 debug, actually. Unless @emoose has something locally?

Nah haven't really done much work on that other than naming stuff like SystemSave/Global, maybe should look into it more some time though, might still be some debug things there that we haven't reimplemented yet.

pas-de-2 commented 1 year ago

Hm, is that true? Playing the debug NA version in Dolphin, I can press all the wrong buttons, so long as I eventually press the right buttons before time is up. At least for the boulder after the farm, and the axe Ganado cutscene in r102. E; You can mash both buttons for the El Gigante knife QTE as well.

I remember having a similar thought before, that they must have nerfed the QTEs somewhere along the way, but I guess they were always like this.

Nevertheless, StrictQTEs could still be a fun tweak for masochists.