Animals herding game using a dog. Low Poly art style.

Post feature Report RSS Steering behaviours

Introduction to steering behaviours used in Join the Pack.

Posted by on

This article tries explains the algorithm used to move each animal with a specific behaviour, like organic beings they respond to user and entities actions.


An entity decides how to move in the space (action selection), how to interact with you and other game elements. In short; how to live in your world, then you can combine dynamics with A* path determination or just use forces as last step (locomotion) this includes the use of the clips of each animal depending on its speed, using these values for blending animations -mixing with others- ,for example, idle blends with walk, this one with running,and both of them with barking animation.

These entities or agents represent a character in the game and have some ability to improvise their actions. This stands in contrast both to a character in an animated film, whose actions are scripted in advance, and to an "avatar" in a game or virtual reality, whose actions are directed in real time by a human player or participant. In games, autonomous characters are sometimes called non-player characters.An autonomous character must combine aspects of an autonomous robot with some skills of a human actor in improvisational theater. These characters are usually not real robots, and are certainly not human actors, but share some properties of each, except for the main actor, it follows the user input and take actions depending on this.

You can have a really complex behaviour tree. If you want to know more about this, check "Behavior trees for AI: How they work".

Basic Example

This is a steering behaviour from a global vision/view

Image from OpenSteer framework.

Each behaviour is represented as a force vector. Giving more importance to one or another by making the vector scale bigger, makes the entity move in the direction of this force-behaviour. For example, set the player as a seeker so you can have the entity char follow a position and then add an entity that is a sheep that will evade wolves entities. Now set an evade force for the sheep and a pursueforce for the wolves, you may want to add a wander force to make the sheep follow a location, then you will have a diagram like this:

You can download this sample from the ShiVa wiki page: ShiVa Steering.
Why did I choose ShiVa engine? - you can code in Lua and export the game in C++, it is so efficient that I can run complex behaviours with more than 15 entities in an low-spec device with a good framerate.

Sometimes a char AI can't be plugged and start working, you need to train it, and you have software like ORTS to do such things, this is used to create a balance between player skill and the game entities, for example for strategy or tower defense games. You also can use genetic programming to evolve AI's to what you really want like this genetics cars based in Box2DCar.

Post in gamasutra

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: