Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: Dorf Bath Help! >,<  (Read 1582 times)

Sadrice

  • Bay Watcher
  • Yertle et al
    • View Profile
Re: Dorf Bath Help! >,<
« Reply #15 on: May 11, 2011, 11:57:28 pm »

if water levels were floating point numbers, i dont think you would see the weird wandering units of water traveling across a body of water that you are adding to.  if you add a lot of water (draining something into a cave lake, for instance), you will see whole flocks of units of water moving in synchrony, wandering about, trying to find a lower level to disperse to.  if they were floats, they would even out and homogenize, making a flat 3.2/7 water level, instead of 3/7 with one in five tiles occupied by a semirandomly moving 4/7.
Logged

Uristocrat

  • Bay Watcher
  • Dwarven Railgunner
    • View Profile
    • DF Wiki User Page
Re: Dorf Bath Help! >,<
« Reply #16 on: May 12, 2011, 12:19:40 am »

3/7 is not always 3/7 though.

Create a 2x2 bath, fill it with a pond zone until all the tiles show 6/7.  Then enlarge it by 4 tiles so that everything reads 3/7.  Even though all 8 tiles read 3/7,  you'll find that you can't path through it until at least one of the tiles drops to 2/7.  Usually by digging out a 9th square.  That happens to me often enough in 31.18 and 31.25 that there's definitely something strange.

Which is why I say that the bath should have 2/7 in at least one tile and 2/7 or 3/7 in all the other tiles.

(My theory is that water levels are actually calculated as floating point numbers, and 3/7 can be anything from 3.0 up to 3.4.  Because all the tiles read 3/7, but the dwarves won't cross.)

You might have to wait for water to stop sloshing about in that case.  You might have water sloshing around for a while leaving you with 4/7 in one place and 2/7 in another.  I know for a fact that all my bathtubs, in which I have at a steady 3/7 in every square, do not cause pathing issues.  I can also almost guarantee that water level is an integer.  I think Toady packs it into 4 bits, to pack the values tightly and save on memory.  A look at the source code to dfliquids would probably confirm that one way or the other.
Logged
You could have berries on the rocks and the dwarves would say it was "berry gneiss."
You should die horribly for this. And I mean that in the nicest possible way.

Halnoth

  • Bay Watcher
  • Plan for the Worst. Hope for the Best. Have Fun!
    • View Profile
Re: Dorf Bath Help! >,<
« Reply #17 on: May 12, 2011, 03:40:50 am »

If you want a working pump bath design I make one in almost all my forts now after the success of my first endeavor. You can find the plans on this thread http://www.bay12forums.com/smf/index.php?topic=69751.15
Logged
One of the dwarfs walked in front of Thor to get a better view of the prye, and Thor kicked him irritably into the middle of the flames, which made Thor feel slightly better and made all the dwarfs feel much worse.

Cloth Armor Mod http://www.bay12forums.com/smf/index.php?topic=158967.msg7063531#msg7063531

Disquiet

  • Bay Watcher
    • View Profile
Re: Dorf Bath Help! >,<
« Reply #18 on: May 12, 2011, 03:41:44 am »

The last time I tried to create an automated dwarf bathing system failed miserably. Unless something about blood has changed since .12, attempting to bath dwarves results in endless duplication of blood creating a massive bloody torrent instead of cleaning anyone.

My system had a waterfall going through grates on the entrance to my dining room. I would NOT recommend this as it is simply a blood production machine. If anyone figures out a cleaning system that actually works I'd be interested.
Logged

Halnoth

  • Bay Watcher
  • Plan for the Worst. Hope for the Best. Have Fun!
    • View Profile
Re: Dorf Bath Help! >,<
« Reply #19 on: May 12, 2011, 04:16:07 am »

The last time I tried to create an automated dwarf bathing system failed miserably. Unless something about blood has changed since .12, attempting to bath dwarves results in endless duplication of blood creating a massive bloody torrent instead of cleaning anyone.

My system had a waterfall going through grates on the entrance to my dining room. I would NOT recommend this as it is simply a blood production machine. If anyone figures out a cleaning system that actually works I'd be interested.

I just posted one.
Logged
One of the dwarfs walked in front of Thor to get a better view of the prye, and Thor kicked him irritably into the middle of the flames, which made Thor feel slightly better and made all the dwarfs feel much worse.

Cloth Armor Mod http://www.bay12forums.com/smf/index.php?topic=158967.msg7063531#msg7063531

Girlinhat

  • Bay Watcher
  • [PREFSTRING:large ears]
    • View Profile
Re: Dorf Bath Help! >,<
« Reply #20 on: May 12, 2011, 04:29:53 am »

Water (and magma) is NOT a floating point.  It is, in fact, a bit (or is it a byte?  I think it's a bit...).  Water goes so high as 7/7 because that's 8 values, 1-7 and "dry" 0.  This means that every tile on the map has a single bit attached to it, determining what depth of water it's at from 0-7, and a Boolean for water/magma.  At least, I suspect the boolean.  It would only need to determine "this is water, or this is magma" and wouldn't need to state "this is dry".  0/7 water and 0/7 magma are both dry, so a distinction in the type of dryness would be moot.  Either way, it's somewhat well known that fluid level is a bit because this leads to very clean memory mapping.

Sadrice

  • Bay Watcher
  • Yertle et al
    • View Profile
Re: Dorf Bath Help! >,<
« Reply #21 on: May 12, 2011, 04:07:14 pm »

A bit is just a 0 or a 1, encoding two possibilities.  A byte is eight of those, encoding 2^8, or 256 possibilities.  To have exactly eight possible values you need 3 bits, because 8 = 2^3.  I suspect he uses four bits, sometimes called a nybble, with the fourth bit as a boolean, specifying water/magma, as you hypothesized.
Logged
Pages: 1 [2]