Download

How expensive are shape traces?

Right now I have a capsule trace (sweep) that happens every tick. I assume sweep traces are relatively costly so would something like using a box overlap (the size of the capsule & its path) as a trigger for the capsule sweep be counter productive or a more efficient approach?
Am I worrying over nothing?

I’d imagine that a shape trace is not that expensive, since it is pretty similar to having a collision shape like a capsule and seeing where it overlaps/blocks
, though I honestly don’t know, so don’t quote me on that.

Thanks Jamendxman3, again :slight_smile:

I couldn’t find any mentions of performance within the documentation and from google searches so maybe it’s nothing. I’ll stop worrying about it then, leave as is and move on.

Thanks again for the help.

Do a test and bump up the number of traces you are doing and see what happens, thats usually the best way to test things since everybodies computer will perform differently.

Cheers ZoltanJr,

Followed your advice, tried it out and it seems I was worrying for no reason after-all.
I fired multiple capsule traces off in random directions & distances, ramping the amount of traces each time.

You can see it in action here in these videos I made:
Running once every 2 seconds: https://vid.me/6b2m
Running every tick: https://vid.me/Ex3d

Also pic of what’s going on:
93ab58c093a498d9497c73ede2d8855905c16774.jpeg

When tracing for StaticWorld; somewhere between 500 and 1000 simultaneous capsule traces seems to drop performance a little on more complex meshes (like the stairs in my example). Other things like walls & cubes didn’t seem to have any impact at all, even up to and beyond 2500 traces/tick (which is when I gave up trying).

Since I was looking at ~5 capsule traces max, and 500 traces seemed to have no issues, I think I’m ok.

Thanks again.

Best way to learn is to break it! :smiley: