Skip to main content
gamedev.net
🔒 Locked

Predictive

Started by Soul Jan 24, 2003 at 2:44 PM 1 replies 800+ views
Original Post
Soul
Soul
OK as we all know in a MMOG, we can''t send every little change a player can see from the server all the time, so we usually need some kind of predictive engine that predicts what a player will do. Basically I''ve written a predictive engine for a little game I''m working on, and it works quite nicely by assumming that if a player is turning right at a given rate, that player will probably continue to do so until another packet is received (so I basically smooth the motion), this is great apart from when they make a sudden change in direction as my predictive engine carries on until the packet arrives which then says actually I was going the other way !! and I get a little leap as it moves to where it should be. anyone have any clever ideas to get around my little leap?
OmniBrain
OmniBrain
let the renderengine interpolate between the anticipated position and the new position.

say if you have the info your char is looking at angle 0° at time 0, and you know he is turning clockwise, so you anticipate he is at say +10° next update. now your update comes and it says -10°, rotating left!
you anticipate from -10°, get as result you will be at -20° next tick, but you actually represent the character with 10°. what do now?
for the next frames let the character rotate faster counterclockwise, so you will have reached -20° at the time the next update comes.
so next update comes, it says -20°, still rotating counterclockwise. you predict you will be at -30° at next update, you are at -20°, so just turn your char some slower than before.

i hope this is understandable..
-----The scheduled downtime is omitted cause of technical problems.
Soul
Soul
Yep that makes perfect sense,
Thanks
Soul.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.