Info
This mod adds very very simple block physics to minetest.
Some inspiration came from this post: viewtopic.php?id=3032 credits to Fiberous
The mod only affects humanmade blocks that don't use there param2.
It uses the param2 variable of the affected blocks to store the weight they can hold.
Gifs
Spoiler
The affected blocks are all cobble blocks, all brick blocks and all full blocks (like diamond_block)
These blocks have four properties: shear strenght, tensile strenght, compressive strenght and weight.
When a block is updated (by punching, placing or digging or TNT)
This block will use its values for its strenghts to calculate the amount of support it has from the surrounding blocks.
Then its param2 value will be updated to be the amount of mass that the block can still hold.
This update will spread throught the neightbouring blocks and all unsupported blocks will fall down.
Also there is the param1 value for the amount of overhang. I should really documentate this somewhere :P
Spoiler
Code: Select all
cobble = {weight = 2, shear = 8, compressive = 14, tensile = 2}
mossycobble = {weight = 2, shear = 8, compressive = 12, tensile = 2}
stonebrick = {weight = 2, shear = 12, compressive = 20, tensile = 4}
sandstonebrick = {weight = 2, shear = 10, compressive = 18, tensile = 4}
obsidianbrick = {weight = 2, shear = 16, compressive = 24, tensile = 6}
wood = {weight = 1, shear = 12, compressive = 8, tensile = 6}
coalblock = {weight = 2, shear = 2, compressive = 20, tensile = 0}
metalblock = {weight = 3, shear = 24, compressive = 12, tensile = 30}
goldblock = {weight = 3, shear = 12, compressive = 6, tensile = 12}
diamondblock = {weight = 3, shear = 30, compressive = 15, tensile = 30}
It's an extra challenge while you build a house!
The different materials have different properties, this makes for some more interesting building
Arches are stronger than 90 degree angles, thick pilars reach higher.
Why shouldn't i use this on an existing world?
This mod uses the param2 of all affected blocks.
Param2 defaults to 0 which means there is no support.
When you build your buildings with the mod enable, it will work as intended.
Build tips
- If a node is connected from to opposite sides, it is considered stronger.
More of these double connections make the node even stronger. - This means that building a bridge will propably require some kind of temporary scaffolding.
- Different materials have different qualities.:
You could use stone as a base and wood for higher walls and overhangs. - Arches are pretty good too.
- Just experimentate!
Use at an existing world at your own risk: all buildings will collapse!
The mod can be downloaded here: https://github.com/LHolten/block_physics
Depends: default? and stairs?
License: GNU GPLv3
API
Spoiler
Code: Select all
block_physics.add_single(pos)
Code: Select all
block_physics.add_neighbors(pos)
Code: Select all
block_physics.register_node(name, def)
This also adds paramtype2 = "physics".
The node definition should have the groups "shear", "weight", "compressive" and "tensile". For examples look add the "Data" tab of this post.
Code: Select all
block_physics.add_deco(def)
- fix hanging blocks
- fixed blocks not falling in water, lava and fire
- use something different from abm to get rid of the lag: minetest.after
- fix diagonal falling blocks bug
- add support for TNT back
- fix attached node removal
- add physics for natural nodes
- falling node double check or something
- add group for delay
- add a more realistic destructive option