This application was built from a school exercise we had in second year at Creajeux about steering behaviors. Steering is a movement method applicable on objects in a game, it is used to create behaviors and it is possible to mix them to obtain new ones.
The program contains multiple behaviors as follows :
- Seek / Flee : Pairs of entities arecreated, one seeking for the other, which flees. This behavior is quite simple but can be used to create other ones.
- Pursuit / Evasion : Similar to the previous one but with a little prediction in the mix. The pursuing enitity goes to the future position of the evading one that avoids the future position of the first.
- Arrival + Obstacle avoidance : Entities try to reach the user’s cursor while avoiding the red circles on the screen.
- Wander : Random determination of the next direction of the entity within a restricted range to keep some consistency and smoothness to its movements. It can be used to simulate some sort of idle state of an AI.
- Path following : Red cricles form a path that the enitities take. Once they’re at the end, they turn around and do the same path in reverse.
- Unaligned Collision Avoidance : Each entity predicts the movements of others around them and uses the obstacle avoidance to react when their trajectories interesct.
- Separation : Each entity goes to the opposite direction of the average one formed by their neighbors in a given area.
- Cohesion : Each entity calculates the average position of the others around and try to reach it.
- Alignment : Each entity goes in the same direction as the others around.
- Flocking : A combination of Alignment and Separation, the entities go in the same direction while keeping some distance between them. This behavior can be compared to a shoal.
- Lead following : All the entities follow the same leader while they keep distance between each other.
- Formations : A specific kind of lead following behaviour where the enities form a given shape when following their leader. The available formations are Circle, V, Line and Multiline.
I enjoyed this exercise as I found it quite interesting and rewarding, I often found myself just looking at my results when debugging instead of closing the application right away. Flocking in particular can be really mesmerizing with enough entities. I also liked using those behaviors for the first time in WarCreaft as we were creating the two at the same time so after developping a behavior in the app, we put it in the game. Watching the game characters moving with my behaviors filled me with joy.
Arrival + Obstacle avoidance
Here are the user manual (that you can find in the zip directory with the application) and the download button to get the application.