The original design aimed for four distinct unit types (Gunner, Shield-Bearer, Swordsman, and Healer), each reacting differently in battle. While only the Gunner was implemented, the modular AI structure means the framework is ready to expand with new unit classes in future versions.
Battle Simulator
A simulation project where autonomous AI agents fight each other using modular decision-making and movement systems. The aim was to create an expandable framework where agents could adapt their behaviour dynamically based on their environment, inspired by industry examples such as Totally Accurate Battle Simulator.
-
Custom Edge Avoidance Mechanic
An early problem was that agents ignored the boundaries of the map and wandered out of the area. Standard wall avoidance behaviours failed to work correctly, so I developed a custom “edge avoidance” mechanic. This checked the plane’s bounds and applied steering forces when agents approached the edges, successfully keeping them inside the play area.
-
Combat Scenarios with Emergent Outcomes
Although only one unit type (the Gunner) was completed, the system still produced varied and unpredictable battles. Each encounter played out differently depending on health levels, distance to enemies, and steering responses. This emergent gameplay demonstrated the adaptability of the combined behaviour tree and steering system.
-
Steering Behaviours for Realistic Movement
Movement was handled through steering behaviours, enabling agents to wander, pursue targets, and avoid obstacles in a natural way. These behaviours were attached and detached as needed by the behaviour tree, making motion more fluid and responsive compared to rigid pathfinding systems like A*.
-
Behaviour Trees for Decision Making
To control agent decisions, I implemented behaviour trees instead of simpler finite state machines or overly complex neural networks. Behaviour trees allowed me to build modular and reusable logic, such as choosing when to attack, retreat, or wander. Their hierarchical design made the AI adaptable while leaving room for future expansion with new unit types.
-
Debugging Steering and Behaviour Conflicts
At first, agents would freeze because the wander node repeatedly removed and reattached behaviours, cancelling out movement. Careful debugging revealed the issue, and by restructuring how behaviours were applied, I ensured agents could combine multiple steering forces smoothly without stalling.
