Page 1 of 1

Very simple block physics

PostPosted: Wed Sep 12, 2012 04:34
by Fiberous
I have been toying with the idea of a very simple physics system for block games like Minetest. Unfortunately I won't have much time to do anything with it, so I thought I would post it here in case anyone thinks its a good idea and wants to try it.

This physics system would allow for simple interactions between blocks based on forces in up to 6 directions (one for each block face). It would allow you to determine whether a block is under too much stress and should break or fall down. I think that it would end up being close enough to people's intuition about how heavy blocks should behave that it would be pretty fun building with the risk of everything collapsing. If it was incorporated into the game (some day) then it might serve as a good way to distinguish the game mechanics from that of other similar games (like Minecraft).

Each block would have four different properties: weight, compressive strength, tensile strength, and shear strength. If a block is completely unsupported then it would fall like sand currently does. Otherwise a block could be supported by other blocks sharing faces with it based on one or more of its strengths. Each strength applies to a force coming from a particular direction:

* Compressive strength would support a block if it has a connection in the direction with the force. For example: the blocks of a pillar would exert a downward force on the blocks at the base of the pillar. If their compressive strength is great enough for the weight of the pillar, then they will not break.

* Tensile strength would support a block if it has a connection in the direction opposite of the force. For example: a chandelier hanging from a ceiling would pull on the block it is hanging from. If the tensile strength of that block is great enough, then it will not break and fall.

* Shear strength would support a block if it has one or more connections in the directions perpendicular to the force. For example: a block in a beam supporting a tunnel ceiling would support the ceiling (downward force) by its horizontal connections to other beam blocks. If the compressive strength of that block is great enough then it will not cave in.

If a force exceeds the sum of all three strengths for a given block, then it will break. This could mean a couple of different things, so tinkering with it might be necessary to get the best results. A breaking block could just become a Minecraft-style dropped block, but this is kind of boring and so something more complex might be better. An alternative is for the block to move in the direction of the force if it is able, or fall downward if it is not, or move into an adjacent space if it is not able to do either of those.

Also, when a block moves from having exceeded its total strength, for the first instant that it moves to that area it would not be supported by anything unless other blocks moved with it at the same time due to the same force. This would prevent a falling structure from suddenly being supported by something it brushed up against while moving. A further improvement to structural collapse could be done by making breaking blocks give a small and sudden spike in force so that poorly supported blocks nearby (such as on the same structure) would also collapse.

If the block does not break, then the forces would be transferred to the blocks that are supporting it. This would allow, for example, a thick ceiling to cave in if you put too many heavy blocks on your roof. Of course, there would need to be some limits on force transfers, or it would lag. Forces could only be recalculated when a block is placed or removed. The forces could also be only calculated for an expanding Manhattan distance so that forces do not have looping transfers (I am not sure what effect this would have on the realism of the physics, though). Forces could also gradually diminish as distance increases, which would prevent forces from accumulating in your calculations. This would also prevent the entire world from falling down due to it not having an actual bottom supporting it. The number of blocks a force would act through could be tuned and even set on a server by server basis. I think that even if the force diminishes after just a couple blocks it would still add a cool level of realism to building.

Non-block entities (like players) could also have a weight, which would allow them to cause the collapse of unstable structures by walking on them. There could also be other sources of forces, like pistons and explosives and water and things like that, which could add an interesting layer of complexity to the game. You could even have special blocks that experience an upward force (like a negative weight), or even a sideways one. If you were building a structure out of blocks with a negative weight, you would have to support it in the opposite direction compared to normal blocks, leading to a sort of upside-down building style. If negative weight blocks were to collapse, it would have disastrous consequences, since your entire building would fall upward into the sky (up to some limit). You could probably base a lot of even weirder things on this sort of system if you wanted to.

PostPosted: Wed Sep 12, 2012 14:46
by PilzAdam
Can someone record the post above and make a audio book of it? I dont want to read this long text.

PostPosted: Wed Sep 12, 2012 14:51
by Jordach
PilzAdam wrote:Can someone record the post above and make a audio book of it? I dont want to read this long text.

I'll do it.

PostPosted: Wed Sep 12, 2012 15:22
by Liandri
PilzAdam wrote:Can someone record the post above and make a audio book of it? I dont want to read this long text.



It's nice to see how people is open to new ideas...

PostPosted: Wed Sep 19, 2012 09:39
by fgr
this feature should be as soon as possible mandatory because building houses, obects against the physic is not that nifty feature. it should handle constrcutions to concentrate blocks to get a stable object.

i would vote for that in a core release ;-)

PostPosted: Wed Sep 19, 2012 10:12
by Mito551
the idea is neat/great. but it's not for MT. it's a bit out of place. it belongs to another game, or just the MT fork. seeing MT (MC-like game) with this kind of physics would be great.

PostPosted: Sat Sep 22, 2012 20:24
by Fiberous
Mito551 wrote:the idea is neat/great. but it's not for MT. it's a bit out of place. it belongs to another game, or just the MT fork. seeing MT (MC-like game) with this kind of physics would be great.


Why is it out of place? It would change the building style somewhat, of course, but it fits block construction pretty well. Buildings made in Minetest with physics would work the same in Minetest without physics as buildings with the same blocks, and you could easily toggle enabling/disabling physics since it is an active check to see if blocks are going to break or fall down.

PostPosted: Sun Sep 23, 2012 01:14
by tonyka
oh my god!
no human being can read this, is endless

incorporate a physical system would make it impossible to build a multitude of existing buildings
would be necessary to create lots of specialized blocks
I do not like the idea of having to plan my constructions, for crumble at the slightest defect ...
I love the domes, imagine making a mountain of sand 100 x 100 x 100 blocks, to put glass on top and then empty it, without crumbling the dome?

PostPosted: Sun Sep 23, 2012 06:30
by Topywo
tonyka wrote:oh my god!
no human being can read this, is endless

incorporate a physical system would make it impossible to build a multitude of existing buildings
would be necessary to create lots of specialized blocks
I do not like the idea of having to plan my constructions, for crumble at the slightest defect ...
I love the domes, imagine making a mountain of sand 100 x 100 x 100 blocks, to put glass on top and then empty it, without crumbling the dome?


+1

PostPosted: Sun Sep 23, 2012 06:57
by cornernote
sounds like world of goo in minetest ... would make some interesting buildings =)

PostPosted: Tue Sep 25, 2012 20:49
by Fiberous
tonyka wrote:...incorporate a physical system would make it impossible to build a multitude of existing buildings...


Almost everyone already builds with a sense of what buildings "should" look like, which comes from a consideration of utility for humans (players ingame) and an awareness of the physics that governs buildings in the real world. The vast majority of buildings would only need changes that don't appreciably affect the appearance of the building.

tonyka wrote:...would be necessary to create lots of specialized blocks...


What specialized blocks? In the real world wood has lots of shear strength and tensile strength, and cobblestone has lots of compressive strength but little shear or tensile strength. Most buildings could already be made just out of a combination of these two materials, and these are two of the most common in Minetest. Sure something like steel reinforced concrete would be more effective (all three strengths are high), but its not like you are limited in what you can build because of a lack of blocks. Specialized blocks would only be needed if you are doing weird things like making buildings that are pulled upwards and such.

tonyka wrote:...I do not like the idea of having to plan my constructions, for crumble at the slightest defect...


Let intuition guide most people. Tiny structures could be made even while making silly mistakes. Small structures might only collapse if you do something stupid, like build the roof before the walls are in place. Medium structures could be made without planning if you were careful, like making sure to put stronger materials in the right places. Large structures could be made with some planning, and gigantic ones would take a master to build.

Newbies would learn about how the physics works as they graduate from one size to another. For most players a set of standard practices would emerge, like "Make sure you place such and such a number of horizontal beams supporting a roof of this size". It is with amazing structures that significant craftmanship and planning would emerge. You would probably actually get more really big structures in more interesting shapes just because of the challenge of building them.

tonyka wrote:...I love the domes, imagine making a mountain of sand 100 x 100 x 100 blocks, to put glass on top and then empty it, without crumbling the dome?


Well, this would be an effective method, if unimaginative and inefficient. Just use some planks to make some temporary support columns and then knock them out when the dome is done.

tonyka wrote:oh my god!
no human being can read this, is endless


I don't understand the problem with my original post. Don't most of you have to read software manuals and technical specifications of similar complexity to be able make more advanced programs? I need to put things precisely to be able to properly get my idea across, but its not like I wrote an academic journal paper or anything. I understand that there are people on the forum that don't have English as a first language, but even if that is so you could ask me to clarify or explain in different terms rather than complain or insult me like the first couple of replies did.

PostPosted: Tue Oct 02, 2012 10:29
by CTMN
Fiberous wrote:I don't understand the problem with my original post. Don't most of you have to read software manuals and technical specifications of similar complexity to be able make more advanced programs?


Ok, then print it out and give it to us :D

Physics r a good idea, but maybe in a fork and not in the original game. Also don't forget that we don't have super computers

PostPosted: Tue Oct 02, 2012 12:15
by rubenwardy
Fiberous wrote:I don't understand the problem with my original post. Don't most of you have to read software manuals and technical specifications of similar complexity to be able make more advanced programs? I need to put things precisely to be able to properly get my idea across, but its not like I wrote an academic journal paper or anything. I understand that there are people on the forum that don't have English as a first language, but even if that is so you could ask me to clarify or explain in different terms rather than complain or insult me like the first couple of replies did.


It is realitively easy to read, the only way to make it read easier is to use bold, and subtitles.

I think this is a good idea, but the major point of MT is its support of older computers, so it will not be included in the main game

PostPosted: Tue Oct 16, 2012 02:53
by Fiberous
Depending on how you did it, it could be as little as six equations computed per block and then a few conditional statements. The number of blocks you computed would then depend on the radius that you allow the forces to extend. This is nowhere near a full physics simulation; it just tests to see whether a block should break or fall (e.g. so the cave you are mining in falls down, for example).