I've been working on a vertical shooter and right now I'm tackling enemy A.I. using self constructed paths. I've got things working so that each enemy sets its next WP, the speed it should use to get there and if it should pause when reaching it.

The thing is that all the movements are strictly linear and as you may know, this is hardly the case for enemy movement in vertical shooters. So i was playing around trying to implement Bézier curves which i had some real problems with. Eventually i got it to work using to points in space and one control handle, a Quadratic Bézier curve.

The problem i have though is that the formula i got working isn't taking into account the enemy speed, but only moves along the curve by setting X/Y positions each tick. Secondly, this isn't time based animation taking into account the delta-time which will make the animation slower on slow machines. How can i implement a constant time based animation across a Bézier curve?

I'm still trying to find a solution to this and math is not my strong side. As i understand it, getting a constant speed through a Bezier curve is impossible but you could get pretty close by calculating the arc length?

The problem is that you can't have a Shoot em up without having some advanced patterns for the enemies and the only thing i can think of is using bezier curves. If anyone has any other suggestions that would be great ^^

So far it seem to work really nice but i had to make a compromise because calculating the length of a more complex Bézier curve is way beyond my math knowledge. This is something that might bite me in the ass later if i decide to implement more complex enemy paths. We will see... ^^hdnine2013-09-05 13:47:55