Does using Update give different player experiences on different framerates?

We talk a lot about working in update and how it’s running the calculations ever frame. But if you were to play a player vs player game where quick reactions were imperative, would the 60fps player have an unfair advantage against the 30fps player? Would the game even behave differently due to it being updated twice as much?

Hi SlackerProject,

That’s a good question. I have to admit that I have never thought about this as I don’t play or develop any multiplayer FPS or “fast” games in general.

Maybe @Yitzchak_Cohen knows more?

Hi there,
This is a good question and the answer depends on a lot of things.

You are correct that the FPS would affect gameplay if your project is not properly structured. Locally, on each computer a game is being played on, we do our best to run things in a way that is independent of frame rate. As you may know, this is why often FixedUpdate() is used instead of Update() for physics based statements. (FixedUpdate() runs at a fixed time interval instead of each frame.) If a game is coded well, it should run similarly on most machines. You can also adjust values based on the length of each frame using Time.timscale to similar effect. The goal being to cause actions in-game to occur at the same real-time for each instance of the game.

Of course when this runs up against the limit of the hardware, some computers may not process fast enough and the hardware becomes the limiting factor. If it takes longer than FixedUpdate() to process a frame or if you can only run a few frames each second, this will cause inconsistent results.

Where the networking/multiplayer factor fits in, is how often information is updated between the various machines that are playing the same game. In Mirror Networking for example (which is what I have experience using) you can set the time step for updating the position of an object. So even if everyone is controlling their game at different rates, the data is synced at a constant rate.

The other consideration is internet speed. If one person’s s internet can’t get them the data within the sync time step, this would cause their version to lag behind other connections.

I’m not familiar with optimizing a game for network play, as this is an entire field of study, but within Unity, I would say that having your game frame rate independent, and optimized to meet the lowest expected hardware specs and internet speed, could reduce the competitive advantage of a faster computer.

Sorry about the long post, I hope I answered your question. If you have more questions on this subject just let me know, I would be happy to answer!