Using Tick() within AI?

Is there anything wrong with using the Tick() method to get AI to perform tasks or is there something better?

If you need to do something for each frame rendered then there nothing better then Tick()

Using Tick for controlling AI has a (very) long tradition, so it’s a good start. Nowadays we don’t do that since every tick counts (as if it was not the case more years back! ;)). The main problem with tick is that most of the time your AI won’t have anything new to do every tick, so most of that Tick function calls will be wasted performance.

The right way to do AI is to have it event driven, where AI responds to events in the world (like being shot) and case of no events it’s just performing some kind of scripted behavior (scripted in a sense there’s a piece of code producing a sequence of action that AI follows).

UE4’s way of controlling AI is by Behavior Trees. And don’t be scared by the “Experimental” label - all that’s experimental in our BTs are tools, and only because they just need the Epic polish to reach the right quality bar. I strongly encourage everyone to use it! :smiley:

Cheers,

–mieszko

1 Like

Can I refuse to use Behavior Trees as they are blueprints and I want to abstract away from the unreal engine as much as possible :smiley:

Also I can’t make my AI work in blueprints as they use a lot of complex combat systems that use classes that blueprints can’t access/use.

First of all our Behavior Trees are not blueprints. We support implementing BT nodes in BP, and have a pretty editor, but the core is deep inside engine’s native code (AIModule to be precise).

If you want to abstract from the engine then you’re on your own in terms of implementing all of AI functionality, seems all of what we have is, well, engine-specific :slight_smile: