autocreate nodes and autocreate links demo

Community Forums/Showcase/autocreate nodes and autocreate links demo

RemiD(Posted 2015) [#1]
Hello,

I am currently working on pathfinding (with nodes and links) in a 3d world, and as i see it, the steps are :
-create nodes around passages, near incorners, near outcorners, around obstacles
-create links between some nodes, if there is a free path (considering the character/vehicle width/height/depth) between one node and another node of the same area/room.
-calculate a nodespath
-follow a nodespath

This is a demo which demonstrates what i mean by autocreating nodes and autocreating links.

(The demo is intentionally slowed down so that you can see what is going on)
gif : rd-stuff.fr/autocreate-nodes-then-autocreate-links-640x480-10fps-HQ.gif
exe : rd-stuff.fr/autocreate-nodes-then-autocreate-links-201507261749-EXE.zip

Maybe this can help some of you to visualize what this is all about...


Rick Nasher(Posted 2015) [#2]
Pretty impressive. This may be handy for enhancing the AI on player's enemies. Reminds me a bit of algorithms used by robotic vacuum cleaners in the real world, for avoiding obstacles they've come across before and mapping the room.


RemiD(Posted 2015) [#3]
Nodes and links are essential if you want your ai to be able to avoid walls, avoid obstacles, find passages, and reach their target.

There are several ways to do this, the common way is to use nodes positioned on a grid, but the problem is that you end up with many many many nodes so the path calculation may be slow.
In this case the nodes are positioned around obstacles and only kept if they are inside the room/area, and if they do not intersect with a wall, and if they do not intersect with another obstacle, and if they do not intersect with another node, then the links are created between the nodes where there is a free path and the link length is precalculated.

Nodes are ideal when building the environment procedurally because you know exactly where to position each node related to the passage, incorner, outcorner, obstacle.

This demo demonstrates only the basics of nodes and links but you can probably improve it where more nodes and links are created so that some bots are able to cross some obstacles by jumping/climbing above/on top...

Personally i have found very useful to be able to see how pathfinding was done in Morrowind (with nodes and links visible in debug mode) so i thought that this demo may help some of you to understand it better.