mirror of
https://github.com/open-goal/jak-project.git
synced 2024-10-20 11:26:18 -04:00
685ff2cf1c
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> |
||
---|---|---|
.. | ||
ai | ||
ambient | ||
anim | ||
camera | ||
collide | ||
common_objs | ||
data | ||
debug | ||
dma | ||
draw | ||
engine | ||
entity | ||
game | ||
geometry | ||
gfx | ||
level | ||
load | ||
math | ||
nav | ||
physics | ||
process-drawable | ||
ps2 | ||
scene | ||
sound | ||
spatial-hash | ||
target | ||
ui | ||
util |