Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Megaproject performance dilemma  (Read 1311 times)

csebal

  • Bay Watcher
    • View Profile
Megaproject performance dilemma
« on: August 31, 2010, 04:50:29 am »

Okay, so here i am planning on building a pretty straightforward megaproject, the Great Urist Dam. Its a 5x5 embark location, with a nice brook in a valley splitting the landscape in two. About 10-15z levels of mountains on both sides from the ground (brook) level.

The dam i'm planning would split the map in half, and would be about 10 z high. Here are the things im wondering about:
- Can an area this large be filled without the water evaporating and / or the game dying halfway through the filling process? after all, we are talking about 2x2 embark tiles worth of water, 8-9 z levels high on average.
- Would the water getting in contact with the original brook cause me any problems? I do not intend to block its path, but as we all know, water travels down first and then it teleports onto the first accessible open square on that level, so i guess it would try to fill the riverbed i'm pumping from. I guess i might have to install some floodgates there to prevent the stuff im pumping from flowing out under the dam. How about after i filled the dam? Would i open the floodgates, i figure the whole lake would empty itself kinda fast into the brook. I think the solution to my problem is to build floorin above the part of the brook that flows under my artificial lake.
- Last, but not least, it is a temperate area, with freezing winters. Am i right in the assumption, that the whole artificial lake would try to freeze during the winter essentially killing my game next spring when it tries to thaw? It would mean, that i either need to build another floor above the water reservoire, or turn off temperatures for the game.

Another interesting feature would be the artificial waterfall that goes around my staircase. It is driven by a 20 z high pump stack of 3 pumps on each level pumping water from an underground tank to the top of the stairs, where it falls around the stairs down right into the tank. My concern here is that such a large body of water being moved would effectively kill my framerate, even without the dam and the rest of the game to begin with.

Any of you done similar things in the past? Whats your experience with these things?
Logged

Bernard

  • Bay Watcher
    • View Profile
Re: Megaproject performance dilemma
« Reply #1 on: August 31, 2010, 06:01:36 am »

If it freezes in winter, I would channel out the brook under the dam and install flood gates to block it, then you can close the floodgates once your dam is finished, and use the brook itself to fill the dam.
Logged

Emily

  • Bay Watcher
    • View Profile
Re: Megaproject performance dilemma
« Reply #2 on: August 31, 2010, 06:56:11 am »

Well, while its filling up, it might be easiest to just wait with the game running in the background.  It'll fill eventually, just at a low framerate.

Evaporation has never been a problem for me when I've had floods.  Lag honestly hasn't been either, but my framerates tend to dive after I pass twenty dwarves anyway, soooo... (slow computer :( )  And with the freezing winters, note that after the water thaws it'll turn anything less than 7 depth into 7, which means that, while yes, the freeze/thaw cycle will cause bits of lag, they will probably help fill a bit faster.

(And really, does the freezing/thawing cycle cause that much more lag than seasonal autosave?  I mean, it's a bit frustrating, but it resolves eventually...)

And yes, you should dam the brook.
Logged

Dorf3000

  • Bay Watcher
    • View Profile
Re: Megaproject performance dilemma
« Reply #3 on: August 31, 2010, 06:57:41 am »

The dam i'm planning would split the map in half, and would be about 10 z high.
A dam in the middle of a v-shaped valley?  And which side do you think the water will stay on, without flowing off the side of the screen?

- Would the water getting in contact with the original brook cause me any problems? I do not intend to block its path, but as we all know, water travels down first and then it teleports onto the first accessible open square on that level, so i guess it would try to fill the riverbed i'm pumping from. I guess i might have to install some floodgates there to prevent the stuff im pumping from flowing out under the dam. How about after i filled the dam? Would i open the floodgates, i figure the whole lake would empty itself kinda fast into the brook. I think the solution to my problem is to build floorin above the part of the brook that flows under my artificial lake.

Yes, yes, yes and yes.  Think of a brook as a dug channel with grates on top, as far as water flow is concerned.  Although you'll still have the problem of water flowing off the edge of the screen.
Logged
I had a tigerman get elected mayor and he promptly mandated 3 bowls of cereal.

csebal

  • Bay Watcher
    • View Profile
Re: Megaproject performance dilemma
« Reply #4 on: August 31, 2010, 07:25:03 am »

As for the map edges, if I'm not mistaken, the surface map edges do not leak water, that is, the edge of the map acts as some sort of force field, that keeps the water on the map.. I remember to have seen quite a few fortresses with the map flooded with water and/or magma around the fortress in 40d, right up to the map edge. This might have changed of course, but i do not see why it would have. The only way to leak fluids off the map to my knowledge is either to use the brook's 'exit' tiles, some sort of chasm, or fortifications carved into the edge of the map.

The thawing seems really bad. I'm a patient man, but i started a game on a lake map recently and it froze for like 15+ minutes at which time i just gave up waiting for it :) This dam would have about twice as much water as that lake had, thats why i'm a bit concerned. As far as filling the artificial lake is concerned however, you might be right on freezing being a bit of a help. As for my regular FPS, at 120 dwarves the game ticks at about 75 FPS which dipped to 40-50ish, when i was filling the underground tank for my waterfall. It really only was 3 pumps pumping water out of the brook into a 3 tile wide channel leading to a 20x20 2z deep water tank, so nothing fancy compared to a 20z high pump stack and a similarly high waterfall occupying a total of 12 tiles around a 3x3 staircase.

Its setup like this:

Code: [Select]
.www.
wXXXw
wX Xw
wXXXw
.www.


w=>channeled tile with floor grates where the water is falling
.=>floor grates on the corners
X=>up/down stairs
 =>wall in the middle

One concern i have is water splashing around the grates, washing dwarves down the stairs. But i guess that hatches on each level might solve that problem.
Logged

Emily

  • Bay Watcher
    • View Profile
Re: Megaproject performance dilemma
« Reply #5 on: August 31, 2010, 07:35:45 am »

I'm fairly certain water flows off the edge of the map fine.  At least, it has for me.

And yes, your framerates are ludicrously fast compared to what I tend to have.  So I guess the hit from intensive pumping would be more frustrating.

And as for thawing, that's why I suggested leaving in in the background and doing something else :P  But yeah, turning off temperature is probably your best bet; just don't do it until after you've managed to dam the river; my attempts to dam a river when it wasn't frozen have proven that it is quite frustrating.
Logged

csebal

  • Bay Watcher
    • View Profile
Re: Megaproject performance dilemma
« Reply #6 on: August 31, 2010, 08:25:22 am »

Thanks for the input, Emily. I will have to make a proof of concept on that map edge water issue, to see what actually happens.
Logged

Sphalerite

  • Bay Watcher
    • View Profile
    • Drew's Robots and stuff
Re: Megaproject performance dilemma
« Reply #7 on: August 31, 2010, 08:32:06 am »

Water and magma both flow off the map edges in DF2010.  In 40d water would flow off the map edges, but magma would not, so it was possible to block the map edge with a magma moat.  In either case, you can't build a reservoir that touches the map edge, because water will drain off the edge of the map.

Brook tiles are transparent to water, and will conduct water to the map edge, so your brook needs to be isolated from your water reservoir.
Logged
Any intelligent fool can make things bigger and more complex... It takes a touch of genius --- and a lot of courage to move in the opposite direction.

csebal

  • Bay Watcher
    • View Profile
Re: Megaproject performance dilemma
« Reply #8 on: August 31, 2010, 08:43:26 am »

Yea, just checked it out. It made me a real sad little dwarf. Not that i couldnt make a wall at the other end of the lake as well, just 5 tiles from the map edge, but it will definitely not look as cool as it would without that.
Logged

Retro

  • Bay Watcher
  • o7
    • View Profile
Re: Megaproject performance dilemma
« Reply #9 on: August 31, 2010, 10:29:20 am »

A very relevant bug: http://www.bay12games.com/dwarves/mantisbt/view.php?id=2270

1/7 water will evaporate over 7/7 water, just as if it was above ground. So you'll need a water source powerful enough to fill the dam quickly enough without getting stuck in between filling and evaporating. Or, if you're very patient, you can wait ten years if your map freezes for the 1/7s to freeze and thaw as 7/7s.