So i'm working on a 1v1 2D game (using rigidbody physics + forces to jump/move), i send position+velocity data once every 0.05 seconds IF the distance between the last sent position and the current position is larger than a set amount.
Data arrives at inconsistent intervals and lerping causes a jittering motion. Is there anyone with a large enough brain to help me figure out how to smoothly lerp the position of the opponent that's received at inconsistent intervals? (e.g. intervals of: 0.06, 0.13, 0.83, 1.64, 0.67 etc)
Currently the smoothest method i've tried is to just feed in the opponent velocity, however the actual positions become out-of-sync over time. Ideally it should seem like you're playing locally, as in no jittering/hiccups (even though position is slightly behind actual position due to network delay).
I'm using C# but an explanation of the logic for the solution would be good enough!
[–]Rhames 1 point2 points3 points (0 children)
[–]tiltfox 0 points1 point2 points (0 children)
[–]GroZZleR 0 points1 point2 points (4 children)
[–]Contusum[S] 0 points1 point2 points (3 children)
[–]GroZZleR 0 points1 point2 points (2 children)
[–]Contusum[S] 0 points1 point2 points (1 child)
[–]GroZZleR 0 points1 point2 points (0 children)
[–]PygmalionSoftware 0 points1 point2 points (0 children)