- Home /
Simple, wandering AI, no need for obstacle avoidance.
hello, i need a basic randomly wandering AI, however, i have no idea where to start with it, i don't need it to be complex, all i need is for the thing to turn around, move and just generally derp around.
Some keywords to research: coroutines, Random, Finite State $$anonymous$$achine.
Answer by haim96 · Mar 17, 2014 at 03:08 PM
assume that your wandering player can be dead or alive, all you need is a simple loop that work while your player is alive. inside you will random a direction to walk. if something is happen like the player got shot then the loop should stop work and the player will do something else. (drop dead maybe?) it's the simplest AI i can think of...
sorry, i don't follow, the player doesn't use AI, i don't think any player in any game does, it's for NPCs, they don't die, they don't shoot, they just move around aimlessly.
sorry not the "player" player.... :) your wandering object. i just didn't know how to call it...