Portfolio
Squad Based Emergent Behaviour
posted on July 22, 2010For our AI Assignments we had to pick a paper describing an AI technique to recreate, this made for a really fun module with everyone doing different things, all of which were cool.
The paper I chose can be found in AI Game Programming Wisdom; Squad Tactics: Team AI and Emergent Behaviours by William van der Sterren.
It involves squads of units that hold an internal knowledge representation of the world that is gathered both first-hand (From what they can see) and second-hand, using messages that are sent from the other squad members, this gives entities an imperfect knowledge of the world, leading to more realistic behaviour. Squad members, when moving, use a number of different weights to decide on the best spot to move to, all of which can be changed whilst the simulation is running.
The result is pretty cool, I think, although my implementation is lacking some features, the article talks about threats including grenades, however I didn’t have time to implement it, there’s also a few bugs, the entities sometimes go a bit crazy rotating a lot and sometimes they don’t face in the correct direction (Bugs that, regrettably I didn’t have time to fix) but you can still see the effect.
The assignment also requred some for of user input, so the demo includes the ability to edit levels and place units (Go easy on the number of walls and units, the line-of-sight checking is rather unoptimal)
So, after such a build-up, here’s a pic to wet your appitaite and a download link so you can try it out.
- Building a level
The yellow lines are walls
- Deploying the troops
You can see the path-lines (between the grey squares) here. The darker grey squares represent cover
- The fight begins
- The units searching to find the enemy
The visual of the cone extends further than the units can actually see, so sometimes it takes a while for them to find each other
- Editing the weightings of parameters
Each of these parameters is used to decide the next course of action
- A rematch
This time in a smaller environment





