So, part of the NextBot stuff is the idea of Paths. They’re pretty cool. You give it a target position and it will try to create a path to that place. Not just a simple path – but they can include jumping over gaps, and climbing up ladders.

They’re stupidly easy to use too. I’m trying to code them in a way so that they can be used independently of NextBot stuff, but this is the general idea.


So, in this code every second it’s re-computing a path to Entity #1. This is obviously just a test.. in single player Entity #1 is the player.

Here’s the result..

As you can see, they follow the player pretty religiously.. although they do seem to get stuck on each other when they’re colliding. I’m not sure whether that’s something I should handle in-engine.. or just expect the Lua coder to detect and protect against the AI getting stuck.

14 thoughts on “Paths

  1. Interesting, what happens if there is no suitable path? For example, a prop blocking the door. Do they wait outside? Run around confused? Try to hurl themselves into it?

  2. You should make a boolean function for whether or not the engine prevents the AI from kissing each other, win win.

  3. Does this use map nodes or does it generate nodes on the go?

    If it does, does it not work at all on maps with no nodes?

  4. Will this ever be available for lua coders to use? Or will you keep it in engine only, for now? What I mean is, will you ever release the finished coding for lua?

  5. Garry, Any ideas where i can hire some workers for my Game Dev. Team? I have been searching but can’t find much. I Live in Cardiff, Wales.

  6. How are they colliding in this clip? Is it because they rotate and their physical entities clip into each other or do they not take into account non-world geometry (like props) when navigating?

  7. I think it would be create to fix the “sticking” natively within the engine, however it is also my opinion that any good coder will detect and protect against the “sticking”.

Comments are closed.