Search Unity

Bug [1.0.8] (IN-40652) IsRelevant ghost relevancy fails to "wake" relevant prespawned ghosts

Discussion in 'NetCode for ECS' started by Kmsxkuse, May 9, 2023.

  1. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    Apply IsRelevant mode to the ghost relevancy set and add all ghost entities.

    Sometimes at high pings using the simulator (the higher the more likely this will occur), prespawned ghosts on the client will not receive server data despite being registered as relevant on the server. Since all entities are added to the set, all entities should be considered relevant.

    For example, put the simulator on broadband 95% international. Add a rotating prespawned ghost cube to the scene. Add a system that always sets this ghost to be relevant to all connections. Repeatedly start playing until randomly the cube will stop rotating (it will continue to do so on the server but the client will not receive any rotation).

    Using the inverse relevancy logic, IsIrrelevant, does not have this problem. Problem is with IsIrrelevant, there needs to be proportionally large amount of key inputs into the HashMap to indicate irrelevancy compared to only the visible entities that are relevant.
     
    Last edited: May 9, 2023
  2. NikiWalker

    NikiWalker

    Unity Technologies

    Joined:
    May 18, 2021
    Posts:
    315
    Hey Kmsxkuse, thank you for reporting this. Would you mind filing a Unity bug case report?

    A few clarifying questions:
    1. Are these ghosts using Static Optimization? Or does this happen with Dynamic ghost types too?
    2. Similarly: Do these ghosts eventually start rotating again?
    3. Does ghost count play a role here?
    4. Are these ghosts Predicted or Interpolated?
    5. Are you using PredictionSwitching at all?
    A repro project would be especially useful, and/or the specific component and system code to make it rotate. I'm curious to see:
    • Whether or not the server even sends these ghosts (via the NetDbg tool), and at what frequency.
    • Whether or not the client receives these ghosts (again via the NetDbg tool).
     
    Kmsxkuse likes this.
  3. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    Dynamic or static optimized ghosts. It doesn't matter.
    No. In fact, I got a reliable reproducable going. Using IPC (no simulator) going and all prespawned entities indicated as relevant from first frame, none of them receive rotation values from the server. Delaying setting any prespawned as relevant by around 100 frames makes them to rotate.
    Not that I can tell. I only have 25 prespawned and 2 player ghosts. That should be practically nothing. The player ghosts in particular (player + character) are properly networked and function perfectly. As seen by the fact that they are controllable using WASD.
    Both. I have a prediction switcher by distance system so two of the nearest prespawned ghosts are predicted and the rest are interpolated.
    Yes. And disabling the system does not fix the problem of prespawned not rotating. In the repo sent to the bug report, the system was disabled.
    Rotation is handled through the physics system and just setting initial angular velocity as a set value other than 0.
    Normal (Lights rotating): upload_2023-5-9_14-49-24.png
    Broken (Lights not rotating): upload_2023-5-9_14-50-11.png
    Lights being the rotating prespawned objects. The only difference between the two is a 100 frame delay that mysteriously allows the light prespawned ghosts to be registered as relevant where doing so immediately does not.

    Full reproduction project (actually my full project, I really cant trim down all the modules, too spagetti code, it should work out of the box though): IN-40652. Details on how to run and reproduce the problem in my small project located in the report description.

    Should be immediately reproducable in the repo provided using IPC (no simulator) multiplayer Client/Server settings.
     
    Last edited: May 9, 2023
    NikiWalker likes this.
  4. Kmsxkuse

    Kmsxkuse

    Joined:
    Feb 15, 2019
    Posts:
    306
    I do want to mention this remains an problem in the newly released 1.0.8 netcode version.
     
  5. NikiWalker

    NikiWalker

    Unity Technologies

    Joined:
    May 18, 2021
    Posts:
    315
    Thanks for the info, it's very useful. Checking now.
     
    Kmsxkuse likes this.