Improved Damage System, updated suspension

Improved Damage System, updated suspension

Improved Damage System, updated suspension 2560 1440 Studio Tatsu

It has been a few weeks since our last post. We’ve been busy. We have reworked the damage system, creating an alternative for softbody physics for mid to low-end machines and mobile devices. The problem with softbody physics in Unity (or any game engine for that matter) is very CPU intensive, limiting what you can do with gameplay mechanics. For example, creating a racing game with 24 softbody cars will have a decent frame rate on high-end machines while mid to low-level devices would either crash or the frame rate would be so low it would be unplayable.

Our new Damage system has soft mesh deformation physics, which has many of the same benefits of softbody physics by simply removing the bouncy, jelly-like effect. Since we are trying to emulate metal and plastic-type deformations, the bounce effect is unnecessary. Now we can have more vehicles than we ever imagined on-screen with soft mesh deformation.

Since we want our damage system to support 100 vehicles on screen at once, we optimize it for 1,000 vehicles on mid-level machines.

This technique has allowed us to focus only on updating the forces applied to mesh vertices and not calculate velocity for each vertex. In the video above, the deformations are still crude but can easily be tweaked to provide better results. At first, it was almost as CPU intensive as softbody physics, but once we integrated Unity’s Job System and the Burst Compiler, we got massive performance gains. Before Burst, the framerate averaged 10-15 frames per second with the same stress test, sometimes dropping to 2 frames per second. If you look in the top right-hand corner of the video above, you can see the new framerate with Burst added.

Integrating the Burst Compiler with the Damage System removed all unwanted lag even with 2,000 deformation barrels on screen.

Next, we updated the suspension system based on play-testing and user feedback. The vehicles now lean more and have improved weight shifting of the chassis during turns, acceleration, and stopping. Updating the suspension system also required us to update our custom convex-collider system, which helps with vehicle handling and control. (I will post more about the custom convex collider next week)

Updated Suspension and Handling, adding improved steering with visual weight shifting.

Now that we have a much better understanding of Unity’s Job system, we will integrate it more and replace CPU-intensive methods in our framework. Note, we added other optimizations, but we’ll save that post for a later day. That’s all for now. To get more frequent updates, follow us on our social media accounts.

Thanks for visiting.

2 Comments

Leave a Reply

Our website uses cookies, mainly from 3rd party services. Define your Privacy Preferences and/or agree to our use of cookies.