Posted by
May 20th, 2015 6:23 am

I’m trying to create a “flow” algorithm, like how water and magma flow in Dwarf Fortress.

I’m having a surprisingly(?) difficult time of it…

Tags:

### 10 Responses to “”

1. rburema says:

Not really surprising… fluid dynamics [ http://en.wikipedia.org/wiki/Fluid_dynamics ] is *not* an easy field.
Remember the movie Shrek? Apearantly the hardest ‘shots’ in the movie where Lord Farquaad fills a glass of milk and the whole ‘Shrek showers in mud’ scene.

• Chaoseed says:

But if I simplify the problem enough, I should be able to create a simulation that is easy to implement yet still has some interesting features.

At least, that’s what I keep telling myself…

¯\_(ツ)_/¯

• rburema says:

Well it’s certainly a fun subject that plenty of people have played around with (like the Box2d extension linked by the commenter below for example, I like that one). There is inspiration, ideas and code all over the web.

It’s just that it’s such a textbook example of ‘thing that seems simple on the surface but is actually really complicated’

Good luck anyway!

2. you can take a look on how the guys from google did it over Box2d: https://google.github.io/liquidfun/

3. Evergreen Games says:

Are you trying to make a physics fluid sim, or a tile based sim(water expanding into adjacent tiles)?

• Chaoseed says:

Tile-based.

• Evergreen Games says:

Couldn’t you check each adjacent tile to a water tile and see if it’s empty or not, then if it is empty change it to water?

• Chaoseed says:

Unfortunately, I wanted something more complicated than that. I wanted varying levels of ‘fluid’, for example, as well as flow. What I REALLY want is a continuous flow from a source to a sink. We’ll see if I can manage it. 😉

4. Tim Bumpus says:

Here’s an article on how Dwarf Fortress did fluid dynamics, if that helps: http://www.gamasutra.com/view/feature/131954/interview_the_making_of_dwarf_.php?page=9

• Chaoseed says:

Interesting stuff! I eventually came to a similar conclusion, that for my purposes I couldn’t have a calculation that was totally local.

[cache: storing page]