Skip to content

AnticipationNetworkTransform Question/Suggestion #3533

@Callen98

Description

@Callen98

Hello,

While Attempting Client Anticipation/Reanticipation I've noticed that NGO's Reanticipation only really supports stateless movement (Movement calculated purely from current input and known constants, With no reliance on Previous/Accumulated states). I will give an example to help illustrate why Reanticipation does not work very well with stateful Movement below, and I will make a suggestion at the end.

Example: I have a stateful movement setup which relies on a velocity using anticipation, My client will anticipate the movement of my character/object storing velocity each frame, Server will run the same movement code & send transform updates to my client triggering Reanticipate(), at this point, prior to running any code within Reanticipate() the client will have a position which is 1X RTT behind, but the client will have a velocity which relates to the current frame(As the velocity is not rolled back), This is now an issue which I cannot find any good solutions for, if the clients prediction is wrong its likely that the velocity will also be wrong, as the position is both influencing velocity & is influenced by velocity.

Saving the clients values and replaying them seems like a bad solution to this problem as I would essentially be trusting the client values which could still lead to incorrect predictions in the future. Ideally I would love to be able to Rollback and Reanticipate() other values alongside the transform, and I believe most games with slightly complex simulations would require this.

I've attempted to use AnticipatedNetworkVariables to solve this problem, however these seem to send updates & Trigger Reanticipate() at different intervals if I'm not mistaken, which will cause my client to continuously Reanticipate() with only some of the necessary data, as each AnticipatedNetworkVariable/AnticipatedNetworkTransform triggers Reanticipate() separately.

Seems like there should be some form of support/functionality for state influencing variables like velocity for example to be passed along with the AnticipatedNetworkTransforms inside the TransformState, This would then cause every Reanticipate() to start with the correct data (Velocity in my examples case) rolling back to server Authed values and resimulating the movement after.

Please let me know if I've misunderstood anything here.

Kind regards,
Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    stat:awaiting-triageStatus - Awaiting triage from the Netcode team.stat:reply-neededAwaiting reply from Unity accounttype:featureNew feature, request or improvement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions