= Steer Behaviors :revnumber: 2.0 :revdate: 2020/07/23 Steer behaviors allows you to control the locomotion of "`characters`", this can reduce drastically the time needed to develop a game since for almost every game we need to set how these "`characters`" will be moving around the scene. [cols="2",caption=] .YouTube |=== a|.Steer behaviors in action image:ai/steer/hqdefault.jpg[youtu.be/yyzTntsGV00,width="",height="",link=https://youtu.be/yyzTntsGV00] a| |=== Be sure that you have checked the demos: They can be downloaded here: link:http://jmesteer.bdevel.org[jmesteer.bdevel.org] == First steps The steer behaviors AI is integrated with MonkeyBrains so before start coding be sure that you have checked the xref:ai/monkey_brains.adoc[monkey brains documentation]. Be sure to create a reference to MonkeyBrains from your project. Finally, do not forget to import the `com.jme3.ai.agents.behaviors.npc.steering` package. == Overview *Available behaviours:* * Move * Seek * Arrive * Flee * Pursuit * Leader follow * Evade * Cohesion * Alignment * Obstacle Avoidance * Unaligned obstacle avoidance * Hide * Slow * Queuing * Containment * Path follow * Wall approach * Wander Area * Simple Wander * Relative wander * Sphere wander * Box explore * Separation All the behaviours extend from the `AbstractSteeringBehavior` class. == Adding a steer behavior Create instances from the steer behavior classes, They are located in the `com.jme3.ai.agents.behaviors.npc.steering` package. If we want to add more than one steer behavior, we need to create a container: [WARNING] ==== If you add more than one steer behavior to a `SimpleMainBehavior` it will cause problems in the rotation of the agents. ==== [cols="2", options="header"] |=== a| Container a| Purpose a| CompoundSteeringBehavior a| Contains and merges several `AbstractSteeringBehavior` instances a| BalancedCompoundSteeringBehavior 5) throw new CustomSteeringExceptions.customRuntimeException ("Value must be lower than 5"); this.value = value; } ---- == Useful links java steer behaviors project: link:http://jmesteer.bdevel.org/[jmesteer.bdevel.org]