How to make a dynamically destructible wall

Godot Version

4.3

Question

I am trying to make a FPS with dynaimically destructible walls. I want the holes to be similar to R6 siege.

currently i use csg boxes and add a hole shape at the correct point and angle. and it works very well, but it also lags alot if there are more that 15-20 holes in a single wall.

what alternatives are there for dynamic holes in a wall, as I have not been able to find any other solutions(other than voxels which did not really fit with the style of my game

I would also prefer if isolated parts can fall(if a part of a wall gets completely cut out it falls as a new rigid body. but it is not necessary

You might look into how Red Faction did this; they pulled it off on (IIRC) PlayStation 2, and I believe they put out articles on how they’d done it.

It’s been a while, but I think what they did was pre-shatter everything; by the time the game was running, I think everything was shattered, so knocking holes in things was just a matter of deleting anything where the hole should go.

Edit: You might also consider going to voxels.

1 Like

If I were to retry voxels. Is there any tutorials or strategies you would recommend for making them look more natural. Or any specific plugins for it. I tried zylann’s plugin but it seemed to be more for terrain than structures.

Thanks for your help

I haven’t done much with voxels myself, other than some brief noodling around with them in my own engine a while back.

That said, Zylann’s thing seems to handle full 3d environments rather than just heightmaps, and seems like it can make small(ish) voxels. At that point, the difference between a terrain engine and a terrain-with-structures engine is just voxel colors and the question of dynamic things like doors.

you should not use CSGs in a running game. they are for prototyping and extremely resource consuming.

Rainbow six?

the way destructible objects work is one of two:
1 - an algorithms generates pieces of geometry dynamically. this leads to bad textures and unrealistic results. there are some addons for this with godot but I haven’t tried them.
this system is used by marvel rivals.
2 - a destructible model. there is a model of the intact wall, and then there are models for different parts of the wall destroyed and also gibs.
in half-life there were just intact models and gibs. later games added semi-destructed models like a burnt car, a partially broken window, as well as bigger pieces of the model, sometimes fitting, like the wood-planks in half-life 2 that break into 2.
with more small destructible objects like small wood planks you can create a wall or cover a window, like in COD6.
the wood planks method can also be used for realistic destructible wooden barrels or boxes.
another option is to pre-animate the destruction, like in that one part of that one level of marvel rivals.

this option takes a lot of work, since you need meshes for every object and the destroyed versions of them, games like RS have hundreds or thousands of people working on them and so can make destructible pieces for every wall and object, the maps are also “set in stone”, so the parts can be custom made to fit a specific part of a level.

I used this one in my tests:

I don’t know which method RS uses, but it might be a mix of the two.

1 Like