netfox icon indicating copy to clipboard operation
netfox copied to clipboard

TickInterpolator doesn't work with server authoritative StateSynchronizer

Open jonbonazza opened this issue 7 months ago • 3 comments

:bug: Description

I have a Mob scene controlled by a BehaviorTree that uses a StateSynchronizer to replicate the :global_position to clients. It also has a TickInterpolator on the :global_position of the same root node to smooth out the movement. However, even without any clients connected, when the server tries to move the mob, it works fine without the TickInterpolator node, but with the TickInterpolator node, the mob seems to stay in one place.

Observed behavior

Without TickInterpolator:

https://github.com/user-attachments/assets/fe2e1a1a-f724-4bd9-b6ce-a552705d51ab

With TickInterpolator:

https://github.com/user-attachments/assets/4e14b1a6-bf2d-4dc9-ad5c-c889bd714731

Versions

  • Godot version: 4.4.1 stable*
  • netfox version: 1.25.3

Notes

I should also note that this happens whenever TickInterpolator has the enabled checkbox checked or not.

jonbonazza avatar Jun 21 '25 01:06 jonbonazza

Looks like if BOTH Record First State and Enable Recording are unchecked the issue goes away. If either one is checked though, the issue exists.

jonbonazza avatar Jun 21 '25 01:06 jonbonazza

Thanks for looking into this @jonbonazza! Would you mind submitting a minimum reproducible version of the issue? A tiny project that has this issue, so I can check it directly

elementbound avatar Jun 22 '25 21:06 elementbound

I will try to get some time to draft one up. More info though, it seems like it might be related to the fact that it uses a NavigationAgent2D. I think a workaround for now that seems to work for me is I disable the interpolator (and recording) all together on the server and only let it run in the client. Since there’s no rollback involved, it felt like it was pointless to run tick interpolator on the server anyway. let me know if this is a bad idea.

jonbonazza avatar Jun 22 '25 22:06 jonbonazza