Godot Version
4.2.1
Question
Hello! I’m working on a rhythm game and I was wondering if it was possible to decouple the game logic updates (including input) from the visual frame rate.
Mainly because the reactivity to input and the sounds played are more important than the visuals, and so I’d rather keep a constant 60 fps while all else was updated more frequently.
I’ve seen that the physics updates can be decoupled from the visual and normal process, but from what I’ve seen, the input events trigger right after a normal “process”, thus not updating in the “in-between” frames.
Thanks!
Calinou
September 14, 2024, 9:00am
2
This isn’t implemented yet:
opened 07:22AM - 01 Aug 20 UTC
topic:input
I thought this deserved a mention https://github.com/godotengine/godot/issues/26… 828 coming from a FPS background, it drives me insane when there is any input delay.
**Describe the project you are working on:**
FPS project.
**Describe the problem or limitation you are having in your project:**
No problem, but having fluid input 100% of the time would be very nice.
**Describe the feature / enhancement and how it helps to overcome the problem or limitation:**
If input is polled in the render thread and the game lags at all, it introduces input lag. Unity, Unreal, Source and all major engines have this problem (although it's being fixed in Unity https://github.com/Unity-Technologies/InputSystem).
If a user can't reach high enough frame-rates, they will have input lag. Polling in a separate thread would eliminate this problem. Instead of getting input lag, you would just get visual frame skip when moving your mouse (which is still present when you poll at lower rates anyway). The advantage of this is it will make input feel snappy all the time (for both mouse and keyboard input).
Example:
If the input was polled in a separate thread and a person flicked their mouse the same distance at 15fps and 300 fps, it would land in the same spot at the exact same time (although the 15 fps player would skip/chunk a lot of frames).
More info:
https://www.epicgames.com/unrealtournament/forums/unreal-tournament-discussion/ut-development-bug-reports-qa/3209-mouse-input-issues-concerns-and-what-will-be-done-about-it
https://www.epicgames.com/unrealtournament/forums/unreal-tournament-discussion/ut-development-bug-reports-qa/16532-mouse-input-investigation
https://www.reddit.com/r/GlobalOffensive/comments/6y47m8/
https://www.reddit.com/r/reflex/comments/499s68/
https://www.reddit.com/r/Competitiveoverwatch/comments/6xet7k/
**Describe how your proposal will work, with code, pseudocode, mockups, and/or diagrams:**
It's possible to implement this using GDNative or using a Module, but having it directly in the engine would be best.
**If this enhancement will not be used often, can it be worked around with a few lines of script?:**
If implemented, everyone would be using it.
**Is there a reason why this should be core and not an add-on in the asset library?:**
Everyone deserves fluid input, it would make the user experience better for everyone (especially people on lower spec machines). Having it in engine while most others don't would be a nice step above.
Note that many rhythm games like osu! just take the approach of disabling V-Sync (or using mailbox V-Sync) and rendering as many frames as possible to achieve lower latency and deliver audio events at more accurate timestamps. There’s usually still an user-decided cap in place to ensure this latency doesn’t fluctuate according to scene load during gameplay (and avoid frame queuing due to GPU-bottlenecked scenarios).
Thanks for the reply!
Not the answer I hoped to get, but it answers the question.
I will go with mailbox VSync and a higher framerate and deal with problems as they arise.
system
Closed
October 14, 2024, 11:30am
4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.