Monday, September 18, 2006

Dwarf Fortress (5): Farming Basics



Farming. It can be critical to self-sufficiency in Dwarf Fortress, and managing all the different components can be fairly tricky (for me, at least). This is going to discuss the basics of farming, and there will be a follow-up post with an intermediate guide by Thom Moyles.

As part of your skill loadout when you make your party, I’d give someone points in both farming (fields) and farming (workshop). It helps them plant more quickly, and that’s a big help. Oh, and don't exchange your seeds for additional allocation points when you do your starting loadout--no seeds means no farming.

First off, and here’s one of the few “must knows” in the game that isn’t self-evident: there’s an underground river in the mountain. You must dig a mining shaft to the east (I make it one square high, usually, to progress as quickly as possible) until you find the river.

When you find the river, by the way, the reaction of your miners is quite funny—and entirely logical.

The reason you need to find the river is that periodically, it overflows, and when it does, it turns the area around the river into farmable land (in the game, it’s mud). Regular land in the world is not arable, because it lacks the moisture content necessary to support crops (I believe that’s the correct explanation).

Now it’s possible to just farm the muddy land provided by the river when it overflows (this is known as “Nile” farming), but that puts you at the mercy of the river. It also means you might lose a crop (or a farmer) if the river overflows unexpectedly while you’re planting or harvesting. So it’s far more effective, and far safer, to use floodgates.

Let’s go through this procedure step-by-step. There’s quite a bit involved here, and I’m sure there are others ways to do it, but here’s what worked for me.

You’re actually on parallel paths to support farming as quickly and efficiently as possible. One path is to find the river. The second path is to build infrastructure.

First off, start the mining shaft to the east from the entrance to the mountain. I just designate a long, narrow area and the miners dig until they hit the river. I also make it parallel to the settlement shaft. Because of certain flooding hazards if you make a mistake, I try to keep the settlement shaft and the river shaft separate for safety reasons.

While the miners are digging, you need to start building the farming infrastructure. As an example of the thoughtful complexity in this game, you can actually use fertilizer in your fields to increase their yield. But it works in a logical progression—you need to make ash, which can be soaked in water to make lye, which can then be used to make potash, and then the fields can be fertilized.

Which is great.

It’s a logical sequence. Build a furnace to burn wood to make ash. Build an ashery (which is a type of workshop, so use ‘w” to access the workshops list from the building menu or you won’t see it) to soak the ashes in water to make lye, then use the lye to make potash (it’s another ashery task) for fertilizer.

The devil, of course, is in the details. You need wood to burn in the furnace, so you’ll need to cut wood. You need blocks and a barrel to build an ashery, so you need to obtain those from a mason’s workshop and carpenter’s workshop, respectively. You’re also going to need barrels and buckets for the ashery (to store lie, etc.), so those need to be built at the carpenter’s workshop as well. And you need lye to make potash, so you must perform the “make lye” task first at the ashery. I just alternate the tasks (lye, potash, lye, potash, etc.) and load up the task screen. Just keep making it—you’ll need all the fertilizer you can make.

You’ll also need dwarves with the skills to operate the furnace and the ashery. I turned on both skills for the same dwarf.

Why do you want to fertilize the fields? Well, your production can be 4X (maybe more) what it is without fertilization. That’s a huge difference in productivity and well worth the time, but it can certainly be daunting to be coordinating all these activities at the same time, particularly in the first year of a fortress.

Let’s go back to mining now. As I said before, you’re mining a tunnel that’s only one square high. Once you reach the river, the water is going to blow back all the way to the mountain entrance. When it recedes, you can get to work.

First, move back six squares or from where the shaft breached the river. That gives you a section of corridor to work with. Now you’ll be doing two things to get the area ready for farming: creating a farming area by mining, and creating a system of floodgates and levers to control the water from the river.

Why do you care? Because once you get the floodgate system set up and working, you can flood the farming area whenever you want. That means you’re not at the mercy of the cave river overflowing for Nile farming. That means much greater productivity from the same amount of land.

Before you designate the mining area to create the farming rooms, start queuing up your materials tasks. You’ll need two floodgates (made at the mason’s workshop), and you’ll need a mechanic’s workshop to make “rock mechanisms” which will then be used to make levers to control the floodgates. I believe you’ll need four to connect two floodgates, so add those as building tasks at the Mechanic’s Workshop menu.

I dug out two large rooms off the main corridor, one of each side, that are each 10 squares wide by 5 squares deep (see the screenshot). I also excluded two squares in each room to act as pillars so that the room wouldn’t cave in. And in addition to those two rooms, I added a small 3x3 room, not connected to the farming room, to serve as a control room.

While the mining is ongoing, you can place the floodgates. Select the square in the corridor that is adjacent to the river to place the first floodgate (use the building menu—from that menu, “X” is the floodgate command). Note that your mason must have built the floodgate for it to be available now. Move the yellow “X” into place and press Enter.

That’s not a floodgate yet—it’s an instruction for a dwarf to haul a floodgate into that position.

Once the control room has been mined out, go back into the building menu and select “Traps/Levers,” then choose “Lever” from that sub-menu. If your mechanic’s workshop hasn’t built the mechanisms yet, you’ll get a “needs mechanisms” message. If the lever is available, place it in a corner of the 3x3 control room.

The mechanic will need to come install that lever. When it’s installed, press “q” for the building tasks menu, move the cursor over the control room, choose “a” to add a new task, then choose the “Link Up to a Floodgate” task. If a dwarf has placed the first floodgate, it will be highlighted as a yellow X. Select that—you’re asking the mechanic to connect the lever to that floodgate.

That way, when you pull the lever, it will open the floodgate.

Now is a good time to install a door in the corridor beyond the farming area but before the control room (it doesn’t show up in the screenshot because a dwarf with seeds to plant is passing through it, but the tiny red dot in the corridor at the edge of the farming room is where it’s located). In essence, you can seal off the farming area and floodgates from the rest of the shaft. The mason can build the door, and you can place it using the building menu (again, it will have to be hauled into place).

When you see the mechanic create the lever, use “q” again, select the lever, use “a” to add a new task, and you should see a new option—“P” (capital P, which is one of the very few times you need to actually use a shift-letter command) for “Pull the Lever.”

Now this is critical: add the “Pull the Lever” task and test the floodgate. Once you install a channel and a second floodgate, the mechanic will no longer have access to that first floodgate. If it’s not working properly, you are well and purely screwed. So be sure that the floodgate opens, and just as importantly, add another task and have the lever pulled AGAIN to close the floodgate.

With the first floodgate working properly, it’s time to add a channel. From the building menu, select “channel.” You can adjust the height and width, but I used a very simple 3 (wide) by 1 (high) floodgate. It must be touching the floodgate—in other words, the end of the channel must be in the square adjacent to the floodgate—it can’t be separated by a blank square. Which makes sense, obviously, because if there’s a gap, the channel can’t be expected to work.

A worker must install the channel, and when it’s completed, you can add the second floodgate. Again, there can’t be any gaps between the end of the channel and the second floodgate. You can see what it looks like in the screenshot.

Once the second floodgate has been hauled in, add a task to your lever in the control room to “Link Up to Floodgate.” You’re going to connect that lever to the second floodgate as well. That’s why you have to be sure the first floodgate is closed—otherwise, one will be open when the other is closed.

The mechanic will come and hook up the second floodgate to the lever. At this point, you should have both floodgates connected to one lever.

At this point, it’s a good idea to clear that farming chamber, and when it’s clear, use “q” and select the door, then choose the “forbid passage” option. You’ve just sealed off the farming chamber if anything goes wrong.

Now just add a “Pull the Lever” task to the lever in the control room. The mechanic comes, flips the lever, and you should see both floodgates raise, then see water coming from the river, through the channel, and flood your farming room. Add another “pull lever” task to raise the floodgates back into place and the water will drain away, leaving you with muddy, prime farmland.

And remember to change that door back to passable, or no one is going to plant anything (because they can’t get in).

Now let’s make some farm plots. In the building menu, select “p” for Farm Plot. You can adjust the height and width in the usual manner—the maximum size is 10x10, but you might be better off with smaller individual plots if you want to plant different crops, because one plot gets assigned a single crop (although you can change the designated crop next planting season). I used (roughly) 5x5 plots and separated them by one column so that I could visually tell them apart.

Dwarves will come and prepare the farm plot, and when it stops flashing, it’s ready to plant (it’s “wavy” in the screenshot—the planted sections look like equal signs). Press “q” for building tasks from the command menu, move the cursor to one of the farm plots, and you’ll see the Farm Plot menu. Here are the options:
Z: Fallow... F: Fertilize or Cancel Fertilize
Ft 0/14...S: Seas Fert (Y)
A: Spring...B: Summer...C: Autumn
Plant Before Mud Dries in Winter

Here’s how the menu works. First, there’s no reason to leave a field fallow, because you get “fresh” mud every time you flood the farming room, so ignore the Z option. To fertilize the field (if you have fertilizer), press “f”. The degree to which the field is fertilized is in the “Ft 0/14” designation—in this case, the field hadn’t been fertilized at all (hence the 0 value), because I wanted to compare crop yields with a fertilized field. If you’d like to make the fertilize task seasonal, select it with “s”.

Your current season will automatically be highlighted from the A/B/C options.

Once you’ve set your instructions, just choose a crop from the list at the top by pressing Enter (it should highlight in white). Now you have a full set of farming instructions, and a farmer will come by and get to work.

Yes, you need someone with the farming skill.

So what can go wrong here? Lots of things. If your farming room has even one tile not completely closed off from the river, the water will never drain after the room is flooded, even when the floodgates are raised. That’s why I had you back off quite a few squares from the river, to hopefully prevent that from happening.

It can take time to go through the furnace/ashery sequence, because there are many steps and it’s quite a bit of work for the dwarves.

If you forget to install a door to seal off the farming room (or forget to make it impassable before you flood the farming room), you’re going to have a flood all the way back to the cave entrance. Oops. And if you didn’t separate your farming shaft from your settlement shaft, well, now you have a water park.

Once the crops are planted, all you need to do is wait. They’ll mature into harvestable crops and your farmers will harvest them.

Like I said, there’s a simpler method to farm known as “Nile farming.” Essentially, you wait until the cave river overflows and farm the resulting muddy squares. But you won’t have as much usable farmland, and your growing season will be entirely dependent on the cave river and when it happens to overflow.

There’s a second Nile scenario involving the outdoor river and a channel, but I’ve never done that before. You can consult the wiki http://dwarf.lendemaindeveille.com/index.php/Main_Page for help with Nile farming, in addition to details that I’ve probably missed concerning cave farming using the floodgate system.

I'm sure I missed something there. I'll post a correction if necessary, and Thom's farming strategy guide will be up shortly. Oh, and before you use this as a guide, please back up your save directory someplace safely, just in case I made a mistake (and it leads to you making a mistake).

Site Meter