Search Unity

Feedback Lag compensation and historic collision worlds size limitation

Discussion in 'NetCode for ECS' started by FaithlessOne, Apr 10, 2023.

  1. FaithlessOne

    FaithlessOne

    Joined:
    Jun 19, 2017
    Posts:
    315
    In my test project I integrated units which are able to shoot at each other with instant hits. While the own player ghost unit is predicted and uses prediction spawned shots the enemy units are interpolated. Thanks to the lag compensation of ECS Netcode the player can shoot and hit other units without having to aim ahead which is really impressive. There is only one issue I have so far and that is the limitation of the history size for the lag compensation. Lag compensation uses historic collision worlds and the amount of the worlds is hard limited to 16. I am not sure on this topic, but I assume 16 means that the server can look 16 network server ticks into the past for raycast collisions and the like. In my test project this was enough for compensating a latency between client and server of approximately 130 to 140 milliseconds using the ECS Netcode simulator. On higher latencies the most aged available collision world is used which then means that enemy units are in different spots for the server-based raycast collision checks than the player will see them rendered on the client. The awesome multiplayer game play experience is blown away instantly then.

    Firstly my question is: Why is there a limitation for the count of historic collision worlds used for the lag compensation at all?

    And secondly at least I would like to see an considerable increased limit of historic collision worlds to enable the experience of lag compensation for higher latencies.
     
  2. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    894
    Unfortunately there is a limit today and it is 16.

    The reasons behind this is multi-fold, but let's say it was mostly a problem due to the fact we couldn't store this
    struct efficiently and pass them to a job was also tricky (because of the size). So we have to limit ourself a bit.

    We can provide large buffer now, but it still requires some changes that will be not available for dots 1.0. But we have plans to extend that to allow you pass and configure which size you need.
     
  3. FaithlessOne

    FaithlessOne

    Joined:
    Jun 19, 2017
    Posts:
    315
    That's great to hear. Will this feature get backported to Unity 2022.3 LTS then or does it require to update to Unity 2023.X?