Search Unity

Question Component with multiple ghost field attribute question

Discussion in 'NetCode for ECS' started by optimise, Nov 23, 2021.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Let's say I have a component with 10 fields and all marked with [GhostField] attribute, if only 1 field has data changes is that only that 1 field data will be sent across network or all the 10 fields data will send across network no matter what?
     
  2. timjohansson

    timjohansson

    Unity Technologies

    Joined:
    Jul 13, 2016
    Posts:
    473
    Only that 1 field will have a delta value send over the network, the other 9 fields will not send a delta.

    All 10 fields will have a single bit saying if they did change or not. If a field did not change from the baseline we will set "did change" to 0 and do not include the data for that field.

    The "did change" bits are also delta compressed, so assuming the same set of fields change every time they do not give you any additional network traffic.
     
    bb8_1 and optimise like this.
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    @timjohansson I see but this behavior only applies to ghost dynamic optimization mode right? For ghost static optimization mode should be send nothing including "did change" single bit when there's no field has delta value changes?