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

UI anims play at the wrong speed when FPS is not set to 60 #2131

Open
Sushiman3000 opened this issue Nov 19, 2024 · 5 comments
Open

UI anims play at the wrong speed when FPS is not set to 60 #2131

Sushiman3000 opened this issue Nov 19, 2024 · 5 comments
Labels
group: lua Problem with things handled by external scripts (screenpacks)

Comments

@Sushiman3000
Copy link

Describe the bug

Whenever you set your FPS (Framerate setting) in config.json above or below 60, UI animations will play at the wrong speed.

Setting the Framerate to match your monitor’s refresh rate makes the game run smoothly on high Hz monitors but causes UI animations to play at twice the speed. This issue does not affect characters, explods, stages, or other gameplay elements, only UI animations.

Here’s an example using a character animation as a UI animation (char portrait/face on the select screen):

Honeycam 2024-11-19 16-12-04

To Reproduce

  1. Set the "Framerate" setting in save/config.json to 120 or 30.
  2. Background, power bars, and other animated UI elements will play at the wrong speed.

Expected behavior

Keep UI animations locked at 60 FPS, independent of the "Framerate" setting.

Screenshots / Video

No response

Engine Version (or source code date)

nightly (9/11/24)

Operating system

Windows

Extra context or search terms

No response

@K4thos
Copy link
Member

K4thos commented Dec 7, 2024

edit: need to investigate it further

@K4thos K4thos added bug Something isn't working group: engine Problem related to engine logic (triggers, sctrls, bytecode, etc.) not an issue This doesn't seem right and removed bug Something isn't working group: engine Problem related to engine logic (triggers, sctrls, bytecode, etc.) labels Dec 7, 2024
@K4thos
Copy link
Member

K4thos commented Dec 7, 2024

works as expected, that setting affects the rate at which consecutive frames are rendered. Including menu frames. Not sure if we should even externalize it.

@K4thos K4thos closed this as completed Dec 7, 2024
@K4thos K4thos reopened this Dec 7, 2024
@K4thos
Copy link
Member

K4thos commented Dec 7, 2024

Ok, I see where the problem lies. When you set the Framerate to 120, the entire game runs twice as fast internally, but the in-game speed is halved due to the GameFramerate setting. The game speed is calculated as GameFramerate / Framerate, which in this case equals 0.5. We could potentially use this behavior for screenpack rendering as well.

However, I’m not sure if the Framerate setting should be externalized in the first place. Does running the game with Framerate set to 120 and halving the game speed via GameFramerate set to 60 really make a noticeable difference on a high-refresh-rate monitor compared to Framerate = 60 and GameFramerate = 60?

@K4thos K4thos added group: lua Problem with things handled by external scripts (screenpacks) and removed not an issue This doesn't seem right labels Dec 7, 2024
@Sushiman3000
Copy link
Author

It really makes a difference. You can compare it to setting the Framerate to 30 while keeping GameFramerate at 60 on a 60Hz monitor. That's how Framerate at 60 looks on a 120Hz+ monitor, though not as bad, it’s still quite noticeable. I’m referring to in-game performance, while still running at normal speed, there’s a lot of micro-stuttering.

This isn’t an Ikemen only issue though, but a general fps/hz thing issue on all games. 60fps looks smooth on a 60Hz monitor but looks awful on a 120Hz+ monitor. That’s why I think this change would be useful to people with 120Hz or higher monitors, so they can have smooth in-game performance while keeping normal speed UI elements in custom screenpacks with lots of animations.

I can try to provide some examples if that helps.

@potsmugen
Copy link
Contributor

potsmugen commented Dec 11, 2024

For some things it doesn't make a difference, but with characters for instance Ikemen will deliberately interpolate their movement to make it appear smoother. Lifebars too. The easiest way to see it is setting debug speed to 25%. Chars will still move at 60fps, just slower.

I don't particularly care to set frame rate above 60, but I'm sure many people would get a kick out of running Ikemen like that. Actually I can picture screenpacks with scrolling elements and such also benefitting from it, but that'd require porting the position interpolation to their code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group: lua Problem with things handled by external scripts (screenpacks)
Projects
None yet
Development

No branches or pull requests

3 participants