jak1: fix high fps ripples + frozen ripples #4067
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Have done some custom ripples so thought I could fix this. At first I scaled ripple speeds before realizing that wouldn't work if you change FPS mid-game.
Instead I found the delta increment is there as a variable, and just scaled that increment directly. I followed the same convention used everywhere; just multiply by
DISPLAY_FPS_RATIO.That was the easy bit, the hard part was a second, unrelated issue, whether you scale the delta or not, which is on level entry at high fps, it shows no water movement at all.
I saw the delta was always being created at 0.0 on high FPS, and saw the delta was computed nowhere in GOAL, only mips2c. I found inspiration from this patch, where the time ratio is changed to 60 FPS temporarily. However, fixing the time ratio still created 0.0 deltas, and no matter what I did, it always created 0.0 deltas.
I was about to give up, thinking there's no way to scale the mips2c deltas. However, I found out why it was giving 0.0 deltas, which is on high FPS, the video-mode is neither
palorntsc, butcustom, and the misps2c code uses settings forpalorntsc.To include support for high FPS, I temporarily change it to
ntsc, and only apply this at the wave table creation whencustom.