Download

programming AI in C++ or...

Well I was just watching tutorials and things and for C++ you normally do a base class then you do your blueprint for put the meshes and things like that… so if animations is tied to handle themgraphically, seem to me that AI/behaviour trees/EQS are too tied to the editor… so, how do I programm my NPC/enemies?

NPCNative-> NPCBawseBlueprint -> more chiles?

And those childs in blue prints?? or they can be in C++ (so AI and animation will be on editor, but all the rest on C++).

You program their behavior using Behavior trees. For behavior trees, you create nodes and services, which can be done in both C++ and Blueprints.

See: https://docs.unrealengine.com/latest/INT/Engine/AI/BehaviorTrees/QuickStart/

I already have seen that tut, will look again, but it doesn’t use C++ IIRC.

Still, I have heard that a ¨good way¨ would be to expose all functions via static on C++… I don’t like the idea much.

Decision/Behavior trees are not blueprints.

Components used in behavior trees are written in C++ (and can be written via blueprints), and you can add more.

You’ll WANT to use behavior trees for AI for anything that is not trivial. For example, if your npc can fight, talk and has multiple fighting modes, with C++ code things will get messy very quickly. AI is one of the very few areas where you want visual aids.

To create AI controller in pure C++, derive from AAIController.

To create more components for behaviour trees, derive from UBTDecorator_BlackboardBase UBTDecorator, UBTService, UBTService_BlackboardBase, UBTTaskNode and UBTTask_Blackboardbase.

Thanks!!! with that info I will dig again on the tut, and now advance also to EQS :slight_smile: