Structural integrity : Minecraft?

Hi, I am wanting to mess around with something that i can only really describe as minecraft but with structural integrity.

I want to be able to place blocks and each block has a certain weight and can hold a certain amount of weight. In the image I have shown below, the green indicates that the structure is sound and would not collapse. The red indicates that, that addition of that block is too heavy for the structure and that red block would break.

Vertical weight would not count if the blocks are attached to a ground block (the tall structure at the back of the image would be safe) , but do count if attached like the top right structure.

I want this to work with buildings of any size ( 5 block buildings or 5000 block buildings).

I had initally started working with some list and dictionaries and checking the blocks neighbour’s, and it worked for basic structures (an L shaped structure) but would fall apart with anything larger, or more complex.

I am not the greatest when it comes to problem solving for problems, so I am not looking for someone to give me code etc. But just some ideas at what I could start looking at to implement something like this. Any ideas would be appreciated.

What you propose is making a 3D structural simulation package. In the general sense this is an Extremely Hard Problem™.

The existing 3D physics engine can do this but it’s not really optimized for such a thing. You likely wouldn’t be able to have more than a few items in contact with each other before it became massively unstable.

Try it yourself: make a fixed block, then use FixedJoints to attach other blocks to it in a long spar and you’ll see about the limit. The limit has to do with Rigidbody count as well as disparity in weights. The bigger the weight disparities the harder it is for the solver to keep thing stable.

for inspiration,
block physics
https://vimeo.com/45405275

from this thread, After playing minecraft... page-22#post-971773

i think you could make up some simple fake algorithm to determine those values,
flood fill, path finding, 3d graphs… and it could be easily running in separate thread(s)/jobs/or lazy iterative updater…

Yeah makes sense I was beginning to think it was going to be an extremely advanced problem.

Oh this is basically everything I am looking for. I wonder how he does it :eyes: . Ill take a look into those ideas. Thanks