well the algorithm is something close to the A* (A star). I said “close to” because I haven’t studied the A* algorithm completely. I tried to do something simple.
You can find it in internet for sure. But in a few lines it is…
1.- You have nodes (emptys, cubes or whatever), every node can be join with a straight line with another one, I mean no obstacles between them
2.- from first node to last node, the script try diferent ways, eliminating those that step foward,
3.- The first path that reach the last node, is the right path.
4.- follow the path.
If you mean my comentaries in the code, are just a few words that you can traslate online, for example.
But it didn’t help too much, it is more for don’t get myself lost, than for a good explanation.
This is really awesome…but how would you just make a AI track? and repeat the track? like this tutorial, you have nodes, you goto node to node but how would you just go to node to node and repeat? like a rotation.
is this code only for 2d or can it be used in 3d? like stairs and ladder?
p.s. yo tambien ablo espaniol gracias!!
kojima pro, i think i know what you are talking about, like having nodes set in a circle and have an object follow them
if that is what it is then you dont even need python you easily achieve it with logic bricks using this tutorial
Well the code is used to find the path, node by node. The way the actor go from one node to another one, is not script’s bussines. I mean, if you have a game in which an actor can use ladder and stair, yes you can use the script to make him go, from one node to the next one.
I have a simple question. In your script it looks like you define the nodes and list their location. Does this have to be done? I’m thinking how this would work with 50-100 nodes, of course I guess I make a script that finds every node and puts it in the list.
there is a way for locate a node in automatic for every face of a mesh? (like floor map elements, and have one node for every triangle center of its faces)
Steering in Blender is fantastic, but with more than 100 zombies my game fps drop too much, with this script i can have only 1 AI that move all zombie army, and not 100 AI (also if simple,is hard to add sensor and conditions change without have poor performance)