Object Visibility

Would be nice to have an Object Visibility / Interest Management feature (not the same as the importance stuff), where you can customise what different clients can see.

E.g block them from knowing about objects a certain distance away from them.
Or prevent inventory cheating by only sending data to the holder.
Or setting up a system so you only receive data about your allies health but not the enemies.

Here’s the Netcode for GameObjects implementation, though obviously not usable for Entities:

Having a DynamicBuffer of connections on the ghost would probably be the easiest implementation. And if that buffer doesnt exist on the object then it’ll go through the normal sending process. Though for a large server that buffer could get big in certain scenarios.

This would be a good tool to reduce unnecessary packets.

The feature already exists and is called relevancy in Netcode for Entities. You need to get the GhostRelevancy singleton, set the relevancy mode and build a map of either all relevant ghosts per connection or all irrelevant ghosts per connection depending on which mode you use. See Struct GhostRelevancy | Netcode for Entities | 1.0.17

1 Like

Ok cool thanks.

It’d be a good idea then to put a section in the main doc about it as I’m sure it’s not mentioned anywhere.

https://docs.unity3d.com/Packages/com.unity.netcode@1.0/manual/

True! A section will be added, thanks!

EDIT: Section added to optimisations.md, which will land in the next pre-release. Thanks again!

1 Like