How to optimize AI perception update to stay fast? When having some near 100 characetrs in pool, I cant find away to prevent it having effect on AI perception update speed. Delay gets around 5-20seconds. When having 20actors the delay is already 0.3-0.6seconds (the debug ball updates with that rate). Tested this in empty map only with the actors. View distances are 5500 at most, and half view cone 90.
I have set component tick off for AI perception component, stopped brain component logic, disabled tick for whole AI controller, but no effect.
If affiliation settings have effect, would need to way to mark wanted pawns as enemies. Also disable wanted pawns to show in perception system at all. All animals are currently showing.
Not using AIPerception component events. Instead having own timers to slowly copy currently perceived actors to variable and then checking it with slow rate.
Is there some more tricks how to get it faster. Would hope to have around 40-60AI at one time without response times getting over human reaction time.
Else having smooth fps staying over 60, so bit lost why it behaves like that.
EDIT: Looks like its only the sight that is slowing down. Hearing is instant.
Did you ever figure this out? I’m curious myself because perception is an important part of the AI system and if its being slowed down I want to know if its the engine or the code you wrote causing the slowness.
I don’t think, you can have dozens of ai, all tick with perception and other complicated behaviors. Crows have no individual intelligence, but mostly following leader (or “game director”).
You need different approach (code solution, no matter bp or c++). For example you can make group leaders, for every 10 or more ai. Only leaders will use perception, others will just follow leaders. However, perception system is as I know obsolete and it will be mark soon if not already.
Would be nice game with 100 characters and they all have sophisticated ai, perception etc working same time, but I don’t know game like this, maybe I’m wrong.
Use crowds with leader, and better create own perception system.
In your case, from memory - check perception and/or stimuli update. Maybe is every tick for every ai actor…
I have moved civilians, zombies and animals to use simple traces (sphere trigger detecting pawns slowly near the pawn, only then checking line of sight with trace). That gave nice boost for perception, but not yet tried with heavy amount of AI. Shouldnt have much problem at the end. Could use different tricks like that group leader focus if needed.
Running into this issue too (4.27.2), working with about the same config, same number of characters and same update delays. I guess the difference for me is the detection is one way only, handful of “intelligent” actors perceiving dozens of “dumb” actors.
@SaOk I am about to concede and put together something with the sphere/trace combo too, so I’m wondering if that’s the route you ended up going down?
Sorry for late reply (I rarely visit this forum), but I ended using queries from spatial grid plugin and async lines traces from BPThreads plugin. Made own perception system with those (float curves and interfaces) and been very light for CPU.