About games where frames are important

Godot Version



Which is better, process() or physics_process(), for games where frames are important, such as fighting games?

These are two separate logic threads that may run at different speeds. If you are using physics objects you must run their movement in the physics thread to get them to work correctly. If you want to sync to the frames that are drawn to the screen, that’s better done in the main process, but it is not guaranteed to sync exactly with the display due to refresh rates and not every hardware combination supporting vsync. If you just want to count how many logical frames have gone by, that’s process, and you have a shorthand in Engine.get_process_frames(). There’s also one for physics frames, but as I said, that doesn’t sync with the logic one.

1 Like