Bay 12 Games Forum

Please login or register.

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

Author Topic: A Better Magma Pump Stack  (Read 54122 times)

NecroRebel

  • Bay Watcher
    • View Profile
A Better Magma Pump Stack
« on: December 03, 2010, 11:57:11 pm »

Note: There has been refinements done to the original design posted in this thread that are as effective as the original but much smaller. The best known is as follows:

Casing:
=====
=+++=
==.==
  + 
  . 


With pump added:
=====
=+++=
==%==
  % 
  . 


Pump in this example pumps from south to north. =s refer to walls, +s to floors, .s to channels, and %s to the pump tiles. Like the classic-style pump stacks, the impassible tile of each pump goes directly on top of the passable tile of the pump below. Essentially, this refined design is a classic-style pump stack with the reservoir on each level expanded into a 3x1 space in order to keep the tiles around the pumped tile warm.







As I'm sure many of you are aware, using the standard-style pump stack design on magma causes massive FPS drop. 10-level pump stacks of that style, which is shown on the wiki and is the most commonly-cited style for new players due to its efficiency, can drop a fort at 50 FPS down to 20 while they're running. 30-high stacks can drop 100 FPS forts to single digits. Clearly, this is a large problem. I have come up with an alternative to the standard pump stack design that I have found causes significantly less lag when applied to magma. No noticable amount, in fact, on my current, fairly mature fort.

Spoiler (click to show/hide)

Why, you might ask, does this design cause less lag? I cannot be certain of this, but I have my theories. My thoughts on the matter is that whenever magma moves, squares that are now adjacent to or covered in magma have their temperature recalculated. The same happens when squares cease to be adjacent to or covered in magma.

In a standard pump stack, every few steps magma suddenly appears in a single square, causing the square it is now in, the 8 squares on the same z-level adjacent to that square, the tile directly above it, and the tile directly below it to have their temperature recalculated. As magma is now not in the squares below the pump's input, the counterparts there have their temperature recalculated as well. In short, whenever a pump pulls up magma, 22 temperature recalculations are done. Multiply that by 5, 10, 50, or more, and you force quite a few processor cycles to be taken up. This happens every couple of steps, so it works out to a consistent, massive FPS drop.

My new-style pump stack, on the other hand, keeps magma adjacent to the square being pumped into and out of at all times, so the temperature of the tile the magma is being taken into and out of, as well as the 8 adjacent tiles on the same z-level, is never recalculated. Only the temperature of the squares directly above and below the pump inputs is recalculated, so only 2/11s as many temperature calculations are done. As a result, many, many fewer processor cycles get eaten by this, which equates to far, far less lag.

My own experience thus far is this: I have 2 17-z-level magma pump stacks, one of the old standard style and one of the new style. Both can be shut off with a lever when needed. With neither running, I've been getting ~25 FPS. With the old-style one running, I get ~11 FPS. With the new-style one running, I get ~24 FPS. The difference is clear; whether or not my reasoning behind why the improvement exists is correct, the improvement does exist. Take heed!



tl; dr New pump stack design for magma; perhaps 1/15th the FPS drop. Yay!
« Last Edit: May 29, 2011, 10:54:15 am by NecroRebel »
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

Gara-nis

  • Bay Watcher
    • View Profile
Re: A Better Magma Pump Stack
« Reply #1 on: December 04, 2010, 12:00:04 am »

Well done sir. A thousand engravings will be dedicated in your honor in my latest fort.
Logged

cdrcjsn

  • Bay Watcher
  • My name is Cedric
    • View Profile
    • Familiar Ground, fantasy comedy from a familiar point of view.
Re: A Better Magma Pump Stack
« Reply #2 on: December 04, 2010, 12:16:06 am »

Put this up on the wiki.

Seriously.
Logged
Check out my comic!
http://www.familiar-ground.com
Fantasy Comedy.  Familiar Point of View.

Vehudur

  • Bay Watcher
  • [evil]
    • View Profile
Re: A Better Magma Pump Stack
« Reply #3 on: December 04, 2010, 01:10:44 am »

Awesome.  I love you.
Logged
Quote
...and a third died in his bunk of natural causes - for a dagger in the heart quite naturally ends one's life.

I used to have an avatar, but I was told to remove it after it kept making people go insane.

Quote
We are mere steps from the gates of Hell and the last defenders of Earth.

Xenos

  • Bay Watcher
  • [DWARFINEER]
    • View Profile
Re: A Better Magma Pump Stack
« Reply #4 on: December 04, 2010, 03:01:42 am »

...I wish I had known of this before I built a pump stack for DOMAIN Mk.II...well...time to redo that stack...
Logged
This is a useful feature..and this is DF.. so im gonna assume its bugged
That's what cages and minecart shotguns are for!  We don't need to control them.  We just need to aim them.
[DWARFINEERING]

duckInferno

  • Bay Watcher
    • View Profile
Re: A Better Magma Pump Stack
« Reply #5 on: December 04, 2010, 03:06:30 am »

Nice, thank you for your science.  Now wiki it :D
Logged
HAHAHA YES MY EXPIDITION LEADER IS PARTYING WITH GHOSTS THIS IS THE BEST UPDATE EVER

NecroRebel

  • Bay Watcher
    • View Profile
Re: A Better Magma Pump Stack
« Reply #6 on: December 04, 2010, 03:27:08 am »

...I wish I had known of this before I built a pump stack for DOMAIN Mk.II...well...time to redo that stack...
If you can figure out a good way of retrofitting old-style pump stacks into the new-style without too much difficulty, I'm sure many people would appreciate that. I'm not sure what that would look like, myself; you'd probably have to put in a lot of constructed floors in order to accomodate the changed power-transfer-hole and walkable square locations.

Nice, thank you for your science.  Now wiki it :D
Put this up on the wiki.

Seriously.
Quote from: The Wiki
Because a magma pumpstack is known to cause massive amouts of lag a new type of pump stack was developed that causes a much smaller drop in FPS. If you change the single tile magma chamber at the output of every pump into a 3 by 3 area instead of 1 by 1 then the lag because aprox 1/15 of that caused by the origenal pump stack. This only goes for magma.
I was going to suggest waiting until other people have !!SCIENCE!!'ed the design to put it on the wiki, but it looks like someone has put a few words on the subject up already. I don't mind that someone else did this; I've not edited any wikis, myself, so wouldn't really know how to format it or such stuff  :)

Once additional !!SCIENCE!! is done, if the design holds up as valid, it might be good to put this design under a seperate section on the pump page instead of just stuck into the text of the generic pump stack section. It is a fairly significant deviation from the norm, after all, and the changes aren't really well-explained in what is there now. As I said, though, I'm not really sure how to do that myself, so if someone else would like to, feel free  ;)
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

Xenos

  • Bay Watcher
  • [DWARFINEER]
    • View Profile
Re: A Better Magma Pump Stack
« Reply #7 on: December 04, 2010, 03:35:48 am »

...I wish I had known of this before I built a pump stack for DOMAIN Mk.II...well...time to redo that stack...
If you can figure out a good way of retrofitting old-style pump stacks into the new-style without too much difficulty, I'm sure many people would appreciate that. I'm not sure what that would look like, myself; you'd probably have to put in a lot of constructed floors in order to accomodate the changed power-transfer-hole and walkable square locations.

Nice, thank you for your science.  Now wiki it :D
Put this up on the wiki.

Seriously.
Quote from: The Wiki
Because a magma pumpstack is known to cause massive amouts of lag a new type of pump stack was developed that causes a much smaller drop in FPS. If you change the single tile magma chamber at the output of every pump into a 3 by 3 area instead of 1 by 1 then the lag because aprox 1/15 of that caused by the origenal pump stack. This only goes for magma.
I was going to suggest waiting until other people have !!SCIENCE!!'ed the design to put it on the wiki, but it looks like someone has put a few words on the subject up already. I don't mind that someone else did this; I've not edited any wikis, myself, so wouldn't really know how to format it or such stuff  :)

Once additional !!SCIENCE!! is done, if the design holds up as valid, it might be good to put this design under a seperate section on the pump page instead of just stuck into the text of the generic pump stack section. It is a fairly significant deviation from the norm, after all, and the changes aren't really well-explained in what is there now. As I said, though, I'm not really sure how to do that myself, so if someone else would like to, feel free  ;)

Just stick a gear assembly above the top pump.  Powertrain connects in, BAM.  Amazing pumpstack.
Logged
This is a useful feature..and this is DF.. so im gonna assume its bugged
That's what cages and minecart shotguns are for!  We don't need to control them.  We just need to aim them.
[DWARFINEERING]

Vehudur

  • Bay Watcher
  • [evil]
    • View Profile
Re: A Better Magma Pump Stack
« Reply #8 on: December 04, 2010, 03:37:03 am »

I'm going to try to retrofit my 80 z-level pump stack.  Update at 11.
Logged
Quote
...and a third died in his bunk of natural causes - for a dagger in the heart quite naturally ends one's life.

I used to have an avatar, but I was told to remove it after it kept making people go insane.

Quote
We are mere steps from the gates of Hell and the last defenders of Earth.

darkrider2

  • Bay Watcher
    • View Profile
Re: A Better Magma Pump Stack
« Reply #9 on: December 04, 2010, 09:04:00 am »

The forums ingenuity never ceases to amaze.
Logged

Graebeard

  • Bay Watcher
  • The reasonable penguin
    • View Profile
Re: A Better Magma Pump Stack
« Reply #10 on: December 04, 2010, 12:34:55 pm »

That's hot.

The only downside I can see is that this design can't be fully "cleared" by shutting off primary access to the magma.

As far as retrofitting, it seems like it would involve a bit of work.  In a traditional stack, the pumps line up head to tail all the way up.  In this version, it seems like all the heads are stacked in a line all the way up.  I think that means you'll have to re-channel/floor every other story in the stack.
Logged
At last, she is done.

NecroRebel

  • Bay Watcher
    • View Profile
Re: A Better Magma Pump Stack
« Reply #11 on: December 04, 2010, 01:04:52 pm »

That's hot.

The only downside I can see is that this design can't be fully "cleared" by shutting off primary access to the magma.
You could have a lever-linked hatch over the input square of the bottom pump. Open it, and the pumps fill the reservoirs, but close it and the pumps will keep working, eventually emptying each floors' little reservoir to 1/7 all around, which will then dry. It would take significantly longer to clear than a standard stack, but would be possible.

Quote
As far as retrofitting, it seems like it would involve a bit of work.  In a traditional stack, the pumps line up head to tail all the way up.  In this version, it seems like all the heads are stacked in a line all the way up.  I think that means you'll have to re-channel/floor every other story in the stack.
That was my thought as well. Since you have to shift the pump on every other level 1 tile to get its input in the right place, you'd have to floor over the old input and power-transfer squares and channel new ones on every other level in addition to mining out each floor's little reservoir.



Though actually, I think I might have come up with a refinement to this design already. Assuming my reasoning as to why it lowers lag is correct, it's the fact that magma remains adjacent to the tiles being pumped at all times. Thing is, you don't, then, need magma in every tile adjacent to the pumped tiles as I've got here. Instead, you just need enough to keep every tile adjacent to the pumped tile warm. So, how about this?

=====
=+++=
==.==

==+==
==.==
=====


Red squares are kept warm at all times. Basically, it's just a standard pump stack with the single output tile extended into a 3x1 reservoir. Magma fills the 2 extra cross tiles on the T-shape, and those two magma-filled tiles keep the tiles next to the pumping tile on the same z-level warm, reducing required temperature recalculations just as the version I posted last night. This version would be very easy to retrofit as well; just dig or channel out those extra tiles on every level, then let each level fill. It even has the same head-to-tail power transfer scheme as the old-style pump stacks.

Assuming this newest design has the same lag-reduction properties as the other, it should be the new standard for magma pump stacks. If it takes more processor power than the other, well, I think that less lag is a more important issue than the extra space the bigger one takes.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

thijser

  • Bay Watcher
  • You to cut down a tree in order to make an axe!
    • View Profile
Re: A Better Magma Pump Stack
« Reply #12 on: December 04, 2010, 01:23:31 pm »

What happens if you surround the entire stack with magma
mmmmm
m===m
m=+=m
m=.=m
m=+=m
m=.=m
m===m
mmmmm
m=magma (you can guess that it's surrounded by walls aswell).
Logged
I'm not a native English speaker. Feel free to point out grammar/spelling mistakes. This way I can learn better English.

NecroRebel

  • Bay Watcher
    • View Profile
Re: A Better Magma Pump Stack
« Reply #13 on: December 04, 2010, 01:35:40 pm »

What happens if you surround the entire stack with magma
It should work similarly to the design in my previous post, except it takes more space, and it doesn't block the pumped tiles themselves from getting rapidly heated and cooled. It would probably be less laggy than the normal design, but more laggy than mine, and thus inferion when combined with the significantly-large space it takes.
Logged
A Better Magma Pump Stack: For all your high-FPS surface-level magma installation needs!

Vehudur

  • Bay Watcher
  • [evil]
    • View Profile
Re: A Better Magma Pump Stack
« Reply #14 on: December 04, 2010, 02:29:16 pm »

With my 80 z-level pump stack...

I went from 7 fps to 83.
Logged
Quote
...and a third died in his bunk of natural causes - for a dagger in the heart quite naturally ends one's life.

I used to have an avatar, but I was told to remove it after it kept making people go insane.

Quote
We are mere steps from the gates of Hell and the last defenders of Earth.
Pages: [1] 2 3 ... 6