May
31
2011

Enhanced Pathfinding

In a previous post - Mobile games are different - I mentioned that I made it so the player would walk to the location on the map you touched. Obviously, I had to implement some kind of pathfinding so the player would walk through solid objects. I chose to go with the A* algorithm. From what I read, it was fast, and I found a guy who did most of the leg work for me.

It was great, except the movement was not real. The player walked pretty jagged, and it turns out that is a pretty common thing. With a bit of digging I found an article that gave many ways to improve the algorithm. I only implemented the stright line movement improvements as I wasn't worried about the turns, but it looks great now. 

Add comment




biuquote
Loading


AdSense

Software engineer by hobby and trade. When I am not sitting in front of a computer, you can find me playing with my kids. I am lucky enough to be married to my best friend and high school sweetheart. Life couldn't be better!

 

All content is mine, not my employers

Chronology

Tweets

#hanselmemes is the best thing to happen to twitter this week
about an hour ago via Silver Bird
i hate when I go to up vote an answer on #stackoverflow only to find it has a ^2 count...the geek in me can't do it!
an hour ago via Silver Bird
@haacked, I am very much looking forward to your talk at the dotnet startup group on 3.8
16 hours ago via Silver Bird
free 2d platformer style graphics I created for prototyping. enjoy! http://t.co/r4Ne1ggh #gamedev
17 hours ago via Silver Bird
@DanielEgan thanks. replied :) Let me know if you need more screenshots
17 hours ago via Silver Bird
@DanielEgan did you get an email from me regarding wp7 phones? (Joe Kaiser) will resend if I have to :)
18 hours ago via Silver Bird
Waiting for art to get Nokia wp7 devices. Mt focus is broken, and I need a new one
19 hours ago via rowi
Follow me on Twitter