Steering Behaviour Example

I am currently programming the third type of AI or “autonomous agent” for Dreamland Defender. The current one is meant to utilize flocking behaviour for many small sized foes.

Below is a test example of flocking and steering behaviours (based on the ideas in “Steering Behaviors For Autonomous Characters” published by Craig W. Reynolds for Sony) for a set of foes attacking a player (the green thing).

The code running below is very lightweight. It can run quite a few of these AI’s before it gets weighed down by especially physics/raycasts (directional “eyes” sensing obstacles, of which there are very few in the scene) and calculating distances and relative velocities for all neighbours to each individual AI.

Feel free to spawn some more foes and play around. You can change their behaviour by pressing 1-4). Make sure the “game” is active, by clicking somewhere inside the game frame with the mouse.

Thomas Felumb, OCT. 2017 

references:

“Steering Behaviors For Autonomous Characters”, C.W.Reynolds https://www.red3d.com/cwr/steer/gdc99/

“Boids”, C.W.Reynolds https://www.red3d.com/cwr/boids/