# Thread: Movement Prediction using bezier curves

1. ## Movement Prediction using bezier curves

Hi there,

I'm essentially trying to make a Dead Reckoning engine (a movement tracking system for online use), but for now im just simulating this offline by having a moving character (which uses 0 gravity 360degrees spaceship/asteroids style movement) and having a "ghost" that follows the ship, but the ghost only gets updates on the original ship's x,y positions, x,y movement vectors, his rotation speed etc. every x amount of milleseconds.

Basically i'm trying to make the ghost roughly follow the ship (delay is expected). It is possible to make educated geusses as to how the original ship would have moved, given a 2 sets of x/y pos and x/y vectors (speed and direction) information. I've tried to illustrate the problem better in the image below. The arrows represent the vectors.

Basically, I'm uncertain of how best to construct the curve (bezier curve?), and how to tie in acceleration/changes in speed into the curve.

My apologies if i have explained this badly. Its quite complex!

2. ## Re: Movement Prediction using bezier curves

Hi there [Alee], There is an extension called 'move by bezier curve' which allows you to define a curve with infinite parameters, you could use some clever math to constantly add parameters to a never completing curve, or simple average 2 objects positions; one on the current curve the other on the next curve. The object also has options to slowdown when taking corners and more.

But I've got to warn you; I've used this for dead reckoning before and it just get's more and more complex; MooGame had this function built in, maybe have poke around with it; even just seeing what parameters it uses should give you some ideas :wink:

Good luck.

{for anyone else reading this thread; right click the image and select 'view image' to read the text in it}

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•