April 2022 Update
Long time no blog post. I think most of the people reading this blog is already on our discord where most information is shared long before I pull my thumb out of my ass and update this godforsaken blog.
Anyhow todays show & tell feature a couple highlights from the last few months
Procedural Destruction 2.0
Our freelance developer Eddie Ataberk aka Outsider finally finished his mesh deform system which is a huge step forward compared to prior solutions for soft body mesh deform.
Note: this system is still work in progress so not every vehicle have proper shaders for glass / lights / detail destruction yet. The Mesh Deform plugin from Eddie provides us with some vital groundwork for interacting with the otherwise relatively off-limits vertice data opening up for building much more complex interactions with regular meshes in Unreal without having to rely on runtime meshes / mesh tools to achieve what we want. The key difference betwen this system and all the old methods is that we only need to provide a vector for the system to create an anchor, once the anchor is in place it controls the movement of the vertices associated with it. This means we can utilize well documented methods such as Delaunay Triangulation or Rolling Ball Pivot to procedurally generate a much less dense point cloud to use for Anchor points compared to iterating over hundreds of thousands of triangles every impact. The main reason we can't just take the exact mesh data and just mod it as we please in runtime is because iterating over enormous lists hundreds of times per second quickly becomes too cumbersome for consumer grade PCs.
The solution is reducing the amount of data that needs to be iterated over and then handle the actual moving of the vertices on a separate thread and let it take the time it needs, once we are off the game thread we don't really care about async tasks being stuck for a few frames because the result will usually be visible faster than the human reaction time.
And for the inevitable:
But Hoffa, Epic just released Sample City with deforming cars, why aren't you using that?
Short answer: They are not really doing anything new or innovative with procedural damage in that demo. They use morph targets and Control Rig, each car has hundreds of bones in their rigs and I honestly feel bad for the artists that had to set that up. If we took this approach we'd ship the alpha with maybe 2 max 3 cars due our artists doing nothing but assigning vertex weights for months on end. The key benefit of our system compared to that is the fact that once our artists are done with the body and groups for animated parts, they're done, the game handles the rest for damage, shaders, decals, deforms which means we can produce a lot of cool cars in very little time due to the limited overhead and complexity of our art pipeline.
The less time spent on finicky details the more time can be spent on actual gameplay. The system is not perfect but it's the cheapest & fastest solution in the industry right now and I'm okay with some jank as long as the game is fun.
Generative Adversarial Networks - Vehicle AI
I tried making self driving cars some odd 15 years ago in Garry's Mod.
I was not smart enough to pull it off back then but now 15 years later it appears I have gathered enough experience to actually understand the concepts involved, as a result we now have a system for teaching "objects" in Unreal Engine to do things. The system is broken down into a few key components:
Neural Network Component
Neural Network Mass Manager
The network itself is nothing special, just a forward propagating neural network.
The component itself is what maps the networks input / output layers to actual game data. In this case I feed the cars sensor inputs, speed and direction so it gets some feedback from the world as its driving through it.
The outputs controls Throttle, Brake, Handbrake and Shunt (lateral movement)
The Mass manager is responsible for the generative and adversarial part of the implementation. Each car has its own Neural Network and compete against every other car, the cars who perform best gets parts of their "genetics" copied to the next generation of cars and then use that as the starting point. The idea is that over time you essentially get "Survival of the fittest" by brute forcing variations of the starting data based on the success of previous changes.
Now there's probably 10 000 things you can do to make the training of the AI faster but I really enjoy watching them progress in the editor as they learn step by step.
As you can see they are not very smart despite being like 30 000 generations in with this topology, considering I know nothing about AI research I'm fumbling around blind trying things to see what happens. Am I really training the AI or is the AI training me?
Arvid is working on a new arena for team based gamemodes. Have some early screenshots: