Search Unity

0.51 feedback

Discussion in 'NetCode for ECS' started by skiplist, Jun 22, 2022.

  1. skiplist

    skiplist

    Joined:
    Nov 9, 2014
    Posts:
    47
    I haven't gotten to doing that much testing yet, but this is the feedback I have initially:

    I can still see the FIXME from here so I assume that bug remains?
    I fixed that previously by using the sequence number like suggested, but also in a bunch of hash maps that used ArchetypeChunk as key. Not sure if latter is necessary but I didn't trust the AchetypeChunk equals check and it has been really stable so I will probably do the same in 0.51.

    Ghost debug stuff is fast now! Awesome!

    Ghost collection is still (continuously) very slow with a lot of ghost prefabs in the collection (~1000). I changed this to only do the prefab initialization initially in the old version, which probably only works since we only load prefabs once. But still, feels like there are improvements to be made here.

    The serialization jobs are a lot faster without burst. Really helps a lot since we can opt to not use burst in the editor which is a huge productivity win. Not sure if this is something you have changed or because of 2021 and new C# runtime.
     
  2. timjohansson

    timjohansson

    Unity Technologies

    Joined:
    Jul 13, 2016
    Posts:
    473
    That bug should be fixed, it was not related to how we compare archetypes directly, but structural changes. It's this line in the changelog from 0.8.0:
    * Fixed a very rare issue where invalid baselines could be used when an entity had structural changes

    We've also fixed a bug where the chunk -> state hashmaps were not cleaned up properly - I think that would fix the same issue you switched to sequence numbers for (the two issues are not really related) so you should not need that change anymore.

    We did an optimization pass on serialization which - among other things - reduced the number of function pointer calls by batching more processing in a single function pointer. This was the #1 perf issue when burst was disabled so that is likely what you are seeing
     
    Occuros likes this.
  3. skiplist

    skiplist

    Joined:
    Nov 9, 2014
    Posts:
    47
    Yeah, that sounds exactly like it. I thought the call itself just had gotten faster, but this is great. Wasn't very keen on updating to 2021 just yet :)
     
  4. skiplist

    skiplist

    Joined:
    Nov 9, 2014
    Posts:
    47
    I was still getting the "A ghost changed type" exception so I switched back to sequence numbers and it went away. So for me it doesn't seem to be fully fixed, but I can just use my sequence number patch so no worries.

    Maybe the more correct fix is to use the sequence number in the ArchetypeChunk Equals function, but I'm a bit hesitant to changing that myself in case something weird depends on the current behaviour.