C# XNA 4 AI for path
-
right now, i know how to get the mouse location and show the mouse and so left clicj right click and such. I am wondering if anyone had a formula for an AI for a path, eg o = you sprite | = wall can pass through ' = floor can pass through * = path way for the spite C = the cliked for the path to go heres my example
o''''' '*|''' '****C
I hope you understand basicly i want to it go a certain location it will go there, and if there is an object in its way it will use a formula to get around it. all this nis in 2d by the way. and if you have the formula can you please make it as simple as possible? -
right now, i know how to get the mouse location and show the mouse and so left clicj right click and such. I am wondering if anyone had a formula for an AI for a path, eg o = you sprite | = wall can pass through ' = floor can pass through * = path way for the spite C = the cliked for the path to go heres my example
o''''' '*|''' '****C
I hope you understand basicly i want to it go a certain location it will go there, and if there is an object in its way it will use a formula to get around it. all this nis in 2d by the way. and if you have the formula can you please make it as simple as possible?try using A* algorithm see links below. Very simple A* algorithm implementation[^] C# - Visualizing Path Finding With Dijkstra, AStar, Bi-directional Dijkstra's, and Bi-directional A* Algorithms[^] Hopes this helps jk chan http://cgmath.blogspot.com
If u can Dream... U can do it http://cgmath.blogspot.com/
-
try using A* algorithm see links below. Very simple A* algorithm implementation[^] C# - Visualizing Path Finding With Dijkstra, AStar, Bi-directional Dijkstra's, and Bi-directional A* Algorithms[^] Hopes this helps jk chan http://cgmath.blogspot.com
If u can Dream... U can do it http://cgmath.blogspot.com/
-
yes. I remember, I have seen some learning based algorithms .see http://gamesitb.com/pathgraham.pdf[^] jk chan http://cgmath.blogspot.com/[^]
If u can Dream... U can do it http://cgmath.blogspot.com/
-
A* is indeed the best option here. If you need an easy way to learn about how A* works, check it here http://www.gamedev.net/page/resources/_/technical/artificial-intelligence/a-pathfinding-for-beginners-r2003
- A.