It has been a busy couple weeks, and I finally found a good spot to squeeze in a new blog post! Last time I promised to make a video of the new features, but you’ll have to wait a moment for those – Although I have a short clip of the new overhauled gore system.

I’ve thrown away the old gore system and completely reworked it. The reworked gore system is awesome in its simplicity, and it has a huge (positive) impact on overall performance of the game. The old gore system worked like this: The zombie model was split into separate meshes for the areas that could be severed – Left and right hands / legs and head. Upon death the gore system would pick a random limb, or in the case of a critical hit, the head. It would then disable that area’s mesh renderer, and spawn severed body part prefab in its place, and give a bit of physic force to knock it around. While this system worked, kinda… It doubled the amount of skinned mesh renderers in the model. I noticed how big impact this has when I reworked the basic zombie model to even lower-poly (down to less than 50% of the previous one). I was expecting a good performance increase with the newer model, and it did perform better at first – but after creating the separate body part areas the performance was almost the same as with the old model. So I faced a problem: How can I hide parts of the mesh without separating the meshes to split areas?

And the solution was simple. So simple that I had overlooked it previously, even though I had read about it when I started doing the old gore system. And the solution is to scale the model’s rig down to a tiny fraction at the hit location, so it becomes basically invisible. While the verts are still there, they’re so tiny that you can’t really see them. Then a bloody stump model is enabled at the “separation” point, and some gore VFX are played. When I tried this in action, I spontaneously laughed out really loud – It was just so over-the-top exaggerated (I also had about 3x excess physic forces applied which helped being over-the-top). Here’s a video of it after some refinement and tweaking:

What remains to be done is a blood pool effect which kicks in once the zombie is dead in the ground.

I did some performance checks, and rendering performance is now much better: with 40 old enemies, medium quality settings the rendering took around 5 – 5.5 ms, with the new enemies it was down to 3.5 – 3.7 ms. Doesn’t sound like much, but it means I can use about 40% more enemies, probably even more if I manage to tweak the enemy even further. I think I can combine the model meshes further and remove at least one skinned mesh renderer, which will probably improve the rendering performance by around 15-25 percent.

That’s it for this week, I’m hoping the next time I can really show all the new features with a video. Thanks for stopping by! ‘Til next time!