Some questions about how to build enemy AI

Well in short, building dynamic, natural, and complex AI is not a small task but if you learn about behavior trees one step at a time you will soon be able to start putting things together. But to answer your questions:

  1. Take a look into custom behavior tree tasks and decorators. Through decorators you can define your own conditionals to tell the AI things to do next like execute certain tasks or run a child behavior tree. With custom tasks you can define what exactly you want the ai to do, just like a method in c++. Then it just comes down to what you want it to do. So in your case, you would want a decorator to check distance or state and then switch attacks with a new task. From there you can run a new behavior tree depending on whether its ranged or melee and again create some more decorators and tasks to determine which ability is used. When it comes down to it, behavior trees are a different way to organize code execution but its doing the same things.

  2. Yes, you do need to make blend spaces for your attacks. Animations function the same for ai as for your player character. Take a look into the free paragon character animations and blueprints. They will give you the best idea on how to go about setting up character animations.

  3. In terms of gameplay programming there’s really not much, but the benefit that c++ provides is a 10x speed increase for calculations done on tick or per frame. This allows you to program more complex behaviors or whatnot without losing as much performance as in blueprints. Also, c++ allows you to better control memory management and optimization. In my opinion for indie devs or smaller games, blueprints will suffice for almost all your needs but if you find yourself doing some complex math on tick that’s bogging things down, try to transfer that to c++. Also, with c++ you can make custom plugins and include external libraries and whatnot which can allow you more freedom in development.

One suggestion I have for you is to take a look at the Free RPG project offered on the unreal marketplace. Ill post the link below. It is a c++ project but does more or less what you are trying to do. Good luck!