Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 3 4 [5]

Author Topic: I proppose a new-ish fluid sistem.  (Read 9636 times)

harborpirate

  • Bay Watcher
  • cancels eat: job item lost or destroyed.
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #60 on: November 23, 2011, 12:12:35 pm »

Given how pressure works in DF, it wouldn't be easy to make water push other liquids. So you may as well do it right and layer them.

The effect of pushing occurs as a natural outcome of the scenario I described. Nothing special has to occur other than the one look behind/attempt to combine step.

I'm not so sure that layering alleviates all the problems of pressure calculations in the presence of multiple liquids. You'd at least have to calculate the sum of the total depth stored in the new data structure prior to making every pressure calculation.

Its really hard to say just how painful each of these options would be without seeing the details of the code; and we know that isn't going to happen.

That said, I have to agree that the biggest issue with tile swapping is the one you mentioned a couple of posts ago, where depth doesn't match and tiles can't be combined; like a 1/7 oil tile moving around a reservoir full of 7/7 water. It would just look strange.
Logged

harborpirate

  • Bay Watcher
  • cancels eat: job item lost or destroyed.
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #61 on: November 23, 2011, 12:22:50 pm »

Did you guys like totally not even read what I just said?

Anyway, tile swaping IS a dumb idea. One tile can have 7 units of ANY kind of liquid at once. Dont you understand. This means that the tiles dont have to "swap", the water and oil can just mix on a tile basis. They wont create a new liquid but they will mix in one tile. the 7/7 water will go over the 1/7 tiles of oil and the oil will be on the top.

I saw it. I'm a bit confused as to whether you're saying in the above that:
1) You'd end up with a tile of "wateroil"
2) The oil tile would be pushed up to the next z level
3) We should allow multiple liquids in a single tile as everyone else is suggesting
Logged

antymattar

  • Bay Watcher
  • *Antymattar has created a Cat-ass-trophy*
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #62 on: November 23, 2011, 12:32:02 pm »

The third. The whole bloody idea of the suggestion is that multiple liquids can be located in one tile. The two liquids CAN be located in one tile. The possibility that they make something is just a side effect. Il just draw it.

So you have a tile of seven water units

_
_
_
_
_
_
_


but you can also have a tile with some water and have the rest be units of oil.

_
_
_

_
_
_
_


Brown being oild in this case. The whole stack above is just one tile. As I said in the beginning.

King Mir

  • Bay Watcher
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #63 on: November 23, 2011, 01:17:14 pm »

Did you guys like totally not even read what I just said?

Anyway, tile swaping IS a dumb idea. One tile can have 7 units of ANY kind of liquid at once. Dont you understand. This means that the tiles dont have to "swap", the water and oil can just mix on a tile basis. They wont create a new liquid but they will mix in one tile. the 7/7 water will go over the 1/7 tiles of oil and the oil will be on the top.
I was responding to harborpirate alternative of having mixing work like a block level cellular automaton.

Given how pressure works in DF, it wouldn't be easy to make water push other liquids. So you may as well do it right and layer them.
The effect of pushing occurs as a natural outcome of the scenario I described. Nothing special has to occur other than the one look behind/attempt to combine step.

I'm not so sure that layering alleviates all the problems of pressure calculations in the presence of multiple liquids. You'd at least have to calculate the sum of the total depth stored in the new data structure prior to making every pressure calculation.

Its really hard to say just how painful each of these options would be without seeing the details of the code; and we know that isn't going to happen.

That said, I have to agree that the biggest issue with tile swapping is the one you mentioned a couple of posts ago, where depth doesn't match and tiles can't be combined; like a 1/7 oil tile moving around a reservoir full of 7/7 water. It would just look strange.
But how would it know to attempt to combine? A simple swap would involve only two tiles, the 7/7 and the 1/7. That's simple. Checking that there are additional 1/7 tiles around so that the liquids could balance out at 4/7+3/7+2/7 would not be as trivial.

And we can estimate how hard it is to code something. We don't know about the state of Toady's code, but we can estimate how hard it would be to code from scratch. Also, we know how water currently behaves. It's unlikely Toady coded it is a strange way, so we can guess at the current code pretty well too.

Re: layering
I agree that that's the right way to do it, but that does add it's own mixing challenges. For instance: if shallow water and oil mix then the two can just spread out independently. However, if you have two adjacent tiles with no air gap you would still want the oil to spread out.
« Last Edit: November 23, 2011, 01:28:49 pm by King Mir »
Logged

knutor

  • Bay Watcher
  • ..to hear the lamentation of the elves!
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #64 on: November 23, 2011, 02:37:58 pm »

but you can also have a tile with some water and have the rest be units of oil.

_
_
_

_
_
_
_


Brown being oild in this case. The whole stack above is just one tile. As I said in the beginning.

And which liquid would a dwarf of lv.1 swimming and a maple bucket be able to retrieve?
How would this ruin the buckets, some can't be used after contact with certain things?  Lye.

In this example I would rather it took on the bottom 4/7, since it is in majority, whatever that is.  Unless it was magma and water, I like having a way to form obsidian.  I would like one other step, and be able to form Adam Ant from obsidian.  He could always sing good.

Maybe this new-ish fluid system could be an extension of obsidian creation, linking it to another coveted compound. 

It certainly opens the door to many ideas.  Like including radioactivity, and magnitism.  Should be able to make compasses in this game.  To help traveling dwafs move quicker to their destinations.
Logged
"I don't often drink Mead, but when I do... I prefer Dee Eef's.  -The most interesting Dwarf in the World.  Stay thirsty, my friend.
Shark Dentistry, looking in the Raws.

antymattar

  • Bay Watcher
  • *Antymattar has created a Cat-ass-trophy*
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #65 on: November 23, 2011, 03:34:19 pm »

...And we can estimate how hard it is to code something. We don't know about the state of Toady's code, but we can estimate how hard it would be to code from scratch. Also, we know how water currently behaves. It's unlikely Toady coded it is a strange way, so we can guess at the current code pretty well too.

Re: layering
I agree that that's the right way to do it, but that does add it's own mixing challenges. For instance: if shallow water and oil mix then the two can just spread out independently. However, if you have two adjacent tiles with no air gap you would still want the oil to spread out.
Of course they can spread out evenly. Thats the idea. They are all liquids anyway And yes, the liquids will spread out in a room. If you have a room filled with water and a single tile of oil  in the middle, then the oil would still spread out throughout the water. It wouldbe a bit harder to code and would cost some more cpu, but then again, complex calculations must be done only if twoor more fluids are present in one tile. therefor rivers and oceans are still embarkable... ish.

And which liquid would a dwarf of lv.1 swimming and a maple bucket be able to retrieve?
How would this ruin the buckets, some can't be used after contact with certain things?  Lye.

In this example I would rather it took on the bottom 4/7, since it is in majority, whatever that is.  Unless it was magma and water, I like having a way to form obsidian.  I would like one other step, and be able to form Adam Ant from obsidian.  He could always sing good.
???... :o... ::)...Oh  I see what you did there. Yeah, someliquids MIGHT be made possible to become other liquids inthe same tile if theres a majority. Cool idea.

Maybe this new-ish fluid system could be an extension of obsidian creation, linking it to another coveted compound. 

It certainly opens the door to many ideas.  Like including radioactivity, and magnitism.  Should be able to make compasses in this game.  To help traveling dwarfs move quicker to their destinations.
you lost me  :(... oh wait maybe not(I write as I think) Radioactivity and magnetism would be !!fun!! to ad to liquids however I dont understand how compasses tie into it all.

knutor

  • Bay Watcher
  • ..to hear the lamentation of the elves!
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #66 on: November 23, 2011, 04:18:46 pm »

Should be able to make compasses in this game.  To help traveling dwarfs move quicker to their destinations.
magnetism would be !!fun!! to ad to liquids however I dont understand how compasses tie into it all.

An ionized sword blade(beaten on an anvil), when dropped in a pool of water, like Excalibur will plummet to the bottom, always pointing West.  West is on top of maps in Middle Earth.  The one's dwarfs draw.  Hope they mention that in the upcoming movie, Hobbit, its a little known Tolkien fact.  The top of a Moria map is always West.

Or in the case of our world.  Take a needle and rub it on your sleeve, to make static, then plop it in a cup of clean clear drinking water.  It will spin to N, if its lighter than water, it'll hold its position there, and not sink.  At that point a person can reconnoiter true North, or their direction as opposed to North.

Thats every bit dark age tech.  Ha!  Oh crap we are lost and going insane, tech, too.  Could be voodoo tech, if it were a doll needle.  Heck, imagine the possibilities!  I like this idea, aslong as the mixture of fluids in this new system weren't too gosh darn complex.

Sincerely,
Knutor

Logged
"I don't often drink Mead, but when I do... I prefer Dee Eef's.  -The most interesting Dwarf in the World.  Stay thirsty, my friend.
Shark Dentistry, looking in the Raws.

antymattar

  • Bay Watcher
  • *Antymattar has created a Cat-ass-trophy*
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #67 on: November 23, 2011, 04:25:57 pm »

Thats every bit dark age tech.  Ha!  Oh crap we are lost and going insane, tech, too.  Could be voodoo tech, if it were a doll needle.  Heck, imagine the possibilities!  I like this idea, aslong as the mixture of fluids in this new system weren't too gosh darn complex.

Sincerely,
Knutor
They shouldnt be. The game isnt going to have elemental fluids and all that base non-base nonsense. Just reactions as you define them. Thaks.  :)

harborpirate

  • Bay Watcher
  • cancels eat: job item lost or destroyed.
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #68 on: November 23, 2011, 10:08:20 pm »

But how would it know to attempt to combine? A simple swap would involve only two tiles, the 7/7 and the 1/7. That's simple. Checking that there are additional 1/7 tiles around so that the liquids could balance out at 4/7+3/7+2/7 would not be as trivial.

Probably should have gone into a bit more depth on that, I figured the best way is to only look at the tile directly away from the one encountered that contains a different type, and if it can't combine, just do the swap as normal. This would allow for non-full tiles to wander around for a time, which again would definitely look strange, but eventually they'd combine with the others of their kind.

And we can estimate how hard it is to code something. We don't know about the state of Toady's code, but we can estimate how hard it would be to code from scratch. Also, we know how water currently behaves. It's unlikely Toady coded it is a strange way, so we can guess at the current code pretty well too.

We have a vague idea, but there are two unknowns that make it difficult:
1. We don't know what data structures he's using and how he's using them, and just how much of the surrounding code is tied to the assumption that the liquid contents of a tile can be treated as a single number.
2. We haven't come up with the general purpose algorithm and analyzed the edge cases of the primary system everyone is in favor of.

In my opinion, this makes it more of a "gut feeling" than a real estimate, but gut feelings are valid too. I happen to agree with your assessment in this case, but one thing I wanted to make clear is that we are making assumptions, and we should be clear about what those assumptions are.

Re: layering
I agree that that's the right way to do it, but that does add it's own mixing challenges. For instance: if shallow water and oil mix then the two can just spread out independently. However, if you have two adjacent tiles with no air gap you would still want the oil to spread out.

The biggest challenge I can think of with multiple liquids per tile is making the exchange process take place when multiple liquids are present without hammering the CPU.
The most obvious approach is to search each element of the entire liquid storage structure of tile 1 against each element of tile 2, complete a reaction if reacting elements are found in that search, then if not and if there is sufficient difference, exchange this liquid for a different liquid or liquids which would have to somehow have been chosen along the way. (That last part would be quite tricky)

Another option that came to mind is to take all of the array elements from both and put them into a single structure that contains all possible types, compute reactions, and then split it back up and assign the results back to both tiles.
Logged

antymattar

  • Bay Watcher
  • *Antymattar has created a Cat-ass-trophy*
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #69 on: November 26, 2011, 02:16:50 am »

Ok. So I think this is about done. We'll just package it up and ship it then.  8)

Buttery_Mess

  • Bay Watcher
  • 11x11
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #70 on: November 27, 2011, 08:59:25 pm »

We all want a more robust fluid system so we can dick around with boiling oil, fountains of ale, and use magma to cast alloys en masse, not so mention sewage handling. The calculations required are potentially game breaking to FPS though. Let's wait for Moore's Law to catch up with Dwarf Fortress please, shall we?
Logged
But .... It's so small!
It's not the size of the pick that counts... it's the size of the man with the pick.
Quote from: Toady One
Naturally, we'd like to make life miserable for everybody, randomly, but that'll take some doing.

antymattar

  • Bay Watcher
  • *Antymattar has created a Cat-ass-trophy*
    • View Profile
Re: I proppose a new-ish fluid sistem.
« Reply #71 on: November 28, 2011, 06:06:12 am »

Nah. Moores law can wait.  :P
Pages: 1 ... 3 4 [5]