Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Feature Request Object Visibility

Discussion in 'NetCode for ECS' started by ThatDan123, Dec 16, 2022.

  1. ThatDan123

    ThatDan123

    Joined:
    Feb 15, 2020
    Posts:
    11
    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:
    https://docs-multiplayer.unity3d.com/netcode/current/basics/object-visibility

    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.
     
    Last edited: Dec 16, 2022
  2. timjohansson

    timjohansson

    Unity Technologies

    Joined:
    Jul 13, 2016
    Posts:
    473
    PolarTron likes this.
  3. ThatDan123

    ThatDan123

    Joined:
    Feb 15, 2020
    Posts:
    11
  4. NikiWalker

    NikiWalker

    Unity Technologies

    Joined:
    May 18, 2021
    Posts:
    224
    True! A section will be added, thanks!

    EDIT: Section added to optimisations.md, which will land in the next pre-release. Thanks again!
     
    Last edited: Jan 12, 2023
    ArgenticsMT likes this.