This site is currently in read-only mode during migration to a new platform.
You cannot post questions, answers or comments, as they would be lost during the migration otherwise.
0 votes

I am currently making a small FPS game. Today while I was playing Star Wars Battlefront II I noticed that it feels way more responsive than my own shooter. The Nvidia performance overlay showed me a render latency of around 27ms in Battlefront and around 50ms in my own game. So my question is how to reduce the render latency to make my game feel more responsive?

Godot version 3.4.4
in Engine by (25 points)
reshown by

Kudos to you for not using the blanket word "lag" to describe your rendering problem ;)

Have you looked at the articles on optimization in the documentation?

1 Answer

+1 vote

In your project:

  • Disable V-Sync in the Project Settings (search for vsync).
  • Ensure FPS is not capped in any way by Godot or an external program. By default, framerate is uncapped in Godot, but V-Sync will cap the framerate to your monitor's refresh rate.
  • Run with fullscreen enabled (not a borderless window, not windowed mode). Windows will bypass compositing when running a game in exclusive fullscreen, leading to decreased input lag.

On the system:

  • Set Low Latency Mode to Ultra in the NVIDIA Control Panel, or enable Radeon Anti-Lag on AMD (both are only available on Windows).

    • This reduces overall latency by ensuring the GPU is never fully utilized (therefore avoiding bottlenecks). Note that this can decrease framerate slightly. Microstuttering may also become more noticeable.
    • On any GPU and OS, a similar effect can be obtained by capping framerate to a slightly lower value than what your GPU can sustain in all scenes in your game. You'll want to expose a way to set Engine.target_fps to the player for this purpose.
  • Force the maximum GPU performance profile (at the cost of increased power consumption). On Linux, gamemode can be set up to do this.
by (12,908 points)
edited by

Is there no other way than disabling V-Sync? I play other games with V-Sync enabled too because of the screen tearing and they all run at a lower latency than my game.

If you want low latency and no tearing, you have to enable V-Sync, use a variable refresh rate monitor (G-Sync/FreeSync) and cap the maximum FPS to a value slightly lower than the monitor's maximum refresh rate. See this page for more information. No V-Sync and no VRR will always give you the lowest latency, but optimized VRR can get you fairly close on some monitors.

I have a pull request adding documentation about reducing input lag: https://github.com/godotengine/godot-docs/pull/6186

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.