Skip to content

Conversation

@gratefulforest
Copy link
Contributor

@gratefulforest gratefulforest commented Nov 1, 2025

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 pal or ntsc, but custom, and the misps2c code uses settings for pal or ntsc.

To include support for high FPS, I temporarily change it to ntsc, and only apply this at the wave table creation when custom.

@OpenGOALBot
Copy link
Collaborator

Can one of the admins verify this patch?

@Zedb0T
Copy link
Contributor

Zedb0T commented Nov 1, 2025

Seems like this would be a usecase where protect could be utilized.

(defmacro protect (defs &rest body)
(if (null? defs)
;; nothing to backup, just insert body (base case)
`(begin ,@body)
;; a unique name for the thing we are backing up
(with-gensyms (backup)
;; store the original value of the first def in backup
`(let ((,backup ,(first defs)))
;; backup any other things which need backing up
(protect ,(cdr defs)
;; execute the body
,@body
)
;; restore the first thing
(set! ,(first defs) ,backup)
)
)
)
)

(#when PC_PORT
(protect ((-> *pc-settings* text-language))
(set! (-> *pc-settings* text-language) (pc-language english))
(load-game-text-info "common" '*fallback-text* *fallback-text-heap*))))
(none))

@gratefulforest
Copy link
Contributor Author

Oh, I like that. Less lines too, thanks Zed!

@gratefulforest gratefulforest changed the title Fix high fps ripples + frozen ripples jak1: fix high fps ripples + frozen ripples Nov 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

3 participants