Who implemented dirPrediction?

Discussions related to the BloodsPilot clients
Post Reply
Angeba
Posts: 88
Joined: Sun Feb 06, 2011 11:23 pm

Who implemented dirPrediction?

Post by Angeba »

I would like to have a first hand explanation of how dirPrediction works.
This should help to debug the jumping/jerky ship turning which I often encounter.
Samaseon
Posts: 13
Joined: Wed Mar 24, 2010 2:47 pm

Re: Who implemented dirPrediction?

Post by Samaseon »

It was a player called Marvin, I think his name is mentioned in the XPilot NG AUTHORS file, his sourceforge user name is marvn.
Angeba
Posts: 88
Joined: Sun Feb 06, 2011 11:23 pm

Re: Who implemented dirPrediction?

Post by Angeba »

Ok, thanks. Not sure if I can contact him though. I would also accept second hand explanations
from anyone who understands how dirPrediction works. Still haven't looked into the relevant code
closely.
Samaseon
Posts: 13
Joined: Wed Mar 24, 2010 2:47 pm

Re: Who implemented dirPrediction?

Post by Samaseon »

I believe the idea with dirPrediction is that instead of waiting for the server's update of your new direction, you apply the new direction based on mouse movements immediately. This way, visually, the turning lag is eliminated.
Virus
Posts: 6
Joined: Mon Sep 19, 2011 1:27 am

Re: Who implemented dirPrediction?

Post by Virus »

Another important detail added in NG was the switch from relative mouse moves each packet to total moves IIRC. This, basically, eliminated the worst parts of network loss: losing bits of turns so you end up facing in an unexpected direction.
Virus
Posts: 6
Joined: Mon Sep 19, 2011 1:27 am

Re: Who implemented dirPrediction?

Post by Virus »

Also, bp client seems to dirpredict the hud function 'direction pointer', while NG does not. So on NG you see the3 direction pointer lagging behind ship turns, on BP you do not.
Angeba
Posts: 88
Joined: Sun Feb 06, 2011 11:23 pm

Re: Who implemented dirPrediction?

Post by Angeba »

Yes, kps removed the round-trip-time from the direction pointer (in 2007 IIRC). Throat was interested to put this feature into the official ng client, but I think this was not done yet.

The main annoyance I have/had with dirprediction, is that sometimes the ship direction jumps back and force while I turn the ship. AFAIU, this is not related to loss, but most likely to lag. And my theory is that it is probably worse with variable lag (I think some call this jitter). I rule out loss, because I noticed the bad behaviour also while the loss metter didn't report any loss and also ping did not lose packets. I have also noticed the problem on a local server, while the system was _very_ busy, so that lag/client lag varied between 0 and over 100 ms or so.

When disabling dirprediction, the jerky ship movement vanished, but then I was not happy either, because it lagged behind my moves.

It is less of a problem now, than it was while on 56k. While I have relatively high lag to Rotunda's server, it seems to be quite stable:
rtt min/avg/max/mdev = 95.873/97.023/106.705/1.054 ms
But also on this connection/server, I sometimes feel a little "shiver" in the steering, more on the fxi server than on ng, if my prejudism doesn't deceive me here.

I'll post an illustrating recording some other day here.
Post Reply