how to make minecraft-like lava|water physics?

This forum is currently in read-only mode.
From the Asset Store
Simple yet very life-like rag doll made with Physics!
  • how to make minecraft-like lava|water physics and flow?

  • Top down, side view?

    I would imagine side view would pretty straight forward with physics. Quasiblobs?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Top down, side view?

    I would imagine side view would pretty straight forward with physics. Quasiblobs?

    side

  • I would imagine side view would pretty straight forward with physics.

    Minecraft doesn't use physics for the fluid. It's just a 3d falling sand type of "fluid" solver. Search the forums aolko, Quazi made a falling sand sim a long time ago. It's a lot of events however and it's quite cpu intensive. Your best bet is to work off of that code.

  • I think the way Notch approached water/lava in MineCraft doesn't require a lot of CPU, as he didn't go for ultra-realistic.

    He has source blocks that water/lava can flow from, with a maximum distance of 8 squares from the source block.

    If you have MineCraft, put a source block near the edge of the terrain, and you'll see that there is no limit to the drop, and that it either continues the 8 count or restarts it when it hits land (I forget which).

    Also, it doesn't update every tick.

    Far from it.

    Water seems to update a few times a second when it's spreading, and lava seems to update every few seconds.

    So it's not down to masses of computations, but more down to clever logic with timed updates.

    And of course, you only need to update the flow of a source block if it's surrounding terrain changes.

    It shouldn't be too difficult to get it working in 2D, but will probably take quite a bit of tweaking when in place (as Notch had to).

    Krush.

  • > I would imagine side view would pretty straight forward with physics.

    >

    Quazi made a falling sand sim a long time ago. It's a lot of events however and it's quite cpu intensive. Your best bet is to work off of that code.

    And that file got deleted

  • Here's my attempt at creating this:

    http://dl.dropbox.com/u/5426011/examples3/water2.cap made in 0.99.96

    It works well visually but requires a pretty much static environment. AKA it doesn't allow you to drain a body of water but it fills it nicely.

  • Here's my attempt at creating this:

    http://dl.dropbox.com/u/5426011/examples3/water2.cap made in 0.99.96

    It works well visually but requires a pretty much static environment. AKA it doesn't allow you to drain a body of water but it fills it nicely.

    ok

    that was fast

    how to slow down it a bit? AND what about exporting to another projects?

  • You could set up an every x milliseconds event, just have to rearrange the events some.

    As to the exporting... you can either study the cap and figure out whats going on, or perhaps someone could come up with a python version.

  • [non-construct]

    So, basically what do i need to make a minecraft fork?

    ---

    Knowledge of java? I think its difficult to learn + non-visual + additional libraries for graphics...

    any suggestions/alternatives?

    [/non-construct]

  • Here's my attempt at creating this:

    http://dl.dropbox.com/u/5426011/examples3/water2.cap made in 0.99.96

    It works well visually but requires a pretty much static environment. AKA it doesn't allow you to drain a body of water but it fills it nicely.

    Good example to have ROJO, Thanks.

  • Thanks a lot ROJO, just what I needed. Man that is a great job, you're awesome.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)