In gmod rust racers the cars were rolling contraptions, they had doors, trunk, hood, fenders, exhausts, engines, wheels, axles and so forth. Everything was a separate object welded to the chassi.
Being a purely multiplayer gamemode this didn't scale well. Each vehicle increased the load on the network by a large amount.
Every new vehicle spawned into the match put another 30 objects into the world that needed to be syncronized in realtime between every other player.
In this version of the game we wanna take a more scalable approach without sacrificing the visual fidelity.
So how do we do this? I have no idea but I figured a good start would be a shader that lets us modify the cars basic shape and looks and scale it with the health.
This is obviously a very rudimentary approach and the damage isn't applied to specific areas but to the overall vehicle. This works well to communicate the overall state of the vehicle to yourself and your opponents while following our "no hud" policy.
I've been researching methods for achieveing this and come across a lot of different methods.
Pros: Easy to use.
We're using Chaos Physics and with PhysX being deprecated in the near future. Flex isn't compatible with Chaos. Unrealistic results, large vertice movements looks really janky.
Looks pretty cool, fairly easy to implement logic wise. Easy to manage new physical shapes on the fly.
Somewhat time consuming process for our artists. Scales poorly in multiplayer.
Tried and true, GTA has been doing this for years. A bit tedious to implement the logic for it on the code side but the results are as realistic as you choose to make them.
EXTREMELY time consuming, every maximum damage state needs to be defined manually. Hard to define physical shapes.
Not sure yet, Unreal Engine was using 35gb of RAM before freezing when trying to copy the vertices of a skeletal mesh into a procedural mesh component. Pretty sure I'm doing something wrong though. The one upside is perfect control over vertices if I can get this to not melt my GPU, RAM and CPU.
Designing a formula for moving vertices procedurally is pretty advanced and it will be hard to get a good result with pure math.
What option is the best? I don't know yet but they all look like we'll be spending weeks per vehicle setting things up 😬
To be continued..