A Tale of Magma and WoeSo a few weeks back, I decided to expand my knowledge of DF and start exploring how to use magma to defend my fort. This is my tale of woe. This is long and rambling, so brace yourself or move on to a different thread, your choice!
I had used pumps in the past to move water around, but always powered by a dwarf, never powered by water wheels or windmills. I had never even built a water wheel or windmill, as I was blissfully ignorant of their potential. So, pumps, that's all I knew about. A bit of reading, and I learn about magma safe materials, ok, that's important, gotta remember that. What else? Ok, it's not like water, that's helpful... It doesn't kill instantly, also good to know. I'm ready!
Wow, I was so not ready. Up to this point, for my fortress defense, I had simply created a single entrance, lined it with traps, and had the dwarves dump all the bits of monster into the magma disposal chute. Not efficient, but it worked.
First attempt. Built a hallway, built a pump above, channeled magma from a nearby volcano, when the goblins were in the hallway, turned on the pump. Dwarf running the pump was burned, pump output needs to be sealed, ok... goblin ignored magma for the most part, as he was long gone past the "pour in" point before it started to trickle in. Scratch that design. Need a way to keep the goblins in one area.
Second attempt. Single twisting hallway, not enough magma pressure, too slow, incomplete floor coverage, and no drainage. Lots of problems, but I did actually manage to kill some goblins with magma. Good learning experience.
Third attempt. In my mind, I still figured a winding path would be best, in that it would collect the most goblins ahead of time before immersing them. Good in theory, tricky in practice. First attempt, I used a path that had 12 turns in it, but the whole thing fit inside a square, so it was relatively easy to build the ceiling-magma-source, the drains and so on. I built stairs at either end to "hold the magma in" should the 9 pumps involved produce too much flow. This design was seriously flawed. First problem, too much drainage, as I used carved fortifications on every wall, which drained away the magma too quickly. By too quickly I mean it didn't actually burn all the associated cruft that goblins bring with them, it just burned them enough so they died. It also allowed for weapons and armor to flow through the fortifications, into the catchbasin below, out of reach.
Second problem was the magma source, and problems associated with having channels to allow the magma to flow down into the hallway. I tried to redirect the source of the magma flow with constructed walls, and then tried to adjust the rate by spacing the channels, and it was all for naught, as the drainage didn't allow for any depth of magma, and so death was either too slow, or the goblins could actually run away and escape, even if they were bleeding ( a lot ). Either the magma didn't cover enough area, or the flow would reach the ends of the halls, or it didn't pour from above in the right places, and so on.
Fourth attempt was the same as the third attempt, but with grates lining the interior of the walls to catch all the weapons & armor. Thinking ahead, I had made this one so I could adjust things, and I added rectractable bridges in the ceiling to allow the magma above to be pressurized ahead of time and then released all at once with one big helping hand from mr. gravity & mr. pump. Worked too well, as it pushed the goblins through the fortifications onto the grates behind the walls, and thusly into the fortress to kill all the un-militarized dwarves. I fiddled around quite a lot with the bridge-hatches and timing and so on, but ultimately, it was not to be, and I moved on. I had learned about water wheels, axles, gears, pressurizing and even more about drainage, though, so time well spent.
Fifth attempt. By this time, I had read up on some other designs, and had a laundry list of problems to solve. I also wanted to incorporate a few must-have features such as: Complete submersion. None of this 6/7 crap, I wanted everyone breathing magma. Complete automation. No manual switches, it must completely cycle with automation. A few of the designs I read about used water driven logic. This essentially involves a water source, floodgates, and pressure plates. Some of the designs reminded me of a digital logic truth table, which makes sense in retrospect. At this point, I had abandoned fortifications entirely and was working with a pure grate system, with bridges as walls along the hallway length. Ultimately, it worked, but not to my satisfaction, as drainage was a continual problem, and there were limited choices regarding location with this design.
Logic problems with #5 were related to using sequential pressure plates. This doesn't work reliably. Primarily it's due to the nature of flowing water and drainage. You can build a one-shot stateful system, but multiple states in the same logic flow was ultimately a failure. So I redid it with parallel flows, and it worked better. Timing was still a problem, in that if you wanted SLOW events, but reliable, that was harder that fast events. In any case, I refined it down to water_source->floodgate->pressure_plate->floodgate->drain. This basic logic flow has served me well from this point on. It basically allows for a given trap system to remain in a given state indefinitely, until affected by another outside event. For example, if you tie your magma source to the pressure plate in the logic flow, and the creature driven pressure plate to the first floodgate, it will open momentarily, put enough water on the logic pressure plate to open the magma, and stay that way forever, until the second floodgate is opened. This, for me, was an essential piece of the puzzle.
Fillage. The "room full detector" worked fantastic, if a little fast. In later versions I delayed the detector with a longer fill hallway to ensure 100% burnage. In this first incarnation, it killed everything, guaranteed, but it didn't BURN everything. There were often corpses and bits of silk underwear in the grate room below, and that just wouldn't do.
Drainage. Magma drainage was a constant problem here, but I learned some valuable lessons regarding the order in which things should be built, the order in which mechanisms should be tied, and how quickly magma will drain given ideal and not ideal conditions. Magma evaporation is completely unreliable. It should never be relied upon for trap reset or timing or pathing, or anything related to the start, stop, execution, state, or reset of any system. Bah on magma evaporation, bah I say! (more on this in the sixth attempt)
Manual levers. I also started putting manual levers in place to control the hallway containment walls, bridge floors, magma pumps and magma source hatch, and put them in every design from this point on. This allows for testing, but also the removal of those annoying forgotten beasts and titans that show up and don't trigger pressure plates.
Sixth Attempt. Long hall (40x3 worth of retracting-bridge-floors), pressure plate in the middle, 4 Z-Levels required. Gravity driven drainage. This was the 1.0. It worked, it actually worked! Trolls walked down the hall, tripped the pressure plate, walls went up, magma went in, trolls immersed in magma, floor fell away, magma drained out, trap reset, floors and walls returned to normal, next round of monsters are free to enter.
However (and of course you knew this was coming) there were two problems in the long term. These took years of in-game time to show up, but they became extremely inconvenient. The first was magma evaporation of the pressure plate and the second was monsters occasionally escaping the room prior to the containment walls going up (they can run a fair distance in 100 ticks!). This design was definitely fun though, and bolstered my desire to continue on. It was at this point that I abandoned having the pressure plate INSIDE the room, as the magma evaporation problem has no solution that I'm aware of. Even if it's one tile surrounded by nothing but bridge-floors, it can be months of in game time before it will evaporate and permit creature pathing again.
Seventh attempt. Long hall, pressure plate at the start at first, then at the end of the hallway. This was primarily an exercise in timing, but I also ran into a third long term problem. If used enough, the catch basin (the lowest point of the entire system) can FILL UP. As my "the trap is drained, reset" indicator is triggered off of magma level, you can see where this would be a problem. If the room below fills up, and then fills up the lower grate room, the trigger never shuts off, so it doesn't reset the trap properly, and the magma source stays on, and the ... oh noes! magma filling the fort! Yeah. So, bigger catchbasin, it's now 50x100 with engraved fortifications to the entire map edge on the north and south edges.
Having the creature driven pressure plate at the start of the hallway creates the problem of the goblins standing ON the plate indefinitely, keeping the trap cycling indefinitely. The logic I built ensures that, unless there's an anomolous condition, the containment walls are the first to go up and the last to go down. This means with them standing on the plate, it will never let them in. Bad. Ok, so I moved the pressure to the end. Great, except under one condition, which is exactly the same as having it at the start of the hallway. Goblins standing ON the pressure plate, trying to escape the fort after the siege has failed. They force the trap to continously cycle, and again, it will stay this way forever.
To address that problem, and I'm not sure there's a 100% solution, but for the moment, I've built an additional drawbridge wall down-path from the magma hallway; between the magma hallway and the traps that are my last line of defense before my fort/trade-depot. This prevents the cowardly goblins from pathing OUT of the fort temporarily. Initially I had though to create two drawbridge walls that would pop up immediately adjacent to the creature-pressure-plate but this only ensures the goblin remains on the plate, which is bad in my system. I want them to move off it/past it, so this current design permits and encourages that. There has been a situation occur since this, where a small group of a few goblins were caught in this area retriggering but not standing on the creature-pressure-plate. In this instance, I manually opened the containment walls with a lever to allow them to 'escape' then shut it and burned them all, of course. Sheesh, what did you think, I would have mercy on goblins? As if !
Annoyances:-embarking with proficient mechanics, but having them choose the least magma safe materials for mechanisms before the bookkeeper gets their act together. Surrounded by nothing but obsidian for 10 Z-levels and all other directions, those Mechanics will choose microcline 50 Z-levels away. Thumbs up, dwarf-dudes.
-goblins standing ON pressure plates. For a long time. Move, you cursed fiends!
-monsters that give up too easily. Don't run away! You haven't bathed in magma yet! You shouldn't say no until you've tried it...
Problems that need long term 100% solutions:
-magma evaporation on pressure plates takes too long & prevents pathing, while required to be a chokepoint for pathing.
-fleeing/cowardly creatures pathing back across the original trigger.
I recognize there are some "dwarfy" solutions to some of these problems, that is, you could push the goblins off the trigger with water, to ensure they don't constantly re-trigger it, or build a second adjacent magma hallway down-path from the original, and so-on, but I wanted to see how far I could personally push the idea I had in my head, and this is where it led me. Good times! As a final note, my current design has been running for 12 in-game years, survived at least 10 sieges, one titan, vaporized over 750 goblins & trolls, and my dwarves have collected every single scrap of goblinite they were carrying.