How many AI controllers should I have?

Say I have a soldier that should be able to follow another unit, attack or retreat to a safe location when his morale is low. And also have a medic, that should be able to follow at safe distance, heal and retreat when in inminent danger. And finally a static sentry gun that picks targets on it’s detection radius. How many AI controllers should I have?

Thanks.

just one or two maybe ( because sentry gun, maybe not same as human AI) the rest. just play with the behaviour tree

By default you should have a controller per pawn/character on the map. It’s possible to have less, but it would require a fair amount of C++ trickery. But there’s not much to gain to have less controllers then controlled entities.

Have one AIController per one AI body :slight_smile:

Cheers,

–mieszko

Thank you MieszkoZ. I was actually referring (maybe the question wasn’t clear enought) to how many different AI Controller blueprints, or implementations should I have. For example, say BP_Sentry_AI_Controller for the sentry pawns, BP_Human_AI_Controller for all human pawns, BP_Tank_AI_Controller for tanks?

It’s absolutely up to you. It depends on how similar or different your specific AI types are. There’s no generic rule here :slight_smile:

I would have 5. 1 base human controller for movement logic. 1 base stationary ai controller for stationary turrets. then children for class specific implementations of their logic. Medic would target allies turret could have rockets and target differently than a gunner turret etc. it makes extending easier.