.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   General Bot Coding (http://forums.bots-united.com/forumdisplay.php?f=24)
-   -   Simple Pathfinding Idea (http://forums.bots-united.com/showthread.php?t=3137)

stefanhendriks 06-12-2004 16:21

Re: Simple Pathfinding Idea
 
i'd say, try to let it find a path first (shortest) before trying to create random paths ;)

Rifleman 06-12-2004 16:30

Re: Simple Pathfinding Idea
 
I can get them to find a shortest path but not a random path

stefanhendriks 06-12-2004 16:40

Re: Simple Pathfinding Idea
 
well, then simply change the cost. So normally you have:

cost=distance

you add lines so yo uhave

cost += cost * (any value between 0 and 1).

Ie, when danger is 1, its very dangerious and will double the cost for that node...

Rifleman 06-12-2004 17:30

Re: Simple Pathfinding Idea
 
is there any way to make the floyd-warshall pathdiner take a more random route ? I am currently playing around with various pathfinder

Pierre-Marie Baty 06-12-2004 18:16

Re: Simple Pathfinding Idea
 
basically, no. That's because the Floyd-Warshall algorithm only consists in looking up in a table of fixed paths (which table is usually saved in the waypoints file).

If you want to know more about pathfinders, as well as pseudo-code samples for various of them, look here:
http://filebase.bots-united.com/inde...on=file&id=106
that's all I ever needed to write my own A* implementation.

@$3.1415rin 06-12-2004 19:22

Re: Simple Pathfinding Idea
 
well, somewhat you can do it.

once again a quote from http://www.lampel.net/johannes/joebo...XPDoc-beta.pdf, i'm too lazy to type that again :

Quote:

To find a path between two nodes of the waypoint graph, there are several algorithms. Using brute force here is not possible unless you only have less than 200 nodes with only little interconnectivity. \textit{\joebot used the Floyd Warshall algorithm. It calculates a table containing all shortest paths from each waypoint to another before the game starts. When the bot needs then a path, it can be calculated really fast : You only need to look up the next waypoint for your current nearest waypoint and your goal. So if you get off your initially wanted path, continueing to your target does not need additional calculating. If you have only a few targets like in Counterstrike, you need to randomize your paths : You can do this for example by picking up to 50 nodes from the middle of the wanted path, calculating some values for those new paths, like how dangerous a path is, how long the path is at all, if the hostages are able to follow and some random values. The bot then decides which path to take based on its constitution - the bot can be aggressive, normal or defensive. By searching paths this way, they can be randomized almost sufficiently, but defining the exact costs of the paths is problematic.
and btw, like william pointed out, that generation5 A* code, which is containing this updateParents function is pretty slow. removing this updateParent function and reinserting the relevant nodes to the open list is better and faster :)

RedLink 15-12-2004 02:03

Re: Simple Pathfinding Idea
 
ahh, I did something similar to this for my bot "AXB" ;P but then again, I didnt find a good way to do it fast enougt, It would just keep eating CPU power ;P


All times are GMT +2. The time now is 19:03.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.