Search Unity

Bug (IN-42182) [1.0.10] Keep running change filter at owner predicted ghost

Discussion in 'NetCode for ECS' started by optimise, May 27, 2023.

  1. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    When it's owner predicted ghost, change filter keep trigger no matter what. The expect behavior should be only trigger change filter when ChangeFilterComponent actually change value. Btw change filter at interpolated ghost is working that only debug log once.
     
  2. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    900
    I didn't check the repro yet.
    But as a remainder: as soon as you have a query that is not readonly or retrieve a component in a job with non-read-only access, no matter what you do with it, its value is considered changed, even though it is not.

    The change filter does not consider or check that component data/fields is actually modified at all (in general). And because it is owner predicted, I assume the owner client modify the ghost, so that should be expected somehow.
    But remote clients should see it as interpolated ghost, so it should behave like them. Is the value changed seen on the "inteporlated" ghost or the predicted ghost?
     
  3. optimise

    optimise

    Joined:
    Jan 22, 2014
    Posts:
    2,129
    Actually I just create a ghost component then a system with change filter to query the ghost component. The system just keep logging for owner predicted ghost. Interpolated ghost will only log once which is expected behavior. But I need owner predicted ghost to also log once since I have the floating UI value use case mentioned at previous post that needs to works exactly like interpolated ghost. If not the UI value will just keep spamming non-stop which is game breaking.
     
  4. CMarastoni

    CMarastoni

    Unity Technologies

    Joined:
    Mar 18, 2020
    Posts:
    900
    Indeed that can happen for many reason. And I think the one reason for that are partial ticks.
    We restore the state of the components to that last full tick when doing the partial updates; And this invalidate the change filter.
    We can add some extra logic to handle that, but it indeed cause some performance costs.
     
    Last edited: May 27, 2023
    optimise likes this.