Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: sticky fluids  (Read 874 times)

int

  • Escaped Lunatic
    • View Profile
sticky fluids
« on: June 19, 2012, 04:05:50 pm »

I understand that magma/lava isn't really affected by pressure and doesn't have any visible flow. This is probably to give it more of a slow moving and "sticky" effect than water but I think there is a better way to do this.  I would suggest making a new integer variable of range 1 to 7 called "stick" for each fluid which would decide how "sticky" that fluid is.  How it would work is that fluids won't space out naturally (or flow) if their amount in a specific space is less than or equal to their fluid's stick variable.  For instance: water would have a stick value of 1 meaning it will always space out whenever it can while magma would have a higher stick value like 3 or 4 meaning it won't flow out naturally from a space if that specific space has an amount less than or equal to 3 or 4 (thus making it take longer to spread out).  This would allow people to customize the flow rates of specific fluids and would allow water/magma to share the same code for their behavior for the most part.  It would also mean that magma can be easily animated to show flow now that it behaves more like water.  You could even set the stick value of a certain fluid to 7 meaning it will never space out/flow naturally.  I really don't know what you're current code for fluids looks like or if this is really that helpful/useful of an idea so I'll just have to see how people respond to this.
Logged

Mrhappyface

  • Bay Watcher
    • View Profile
Re: sticky fluids
« Reply #1 on: June 19, 2012, 09:53:34 pm »

Please word your title better. Honestly though, it's a neat idea.
Logged
This is Dwarf Fortress. Where torture, enslavement, and murder are not only tolerable hobbies, but considered dwarfdatory.

Itsdavyjones

  • Bay Watcher
    • View Profile
Re: sticky fluids
« Reply #2 on: June 19, 2012, 10:25:43 pm »

I do agree that this is a neat idea, and what I could see being a 7 with stickiness is snow, if it gets added as a fluid, or maybe a 6.
Logged

nanomage

  • Bay Watcher
    • View Profile
Re: sticky fluids
« Reply #3 on: June 20, 2012, 12:57:00 am »

I think implementing viscosity to more accurately simulate liquid flow would be better than using quite unrealistic "stick number".
While your suggestion is beatifully simple, I regard the idea of 4/7 lava puddle laying indefinitely on the spot as weird. Simulating viscosity would allow to have slower-than-water-flows while still having liquids that spill around.
Adding adhesion would allow for even more precise control of fluid behavior.
I do not know if adding other liquids is ever planned, but if it is, I'd prefer a more versatile and sophisticated fluid dynamics than just the stick number thing.
As for snow thing, wouldn't it be more consistent to treat snow like sands and other granular substances, when the frameworks for those is done?
Logged

Sus

  • Bay Watcher
  • For ‼SCIENCE‼!
    • View Profile
Re: sticky fluids
« Reply #4 on: June 20, 2012, 12:57:29 am »

It's called "viscosity", and there's a couple of threads that cover the subject already, at least tangentially.

But on the whole, realism is always good, in liquids and contaminants as well as anything else. Also, getting all liquids or semisolids (water, magma, blood, pus, vomit,mud...) to behave consistently in accordance to the same rules would kick seven kinds of ass.

edit: Oh Armok, I'm turning into footkerchief! D:
Logged
Certainly you could argue that DF is a lot like The Sims, only... you know... with more vomit and decapitation.
If you launch a wooden mine cart towards the ocean at a sufficient speed, you can have your entire dwarf sail away in an ark.

weenog

  • Bay Watcher
    • View Profile
Re: sticky fluids
« Reply #5 on: June 20, 2012, 01:05:36 am »

I propose "Fluid Viscosity Change" as the newer, less suggestive thread title.

I don't know if this suggestion is the way to go, but I would like to see some better viscosity modelling along with some new fluids.  Buckets of coal-tar creosote or something like juniper pitch, and a ready source of fire, could make catapults a lot more entertaining.

And oil... everyone wants oil.  That stuff is pretty thick in its crude form.
Logged
Listen up: making a thing a ‼thing‼ doesn't make it more awesome or extreme.  It simply indicates the thing is on fire.  Get it right or look like a silly poser.

It's useful to keep a ‼torch‼ handy.

SealyStar

  • Bay Watcher
  • Gargoyles! Psychics!
    • View Profile
Re: sticky fluids
« Reply #6 on: June 20, 2012, 04:40:14 pm »

It would be right up my alley to see a number of new liquids. Oil, slime of some kind, hell, acid...
Logged
I assume it was about cod tendies and an austerity-caused crunch in the supply of good boy points.