Skip to content
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

consistent grenade/missile/plasma shooting rates #417

Merged
merged 3 commits into from
Jul 10, 2024
Merged

Conversation

tra
Copy link
Contributor

@tra tra commented Jul 5, 2024

This makes it so that all weapon reload times are the same across different frame rates. They were slightly faster for higher frame rates due to the comparisons of the form:

        if (doSomething < frameNumber) {
            doSomething = FrameFromNow(3)
        }

That were changed like this:

        if (doSomething <= frameNumber) {
            doSomething = FrameFromNow(3+1)
        }

Also added a 1-classic-frame limiter to plasma shots which means they can only happen every 64ms (most humans can't click that fast).

Bonus fix, boosting also had this problem too so you'll get back 48ms of boosting in high-FPS games. I need all the boosting I can get!

tra added 3 commits July 3, 2024 17:49
many frame number checks were of the form
    if (doSomething < frameNumber) {
        doSomething = FrameFromNow(3)
    }

For classic mode that means to doSomething at most every 4th frame.  But for high-FPS, this code would start
doing something on frame 13 instead of on frame 16... faster than classic.

Changing code to work across frame rates like this:
    if (doSomething <= frameNumber) {
        doSomething = FrameFromNow(3+1)
    }
The HECTOR.Boost* tests had to be fixed because they were actually boosting on frame 1 since boostEndFrame inits to 0.
so that all frame rates behave the same on shooting rate
@tra tra merged commit 056308d into main Jul 10, 2024
3 checks passed
assertivist pushed a commit that referenced this pull request Aug 13, 2024
* fix FramesFromNow usage

many frame number checks were of the form
    if (doSomething < frameNumber) {
        doSomething = FrameFromNow(3)
    }

For classic mode that means to doSomething at most every 4th frame.  But for high-FPS, this code would start
doing something on frame 13 instead of on frame 16... faster than classic.

Changing code to work across frame rates like this:
    if (doSomething <= frameNumber) {
        doSomething = FrameFromNow(3+1)
    }

* fix tests and bugs found by tests

The HECTOR.Boost* tests had to be fixed because they were actually boosting on frame 1 since boostEndFrame inits to 0.

* added 1 classic-frame limiter to the plasma shot

so that all frame rates behave the same on shooting rate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant