Search Unity

Stuttering in Unity games

Discussion in 'Editor & General Support' started by Vaniqua, Feb 5, 2020.

  1. Vaniqua

    Vaniqua

    Joined:
    Feb 5, 2020
    Posts:
    1
    Edit: Actually had nothing to do with Unity.
     
    Last edited: Dec 27, 2021
  2. Joe-Censored

    Joe-Censored

    Joined:
    Mar 26, 2013
    Posts:
    11,847
    You are best addressing your concerns directly to the developers of the respective games.

    That said, stuttering can be caused by a variety of issues, so no one can say specifically what the cause is. Your computer's specs should be fine, so I wouldn't suspect your machine unless you see these games run on another machine without the same stuttering. There are tools within the Unity Editor which can expose the source of stuttering, but they would only be available to the developers (you need the Unity project itself open, basically the source code of the game). The developers can then go after those problems.

    Often stuttering is caused by putting too much work on a single frame, instantiating too many prefabs in a single frame, garbage collection, loading an asset from the Resources folder, etc. Traditionally Unity games are built around a single main thread where all the C# code and the main game loop is run, with some additional threads created by the engine for specific tasks, such as physics threads, etc. If anything ties up this main thread too long the player will see it as a stutter. So I wouldn't exactly say Unity games are prone to stutters, but they are very easy for developers to create in Unity and solutions to them can be somewhat complex depending on the exact cause.

    Unity has been putting in a lot of effort recently to improve the situation. They introduced the Jobs system to make it easy to offload a CPU hogging task to a separate thread instead of the main thread. They are also introducing an entirely new way of developing games for Unity called DOTS, which without getting into details will result in games more or less being entirely multithreaded without so much work going on that central main thread anymore. Lastly, they introduced Incremental Garbage Collection which will spread garbage collection across several frames instead of the previous behavior of seemingly randomly collecting all at once tying up the main thread until complete. None of this stuff though will help you with your 3 games unless they were redesigned to utilize these new features.
     
  3. xVergilx

    xVergilx

    Joined:
    Dec 22, 2014
    Posts:
    3,296
    Last edited: Feb 6, 2020
    Joe-Censored likes this.