Feedback on Glass Breaking System

Hello everybody!

Currently working together with a friend on a survival kind of game where you’re trapped in a supermarket with all the supplied there in the middle of an apocalypse.

Wanted to share a new glass system that I made & get some feedback on it.
Here are two videos:



I’d love to hear what you think & if you have any improvements or questions in mind.

12 Likes

Wow, that looks crazy. How did you make that? Is it with a draw triangle function or editable mesh?

1 Like

In short, I made a “fracture map” in blender, which contains all the lines that the fracture goes along. Then, when you shoot at the glass, it takes the intersecting area of the glass/shard and the pattern to produce fractured polygons, which then get extruded into 3D pieces. I hope that makes sense.
And yes, then all of those 3D data pieces or whatever you want to call them are converted to editable meshes.

Wow, that’s amazing. This would be awesome for a destruction game.

2 Likes

Oh yeah, that’s actually a good idea. Might do that on the side at some point after we are able to launch this game.

2 Likes

while i acknowledge this work and think it is good, notice it generates a lot of Unions / Intersections, which will pile up real fast and cause stutters if used in the game massively
the very least you must do is detect the glass shard has become motionless, then make it Anchored

1 Like

There is a lot going on in the background to make sure no lag or stutter is created.
First off, no unions are actually being made, it’s all just a bunch of math. Every editablemesh object needed is already created and just sitting in a pool to reduce the delay of creating those. Then, the MeshParts that are required for the editablemesh are made in separate threads, tho they usually all finish in the same frame.

All the glass shards that fall out eventually anchor & fade away. The time depends on their size. For example, at 23 seconds in the first video, just before I start walking, you can see a tiny shard diagonally right & down from the gun disappear. And once they disappear, instead of destroying them, they are added back to the pool.

Also, the ones that fall out are all already pre-calculated & have their complete mesh and meshpart already sitting in a different pool. Only the shards that touch the edges of the glass that was shot are the ones that need extra calculations & meshes.

Currently, just running around & shooting all the glass I can find, I see no major performance dips. The last optimization thing that I have in mind, that I haven’t added yet, is to start removing older shards immediately if a lot of them start appearing at once, which is what I’m currently working on doing.
And even if it at some point becomes a problem, the way that the glass shatters can fairly easily be changed to contain less shards.

4 Likes

wow this is actually very satisfying and it’s the best glass breaking system I’ve seen, I especially like the way the glass just falls

1 Like

This glass-breaking system looks VERY GOOD! Great job on it! It’s a great recreation of other games and is pretty realistic! I rate this 9/10!

1 Like