Fancy Fluids in Flash by Sam

Every now and then I like to code something just for the fun of seeing what I can create. Recently I’ve been working on a 3D water sim in flash. Check it out below. If you’re curious as to how the water in Minecraft or Dwarf Fortress works, this is for you.

This movie requires Flash Player 10


The tech is inspired by that of Dwarf Fortress (which you can read about here), with a couple of my own additions. It is based on two core concepts. Firstly, water always falls down; if there is an empty cell below a cell of water, move that water down. Secondly, if a cell of water is connected to an empty cell somewhere below, teleport the water there.

One of my more interesting additions is that water ‘prefers’ to move consistently in one direction, as opposed to whichever direction is easiest. This means you can get jets of water that spurt out of high pressure areas. Take a look at demo 2 to see that in action.

If you’re curious, the image used in the demo is my display picture from the TIGSource forums. Also the GUI stuff is by BIT-101.

If theres anything you would like to know in more detail, or if you have any suggestions leave a comment below!

You can download the source here, but be warned: it ain’t pretty.

  • Twitter
  • Facebook
  • StumbleUpon

Discussion

  1. stevie says:

    you are a genius sam. destined for great things

  2. Wang says:

    i like it =]
    while i was watching it was just trying to find use for it in a game,
    maybe something like pipe dream (i think that was the name) but way more awesome, and in 3D!!

  3. This is a great display of programming skills! I’m sincerely impressed!

  4. Excellent work! I was doing a small experiment with papervision3d, which ended up looking a lot like minecraft. I’m not going to remake it or anything, but this reminds me of it!

Leave a Comment