So, after starting to fix a minor bug I got sidetracked and recoded a large portion of the AI, (Although they still look like little cubes…) They now maintain a list of everything they can see as well as keeping a few choice things in memory. You can then choose to take any information from these lists in order to have the agents make a decision on what to do. At the moment they choose their target based on a simple hierarchy of object type and distance. Adding new behaviours is now incredibly easy, for example, the agents do not currently react to being shot at, but all that would need to be done is to turn their head briefly in the direction of fire which would cause them to see the enemy and automatically factor it in to their decision making. Easy!
Before I get sidetracked making these improvements however I’m going to port the demo to C++ using DirectX10. The C#/XNA version is available on the download page. It may still be in need of some refactoring.
If for any reason you want to mess around with their behaviour, the best way is to modify or rewrite the TargetChooser() method in the Agent class, (all this does is set ChosenTarget - which holds an index of the target, and also sets TargetType to AGENT or OBJECT_OR_MEMORY - which is necessary to differentiate between agents and objects with the same index.)