I used to do some simulation work with pedestrian movement in a building with Pedestrian dynamics software, a certain situation is that the time taken for calulation and simulation is always way more langer than the real time. For examle, i have to calcluate for 5 days just to get the pedestrian movement results for the next hour in real life.
So, here is my question: If i have thousands of NPCs in the scene moving around, the engine sure has to take more time for calculating and rendering. When i set a behavior named A which cantians some mathematics problem for all NPCs to do in exactly 0.5s, what if the Engine could not get the resluts of A behavior in 0.5s, what would happen?
Hypothetically, the engine has to calculate for 2s just to get the results of A behavior, will i see the A behavior in 2s?
Look into the difference between Async and Non Async. See if that is what you are asking about.
As far as behaviour calculations and their load:
You shouldn’t include any math into anything if you can avoid it.
Since the GPU could possibly perform that calculation faster, when dealing with some excessive quantities as you mention, it may be worth it to “break” or “hack” into the gfx to get your calculations faster than the CPU can handle.
Ofc if the CPU has to utilize this (say to move a character) than you’d get no benefit from all of that anyway, which is why you should avoid all math, or any other superfluous instructions.
In engine, Btree and black board in general are pre-optimized for load. You will see more of a performance drop from the rendering side (and much, much faster) than you will from having even complex behaviour trees on multiple enemies.
Particularly with UE 5, the engine is a complete dud. Adding 10 Optimized skeletal meshes already ends up costing around 50% more than it used to cost in 4.x. And the cost goes up almost exponentially (as it always did in spite of properly instanced materials, because of skinned mesh calculations).
Until things are fixed on that aspect, games like BannerLord are improbable, if not just impossible.
Last thing worth a mention - agnostic of any engine:
If each actor has its own “tick” instructions to compute for, you will quickly max out the CPU (also almost exponentially). For very large gropus of things that all require their math, their math is calculated using Tick Aggregation; a dedicated blueprint is in charge of performing all needed calculation and setting individual variables each tick.
This usually ends up costing less because it is one operation vs many operations. There are limitations to how fast a CPU can handle the math ofc, so even with aggregation the amount of things you can do is limited or may need to be split between different managers.
Generally seen in RTS type games/tutorials (think AOE with buildings/armies/units etc.)