So I’ve restarted the project from scratch. Again.
Trying to manually code all the AI was getting a bit out of hand.
This new project fully utilises AI perception/Behavior trees. The behavior is now state based. This makes things a lot easier and clearer. It also makes it easy for AI to remember what they were doing before. So for example, they can be carrying out a command, get in to combat on the way, then they can ‘remember’ if they were waiting, following a command or following another character etc.
Going all in the AI systems, it’s only taken a few hours to get close to the logic I had previous. Much more cleaner and less buggy! The speed is also helped by the fact that I’ve put it all together in BP. Once I’m done, I’ll go through each of the BT tasks and start transferring them to C++. Mind you, all the tasks being event driven, there isn’t a massive pressure to transfer them to C++.