Pathfinding

Namoreh
Unregistered
 
Post: #1
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
Quote this message in a reply
Luminary
Posts: 5,143
Joined: 2002.04
Post: #2
Search for A* ("A-star") on Google. Should turn up about 1000000 tutorials Smile
Quote this message in a reply
ylaporte
Unregistered
 
Post: #3
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.
Quote this message in a reply
Namoreh
Unregistered
 
Post: #4
cool, I got pathfinding working! Grin 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
Quote this message in a reply
Member
Posts: 104
Joined: 2002.04
Post: #5
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*.
Quote this message in a reply
Namoreh
Unregistered
 
Post: #6
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
Quote this message in a reply
Render
Unregistered
 
Post: #7
Well, if ya need beta testers... Wink
Quote this message in a reply
Namoreh
Unregistered
 
Post: #8
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 Rasp ) 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
Quote this message in a reply
ylaporte
Unregistered
 
Post: #9
Well, if you need beta testers I'd be honnored to test it on X... Smile
Quote this message in a reply
ededed
Unregistered
 
Post: #10
Beta testing certanly my thing I beta test all the games I make. Rasp
Quote this message in a reply
Moderator
Posts: 608
Joined: 2002.04
Post: #11
I'm not sure you'll have a problem finding willing and able beta testers Smile
Quote this message in a reply
Namoreh
Unregistered
 
Post: #12
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 (created in Cinema4D) of the Axeman.

Respect,
-namoreh
Quote this message in a reply
ededed
Unregistered
 
Post: #13
Nice graphics, cool. I like that axeman!
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Thoughts for 3D A* Pathfinding gwihlidal 4 4,525 Apr 21, 2002 09:38 AM
Last Post: Jeff Binder