Hello all, dropping some more info about my dive in AI in UE4. I didn’t think I’d dive so heavily into c++ trying to solve this issue, but I’ve come to the point where I am working mostly within c++ and man did I learn a lot.
Stepping back a little bit here, once I realized all the problems that surround AI in UE4, I decided to go ahead and start making a plugin for the engine in order to help the community out. You can follow the UE4 forum thread here if you are interested in my Utility AI plugin . The trello is here and if you’d be so kind as to fill out this 8 question survey about how you’d use my plugin you can do so here. The live data of the responses live here.
Why am I writing a plugin? Well here are some of the problems with the provided set ups in UE4:
- Behavior trees can be powerful, but they are super rigid and you’ll have a hard time re-following your logic if you need to go back and change something
- behavior trees don’t allow for emergent behavior
- The character movement component is excellent for predicting sporadic actions of players, but is really heavy for lots of AI.
- The character class gives you lots of goodies, but again really heavy if you don’t need it
- The old pawn sensing component is going to be factored out of the engine and the perception system that was made for paragon that replaces it is highly incomplete and not fully exposed to blueprint
- The team system is totally inaccessible to blueprint forcing users to make their own set up in C++
- behavior trees ALWAYS run in the background, though they are threaded and batched from what I can tell so I’ll be trying to mimic that part
- no spawn management or AI management solutions
- EQS and or Nav mesh are taxing ( hard to live without though )
- no way to destroy controllers from within blueprint so you are forced to repossess or to let controllers linger
- vastly different performance numbers in editor ( and standalone ) than in packaged game. World tick times are huge.
I could probably go on with this list, but these are the major things that bugged me the most. I may tackle the movement issue later on down the road, but that’s a hefty task for the time being.
What does Utility AI plugin for UE4 provide? I’m attempting to address as many of these issues as possible. For the most part, I have a lot of them taken care of already just by switching to a task scoring system. You get a lot of emergent behavior and it runs super well already without the behind the scenes stuff that behavior trees provide ( threading/batching/etc.) 100 ai in a scene with dynamic lighting, shadows, and volumetric fog has the game running at a total of 7ms on my i7 3770k and 980 ti.
I’ve included a library of nodes to deal with some of the blueprint exposure problems, a component that handles the core functionality of the task scoring system, which does allow you to override in blueprint, as well as an easy way for users to share their own tasks. I’ve added spawn management and AI management to make sure not too many spawn in one place at a time and only under the conditions desired.
I’ll be trying out the animation sharing plugin provided in 4.22 as well to see how much more I can squeeze out of the engine. Other than that, I’m trying my damnedest to address all the issues.