#1.4.0 seems to break unbatched importance scaling

1 messages · Page 1 of 1 (latest)

dry crescent
#

I recently updated to Netcode for Entities 1.4.0 in my project and had some errors with object references not being set to an instance of an object. This turned out to be caused by the ScaleFunctionPointer function getting called with an invalid chunkTilePtr.

In 1.3.6 (https://github.com/needle-mirror/com.unity.netcode/blob/25d32f8a704040d2fe04b47aeae503d9c8b396e4/Runtime/Snapshot/GhostSendSystem.cs#L1561-L1572) ghostChunk.Has() is called to ensure that the scaling function is only called for entities with the required shared/chunk component. This seems to be the intended behavior.

By contrast, in 1.4.0, if GhostImportance is enabled, this scaling function is called for every serialized ghost regardless of whether that entity has the required shared component. In this version (https://github.com/needle-mirror/com.unity.netcode/blob/00aeffdb9808054b6eef803b22e92a810f89b9ad/Runtime/Snapshot/GhostSendSystem.cs#L1680-L1686) ghostChunk.Has() is no longer called and leads to the scaling function being called using an invalid component handle if the entity does not have the shared component. This means that, if only the normal scaling function (not batched) is used and not all entities have importance scaling enabled, reference errors occur. I did add the ghostChunk.Has() check back in on my end and confirmed that this fixes the issue.

I just wanted to bring this to attention because (1) as far as I can tell this is a bug but I wanted to make sure I'm not missing something and (2) I'm not sure how to proceed with reporting a bug for this in the first place.

GitHub

Unitys Data Oriented Technology Stack (DOTS) multiplayer netcode layer - a high level netcode system built on entities. This package provides a foundation for creating networked multiplayer applica...

GitHub

Unitys Data Oriented Technology Stack (DOTS) multiplayer netcode layer - a high level netcode system built on entities. This package provides a foundation for creating networked multiplayer applica...

magic radish
#

i'd suggest reporting this on the forums (or the multiplayer server, not sure about that though), better netcode representation (or just create a bug report)

#

the netcode team do check this discord occasionally but it could be a while

reef saddle
#

Thanks for the info - it is indeed a bug. We will fix this (and add test coverage that very much should have existed), but note that we'd recommend switching to the batched version anyway for perf reasons.