com.unity.netcode.gameobjects icon indicating copy to clipboard operation
com.unity.netcode.gameobjects copied to clipboard

Some issues with a frozen experience

Open jesuscfp opened this issue 3 years ago • 6 comments

I'm using Netcode and ARFoundation for my project. Sometimes of a random way, using a Android device as host or client, the FPS falls until 1 or less. I couldn't reproduce it using only Netcode or ARFoundation.

Low framerate

After do some diagnosis, I could see the Netcode generates garbage by each tick, is this a normal behaviour? This happens from editor and Android device, I think this could be the cause of the frozen experience.

Tick 30 times per second

Also, after research a bit more, I used a basic project using Netcode. I configured an Android device as host, and the editor as client. After some minutes, the editor shows some exceptions about buffered linear interpolation.

exceptions-interpolation

These issues could be relationed with my low framerate experience?

My setup:

  • Unity 2020.3.26
  • Netcode for GameObjects 1.0.0-pre.6
  • Multiplayer Tools 1.0.0-pre.2
  • AR Foundation 4.1.9

jesuscfp avatar Apr 19 '22 10:04 jesuscfp

it looks like PostLateUpdate.FinishFrameRendering is taking 98.9% of the frame budget. please have a deeper look at that — it doesn't look like a performance issue related to netcode.

0xFA11 avatar Apr 20 '22 15:04 0xFA11

Hey! Thanks for the answer.

I leave from here a new screenshot about the FinishFrameRendering:

high-cpu-semaphore

For my tests, I always leave the device fixed in a same place and simply I leave pass the time until the frames fall. The only special thing is that when Netcode host/server starts, it spawns an object that it is continually moving around the space.

Also I just upload the profiler data at wetransfer if is usefull for you. https://we.tl/t-iGPgb26NLI

jesuscfp avatar Apr 21 '22 08:04 jesuscfp

MTT-3456

ashwinimurt avatar May 03 '22 23:05 ashwinimurt

MTT-3456

I can't access to jira with my Unity credentials to can see the progress. What could be happening?

jesuscfp avatar Jun 03 '22 12:06 jesuscfp

@jesuscfp I am following up on this issue and was wondering if you have the same issues with the official release of Netcode for GameObjects v1.0? If so, could you please capture another profiler session so we can review it?

Also, in your first screenshot I noticed that it is spending a very large period of time on the NetworkVairableDeltaMessage deserialization side. Are you using a NetworkTransform to track the AR device's position and rotation? If so, have you tried (using v1.0.0 release) enabling interpolation and increasing the threshold to help reduce the frequency of "delta updates"?

NoelStephensUnity avatar Jul 29 '22 18:07 NoelStephensUnity

Hey @NoelStephensUnity thanks for the help. I've tried to update NetCode to 1.0.0 and multiply the threshold by 100 for AR's NetworkTransform, but the problem persists.

The problem is random and for this last test, I've executed it six times on Samsung A20 leaving the device in the same position, with the nexts results:

  1. Game freeze after 40 minutes of execution.
  2. Game freeze after 26 minutes of execution.
  3. Game not freeze after 46 minutes of execution.
  4. Game freeze after 10 minutes of execution.
  5. Game not freeze after 30 minutes of execution.
  6. Game freeze after 8 minutes of execution.

To end, I could check that generating the build choosing IL2CPP instead of Mono in past tests, the next warning stopped show:

Failed to load native plugin: Unable to load library '/data/app/~~BDsna8pemmgkNHVPdFnhwA==/com.PlexusTech.Accordion-l7jJAB5OG0a9_7jxi-hYbw==/lib/arm/libMonoPosixHelper.so', error 'java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.ClassLoader java.lang.Class.getClassLoader()' on a null object reference'

After that, the game wasn't become freeze but Android shows a message about overheating after a random minutes (with the same frecuency as the freeze game) and finalices killing the app. I'm not sure if the problem is caused by NetCode, ARFoundation, another Unity system or simply by combined them. In the Logcat that I attached it's possible see a lot of warnings relationed with ARCore and I've tried to Unity 2021.3.4 and ARFoundation 5.0.0.

Profiler datas: https://we.tl/t-OvNlAZDRsY logcat.txt

jesuscfp avatar Aug 08 '22 13:08 jesuscfp

@jesuscfp Ok, we haven't run across this particular issue with the overheating.
Could you try something on your end (if possible) to narrow this issue down? Try decoupling the AR side of things (disable or the like) and where you are feeding the AR device's rotation and position add some script to simulate the AR device to see if the Netcode side still causes it to over heat?

I am trying to narrow down if this is a Netcode or ARFoundation issue in order to determine you best course of action.

NoelStephensUnity avatar Aug 16 '22 16:08 NoelStephensUnity

@NoelStephensUnity I can say that having a scene with AR active but with Netcode inactive (without start as client, host o server), the bottle neck continue appearing randomly. So the problem could be caused by AR?

jesuscfp avatar Aug 18 '22 13:08 jesuscfp

Hi @jesuscfp, It definitely seems like it could be an issue related to AR.
I would suggest opening a new ticket via this link to get support with the AR side of things. Once you can run that without the bottleneck, then try enabling Netcode for GameObjects. If you run into problems at that point feel free to open another ticket here and our SDK team (or myself) will be more than happy to assist you!

NoelStephensUnity avatar Aug 25 '22 15:08 NoelStephensUnity