p2sr / SourceAutoRecord

Speedrun plugin for Source engine games.
https://sar.portal2.sr/
MIT License
93 stars 29 forks source link

Disable frame time clamp #130

Closed mlugg closed 6 months ago

mlugg commented 1 year ago

For some ridiculous reason, Valve clamp frame times between 0.001s and 0.1s (2.0s with -tools). This is what causes everything to break above 1000 fps. We can fix this by just patching that code to change the lower limit from 0.001 to 0 - or at least to some lower value, 0.00001 should still maintain no precision issues. Also, changing the upper limit from 0.1s to something a bit higher (maybe 0.5s?) could potentially lessen the timescale-ey effect of bad hardware (maybe leading to less false positive timescale cheat detections?)

(Note to self: look for MIN_FRAMETIME and MAX_FRAMETIME in Host_AccumulateTime, function already hooked, should be easy enough to modify)