Hi All,
The time to optimize the game has begun. Nowadays my best friends in Unity are the Frame Debugger and the Profiler.
In order to achieve the right gameplay-experience, many vehicles must reach the port what is usually super resource-expensive for the computer as the frame rates will drop immediately.
Therefore, a technique called multi-threading is being usually deployed: Unity usually acts on a single core of the computer, but this does not mean that other cores cannot be used.
Over the past few weeks I’ve been implementing multi-threading to the vehicles, in particular to cover the calculations how a truck can get from point A to point B. Super tricky, but it finally works!!!
I stopped at 2.000 trucks and 40FPS, because I have still pieces of code that are not superoptimal and are reducing the framerate; not because there are more trucks that need a path, but rather that those trucks start to interact with other functions within the game.... so the next steps are to optimize those "interfaces" as well ;-)
Check out the following video and screenshots and please do not forget to like and wishlist the game on Steam:
Thanks and have a great weekend
Starting the test slowly with 30 trucks at 80FPS
Moving on to 800 trucks at 60FPS
Finishing with 2.000 trucks and 40FPS