My Random AI!

Here it is in a separate thread at the request of OTO.

This is an example of a simple AI setup I had started(in 2.49 api). I figured it might be useful to some of us newbies . Any suggestions that might help me improve upon it would be appreciated.

explanation of what it does :

The Blue guy navigates the environment using a ray to detect collisions. If it picks anything up (a wall or enemy etc) it has a random chance to turn left or right.
I added a timer variable to mix things up a bit. After 2 seconds it has a random chance of turning either left or right as well.
I plan to implement random stopping functionality later, that stops the Blue for a random amount of time randomly, random random! .

Now the Red guys simple track to the Blue guy, and constantly move forward at the same time. They chase him throughout the scene and can gang up on him.

Some interesting things can happen with random .

Thanks! Hope its useful.

Have a nice day!


aiPrototype05.blend (181 KB)

that’s pretty nice! good job! I was thinking of doing this for my patrolling state in the my enemy and this helped me out on how to do this! Thanks for sharing this :slight_smile:

No problem, glad it was useful!
I’d like to see what you come up with. :yes:

This is very good. I am learning python and this helped me.
-sorry for my english-

Thanks for the reply!
When I get around to it I’ll upload a commented version.
I can see this being used in a 2D perspective style game relatively easily. Its not super advanced but for that purpose it would get the job done effectively.