Tutorial:Path node AI for non-programmers.

(p00f) #1

Hi all!

Want to add life form simulation to your game?.. But you dont know anything about coding?

Well ,here is a tutorial/example of a popular path node method, 100% code free!!.

This is about as simple as it can possibly get, to explain the most important parts of this theory, following the path node network…

Later you can add other things to the AI, like attacking the player, or interacting with other pawns in the game. the hardest part is getting the network set up and the pawns patrolling the path node network.

Great method for:
Racing games
First person shooters
RPG monsters and NPC’s
and you can even use this exact same method in your old-school 2d “scrollers”!

Have fun!

Please feel free to post your comments and critiques :slight_smile:
feedback will make better tutorials in the future.

Here is the tutorial: EDIT thanks to open office every image is sized incorrectly. Right click on the image and select View image if it is blurry to you. this only seems to effect internet explorer, my firefox is rendering everythin ok.


I will have to fix this when I get more time. I am very very sorry about this :frowning:

(~J~) #2

Hey thanks! Brilliant tutorial, pretty simple to understand too! Nice one.

(Ace Dragon) #3

Looking at the tutorial I wonder about this, by the looks of it your node system simply does a path with 4 nodes. What if (for complex pathfinding) you use a rather large network of maybe 100 nodes or use a very complex path that requires 50 or more nodes. You would need so many logic bricks that it would be impractical.

If i’d like to see anything it would be a pathfinding system using python with node objects and a node script that uses the object name to determine the path (this way very complex systems can be created)

(Wanted Bob) #4

Very Cool! This is exactly the thing I was looking for (Being too lazy to learn Python and all)

Wanted Bob

(fireside) #5

I did something like this a while back, but with python. This is a very good way to start out. It’s already starting to reach the limitations of the logic brick system, however. Imagine adding different actions, sounds, etc, to the A.I. I hope this is a stepping stone for people to move on to python so they see the kind of things that can be achieved.

(Mike_S) #6

Thanks for the tutorial !

I added a couple of keyboard sensors so that the cube can speed up or slow down, just connected them to motion actuators with +8 / -8 y forces. But the cube only changes speed as long as the key is held down. Obviously (I guess) because the always sensor resets it to 10.

Is there a way to have the motion sensor use a variable instead of a hard coded value? I assume some python code might be necessary, that’s ok with me, I haven’t used the g.e. much …yet, but would like to learn about it.

I’ve programmed with python a bit in the ‘main’ Blender program, so I’m familiar with basic Python techniques.


(p00f) #7


Thanks that is what I am aiming for, Simple :slight_smile:

@Icoxo ,
I totally agree! scripting is much more efficient, my first serious programming project will be something like what you described :slight_smile: thanks for the feedback!

@Wanted Bob,
Well, you are definitely the target audience I was making this for :slight_smile: start with logic blocks, later move onto scripting… main thing is to have fun now, so you want to learn more hard stuff later :slight_smile:

Yea! thanks man! yea this is just a stepping stone for the new-bie like you said… easy to add on to, and can take almost the same concept to python later to build custom AI’s :slight_smile:

Thank you :slight_smile:
Im not sure, I will play with it after I get off work :slight_smile:

Thanks to all for interacting with this thread :slight_smile:

(vizzy) #8


p00f, i tried your example file :slight_smile: its great .
you mentioned we could set the tracking to 3d.
i changed all tracking to 3d and moved some of the plates up and down near the floor.
i made a copy of the cube, and have 3 cubes now at different locations.
now, when i start the simulation, the cubes may move around but some stuck at the nodes and, and wont move to the next one, but circle around the last node.
maybe you have a hint here :slight_smile:

thx, vizzy/verblendet

(p00f) #9

hi vizzy,

Umm, i did this tutorial before i knew about the new physics system.

the cube is probably getting stuck on the plane, if you turn off the collision (click the ghost button in logic brick menu) the sheets will still register a collision, but not actually collide anything in the physics world…
it just fires off a pulse saying it has been hit, and wont block anything…

sorry i did not see this message… I will have to see if this forum has an email notifyer…

(Denommus) #10

Wow! I was really looking for something exactly like this, and you gave me it!
Thanks, buddy!
(I’ve said to myself: “if I do the AI, I’ll make a tutorial”. Well, I don’t need to do this anymore, you’ve done!)

(Pacman) #11

I’m make script for all users with mypos.
download: http://www.4shared.com/file/5826074/8204cc8f/pathnodeu.html

(Shellfish) #12

Hi Pacman! Could you upload pathnodeu.blend file somewhere els… I can’t download it from 4shared.com/

So how can I make a walking about NPC with python?

(VenomSeven) #13

Where has this tutorial been hiding? I could find tons of uses for this, thanks for sharing the knowledge p00f = )

(Janet Merai) #14

I was fearing having to do a lot of work to get enemies and AI in my game, you saved me so much work; thank you! :smiley:

(ecgilboy) #15

Thanks for this excellent tutorial poof…

(Shellfish) #16

I finally downloaded the file from pacman with internet explorer. Try moving around the red box but no changes on the path movement.

(p00f) #17

hi guys!

glad you liked the tutorial :slight_smile:

(MushroomDude) #18

Works on Opera.

Really good tut.

(p00f) #19

hi tarers_r_tasty,

Glad you like it :slight_smile:

thanks for the Opera test too 8)

(Shellfish) #20

Hi p00f ! I tried the tutorial ! Can I make my monster move in a more straighter path. Currently its like the monster is skating on ice. HA HA.