• Register

A technical demonstration of realistic liquid simulation for Minecraft, Liquid Cubed is a WIP project where you can build dams, pump water, drain lakes, and otherwise experiment with the liquid system within the building area. ------- The algorithm used for the liquid simulation was developed over two years by in a modified version of Infiniminer. After Minecraft's wild success, we thought it was about time we built a standalone "proof-of-concept" in the hope that the algorithm could be integrated within Minecraft, but unfortunately more work will have to be done before this can become a reality.

Forum Thread
  Posts  
Several suggestions involveing pressure and large bodies of water. (Games : Liquid Cubed : Forum : Bugs and Suggestions : Several suggestions involveing pressure and large bodies of water.) Locked
Thread Options
Feb 26 2011 Anchor

As far as i can tell, water pressure does have a upper maximium limit, equivilent to twice its volume, meaning you could compress a 2x2 cube of water into a 1x2 space and a 1x2 space of maximum pressure water could fill a 2x2 space. Now in real life water can be compressed to near infinity, so what I suggest is that water pressure has a infinite pressure maximum, up to a pratical limit that abovewhich it would be to costly storage space wise to store the pressure in numbers, imagine how fun it would be for someone to compress a small lake into a tiny space and then release it into a structure and watch as it floods and fills it. From a programing standpoint it looks like water is set to spread below it no matter what, to the sides if it is on the ground and has sufficent pressure, and up if it has a sufficent pressure. And if a block of water next to it has a lower pressure it will pass the pressure onto it untill they are equalized. So im not entirely sure how hard this would be from a programing standpoint but I dont think it would be too hard.

My second suggestion is a way for decent less laggy extremely large bodies of water to still be dynamic, like a ocean. When a body of water is a sufficent size, say total 10000 blocks of water or at whatever point it would be too costly to properly simulate, it would be considered what we will call a Whole Body for explnation purpouses. When a whole body is created, all water blocks within it have their pressure calculated and added up to a total pressure number, and a whole body can only be created if all blocks of water within it are at the same surface level. So lets say you dig a hole at the bottom of a whole body into a space that can store a indefinite amount of water, so it will never stop draining. the whole body would start flowing into the hole, and subtract from the total pressure number, once it lowers the total pressure number sufficently it would decrease the hight of the entire body of water at once, and so on and so forth untill the body is completely gone. There are many more factors that are a problem I could easly come up with a solution or explenation for but this post is allready big enough, if there are any big problems you see with my suggestion just voice them and I will attempt to address them.

Feb 27 2011 Anchor

It seems my brains aren't big enough to handle that much, because i didn't understand a thing.
Anyways, from what I understood, you want infinite pressure and big bodies of water to be taken as a whole... IDK but I think it would improve perfomance... so +1

Feb 27 2011 Anchor

Infinite pressure is a big nono, especially if you want this in Minecraft. For each block, you have 4 bits (or 8, I forget) to store data.

Feb 27 2011 Anchor

Its four bits, but prehaps a alternateive for infinite pressure could be that it takes a special device to compress water more then what can be done right now, and then it would use a similar methoid as the whole body system in how it stores its total pressure in 1 number.

[ZanMgt]Aaron
[ZanMgt]Aaron Creative Director
Mar 1 2011 Anchor

In real life water has very little compression available because of the molecules involved, but in our case its just too much fun not to play with.

As for your first paragraph though, more-or-less we could always just use a Spring block with an integer value's worth of liquid inside, causing it to continually dish out water until its empty. To compress that much water into a small space would require some amazing technology, so you could just have a tool of sorts "whoosh" the water into your single cube, etc. Fun idea. =)

With your second suggestion, optimizations like the one you suggest could be used in tandem with the normal cellur automata, its all just a matter of what's practical from the hardware and CPU perspective as well as figuring out when to "bake" instances, etc. We're not quite to that point yet, but its definitely an intriguing thought for the future.

Thanks for the suggestions!

Edited by: [ZanMgt]Aaron

Mar 1 2011 Anchor

Thanks for the reply, please do consider the pressure idea, that spring idea sounds perfect.
I have a idea for when to break instances(ill assume you ment break instead of bake) but il need to explain to you how i think they should be made.
First of all a instance would be made only when generateing or loading the map, on load or generation it would search through every water block that is standing still and search outward once for each water block (think of how water used to work in the creative version of minecraft, except it only spreads to water blocks and can spread up) every water block the search passes through is automaticly set to be skiped in the long list of water blocks to start a search in. The search can pass through only water that is standing still, but it will count moveing water if it is directly touching a nonmoveing water block. For every block the search finds it will add 1 to a integer, if this integer reaches a set value it will continue the search untill there are no more water blocks left, then store the entire searched structure in a separate file inside(im explaining how this would work in minecraft by the way, so im useing minecraft pathways as examples) a separate folder within the main save folder. There would be 1 file per structure, and the file would contain the cordinate positions of every single water block as well as a single integer to contain the total combined pressure of the structure, thus even with dozens of files the save overall would not be signifigantly increased in size.

To figure out when to remove the instance it would go like this:
Every time the structure's integer lowers enough to remove a layer of water blocks off the top it would do another search, this search would be started from every water block on the surface at the same time, once these searches are complete the structure would be recalculated and if the structure is not connected to itself anymore(for example, the structure was in two halfs connected by a cannal 1 block deep that drained out when the structure lowered in depth)it would calculate if the seperate bodys are individualy large enough to be a structure, and the ones that are would be converted into a new structure, the old file of the original single structure would be deleted and new files for each new individual structure would be created.

As far as recalculateing when someone for example uses normal blocks to seperate a structure into 2 or more parts, i have no clue. My only idea is that a search could be conducted every time a block is placed or removed inside the structure, but that would be far to costly.

Edited by: buggy1997123

Reply to thread
click to sign in and post

Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.