Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Generalize the fluid object and use contaminants to define the liquid.  (Read 1042 times)

Adrian

  • Bay Watcher
    • View Profile

I'm not all that good at explaining stuff, so bear with me.

Basically water and magma get generalized into an ambiguous "fluid", which is then defined by it's contaminants.
Clear freshwater would then be a fluid "contaminated" for 100% with water, and blood a fluid "contaminated" for 100% with blood.

In addition to equalizing depth, a fluid tile would look to it's eight neighbors and also equalize their contaminants across the nine of them.
Why is this significant? Because it allows contaminants to get diluted.
For instance: A 7/7 tile of booze surrounded by eight tiles of 7/7 fresh water would dilute into nine tiles of 7/7 fluid "contaminated" with 0.11 booze & 0.89 water. This dilution could go on for a while, depending on how many decimals we're willing to store. But eventually things would be diluted into oblivion. (Diluting the last decimal by at least half)

I'm sure you're inventive enough to think of dwarfy uses for a fluid system like this, but my favorite would be the river in evil regions spawning blood instead of water.
Logged

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Generalize the fluid object and use contaminants to define the liquid.
« Reply #1 on: February 06, 2015, 02:22:38 am »

It kind of only makes sense with water (magma burns contaminants anyways.) And even then, you'd expect certain different fluids to behave differently, which ruins the point of generalizing them. Not to mention special cases like oils and water not mixing.
« Last Edit: February 06, 2015, 02:24:40 am by Bumber »
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

That Wolf

  • Bay Watcher
  • Yes, that Wolf
    • View Profile
Re: Generalize the fluid object and use contaminants to define the liquid.
« Reply #2 on: February 06, 2015, 09:49:37 am »

I like it, to the point where you could get a bit of magma and chuck copper into it and dilute the magma with copper to the point of it being just molten copper, then pour it on gobs, donate it to the elves, or simply spread it on your morning toast with a hot cup of coffee,

After the molten metal has cooled you could have some statues of han solo goblins and othet beasties. Or re use it.
While bumber did say magma destroys contaminants I believe I saw molten copper hanging around after I flooded my fort
Logged
I am not afraid of an army of Warriors led by a Child; I am afraid of an army of Children led by a Warrior.

Sizik

  • Bay Watcher
    • View Profile
Re: Generalize the fluid object and use contaminants to define the liquid.
« Reply #3 on: February 06, 2015, 09:59:17 am »

Ideally, magma's "contaminants" would be the different minerals that it's composed of. As for water/oil interaction, the easiest solution (heh) is to classify liquids as polar/non-polar (and materials as hydrophilic/lipophilic, for being dissolved by the respective liquids), with only same-polarity liquids mixing.
Logged
Skyscrapes, the Tower-Fortress, finally complete!
Skyscrapes 2, repelling the zombie horde!

Bumber

  • Bay Watcher
  • REMOVE KOBOLD
    • View Profile
Re: Generalize the fluid object and use contaminants to define the liquid.
« Reply #4 on: February 06, 2015, 05:00:47 pm »

I like it, to the point where you could get a bit of magma and chuck copper into it and dilute the magma with copper to the point of it being just molten copper, then pour it on gobs, donate it to the elves, or simply spread it on your morning toast with a hot cup of coffee,

After the molten metal has cooled you could have some statues of han solo goblins and othet beasties. Or re use it.
While bumber did say magma destroys contaminants I believe I saw molten copper hanging around after I flooded my fort
I forgot about molten metal.
Cupric Copperfinger: No Mr. Awemedinade, I expect you to die.

Ideally you should be able to make most fluids without adding the contaminants to a base liquid if you can actually get enough in one tile.
Logged
Reading his name would trigger it. Thinking of him would trigger it. No other circumstances would trigger it- it was strictly related to the concept of Bill Clinton entering the conscious mind.

THE xTROLL FUR SOCKx RUSE WAS A........... DISTACTION        the carp HAVE the wagon

A wizard has turned you into a wagon. This was inevitable (Y/y)?

Adrian

  • Bay Watcher
    • View Profile
Re: Generalize the fluid object and use contaminants to define the liquid.
« Reply #5 on: February 10, 2015, 08:19:23 am »

Oil and water already don't mix, because there aren't any liquid oils right now. Immiscible fluids could be simulated, by using an order-of-reaction thing where the least dense immiscible contaminant in a tile is interacted with first until it is depleted.
For example: Drinking from an oil contaminated river would net you a mouth full of oil instead of water, because the oil is the least dense of the two.
As for deeper bodies of water, the equalization step in the fluid simulation could send the least dense of the immiscible contaminants to the tile above, if the one above contains the denser contaminant.

Ideally you should be able to make most fluids without adding the contaminants to a base liquid if you can actually get enough in one tile.
You mean like a reaction at a smelter that outputs a crucible of molten metal? Because that sounds pretty simple to do.
Or did you mean bleeding your enemies dry over a trench to make a moat of elven blood? Because i think it's reasonable to assume that X units of blood equate to 1/7 fluid. And that creature size is proportional to the amount of blood a creature has.
Logged