First of all new demo of SimpleSteer:
This demonstration is supposed to showcase a more complicated movement. Each of the agents has a route of four checkpoints. In demo they move from one checkpoint to the next in a set order, but this can be changed easily because it is handled by a route manager component.
This continuous movement produces a lot of opportunities for equilibria to develop. Handling of these is done on a higher level and are controlled by a branch of a “MoveToLocation” sub-tree. So instead of using steering behaviours, I use the higher level, behaviour tree controlled, agent behaviour. The AIMotor component which actually uses (applies) the accelerations returned by the steering behaviours. It also has functions that allows the AIBrain (decision making component) to give orders to apply accelerations directly.
The first issue with this is detecting the state of equilibrium. My solution for this was to change my way of thinking. Instead of trying to decide wether the agent is ai a such a state, I decided on what the unwanted situations were and then I looked for the characteristics of these situations. So here are the three unwanted situations:
- agent is stuck on level geometry
- agent is stuck on other agent
- the accelerations returned by the steering behaviours cancel each other out
The characteristics of the first two are:
- touching a vertical surface
- speed is low
- the tag of the touching object is NPC or not NPC
The third situations :
- there are multiple active steering behaviours
- the sum of the returned accelerations is close to zero
This third situation isn’t handled yet, but the other two are ok. You can see that such a situation is being detected when the agents turn red. You can restart the demo by pressing space on your keyboard.