The logic for getting a character to move around an area?

first you have to decide what you want the robot or AI to do. Blender doesn’t know what you want it to do, until you tell it by scripting (best way) or logic bricks.

There are a lot of ways to do AI. But animating in the newest builds may not work the way you want. If the AI is not in the cameras view, it won’t play. Which is kind of crippling for me. So if you wanted the Ai to sneak up behind the player, it will be a lot harder in the newer builds of Blender.

Building a state machine is a good way to go for AI.

The navmesh makes it easy. But you need a script to randomly move the target when the AI collides with it. This will make the AI roam the playing area, like it’s on patrol. (I modified a script BPR wrote to do this) Then use states to have it do other things. But alas you don’t want to use scripting.

Another easy way is to simply give the AI a motion actuator. Say Loc, or linear velocity, always------and-------Motion. Ah but now the AI runs into walls (without a navmesh) Easy fix, parent an empty to the AI collision box, cast a ray looking for property “wall” distance 3. then have it change to a different state that turns the AI so it avoids the wall. (Use the rays and controller to bypass the AI state machine)
Don’t forget to give your walls a property “wall” and make them an actor. Or place invisible walls.

On state 1.
always------and-------Motion, Loc or linV (walk forward)
Ray---------and--------state 2. > Then on state 2 > always------and------Motion Rot on the Z axis. (Turn)
Delay 90---------and--------state 1. The delay determines the angle to turn, 90 degrees? 100? degrees, whatever, then back to state 1 to walk.

I made an entire game level where dinosaurs roamed the playing area with the above method. Of course I added other states, for the dinosaurs to do other things.

Another way to do Ai is to use Motion and a track to logic brick, or track_to_closest script. but I think you’re going to need scripting.

I’m working on an android testing facility, where in this game the player tests the controllability of androids.
Press keyboard 1 > and the android follows the player, if the player turns left, the android turns left. and so on. (I parented an empty to my player collision box for the android to track to.)
press keyboard 2 > the android searches for things on its own. Ammo, land mines etc. When the android finds one, it stops, says “over hear” and waves. When the player picks up the ammo, or (fake) land mine. the android continues searching until it has found everything. Then comes back to me. (I used a track-to-closest script to find stuff)
Press keyboard 3 > the android moves to a boat, jumps in the boat, and we go to a different island, to do different tests.
press keyboard 3 again > the android jumps out of the boat ready for it’s next command.
Press keyboard 5 > the android runs back to me from wherever it is.
Press keyboard 6 > the androids stops
This is a working good so far, (animations are weak)

I used states. Keyboard 1____and_____state 1 on the androids collision box . > keyboard 2------and----state 2. etc. and so on.

This is an example of how learning how to use states will really help when doing AI. Learn how to properly use the logic editor, and some basic scripting. Even if it’s modifying others scripts to work in your game. Be better if you learn Python though.

Believe me brother, I struggled like you are too. (still struggling) Keep trying, it’ll get easier. :slight_smile:

Okay, I won’t try to help you any more.