Optimising/diagnosing performance for physics object driven by event tick

Hi. I’ve got a race car pawn actor that is being controlled by with physics (impulse, thrusters…) And everything right now is getting driven by event tick and sequences. It looks kinda like a spidersweb in my blueprint editor and I’ve read that event tick should be used in moderation. How do I diagnose if my race car pawn is bottlenecking cpu and what are the optimisation techniques for such scenario. Thanks

Hi,

In general, in order to give the player a smooth and immersive experience, you have to use tick event to implement some of the functionalities. These can be key input handling, camera movement, player movement, to name a few. For the vehicle, if you’ve implemented it based on the WheeledVehicle class, then all you have to do is to supply some axis mapping input (which fires every tick) and the underlying PhysX algorithms will take care of the smooth movement for you. If the number of cars you’re trying to simulate is less than 30-40, then you shouldn’t really worry much about their performance bottlenecks and optimization.

Overall, as you also mentioned it yourself, you should be careful using the tick event. Some functions such as Get All Actors of Class should not be used extensively in the tick as it might cause some performance issues depending on the number of actors. Depending on the functionality of that method, you should know whether you need a clock that ticks every frame or with a lower rate. For example, in an AI behavior tree, you might not need to set your clocks to tick every frame. Instead for some of the searching or listening algorithms, you can easily get away with using a clock with a 10Hz rate (i.e. ticks 10 times every second), which is almost 10 times less ticking than having it tick every frame for a game that runs in ~100 FPS.

Lastly, for monitoring the performance of your game you can use the engine profiling tools that are explained in here.

Hope this answered your question.