Network ownership assignment on a unfocused user causes major entity desync

Artifact 5375
When unfocusing the game, network ownership is still assigned to the user. Since the game is running with limited resources when unfocused it causes odd, slow motion, laggy physics to happen to any entity which the user is a network owner of.

Fix: Prefer to assign network ownership to users who are focused into the game.

2 Likes

What do you mean by ‘unfocused’? Got any repro?

There shouldn’t be any code for ‘the game to run with limited resources’ so this is a little weird.

By unfocused, I mean by alt tabbing out of the game and having GTA be minimized. It seems like doing this causes GTA to run in a lower frame rate (Like 10 FPS). I think that network ownership should prefer higher framerates rather than just the closest players

… huh? Again, got any repro?

‘alt tabbing out of the game’ doesn’t do any such for any system I have access to: even opening other windows on top, the game remains running at full frame rate and doesn’t get ‘minimized’.

Also, ‘network ownership transfer’ is managed by R* code and there is exactly zero code we have implemented for this, nor would such code be aware of players’ frame rates at all, or should that be the ‘only’ prioritizing factor in any patches to such code, let alone the potential risk of breaking any existing scenarios by patching such, making it a lot safer and easier to fix the issue you’re trying to report by fixing whatever causes this ‘alt tabbing makes it minimized and run at low FPS’, but this can’t be fixed if it can’t be investigated, and it can’t be investigated if it doesn’t happen for whoever would work on it at all.

I see. I have observed this behavior by opening two FiveM clients (On the same computer, with the server running locally to mitigate network latency), and opening one of the instances over the other one, and observed major entity physics lag when the network owner for an entity is set as the minimized client player.

The way I found it this issue (may be?) FPS related is by hovering my mouse over the minimized client in the task bar, and observing 5-10 FPS gameplay in the preview window.

There’s really no way for me to test using multiple clients on different systems, so if it is just caused by my GPU allocating more of its resources to the FiveM instance in focus then it is really no need for concern.

Hopefully this is the level of detail you were looking for, if you’re unable to repro this still, let me know

That is normal behavior for GPU usage on Windows, yes. If your GPU is fast enough, you can try setting both game instances to the lowest resolution and other settings available to see if it changes anything.

I was curious about this mainly as a while ago, we’ve already added some mitigation to disable the game’s ‘constrained mode’, but it had some edge case scenarios where it’s break: it may have been you’ve found another one.