Simple AI for 2D grid based game.
im creating a dead simple 2D game. the game consists of a grid that is15x11. each entity takes up 1 square on the grid. The AI for one particular type of enemy should find a path to the player and move to him. each square in the grid is either open or the enemy to pass through or its not. Enemies pass through each other so they can ignore each others existance.
What method would i use to implement this path finding? simplicity over performance. its a tiny game world after all.
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
There is walls. sorry i didnt type that very clearly in the OP. im having trouble googling A* since google ignores the *. is there a full name for it?[/quote]
A star.
“If I understand the standard right it is legal and safe to do this but the resulting value could be anything.”
Dave Mark - President and Lead Designer of Intrinsic Algorithm LLC
Professional consultant on game AI, mathematical modeling, simulation modeling
Co-founder and 10 year advisor of the GDC AI Summit
Author of the book, Behavioral Mathematics for Game AI
Blogs I write:
IA News - What's happening at IA | IA on AI - AI news and notes | Post-Play'em - Observations on AI of games I play
"Reducing the world to mathematical equations!"
But then again, A* can do a lot more once you get the hang of it.
I haven't used it because I haven't figured out which way I'm going with the map yet(generated tiles vs single image, top down vs isometric[in an html5 game]). Currently I just run around on a background image and use tangent/sin/cosine to move objects on layers above while sliding the bg sprite images based on the sin/cos the object is moving...
i find this to be the absolute best article for learning A*.
@menyo, A* is not very advanced imo, and from the sound of what he's making, it'd be absolutly perfect for his needs, also, your method sounds like A* without a heuristic, and every tile has an equal movement cost(regardless if diagonal or not.).