jak-project/goal_src/jak2/engine/target/gun
Brent Hickey 685ff2cf1c
[high fps] Increase input buffer size and fix cloud scroll speed (#3178)
The game stores the last 3 frames of input (50ms of time at 60fps) and
often checks if a button was pressed within those 3 saved frames as a
condition.

When transitioning states, it often checks if some input was received
during the previous state (within those 3 frames) in order to quickly
transition out. A good example of this is when transitioning to
standing, it checks if you can jump this frame and if you had pressed X
recently, and if so, transition immediately to jump. This allows
transitions between states to feel more smooth/forgiving by letting you
jump at a later time when you are transitioning from falling->standing
than if you were only falling.

At 165fps the last 3 frames is only 18ms of time so the input windows
for these smooth transitions are almost 3x shorter.

This PR saves 15 input frames (enough to cover 50ms of time at 300fps)
for each controller and adds a (recently-pressed?) macro that checks all
15 frames. However, it only updates the necessary frames in history
based on the current frame rate. This way, 60fps continues to only check
against 3 input frames, 165fps checks against 9, 240fps checks against
12, and 300fps checks all 15.

---------

Co-authored-by: Tyler Wilding <xtvaser@gmail.com>
2024-02-23 18:58:45 -05:00
..
gun-blue-shot.gc deftype and defmethod syntax major changes (#3094) 2023-10-30 03:20:02 +00:00
gun-dark-shot.gc deftype and defmethod syntax major changes (#3094) 2023-10-30 03:20:02 +00:00
gun-h.gc deftype and defmethod syntax major changes (#3094) 2023-10-30 03:20:02 +00:00
gun-part.gc jak2: macro detection for launch-particles and seconds-per-frame, add og:preserve-this comments for manual patches (#2974) 2023-09-10 11:48:56 -04:00
gun-red-shot.gc deftype and defmethod syntax major changes (#3094) 2023-10-30 03:20:02 +00:00
gun-states.gc [high fps] Increase input buffer size and fix cloud scroll speed (#3178) 2024-02-23 18:58:45 -05:00
gun-util.gc rename joint node and art element macros (#3111) 2023-11-01 23:16:00 +00:00
gun-yellow-shot.gc deftype and defmethod syntax major changes (#3094) 2023-10-30 03:20:02 +00:00