Performance Wise, Should I use Behaviour Trees or Standard BP script for NPCs? (Roaming AI)

In general I don’t know which one is better for performance - but to achieve my goal (it was 400 - 500) AI. I did it with non of the above__ (Generally I used C++, but most of the tricks could be achieved with BP, still c++ is faster and more options to do).

For roaming characters I used a Background thread to generate a pool of random numbers (directions my AIs would go to) - here is my tutorial Wiki

In addition I did not use EQS and ofc no any shape to detect overlappings (to know if the player or vice versa is in the attacking radius) - I did the it also on a separate thread which measured distances.

Another and very significant optimization was subclassing the CharacterMovementComponent
Dividing it’s tick to 4 groups (when the character is not rendered) means there are no 500 AI ticking together, but only one group per tick.

I also had to invent a movement prediction mechanism to cull of RVO and fire it only when I predicting that units are on a collision course (well this one is questionable - I needed this not for an optimizations but for a smoother gameplay unit movement).

My AI is tick based - but the key is to span tasks across the tick - once again it is like dividing the tick in to several groups - for example:

Tick1 (Query (thread based) enemy unit detection).

Tick2 (Perform some logic - in my case behaviors).

Tick3 (Perform other logic).

The key is you are not doing all the tasks in the same tick - but diving it to 3 or more ticks, which will increase CPU performance.
(For instance if I still was CPU bottle necked and I would add more AI - I would rework the Pathfinding to be asynchronous it would add up some more milliseconds to my bank of time).
And honestly my 500 Unit CAP is GPU bottle-necked :-(.

But my point is: – If you are not lacking performance and everything is smooth enough - just leave it (“Premature optimizations are the root of all evil”)!