I noticed a lot of GC lag in the game.

Discussion in 'New Player Experience Feedback' started by AoiBlue, Jan 3, 2019.

  1. AoiBlue

    AoiBlue Avatar

    Messages:
    139
    Likes Received:
    99
    Trophy Points:
    30
    Gender:
    Male
    I noticed a lot of lag in the game after tasks that would load or unload data from the memory.

    In many cases this could be fixed by calling explicit GC at key points (many of which would not be noticed.)

    The first two points Explicit GC should be run is directly after unloading the last region (pulling to loading screen) and immediately after loading, but before the scene-change into a new region. These two points will likely save enough performance that they will be noticed as a performance improvement.

    I know that GC issues are largely upstream in Unity3D. I spent some time as a volunteer play-tester for Kerbal Space Program, that ran into the same issues a LOT.

    The second time is before starting or stopping a conversation with an NPC, and before loading transitioning to the buy/sell list. This is a time when the human mind expects a pause, and it is a time right before and after some specialized memory usage. It's a good time to clean up.

    Finally, the addition of a disk buffer heap (if possible) to store a lot of frequently used data objects might be useful. This will allow the data to be cleared completely when not in use, but able to be loaded very quickly, in the form it is used in memory. This is particularly useful for textures and models.

    As of other things to do to reduce memory usage, simplifying the collision maps would greatly help. Additionally, using Unity's newer UV map handler to create parallax mapped low-poly models instead of the current high poly ones would greatly improve performance.
     
  2. Feeyo

    Feeyo Avatar

    Messages:
    1,609
    Likes Received:
    2,357
    Trophy Points:
    113
    Location:
    Aelasar’s Forest
    Great post. They use the disk buffer system for the storage chests and bags already I think.
    All in all, hopefully the devs will do something with your comments.
     
  3. Daxxe Diggler

    Daxxe Diggler Bug Brigade - Bug Hunter

    Messages:
    2,631
    Likes Received:
    5,598
    Trophy Points:
    153
    Gender:
    Male
    Location:
    Virtue Oasis - Hidden Vale
    @Chris - Sounds like some solid ideas here, so thought I'd tag you.