Sign in to follow this  

A* and c++

This topic is 4592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A quick google search of astar c++ source comes up with quite a few implementations.

For a game like PacMan, you would build a connectivity graph of all the intersections, give it the point you are at and the point you are interested in, then run the algorithm. If you aren't familiar with the algorithm, Game Programming Gems 1 covers the algorithm pretty well.

frob.

Share this post


Link to post
Share on other sites
Quote:
Original post by hplus0603
The actual AI of Pac Man has nothing to do with A*, though.


Yep... there have been several good expositions of how the AI in Pacman worked posted within this forum. Search the forum archives and you should find them without much effort! If you just want to learn A*, just restrict yourself to finding a simple path in a 'grid world'. Start with no obstacles to ensure that you have the algorithm working properly, then add static obstacles. Finally you can deal with dynamic obstacles, which will require you to extend the algorithm beyond what would be classed as 'A*'.

Share this post


Link to post
Share on other sites

This topic is 4592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

Sign in to follow this