Path finding

posted in Ezbez's Blog
Published January 18, 2011
Advertisement
Since the last update I've been working mostly on path finding. I thought I'd show an image of the pathfinding algorithm running.

pathing.jpeg


The enemies (in red) show their paths (in magenta) calculated by A*. The large magenta dots show the furthest along target that the enemy can see - this is what it actually moves towards in order to take shorter, diagonal paths that A* doesn't find. You can see that the process still has some bugs in it - notice how two enemies are moving directly toward the player (in green) despite a wall being in the way.

One problem I encountered was that enemies kept on getting stuck on walls. This was due to their looking ahead and 'seeing' the waypoint just across the corner, when in actuality their non-zero radii meant that they would get trapped on the corner trying to take a diagonal path. To fix this, I used the common technique of enlarging all collision objects by the radius of the enemy before doing the line-of-sight test. Since I only use the static level geometry for line-of-sight tests, I simply make an enlarged version of it at level load.
Previous Entry Project update - new demo
0 likes 1 comments

Comments

Hawxxy
Hey man, I like your engine, I do graphics and I'd love to do some stuff for you, I can do animations both 2d and 3d. I'd wanted to make a game like this for ages but I cant program. I can make this look polished thouh, I was thinking 16 bit pixel art and make the view point slightly from the side rather than straight down. like age of zombies for psp and phones if you ever played it, but not making it "cute" what do you think?
February 15, 2012 01:44 PM
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Advertisement