-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Porting & PC-specific issues #333
Comments
This actually still exists in the Wii edition and I've made sure to test it as well. Idk which port removed it first unfortunately, but it's definitely there on Wii. No emulation was done to test this, btw. I still own my Wii and copy of the game for it haha. |
Thanks for compiling all these issues in one single post!! -"Animated textures also run at doubled speed": The fire effects still run at 30fps, maybe some other animated sprites effects runs at double speed, but I'd say most of them don't.
And that's it XDDD phewww! |
Many thanks for the list, was hoping you might see this post and add to it 😄
Had a quick look at this, might be caused by a small coding error, comparing the function in r315 to r515 it seems r315 is adding to the cabinet door position while is r515 taking away from it instead, very subtle issue since the only change is Surprised they didn't fix r315 too since they obviously fixed the issue themselves in r515... guess they maybe didn't want to touch any of the older main-game code in case something broke? idk.. should be safe to change it though. Changing it in CE seemed to fix it, you can hex edit EXE to change it too, search for |
Ha! Great. When I think I tried porting all files from room r515 to r315 ... Don't mention it! Maybe it wasn't broken in Separate Ways by default... I can't see them fixing this small bug, really XD |
This one is a little trickier, the GC debug does also spawn them too, so it's easier to test, but you do have to go through the bar shooting section & ashley segment first for game to count her as "rescued", then returning thru r20c -> r20a will have new enemies spawned, and the 2 enemies will show up on r20a. On UHD though doing the same will let r20c enemies spawn, but none on r20a... Doesn't seem r20a has code for spawning those enemies in either version, so they must be done some other way. Seems the game has at least 3 different ways of making enemies show on earlier maps:
The enemies on r20c seem to get spawned by Could be that the Novistadors show up in the normal non-ashley-flag ESL (emleon03? unsure), but without the alive flag, while emleon04 would have a copy of them with the alive flag set, but maybe UHD removed the duplicate entry with alive flag entirely - just a guess though, it's also likely something could be calling the |
Ahhhhh. You gave me an idea. But I never thought emleon04.esl also contained 2 r20a entries... ONLY 2!! and guess what?: They are the 2 missing Novistadors :D In the emleon04.esl of the PC port the enemy ID is "zeroed" So they simply didn't appear... So I simply changed the initial "01 00" of both lines to "01 2D" and they magically appeared only after rescuing Ashley and go back through room r20c. So, it's fixed! You just need to replace this file So, we can conclude this issue only needs a 2 bytes file edit. Is there any other missing enemy compared to the first USA GameCube version? Because the solution is probably the same. |
Aha nice, thought it might be something in there, was going to start comparing entries in GC to UHD to look for it, but didn't think of trying to look for the ones with 20a room ID heh. I did notice some of the earlier entries in the emleon04 also had the enemy ID zeroed compared to GC as well though (eg. the ones at 0xE0 - 0x1E0 use ID 0x14/0x25 on GC debug, but zeroed on UHD) so guess there's a good chance other enemies might have been removed the same way, wonder if a quick GC->UHD ESL converter tool could be useful for those, would make it easier to compare at least. Think it might be better for HD project to include that, could be other mods that also edit that ESL that we wouldn't want re4_tweaks to override. |
Oh, you are right! |
Thanks for looking into it! Pretty strange choice to remove those enemies, pretty sure those are all optional right? You have to choose to backtrack to run into them, so not like players are ever forced to defeat them to continue the story, odd. Maybe they figured adding enemies there could be a waste of ammo or something. I think the difference between 00 and 01 in that column is setting the |
I haven't noticed any difference playing in normal and professional and entering those areas several times after killing them all... So, I have no idea what the 00 01 do in those cases XD And yes, those enemies are optional 100% It's the price you have to pay to backtrack and obtain the broken butterfly for free, and you can dodge them anyway. Specially the ones in room r20f (blue columns). You just need to run and that's it. So... no idea why did they remove them... ¿? Ohh! I almost forget these other 2 bugs:
|
Interesting discoveries here, specially about those enemies being probably intentionally removed, hmm 🤔 |
Ah interesting, thanks for the breakdown. I noticed the game does have a
while these classes have no code and don't try loading anything:
I also found in the PS2 version a enum for the kinds of faces those functions set:
Doesn't seem to have anything pain/death related, unless they just reused the enum values without renaming them maybe - or it's possible this E: btw, could you tell me which file in the pl00.udas has the morph data? Are they both stored inside pl00_004? |
Ahh, that makes sense, Ashley as player (pl01) has the morphing data, but her face never changes in the Gamecube. About Wesker, there is no morphing data. Maybe they had the intention to include it but they forgot XD |
Hm, tried forcing the Looks like the pl00_094/pl00_095 data used for those might also be referencing data from the main model too (_004?), maybe the morph data you found in there. Unfortunately the Shape code it uses to apply the face |
Looks like changing and with 2 / and finally for comparison, the default 0 /
So I guess the issue is probably with the E: yep, still no effect forcing it on UHD. Looks like cutscenes are making use of the same Shape stuff for lip sync though, maybe they changed something to fix 60FPS lip sync and broke the setFace stuff in the process. Going to try forcing one of the cutscene shapes during gameplay to see if it still animates in-game at least. |
Haha it's funny to see these images |
Here's a build with a slightly better patch to Still not sure if it's working properly though, I did get a bug while making it which made his jaw pop out when attacked which was visible for a few seconds, fixed that now, but hopefully means the actual pain face shows too. |
Oh wow! What an exhaustive research! As always! |
wonderful! |
Confirmed this happening too, went back and made two saves, one before jumping on it (where I'd need to jump on it to start the cutscene), and one after - issue only seems to happen on the save that's before jump, so I guess something related to chandelier gets changed after jumping, and game doesn't reset it properly afterward, but saving/reloading after jumping on it lets the data be set back to normal, so the cutscene (and movie browser) doesn't have the issue. Maybe something related to the position of it, I'd guess if it was off even a tiny bit it might cause the cutscene to act up, will try giving a closer look soon. E: huh, position of it doesn't get changed at all by jumping on it, looks like they use the MOTION_INFO stuff to handle the animation of it swinging though, seems a flag is set after jumping that stops the MOTION stuff, maybe during event cutscenes it ignores that flag or handles it different somehow, will have to see if I can find where it's setup. |
Thanks for confirming the issue! |
Ahh think I've got it, it's to do with the So since it's based on the actual time of last frame, the deltaTime starts changing to something like 0.5000039935 or 0.5000010133 each frame, and I guess the animation system doesn't like deltaTime changing so much, resulting in it shaking/flickering around. Our replacement framelimiter code copied the same weird event check & making deltaTime use actual frame time, if I remove that weird code then the chandelier seems to be fixed (and if I force that code, the chandelier starts flickering in gameplay too :p), so pretty sure that's the culprit. Not really sure how to fix the animation code to work with frametimes like that, so I guess for now I can probably just add a check to see if it's playing chandelier event and make it skip the frametime code if it is, if any other cutscenes have weird flickering like that maybe they could be fixed the same way too. |
Functions that still probably have speed-related issue:
stuff I wasn't able to find just by reading the code:
|
Wow!! Thanks! Going to test it now that I have a few minutes :DDD EDIT1 EDIT2 Wait... r21b_GetDragonBall... Dragon Ball? really?? XDD Oh! I see! r315 cabinets's lids wrong position is already corrected. Cool!! |
Ah yeah, the last build I posted (with the FixCompartmentsOpeningSpeed option) should only cover opening chests/cabinets/shelves/etc. The other stuff you mentioned will be hopefully fixed in the next build I'll post. |
Ah, I've edited the post again :P |
While analyzing r31c, I noticed the final door there (the one you use all 3 crests on) also enables a camera shaking effect (cEsp4a) while the door is opening. This camera shake gets weaker on higher fps. It is weak at 60 fps, and nonexistent at 240 fps. Gotta have a proper look at that later. Seems to be controlled by Edit: Wtf? While working on room r50f, I noticed one of the weirdest things ever: This is the room, loaded when playing at 30 fps: And this is the same exact save file, loaded when playing at 240 fps: The position of the box' lid is multiplied by the delta time?! Shouldn't the delta time be applied only when the lid is in the process of opening? Edit2: Instead of hooking every single incorrect deltaTime multiplication in this func, I just worked around the issue by overwriting deltaTime to Crazy how QLOC messed this one up. They consciously added all these wrong deltaTime multiplications: I imagine they thought this function only handled opening boxes, not boxes that should already be open too. Still odd. |
Hmm, is that function only being ran once at room init (maybe with a loop inside to increase the rotation, like the openbox stuff has), or does it get ran across multiple frames? If it's only ran once then I think it'd be safe to just edit it like you mentioned, otherwise if it's called in multiple frames I guess it could maybe break something, eg. if anything else is also using dt across multiple frames at the same time... If needed maybe we could just hook the thunk for it and "wrap" the function with stuff to override deltaTime/call the func/restore deltaTime, if that func actually has a thunk anyway. Good stuff with all these deltaTime fixes too btw, was actually thinking of trying to tackle those this week as well, looks like you've beaten me to them now though :p
Seems GC has them the same way, named as r104 but used in r107, maybe those were originally on r104 and got moved over or something. (ditto with the r20d_moveArmorStatue too, and r20d_getSalazarCrest) I've noticed a few things like that around, maybe those should be renamed to make it easier to find all the funcs for a certain room... maybe with a comment to mention the orig name.
added that too, ty! E: added cR50fDoor stuff here: https://www.mediafire.com/file/4xym01wj49xf3df/bio4-221202-tmp.zip/file |
Hmm, I'm pretty sure it was only being run during the room's init (on r50f at least), but I went ahead and switched to the wrapping method using the thunk as you mentioned. Makes it easier to restore deltaTime afterwards.
Ah, thanks 😅
Hmm, interesting. Maaaybe they had larger rooms originally and had to split them up due to limitations on regular consoles? Meh, who knows.
Many thanks! Edit: |
Ah, nice! Seems emoose was right about this being related to hats and stuff. Ah, @albertre4HD, I've finally implemented the rest of the fixes I had in mind: This build has our two new options: Would appreciate some testing when you have the time. The only issues not covered yet (as far as I can tell) are these: And there's also one not featured in the screenshots, which is Not only the shutter itself opens and closes too fast, but the time it stays closed is also smaller the higher the FPS. Couldn't figure this one out, maybe @emoose could have better luck here? |
Thanks a lot!! I only found this (room 50f) Resident.Evil.4.Biohazard.4.2022.12.03.-.23.38.33.02_1.mp4 |
Oh yeah, you're right, I totally forgot about |
Hm, looks like some of the Looks like the blocks where it sets The That shutterCtrl func does seem to use deltaTime for some things too, but not really sure how that works ( |
I think |
Figured out the opening and closing speed:
Still no luck with the interval between closing -> opening again. Edit: Ah, right, it is |
Oh I forgot to mention that it's fixed now, thanks! ;D |
@emoose Been trying to get the original demo movie to play again (in the "press any key" menu screen). That was removed on the X360 (i think?).
Other .sfd videos skip just fine with SPF_KEY enabled, though, so that's weird. Not sure how GC originally gets into |
I messed around a bit with restoring demo playback earlier. This lets you press the back button at the main menu to start demo playback, just like in the Wii version. Only problem is you have to press Select(?) to skip out of it as though it were a normal cutscene, should be able to press Circle/Back as well. EDIT: Well, that might just be a Wii-mote mapping thing, because you can skip all cutscenes with the // Restore TitleMenu Demo playback
{
// play demo when pressing the back button
auto pattern_begin = hook::pattern("A1 ? ? ? ? F7 40 04 00 00 00 80 88"); // titleMenuSelect
auto pattern_end = hook::pattern("83 C4 2C 8B 4B 2C 8B");
struct CancelToDemoPlayback
{
void operator()(injector::reg_pack& regs)
{
TitleWorkPtr()->SetRoutine(TITLE_WORK::Routine0::Main, 7, 1, 0);
return;
}
}; injector::MakeInline<CancelToDemoPlayback>(pattern_begin.count(1).get(0).get<uint32_t>(0), pattern_end.count(1).get(0).get<uint32_t>(3));
} UHD only includes the PS2 version of demo0eng.sfd. It would be cool if we added checks for the existence of demo1.sfd and demo2.sfd, and looped through all three like in the Wii version. I'm sure @albertre4HD would have fun remastering these for the next HD project release. |
Ah, so you can skip it using a controller? Haven't been able to do it using KB/M for some reason. Huh. |
It lets me skip it when pressing Escape on the keyboard as well. |
Figured out it does the same here, but only if I play a video in the movie browser first. Pretty strange. |
Oh hey you're right, I'm getting the same thing. I just so happened to watch the intro video before I tested it with keyboard. The controller skip always works right away, though. |
Seems like the problem is |
This seems to work to have the videos play if you wait a bit in the "press start" screen: pattern = hook::pattern("D9 05 ? ? ? ? 53 D9 5D ? 57 8B 7D ? 85 C0 75 ? 68");
struct titleStart_hook
{
void operator()(injector::reg_pack& regs)
{
// Code we replaced
float v55 = 560.0f;
__asm {fld v55}
// Set up new timer
static float timer = 480.0f;
timer -= GlobalPtr()->deltaTime_70;
if (timer <= 0.0f)
{
timer = 480.0f; // Reset timer
TitleWorkPtr()->SetRoutine(TITLE_WORK::Routine0::Main, 7, 1, 0);
}
}
}; injector::MakeInline<titleStart_hook>(pattern.count(1).get(0).get<uint32_t>(0), pattern.count(1).get(0).get<uint32_t>(6));
pattern = hook::pattern("F7 05 ? ? ? ? ? ? ? ? 75 ? 8B 0D ? ? ? ? 81 E1");
struct cSofdec__appMain_hook
{
void operator()(injector::reg_pack& regs)
{
// Unset SPF_KEY to let cSofdec::appMain check if the movie should be skipped. This only seems to be a problem during the demo
// videos in titleMain for some reason.
// TODO: Check if this messes something up during playback of other videos?
FlagSet(GlobalPtr()->flags_STOP_0_170, uint32_t(Flags_STOP::SPF_KEY), false);
// Our key check replacements. Only checking Key.btn_trg_20, but the original code also used Joy[0].trg_18 for gamepads.
// btn_trg_20 seems to work fine for gamepads, though.
// TODO: Check Dinput gamepads.
bool PressedEV_CANCEL = ((Key_btn_trg() & (uint64_t)KEY_BTN::KEY_EV_CANCEL) == (uint64_t)KEY_BTN::KEY_EV_CANCEL); // Xinput Back, Keyboard Esc
bool PressedCANCEL = ((Key_btn_trg() & (uint64_t)KEY_BTN::KEY_CANCEL) == (uint64_t)KEY_BTN::KEY_CANCEL); // Xinput B, Keyboard Esc
if (PressedEV_CANCEL || PressedCANCEL)
regs.ef &= ~(1 << regs.zero_flag);
else
regs.ef |= (1 << regs.zero_flag);
}
}; injector::MakeInline<cSofdec__appMain_hook>(pattern.count(1).get(0).get<uint32_t>(0), pattern.count(1).get(0).get<uint32_t>(28));
// The end of routine 7 puts the menu into routine 1, which is the main menu (after the "press start" screen).
// We change it to 17 here, to go back to the "press start" screen instead.
pattern = hook::pattern("C6 46 ? ? E9 ? ? ? ? 53 E8 ? ? ? ? 83 C4 ? 3C ? 0F 85");
injector::WriteMemory(pattern.count(1).get(0).get<uint32_t>(3), uint8_t(0x11), true); // Rno1_1 = 1 -> Rno1_1 = 17 Also makes it possible to skip the videos using B on the gamepad :p |
Cleaned it up and added This option will play demo videos if the game is left idle at the main menu or "press any key" screen for 20 seconds.
Seems to be working nicely, but some more testing would be nice. Test build: |
Wow!! I let the video play and then I went to the movie browser and play a Separate Ways video. Then I went back to the press any button screen and wait again to watch the video, and after that I started a new game and the intro video also played with no problem. So, I guess there are no side effects ;D |
I spent way too long hunting down the keyboard issue. The game stores an If you add a call to I was slightly mistaken about the Wii version. It let you cancel demo playback with the 'Back' button because the Wii-mote's I do like that the Wii version lets you press Back to cycle through the demos on demand, but I guess that would mean replacing the ability to back out to the 'any key' screen. |
Oh cool, so that's what
Meh, if that's the case, I'll just remove it. Thanks for the heads-up, I hadn't actually checked what button the console versions use to skip. |
Since the issues page has got a bit large and it's a little difficult to find the UHD issues that still need work, I figured a separate page indexing them all would be useful.
This page mostly deals with three kinds of problems: issues that appeared during the porting process (GC/PS2->Wii->X360->PC), PC specific issues, and problems caused by 60FPS+ framerate - issues with/caused by re4_tweaks & feature requests aren't covered.
This is by no means complete and mostly just which issues I can recall right now, probably missing a lot from here.. please feel free to mention any that are missing and I'll update this list.
Issues without a linked issue page are either very well-known already, or uncertain/rumoured, if anyone finds an example to prove the issue exists feel free to make a reply or new issue page for it.
Port issues/changes
Wii360/PS3?) (Restore Gamecube's main menu stick behavior #290)could be related to Leon face texture not changing when in pain too, something about model texture changes maybe broken?PC-specific issues
dxvk
can help improve it, but that could bring it's own issues too. Could be caused by overhead from the GameCube/Wii GX-API -> DX9 layer that it uses (dxvk wouldn't really affect that though...), or maybe the D3D9MULTITHREADED
flag slowing things down? (D3DCREATE_MULTITHREADED
flag removal #44, MultithreadFix: slight FPS boost via multithread improvements #255)UseDynamicFrametime
setting added by re4_tweaks can help with this, but also causes a lot of issues too, game isn't designed to work well with varying frametimes... (eg [Hang] Non-60/30 framelimit causes game hang #328)60FPS issues
The text was updated successfully, but these errors were encountered: