This week I have continued to refine the work that has been done on the AI agents from the last two weeks and implemented the Squad Manager and Swarm AI agents into the main map of our game. I had to implement the Squad manager in a way that it would be able to find both Tomas and Aleksandra’s AI agents and access them so that they could be designated leaders for the Swarm AI’s.
There have been some issues where I made oversights on the implementation but have since corrected these and they have allowed me to reduce further mistakes as I continued to work on the Squad manager and AI’s. We had some navigation issues with the AI’s at first but this was due to some geometry problems that have now been rectified and the AI’s can traverse the terrain correctly and follow their leaders.
One of the technical issues that occurred was that when a leader agent had been killed I needed to remove them from the squad manager and update the children if that was their leader so that they could be reassigned. I believe with Blueprint this proved more difficult because I feel I had to jump through a lot more hoops to get this working, luckily we are beginning to move the AI into C++ code so that its easier to manage and update whilst also providing a consistent behaviour across our networked client. This is a low priority task but I believe and our team believes that it is well worth the time taken to finish porting the code.
The first part of the C++ porting was to create a new Class that would inherit from Unreal Engine 4’s AIController and this class would act as our baseAIController that implements all of the default behaviours for the various AI’s we have. We can then create individual classes for MeleeAIController, RangedAIController and SwarmAIController which all inherit from the baseController class that implements the basic needs such as OnSee and OnHear functionality.
I have implemented an Enum for the various states the AI’s can have and this will replace the states feature on the Blueprint blackboard that we currently use, I feel this will make things a lot simpler because we can simply update our Enum on a per controller basis and each individual AI will know what its current state is.
That’s all for this week and next week we should hopefully see the structure of the C++ AI coming together.