Download

How Expensive is running a Trace Every Tick?

I’m hoping/planning to add a system that would trigger an event that would give some descriptive or flavor monologue, if the object in question and being looked at had let’s call it “examined” function, a player would need to have focused on the object for a fairly atypical amount of time let’s say like 10 seconds as an example.
I already have an idea of how it would be implemented, a trace would hit an object, if it remains the hit object after the given time it would then trigger an interface, and if the object in question had it implemented it would do whatever I want it to.

So my question is how Expensive is doing a Trace Every Tick?

I run like 3000-4000 traces every tick and it is fine (i start see lag but it may be from all those dynamic meshes)
So running up to 50 line traces per tick should not cost much (i guess 1-2 frames for 50 or so traces)

4000 Traces Nawrot??? Is this your Crowd AI (obstacle avoidance etc)…?

Nope, doing some constructor script to place x*y bricks. Wall of 70x70 gives 5000 bricks. And it works.

For crowds you should enable (and use) detour AI.

I can confirm what nawrot said. tracers are really cheap don’t worry about them. and as it seem you only need one tracer right?

People get all up in arms about tick, but it really depends on what you are doing with it. You could do a thousands traces on tick and be fine, and turn around and do 1 trace on tick and have it destroy you because you are trying to do too much with it.

I always recommend running your own test cases to see how it affects your setup. Create a setup on tick where you are doing an average amount of work, and then keep doubling it until it causes you issues. Work out your upper limit for both what you need and what you can do on tick while also keeping in mind future expansion/changes. If it works for you at 50 traces a tick, just go ahead and amp it up to see where your breakpoint is.