Hello,
I'm making a game where I'm using a quad tree implementation have terrain parts that are destructible.
The implementation I made is running fine, but I have the feeling improvements can be done, maybe by using the GPU a bit more, or techniques that I might not be aware of.
So I'm making this post to know if it is possible to optimize it. This could help making bigger destructible terrains and (maybe?) use blocks with physics.
Here the code of my implementation (i commented it to explain the general principle) : The conversion from a sprite texture to multiple physical blocks covering it : https://github.com/clemetayer/Diggo/blob/master/Diggo/Scripts/Scenes/Maps/DestructibleSprite.gd The code of a physical block that can be destroyed : https://github.com/clemetayer/Diggo/blob/master/Diggo/Scripts/Scenes/Maps/BlockDestructible.gd * The block is a simple StaticBody2D with a sprite and an Area2D inside it : https://github.com/clemetayer/Diggo/blob/master/Diggo/Scenes/Utils/Blocks/BlockArea.tscn
Also, this is in a super work in progress state, so if you want to run the entire project, there might definitely be some issues.