Lately I’ve been working on a multiplayer ‘Capture the Flag’ battleground scenario for my RPG style game.
It started to get difficult (and boring) to test and debug a team-based game mode alone, so I added AI Bots to my game to fill in the empty spots and make it a full 10vs10 battle.
I also hit a point where I needed to refactor my previously unorganized AI system, and switched to a priority based Goal system. Each NPC has a single active goal as well as a list of pending goals with lower priorities, and each goal then updates its priority every few seconds depending on the NPC’s current state.
It was mostly simple to implement the goal system, but I’m noticing it requires a lot more fine-tuning and debugging in order to ensure that all of an NPC’s goals are working together properly. So to make it easier to debug, I also added a visual output that shows a list of the selected NPC’s goals as well as the priority for each goal.
Here’s a quick gif showing the goal debugger, as well as the AI picking up the flag after it was dropped.
The general lore behind the battle is that a faction of Dark Elf bandits are trying to invade a neighboring faction of Crystal Elementals for their precious metals and gems (the players are Wood Elves, so they can choose to fight for either side). There’s also still a lot of work to be done decorating and polishing the map, but the overall layout is done.