x


How do I handle Pathfinding in Shoot Em Ups?

Hello,

I'm working on a top down Shmup. (Think Air Attack HD, Ikkaruga etc) In these games, enemies fly at you in waves. Usually, when they get to a certain point, they change their direction. In my current game, the enemies just translate in one direction. (left to right, or up and down) I have tried the math.pingpong function. It's okay, but it the behavior is not exactly what I had in mind.

So my question: How is enemy path finding usually handled in games like these? I imagine these enemies follow some type of paths

I found the Angry Ant A* pathfinding tutorial. I have not used it yet, but I feel it may be overkill. I also have found a few tutorials that allow the enemy AI to go between a few points. Again, I just imagine that this would be a huge hit on a computer's memory to have multiple entities checking waypoints every few minutes. Do these games use raycasting? (Disclaimer, I don't know much about raycasting...) Should I have the enemy check what his current world position is, and go in a different direction when he reaches a certain point?

I'll stop babbling, but can anyone point me in the correct way of thinking? Thanks in advance.

more ▼

asked Feb 05 '11 at 04:45 PM

Marvin Hawkins gravatar image

Marvin Hawkins
50 12 16 24

This video does a decent job of illustrating what I'm looking for. Note the red planes that spawn from the red cube. They seem to follow a path along the green cubes. I hate to ask, but what type of math is involved?

http://vimeo.com/13428175

Feb 05 '11 at 05:08 PM Marvin Hawkins
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

Its mentioned in the video, but the math used is a Bezir Curve.

"All boxes have a purpose : one spawn point (what NPC load, how many..), one start point (first point of the path), a final point and one or two mid points. So to calculate the Bzier curve, three or four points are used."

http://en.wikipedia.org/wiki/B%C3%A9zier_curve

http://answers.unity3d.com/questions/5279/moving-an-object-along-a-bezier-curve

more ▼

answered Feb 05 '11 at 08:34 PM

Skjalg gravatar image

Skjalg
1.4k 24 33 50

Thanks! This looks like a good resource. I'll check it out.

Feb 06 '11 at 05:51 PM Marvin Hawkins
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x960
x252
x182
x13

asked: Feb 05 '11 at 04:45 PM

Seen: 1332 times

Last Updated: Feb 05 '11 at 04:45 PM