-
Notifications
You must be signed in to change notification settings - Fork 357
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
WIP: Support >60Hz with com_gameHz #584
WIP: Support >60Hz with com_gameHz #584
Conversation
… order to avoid having to use custom pak content
…ysics with player not working correctly
The old hack replaced "#define GAME_FPS 60" and the similar defines for GAME_FRAMETIME and CHAINGUN_FIRE_SKIPFRAMES with in the scripts with other values based on com_gameHz, for example to "#define GAME_FPS 144". This has two disadvantages: 1. When changing com_gameHz, you'll have to reload the scripts 2. This changes the checksum of the scripts, so each time you change com_gameHz the checksum changes and your old savegames stop working. Luckily the scripts already have functions (that are implemented in the gamecode) that expose the FPS and FrameTime: sys.getTicksPerSecond() and sys.getFrameTime() So now we modify the #defines to call those functions instead. That will still break *old* savegames, but at least savegames made from now on will still work no matter what you set com_gameHz to.
adjusted to use gameLocal.gameHz instead of USERCMD_HZ, of course
There is also a bug related to the crouch rate of the player; this crouch rate uses an exponential smoothing logic and doesn't scale with higher FPS, so the player will crouch faster at higher FPS. The original game code in Player.cpp looks like this:
The fixed version, which properly considers FPS change for exponential smoothing, is the following:
The new code I attached is what I am currently using for my local source code. I don't have Dhewm3's source code locally, so I am unable to contribute. |
The same can be said about the roll and pitch rate of flying NPCs. The fixed version, in AI.cpp
|
Thank you! :) |
thanks to Github user tyuah8: dhewm#584 (comment)
oh ffs, why can't you make a PR use a different branch (or rename it) :-/ |
When investigating the "black screen after changing mod" issue I realized that I don't understand all of Stradex' changes, and even would like to avoid some of them (like breaking the network protocol). I'll create a new branch (and PR for it) that is closer to @dezo2's work (but still has a CVar like com_gameHz and will modify the scripts on load so I don't have to ship new scripts) + the additional fixes for obvious bugs, but tries to be less invasive than Stradex branch. |
@tyuah8 By the way, in d3xp scaling with |
I forgot to mention, and you could be right, but since I don't personally own Doom 3: Resurrection of Evil, all of my changes so far have been for the base game only. |
thanks to Github user tyuah8: dhewm#584 (comment)
Ok, trying this again at #585 with a slightly different approach.. |
thanks to Github user tyuah8: dhewm#584 (comment)
thanks to Github user tyuah8: dhewm#584 (comment)
thanks to Github user tyuah8: dhewm#584 (comment)
thanks to Github user tyuah8: dhewm#584 (comment)
thanks to Github user tyuah8: dhewm#584 (comment)
thanks to Github user tyuah8: dhewm#584 (comment)
Based on @Stradex' "Add com_gameHz to play with higher HZ/FPS" Pull Request, but also integrating fixes from @dezo2's patch (see also) and my own fixes.
Very much WIP, and no guarantees this will work out
Potential bugs that have been observed with various attempts of running dhewm3 with >60Hz and that are worth testing:
com_fixedTic -1
, might not be relevant here?)