Getting Terrible Frame-Freezes... but game is still being Update()'d
Hey Unity Devs, I'm hoping that someone can help me shed some light on a crazy bug that some of our Android players are reporting.
TL;DR: Bad 1sec+ frame freezes, but game keeps updating. Is this a Unity Rendering Bug???
The long version:
We get 1+ second frame freezes whenever coins are added to the players total. BUT the game keeps updating in the background. Here's a video a user sent us showing the HUGE lag spikes:
https://www.youtube.com/watch?v=nyQ34xLMtWA (After the lag spike - the trains have continued moving, making the game unplayable)
After spending several days trying everythign I can to fix the problem (I can't actually reproduce it on any device we have access to). I wrote some code that would make the problem WORSE... so here's what it looks like when we actually have bad code that sticks on a frame.
https://youtu.be/txdFwR6_CHU (Notice that the trains don't continue moving behind the lag.)
This is currently happening to maybe 1% of our players, and I can't (yet) see any common ground on device type, or OS version.
What can cause rendering to stop while we still get calls to 'Update()' ???
Answer by VoxelMatt · Sep 01, 2016 at 07:40 AM
More Information from one of our players. I've highlighted the important bits.
"I tried the Open GL and the first two plays Mons and Bruges were perfect. I had two perfect balloon rounds which I think is a first. One in Mons and then one in Bruges before the (video) freezing returned on my third balloon round when I played Amsterdam."
"The game continues I can hear it and even control the trains. Only the video is frozen for a short, random amount of time. "
We sent them 2 builds, one that disabled multi-threaded rendering. No change. And one that used OpenGLES3.0 (previously we just used gles2.0). In the OpenGLES3 build the problem seemed to go away for a little while. But then came back.
More videos showing the issue: https://youtu.be/g_HaY4g7M-s?t=37 https://youtu.be/olYdnuBinp4
I can't recreate the problem on any devices that we have access to. At this point I think it's maybe the Unity UI system?
I'm a Unity beginner, but am a experienced programmer in general. I'll just share some thoughts, they probably won't help :)
Are you sure that Update() is still called? Or do you do much stuff in FixedUpdate()?
I would double-check all Coroutines for potential locks.
Is there any network traffic involved? Can it be that the problem is related to bad connectivity?
Your answer
Follow this Question
Related Questions
Low Fps on URP on Android 0 Answers
What is the difference between Update() , LateUpdate() , FixedUpdate(), and when i should use them 3 Answers
get image on url, replace and reload in runtime 1 Answer
Script execution order of child and parent classes - Parent then children??? 1 Answer
Multiple small update calls vs one large update call? 1 Answer