I was just wondering on the processing loads generated by a “Capsule Overlap Actors” or “Get Overlapping Actors” call. I’ve got quite a big map with a lot of objects in it, and want to check for any actors in the area designated for the players characters to move to each time they give a move to input.
Does Get overlapping Actors literally check every object in the map, or does it have some kind of mechanism for shortlisting the actual object collision capsule checks it makes to objects it knows are in the nearby area (otherwise I would have thought that could be a lot of capsule overlap calculations)…!
Any insight into how processing intensive overlap checks are would be really helpful as I’m going to be doing a lot of overlap checks… (I guess the same question also stands for triggering overlap events)…
Oh boy checking literally everything on the map sure isn’t viable.
I didn’t check the source so don’t take this as fact but I would be very surprised if that was anything else than a list of objects in an array updated on begin and end overlap. Everything else would make it unusable in actual games with complex levels while having a really simple solution. You could do that array yourself easily. Just add actors as they trigger on begin overlap and remove them on end overlap.
The only way to know for sure is looking at the source or just go with it, write a function in the way I just described and test both in larger levels. My expectation would be that “Get Overlapping Actors” is better or equal in every way but hey. You never know.
Thanks for your answer. But even if its a list of objects in an array you still have to generate the members of that array, and if you perform a “Capsule Overlap Actor” using an abstractly placed capsule surely you still have to perform an overlap calculation for the collision capsule, so how would it choose the actors with which to perform the overlap calculation? And if you enable “Generate Overlap Events” for an actor, doesn’t that mean that that object will have to be added to a Tick Queue where it will have to check whether it is being overlapped on every tick (being even more processing intensive)?
The reason I ask is that I’m giving a move command to up to 20 characters in one go by designating a central move location. The function then calculates each characters location (as part of a unit formation). I then need to check if any objects are in the way of any of the move locations and reassign new locations for those that are blocked (e.g. houses, walls etc).
I do this by first calling “Capsule Overlap Actors” for the area in which the formation will move to, to get a run-once short-list of all possibly blocking actors [BlockObjs] in the area. I then use a dummy capsule the size of the characters and move it to each of the designated move to locations and run “Is Overlapping Actor” on each of the BlockObjs to see if anything is blocking that location. My thinking is that it is quicker to rerun “Is Overlapping Actor” on the short-list of blocking actors (possibly none) for each move location than to run “Capsule Overlap Actors” each time (which would possibly check all actors everywhere)…?