Uploaded April 2019 | Updated September 2026, 2 hours ago
This engine aims to allow the user to visualise various AI behaviour types - how they interact with their environment, what is used in their "decision making", and to test adjustments to those AI in real-time.
This video demonstrates the addition of more-swarm like behaviour creatures (in yellow). The approach I've used to include different types of creatures with different AI "personalities" really paid off here - all that was required was setting up one new entity type, adding in the right set of behaviours, and tweaking the behaviour parameters to get the motion I was looking for. In fact, the motion here exceeded my expectations - it looks pretty cool!
These yellow fish have 5 behaviours set up: Seek other yellow fish, avoid green fish and the red shark, wander, and slow down. I scaled up the speed for this fish type too, and removed alignment,, so it acts in a more "swarmlike" manner.
This video follows one particular fish but maintains a fixed angle of perspective - which makes understanding of what is going on, on a group scale, much simpler.
The next updates will be (in no particular order):
- Addition of more behaviours (e.g. pursuit / evade, wall avoidance)
- The ability to turn on / off behaviours
- The ability to adjust the intensity of the various behaviours
- Ability to view the vantage point to different creatures
- And any others that you may have in mind! Please let me know!!
Please find the current codebase at github.com/s0lly/Steering-Behaviours - but note that this is still a work in progress.
Hopefully this project will allow for the quick creation of multiple AI types by allowing live-editing of various parameters, and give a very deep sense into how the various AIs would respond to different stimuli.
Please let me know how if you have any suggestions on things to add!
Acknowledgements:
This was made using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili!
The ideas of using steering behaviours came about while reading Mat Buckland's book "Programming Game AI by Example", which has proved invaluable in building this visualisation.
Intro music by Eric Skiff, song "All of Us" (Available at EricSkiff.com/music)
This engine aims to allow the user to visualise various AI behaviour types - how they interact with their environment, what is used in their "decision making", and to test adjustments to those AI in real-time.
This video demonstrates the addition of more-swarm like behaviour creatures (in yellow). The approach I've used to include different types of creatures with different AI "personalities" really paid off here - all that was required was setting up one new entity type, adding in the right set of behaviours, and tweaking the behaviour parameters to get the motion I was looking for. In fact, the motion here exceeded my expectations - it looks pretty cool!
These yellow fish have 5 behaviours set up: Seek other yellow fish, avoid green fish and the red shark, wander, and slow down. I scaled up the speed for this fish type too, and removed alignment,, so it acts in a more "swarmlike" manner.
This video follows one particular fish but maintains a fixed angle of perspective - which makes understanding of what is going on, on a group scale, much simpler.
The next updates will be (in no particular order):
- Addition of more behaviours (e.g. pursuit / evade, wall avoidance)
- The ability to turn on / off behaviours
- The ability to adjust the intensity of the various behaviours
- Ability to view the vantage point to different creatures
- And any others that you may have in mind! Please let me know!!
Please find the current codebase at github.com/s0lly/Steering-Behaviours - but note that this is still a work in progress.
Hopefully this project will allow for the quick creation of multiple AI types by allowing live-editing of various parameters, and give a very deep sense into how the various AIs would respond to different stimuli.
Please let me know how if you have any suggestions on things to add!
Acknowledgements:
This was made using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili!
The ideas of using steering behaviours came about while reading Mat Buckland's book "Programming Game AI by Example", which has proved invaluable in building this visualisation.
Intro music by Eric Skiff, song "All of Us" (Available at EricSkiff.com/music)

![2D Game Engine in C++: [8] 2D Normal Maps
This video demonstrates 2D Normal Maps - a technique used to create directional lighting / shading based on the relative location of a LightSource to the drawn object in question. The end effect produces shading which gives even more of a 3D effect to the graphics engine.
The process that Ive used to do this is to create two versions of the tree sprite, one being the simple sprite, and another image (which I call the normal map) which is exactly the same as the original sprite, but with its red, green, and blue colours changed. These are changed to represent the intensity of light that should impact the sprite depending on the direction of the LightSource. These three colour channels represent horizontal (x-axis), vertical (y-axis) and depth (z-axis) coordinates respectively.
For example, a normal mapping of the sprite will have a red colour of 255 (the maximum) if the light intensity is brightest when a light is to the extreme right of the object. So, for the tree, this would be the right hand side of the tree trunk, and any right hand side of the individual leaves. The opposite can then be done for the left hand side of the tree. This gives a nice shading effect to the tree depending on where the light is coming from - although the lighting can be a bit blocky given that we are working on very low-res images!
I will release all code on GitHub once Ive finalised the engine - and have nice looking code to boot!
Using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili! 2D Game Engine in C++: [8] 2D Normal Maps](https://i.ytimg.com/vi/k-Z7wIuZfnA/mqdefault.jpg)
![2D Game Engine in C++: [5] Alpha Blending
This video illustrates an useful addition to the planes concept, that being alpha blending / transparency.
Critically, this will allow effects such as clouds in a top down / isometric game, see-through ghosts in a side-scrolling game, or smoke (as displayed here) in any type of game. It could also allow for effects such as creating see through areas of closer planes to make sure that the playing area is still visible.
I will release all code on GitHub once Ive finalised the engine - and have nice looking code to boot!
Using the Chili Framework: http://wiki.planetchili.net/index.php... - thanks Chili! 2D Game Engine in C++: [5] Alpha Blending](https://i.ytimg.com/vi/kF2RAxFV7qs/mqdefault.jpg)







