• Advertisement
Sign in to follow this  
  • entries
    45
  • comments
    115
  • views
    54819

Day 2

Sign in to follow this  

276 views

Today I took the OpenGL tile engine and stole a couple of bits from another unfinished project to give me some rudimentary A* functionality. My little soldiers are going to use A* to decide how to get from A to B (among other things) so hacking this in seemed like a good exercise for tonight. For now it just marks the path on the map.

test26th_March.zip
540KB download. Requires Win32 and OpenGL. Left-click to choose the next path destination, and right-click to recentre the map.

I'm not sure what to do for day 3 yet. I might implement the line-of-sight algorithm, using pretty much this same framework except with something like the Bresenham algorithm connecting the points. Or I might load in a player sprite, associate the path with a player object, and have that player follow the path. Whatever I choose, the idea is to pick a bite-size piece of functionality, and get it working before bedtime. :)

On that note, does anybody have any experience with combining steering behaviours with traditional pathfinding like A*? I was planning on using the Seek behaviour for all but the last node of the path, which I'd use the Arrival behaviour for.
Sign in to follow this  


2 Comments


Recommended Comments

The standard first place to go for games programmers learning about A* is here:
http://www-cs-students.stanford.edu/~amitp/gameprog.html#paths

There's also some great stuff in AI Game Programming Wisdom showing how you can reuse one A* implementation for various tasks, and tweak it to do more than just find the 'shortest' path. I intend making great use of these slightly different applications in this project to simulate a bit of reasoning on the part of the soldiers.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement