Author: Devman
• Tuesday, October 09th, 2007

I reached a milestone today in Crescendo development:  Pathfinding is working!

For those of you who pathfind naturally, this may not seem like much, but let me assure you that it is a great accomplishment for any silly computer creature, whose intelligence is only as great as what we program it to do.

Pathfinding is simply finding a path around obstacles from a starting point to and ending point.  When you walk around a table to go into your living room, you are pathfinding.  You probably also avoided walls, chairs, couches, slippery toys left on the ground, etc., on your way to where you wanted to go.

What we humans and almost all other creatures do naturally takes a great deal of effort to program such that a computer creature can do it, even in its very limited computer game world.

Fortunately, pathfinding is a problem in computer science that is important, and so algorithms have been developed to solve it and do so quickly.  I used an excellent and free pathfinding library called MicroPather.

Now my creatures in Crescendo don’t run into each other and trees when they move, but instead intelligently find paths around obstacles.  In the screenshot below, the pink squares are the paths that creatures have plotted out for themselves to follow:

Notice the (evil) knight in the upper left: that is a creature from the non-nature kingdom destroying the trees that the squirrels/chickens have been working so hard to plant.  What a jerk, right?  That’s why the nature kingdom needs some bears, some big bruisers to defend its primeval forests.  8)

Share:
  • Facebook
Category: Technical
You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.

One Response

  1. Hurray! Good job, Devin! Dev’s been awakening every morning at 3:30 to work on his game. He’s working so hard for us at such an awful hour!

Leave a Reply