I’m trying to test some multiplayer stuff by running two standalone builds on my computer at once - one as a listen server, the other as just a client. If either player loses focus before I start the listen server, they will stay at around ~60 updates per second. However, if one player has started behaving as a listen server and the other has connected, then I get weird behavior. If either window is in focus, the other has severely degraded performance. If neither window is in focus, both will run at a slower speed than if in focus but still faster than if exactly one is in focus.
This all means that I can’t test anything on the client player - if the server isn’t in focus, it simulates crazy slow and things like physics/important logic will bug out. I cannot figure out how to fix this.
I have tried already tried using a custom UGameEngine
class and can confirm that my custom engine class is being used (I shoot out a bunch of logs.) I tried overridding ShouldThrottleCPUUsage()
- it never gets called. I also tried overloading UGameEngine::GetMaxFPS()
- it never gets called. I finally tried overloadingUGameEngine::GetMaxTickRate()
and just call the Super::
implementation, log the value it gave me, and return it; it is always returning 0, whether in focus or not.
I’ve seen mentions of the t.IdleWhenNotForeground
console command - this does not fix this. When that is set to 1, the player is completely frozen when not in focus; when it is set to 0, I still get very low FPS. And, obviously, the editor setting for “reduce CPU use in background” is entirely irrelevant.