-
Notifications
You must be signed in to change notification settings - Fork 35
ReplaceFramelimiter: implements new reduced-CPU-usage limiter #257
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
Conversation
ec40040
to
4a72d3f
Compare
Wow, nice work!
Ah.. sorry about that. I tried to make the new code easy to adjust, but I couldn't. Basically, you have to change the table index (I haven't implemented the other options myself because it's 2:30 AM here and I'm very sleepy lol) |
Oh nice, not as difficult as I thought then heh, thanks for the explanation (and adding it to the UI :) Had a little look at it and might have found a way to let us add things without needing to track 0/1 across items etc, I'll add it to this PR in a sec. Maybe possible to add the E: took a little while but figured a way to handle the bgHeight stuff in the new functions too, getting that to work properly needed a ColumnFinish func, so was able to add the final Dummy back inside there too 😸 |
5264d76
to
8862259
Compare
Amazing work with the helper functions! Thank you! Edit: Just finished Assignment Ada with the new framelimiter and noticed no issues. Performance has also improved here! |
5c106c8
to
e43f01a
Compare
Seem to be getting a freeze early in the game, not sure if it's caused by this or something else though, was able to reproduce it once but not again after that. Freeze happens when starting the cutscene where Leon looks down at the fallen police car, just freezes with the LOOK DOWN prompt stuck, was playing in fullscreen without debug build at the time so not sure where it was frozen at. To reproduce I had to go through all the beginning cutscenes (besides the first one), making sure not to skip them or the radio calls, then jump out of the upstairs window, kill enemies, and run over to where police car fell and press the LOOK DOWN prompt button - this got it to freeze twice, but third time onwards seemed to play it fine. Gonna test some more with this PR, will update if anything else seems broken. E: played up to 1-2 (I'm pretty slow at this game :p), no other issues so far. |
Tested it a bit more here and everything went smooth. Couldn't reproduce the freeze you mentioned. |
I'm sure I heard about that freeze somewhere else before, can't find much about it now though. Tried testing out |
Ah, odd. |
FYI, I just cherry-picked 798bb47 into master so I can make a new release. |
798bb47
to
cb716f2
Compare
Rebased this onto current Updated build here: https://github.com/nipkownix/re4_tweaks/suites/7489502732/artifacts/307459942 |
Been playing a bit more using this, and no issue so far. Still can't reproduce the freeze from before. |
Sounds good to me, I never had any freezing after that point I mentioned with it neither, hopefully was just some kind of fluke, or maybe just a vanilla bug. Will have to try looking into the |
…d `DisableFixedFrametime` experimental option
cb716f2
to
ed54ed7
Compare
Cool. Just rebased this again and turned the new frame limiter on by default. Hopefully we can get |
btw @nipkownix about the freeze I had with the police car, seems that's been happening for a while, someone mentioned it on re4hd recently: https://www.re4hd.com/?page_id=9319#comment-203270 |
As discussed at #44 (comment), this implements the
FPS_ACCURATE
framelimiter from https://github.com/ThirteenAG/d3d9-wrapper/blob/c1480b0c1b40e0ba7b55b8660bd67f911a967421/source/dllmain.cpp#L46For me this gave a pretty nice CPU usage reduction:
qingsheng8848 also mentioned:
The code is pretty close to the old framelimiter really, but I think the Sleep(1) call helps reduce CPU usage of the busy loop, there's also no longer a 0.01666666... minimum frametime with this so variableframerate above 60 should work better (though still probably has many issues like the ones mentioned in #50)
This also adds two settings to INI [DEBUG] section,
DisableFramelimiting
which should be useful for performance comparisons, andUseDynamicFrametime
, which makes it pass the actual elapsed frametime to the game, instead of fixed 60/30FPS frametimes - this should help with the slowdown issue when framerate drops, but not sure how well things will work with non-fixed frametime, likely will have a lot of issues, so it's disabled by default for now.Using both
DisableFramelimiting
&UseDynamicFrametime
might come in useful for finding some non-framerate-adjusted things in the game too, eg. I noticed aiming with laser-sight seems slower using mouse to aim when FPS is very high, so I guess that might mean the aim speed is slightly different between 30/60 too. (#258 should fix that)Haven't added any GUI options for the
ReplaceFramelimiter
setting yet, not really sure how to add stuff without breaking everything... would appreciate if you could show how to add a UI option for it with the new layout 😅If anyone is willing to help test it out, a release build can be found at https://github.com/nipkownix/re4_tweaks/suites/7489502732/artifacts/307459942 - just be sure to set
ReplaceFramelimiter = true
in the dinput8.ini first!(should work fine across all the usual EXEs)
We mainly just want to make sure the game still plays fine with this framelimiter in place, no idea if anything might be depending on the previous framelimiter behavior or not. If anyone finds anything broken please let us know!