Sphere overlap vs All Actors of Class

I was wondering what of the two would be faster and in which scenario. From my experience all actors of class is faster when there are only a few actors but slows down where there are larger numbers. Anyone know how sphere overlap works in large groups? What does it do under the hood?

i could be wrong but i read that selecting actors by using a collision sphere is the common and fastest way to do it.
i first do a collision check and then filter by distance that’s the way im doing it

If you expect huge amounts of actors it would probably be best to create an array and add / remove on event begin / end overlap.

That way you have no overhead by some function and are left (performance wise) with array operations only.

:X The biggest difference is, that the sphere only gets the actors in its radius. The “All Actors of Class” will get you every Actor of that class in the scene.

I guess you can think about situation where the “All Actors of Class” is the wrong choice :smiley: I also guess, that the Sphere is faster if you only want a few actors that are in range and not every single one.

Hey, thanks for the replies. I’m following up from out of town for holiday break so I have not been able to look into this in any real detail. I was more concerned if the sphere overlap check did things like a trace to the actor to get the distance or if was spawning a sphere and returning an overlap event and counting the events and ators.

I’m trying to determin a way to have potentially hundreds of actors close together and having the AI decide what one to shoot at without it taking a lot of processing power. It looks like I may end up using the EQS system as it is time sliced so that it will not take too much time.