PDA

View Full Version : Pathfinding


Namoreh
2002.08.01, 10:06 PM
in a strategy game I've been working on I need armies to be able to navigate the roads to find the shortest route to a city, without straying from the roads. I can move them one city at a time currently, I can move them to a city directly connected via a road, but i need the army to be able to figure out if i click on a far away city the route it must take e.g. from city 3 to city 4 to city 5 and then to the destination city.does anyone know of a good way of doing this?

Thanks
-Namoreh

OneSadCookie
2002.08.01, 10:11 PM
Search for A* ("A-star") on Google. Should turn up about 1000000 tutorials :)

ylaporte
2002.08.02, 08:08 AM
There were a few articles about path finding recently on AIDepot... You can still find them in the features section:
http://ai-depot.com/Features/

But A* is something so usefull you should still look at it. It's used in many path finding strategies anyway.

Namoreh
2002.08.02, 02:49 PM
cool, I got pathfinding working! :D It took all morning and some of last night to get it right, but i can now move my armies around! now i just need to make the enemy AI, finish the battle engine, and implement TCP/IP for network games. I think I should be done in about a month, based on how fast I've been mowing along, making a checklist of features really helps, I've found, and telling yourself you can't eat until you can recruit 20 archers without the game crashing (which I fixed).

Thanks
-Namoreh

GoodDoug
2002.08.03, 01:49 PM
I wouldn't use A* for this, as its a simple graph problem, and using Dijkstras Search or a BFS will give the results you need without the mess of tuning A*.

Namoreh
2002.08.03, 11:09 PM
ha, i actually am using Dijkstra's, the page i found talked about A*, but actually focused on dijkstra, so i used their example of dijkstra's searching thing and used it for the game. right now im working on the animations for the units (walk, run, attack, die1, die2) there are 4 units (swordsman, spearman, axeman, archer) and maybe a fifth (knight) then I have to make the Generals' graphics, then finish up battle engine, then tcp/ip, then testing.

thanks for the help,
-Namoreh

Render
2002.08.04, 01:39 AM
Well, if ya need beta testers... ;)

Namoreh
2002.08.04, 12:00 PM
You can definitely beta test once I'm done, I'll need a few other people, on 9 and X, but first I gotta get finished with it, so hold on, it'll be a few weeks, I gather. I finished the swordsman's walk and attack animations yesterday (I spent most of the day playing Medal of Honor: Allied Assault, though :p ) but I'll be spending the rest of the day on the other units animations, and on the swordsman's death animation.

See-yah-when-i-see-yah,
-Namoreh

ylaporte
2002.08.04, 10:03 PM
Well, if you need beta testers I'd be honnored to test it on X... :)

ededed
2002.08.17, 04:45 PM
Beta testing certanly my thing I beta test all the games I make. :p

Josh
2002.08.17, 09:23 PM
I'm not sure you'll have a problem finding willing and able beta testers :)

Namoreh
2002.09.03, 03:57 PM
Alright, project is sort of canned, but not really.
I'm using alot of the code from it to create an RTS engine (I'm currently deciding whether to call the Engine "Pain100" "Tape100" or "Boot100"). Then I'll use this RTS Engine to create a game, and maybe I'll release the engine. Anyways, if Carlos is interested I could provide an Axeman, Spearman, and Swordsman for iDG, in walking animations, and death animations, trust me though, you'll want me to redo the attacking animations. Here's an example (http://homepage.mac.com/guilder/DaAxeMan.tif) (created in Cinema4D) of the Axeman.

Respect,
-namoreh

ededed
2002.09.03, 04:22 PM
Nice graphics, cool. I like that axeman!