Bay 12 Games Forum

Please login or register.

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

Author Topic: Why is water 7/7 instead of just 7?  (Read 3700 times)

Fen

  • Bay Watcher
  • Secretly A Kobold Werebull
    • View Profile
Re: Why is water 7/7 instead of just 7?
« Reply #15 on: May 05, 2013, 05:41:50 pm »

Wait, I was right about the water being calculated as sevenths? wat.

wat.


waaaaaaaaaaaaaaaaaaaat.
Logged
This space for rent

Raphite1

  • Bay Watcher
    • View Profile
    • Beards and Brimstone
Re: Why is water 7/7 instead of just 7?
« Reply #16 on: May 05, 2013, 10:53:11 pm »

Liquids are 7/7 for the same reason that boxing and mma rounds are scored from 7-10 instead of 0-3.

Miuramir

  • Bay Watcher
    • View Profile
Re: Why is water 7/7 instead of just 7?
« Reply #17 on: May 06, 2013, 12:52:04 pm »

... While I admit I love the analysis you performed, if the 12 cubic meters is to be believed to be true, that results in 3170.06463 US gallons according to Bing. Making a bucket equal to 452.8 gallons, and a "drink" = 45.28 gallons. According to my "research" there are about 4.7 to 5 liters of blood in the average human body, which is about 1.3 gallons.

This conversation has occurred before; see this thread from May 2012 for some more numbers and discussion. 

tl;dr: If you convert everything out to "per day" terms averaged out over a year it makes a lot more sense. 
Logged

Werdna

  • Bay Watcher
  • Mad Overlord
    • View Profile
Re: Why is water 7/7 instead of just 7?
« Reply #18 on: May 06, 2013, 01:48:07 pm »

While I admit I love the analysis you performed, if the 12 cubic meters is to be believed to be true, that results in 3170.06463 US gallons according to Bing. Making a bucket equal to 452.8 gallons, and a "drink" = 45.28 gallons. According to my "research" there are about 4.7 to 5 liters of blood in the average human body, which is about 1.3 gallons.

Hypothesis - the other 40+ gallons are stored for later use within their naturally absorbent beards.
Logged
ProvingGrounds was merely a setback.

Sanctume

  • Bay Watcher
    • View Profile
Re: Why is water 7/7 instead of just 7?
« Reply #19 on: May 06, 2013, 05:06:09 pm »

I think Toady chose 7 to represent water levels because it would be the least amount of memory (RAM) use. 
It uses 3 bits
000 = 0 decimal
001 = 1
010 = 2
011 = 3
100 = 4
101 = 5
110 = 6
111 = 7

Now this leaves 5 bits to represent a tile. 
So conveniently using 1 byte (8 bits = 1 byte, or 1 char / 1 character) in memory to represent the tile.

Catsup

  • Bay Watcher
    • View Profile
Re: Why is water 7/7 instead of just 7?
« Reply #20 on: May 06, 2013, 05:30:45 pm »

7/7 is comforting, it signifies that the lake is entirely full. 7 is just...not as comforting, it makes you wonder "perhaps it might fill up more?".

BoredVirulence

  • Bay Watcher
    • View Profile
Re: Why is water 7/7 instead of just 7?
« Reply #21 on: May 06, 2013, 09:34:04 pm »

This conversation has occurred before; see this thread from May 2012 for some more numbers and discussion. 

tl;dr: If you convert everything out to "per day" terms averaged out over a year it makes a lot more sense.
Yeah, I thought the same thing, after all they have 1 drink per season right? Not sure if I ever said it though...
Still comical.
Logged

Baccar Wozat

  • Bay Watcher
  • [VAMPOW]
    • View Profile
    • My Fortresses
Re: Why is water 7/7 instead of just 7?
« Reply #22 on: May 07, 2013, 12:18:05 am »

I had figured this out some months ago but I forgot about it.

Something like...

3 bits for the number
1 bitflag for water
1 bitflag for magma

Or maybe it was 1 switch for water/magma and 1 for on/off.

Anyway, those who use DFHack can probably figure out how it works.
Logged

Halceon

  • Bay Watcher
  • [PREFSTRING:vile machinations]
    • View Profile
Re: Why is water 7/7 instead of just 7?
« Reply #23 on: May 07, 2013, 01:23:48 am »

Frankly I think the op is just having some minor OCD issues with it and, as the poster above me said, this is hardly the fiddly-est issue with the interface.

Also, consider that seven is an important number in this game, hint: how many dwarves does every embark begin with, by default? Ayup. That's why Toady picked seven, at least in my interpretation. Seven clearly is Armok's Holy Number.

Well, no. Water goes up to 7, because that's 8 distinct states of wateredness (0 included). And that can be described using 3 bits. Add one bit to describe whether it's water or magma and you still have a half byte to add hidden fun stuff to that tile.
Logged
I'm looking for your fort, maybe. Find out - http://www.bay12forums.com/smf/index.php?topic=124606.0
ág sôd onol nekik
edir thol, kor egar
    berdan kälán
    alod kodor
absam abal aroth limul

Hamiltonz

  • Bay Watcher
    • View Profile
Re: Why is water 7/7 instead of just 7?
« Reply #24 on: May 07, 2013, 09:38:41 am »

The way I'd do it is to have three bits for water and three bits for magma.  Then a check for the presence of both.  If water is 1 then delete the water, leave the magma.  If both are above two delete both and replace with obsidian.

I know this offends most peoples' idea of efficiency, but this is efficient in other ways than memory usage.  The three bits parts is already very efficient.  There is no need to go overboard.

If one where to use the same bits for depth and another set for liquid type then all the checks for interaction would need to be made one tick early, and for every square those liquids could come from.  By allowing multple liquids to move into the same square you reduce the computational cost by 26/27th.  You also remove the need to check every single tick.  It's not the end of the world to have both water and lava in the same square for a couple of ticks before generating steam and obsidian.  But now this gets into reproduceablity issues.  If the game needs a replay feature then the coder has to regulate when these checks occur.  Either every single tick, or every 12th tick, etc.

If you want to know more about this sort of thing look up "collision detection".
Logged

MadocComadrin

  • Bay Watcher
  • A mysterious laboratory goblin!
    • View Profile
Re: Why is water 7/7 instead of just 7?
« Reply #25 on: May 07, 2013, 09:47:44 am »

Frankly I think the op is just having some minor OCD issues with it.
Please don't use OCD to describe nitpicking.
Logged
Pages: 1 [2]