Advertisement

Room detection and pathfinding

Started by October 28, 2004 01:48 AM
2 comments, last by fup 20 years, 1 month ago
I found plenty of articles on pathfinding between defined nodes and points in a map... But what if I want the bot to also define those nodes and explore the level than use pathfinding algorithms? Anyone got some links to some articles, or know of a good method? I was thinking of something like a grid of vectors that grows as the bot explores than gets compiled into a single node for pathfinding... But not entirely sure how such would work out properly.... Any thoughts links etc?
Alex Champandard wrote an interesting thesis called "Realistic Autonomous Navigation in Dynamic Environments (2003)" but the old link I had for it doesn't work anymore. You could try searching for it or email Alex directly (write to me for his email address)
Advertisement
I couldn't read the paper, but I was thinking of a couple ways to generate the graph automatically. One would be to fill the level with a grid of nodes, like one every 5 feet or something. It should be easy to tell if a node is inside or outside a level, just keep the ones that are inside. Then hook up all the ones that can see each other. This is kinda ugly, but can be done in O(n^2) time. Now you have this giant horrible graph that you can traverse, but it sucks because it's strongly connected. What you do now is start removeing nodes. Each time you remove one you check to see if the graph is still connected; if it is then go ahead and remove the node, otherwise put it back in. Keep doing this until you can remove no more nodes. Now you should have a spanning graph for your level.

Notice that the above method is very complex(really quite awfull, worse than O(n^4)), but could be done ahead of time. Even then it might take a really long time to run(like years if it's really bad).

Another aproach might be to set up the grid of nodes, like above, and instead of connecting each node to all the ones it can see, just connect it to its neighbors that it can see. Now you should have a graph that you can go through with A* or something. In fact, you might not even need the graph, logically. You could just "pretend" to move the bot and see if it can go there, and do
A* on a sequence of movements. Does that make sense?.

I was also thinking that if a bot was in a room, it could find a door by casting rays, and looking for places where the length of the ray jumped by a relatively large amount.
Why yes, I will take the "FUSE".
pre-calculating a graph by "floodfilling" a map with nodes or with areas/volumes is a fairly common approach. Each node/area/volume is only connected to adjacent neighbors. Sometimes the graph is then pruned, sometimes it isn't, depends on the needs of the game.

This is not really what you are looking for is it? You said:

"But what if I want the bot to also define those nodes and explore the level "

If you mean by this you wish the bot to explore and graph the map in a similar fashion to a human then that's a different thing entirely. And if that's the case, you really should read Alex's thesis, because it's full o'good ideas. I'll only give his address out though if you email me because of all the terrible terrible evil omnipresent spammers.

This topic is closed to new replies.

Advertisement