I’m working on a clinic simulation game in which time is a critical factor to the game, I have found that when I run the game at ‘normal’ speed (timeScale = 2) the framerate stays a consistent 60FPS, however as soon as I increase the speed to the highest (timeScale = 99) the framerate drops to around 4-10 FPS maximum. If I only have one agent in the scene the performance is acceptable but as the patients are spawned the performance takes a massive dive at high game speeds. Any suggestions or workarounds with regards to pathfinding and time scale?
The included AIPath script will recalculate it’s path every x seconds. If you increase the time scale, it will recalculate it’s path more often, which increases the stress on the pathfinding system. You should modify it to use Time.realTimeSinceStartup instead if a non-time dependent behavior is desired.
Also, are you increasing the fixed delta time as well? If you are not doing that, physics will run at a much higher fps (fps relative to real world time, not game time) which uses a lot of cpu power.
Thanks for your help, I have re-worked my code to handle two separate time scales, one for gameplay and another for interface/calculations. Seems to have solved all issues associated with AI and performance.