Hey, folks, let's speculate about ways to get plants or fungi to grow underground that make thermodynamic sense. Hopefully even chemical sense. Let's not go so far, though, as to require these speculations to also make biological or evolutionary sense. After all, this is the Dwarfiverse, where whole species have obsessions with snatching and providing for other species' children that they can't even breed with - limiting ourselves to sane evolutionary biology would obviously be foolish
.
The basic problem here is well known and easy to understand. Currently dwarves grow various plants below ground with great ease. No sunlight is needed, only a floor of soft soil, or mud (and even that needs to only be put in once, not regularly - then again this wasn't the behaviour in the 2d version so this is probably not Toady's final intent). Without some kind of a source of free energy this shouldn't be possible.
(remember the difference between energy and free energy (or, more appropriately for a complex system, negentropy) here. An empty fortress that's unlivably hot would be full of energy but it wouldn't be extractable for work, i.e. free.)
The obvious choice of energy source for underground farming is all kinds of
organic waste: Manure, carcasses, corpses, blood, vomit, leaves, branches, grass, sawdust, etc.. Perhaps different kinds of fungi could also be specialised for different materials: If, say, cave wheat only grew on a base of composting leaves and wood materials, it would neatly become a specialty of forts with a large carpentry industry, or if there were a plant that preferred meat as its substrate, just exporting that plant could give your fortress a bloodthirsty reputation. Plump helmets would of course be the omnivore that would eat even your beards if you allowed it to
.
This kind of farming would form the basic nutrient loop inside your fortress, and insofar as you bring in stuff that grows on the outside, also bring in negentropy. It could also slightly help the fortress in terms of energy efficiency, but a loop of many biological systems like this by necessity doesn't retain a lot of free energy. Because of this, not all fortresses are going to be able to gather in enough organic material from the outside. It takes a lot of work to cultivate a mountainside (though with terracing, and perhaps a magmaworks arrangement to extend the growing season if you're very high, it could certainly be done) or an ocean (especially if you want to set up aquaculture). And even the lushest rainforest will become useless as a negentropy source if you're under siege.
For more interesting underground farming arrangements, then, we could have ways to either store long-term or actually produce underground the negentropy that you need for farming.
Still in the "it kinda makes biological sense" end of the plausibility continuum we could have a product - a kind of a
fertiliser - that could be made overland specifically for the purpose of being used for dwarven farming. I could imagine barrels packed tight with some kind of a material with high energy density that dwarves can't digest but that some kind of a dwarf-edible fungus could make use of (I don't know nearly enough about biochemistry to make any good suggestions here - seriously, my first idea was dried grass). Dwarves could buy this stuff from overland civilisations and store it to be able to continue underground farming during sieges or otherwise bad periods.
There are many reasons why you'd want to have this kind of a product available. It might be that it keeps better than dwarven foods. Even if there were readily edible foods that kept better than it, it could still be used to hedge against the spoilage of stocks of some specific kind of food providing some important nutrient. It could have a very high energy density, such that even with the biochemical inefficiency from using it for farming it would still take less space to store this stuff than a dwarven food. Perhaps some of the cultivable fungi, say quarry bush, would be slow to grow but fast to die of starvation (in exchange they could be very tasty and nutritious). They would then require a constant supply of energy to be useful in farming - a product like this could provide that.
So far all of the free energy sources have been heterotrophic - they all on an input of organic material into your fortress. It's going to get weirder now, with various different sorts of autotrophic organisms.
We've got plenty of chemosynthesis here on Earth. It seems that one source of free energy from chemosynthesis in Dwarf Fortress could be bacteria that metabolise
hydrogen sulfide (from a magma pipe or a source of natural gas) with oxygen and carbon dioxide. Wikipedia says this would produce water, sulfur and formaldehyde. Unfortunately I haven't had any formal education in chemistry since the one course I took in high school, so I have no idea how these would then continue to react and whether there are bacteria around that would use such reactions as energy sources.
For use in chemosynthesis there's also a whole bunch of
sulfides that occur as ores or stones in Dwarf Fortress: With a glance at
http://en.wikipedia.org/wiki/Sulfide_mineral I can see galena, sphalerite, cinnabar, realgar, orpiment, stibnite, marcasite, cobaltite, and tetrahedrite - and I probably missed some. I don't really know if it would be energy-efficient to ground these into dust for use by reducing bacteria, though. In any case, I could use a chemist's help here to figure out what kind of compounds you'd expect as the final products of chemosynthetically metabolising these, and how plausible it is that dwarven farming could use them as a negentropy source.
(even if it's not energy efficient to produce food through chemosynthesis this way, I could imagine using it for growing expensive spices, dyes, or thred. Consider all those other races going "look at those crazy dwarves, they made this stuff out of rock dust!")
Leaving behind the limits of Earth biology, we could have plants using energy sources that are weirder still (and perhaps a little bit too science fiction for a fantasy universe like Dwarf Fortress, but bear with me). How about a thermosynthetic plant? You could imagine it growing fibers through stone toward magma and feeding on the
temperature difference between that and some environment. You could encourage its growth by arranging for running water next to a magma pipe. The colder the water, the better. Or perhaps you could use a plant like that as a "heat pipe" to bring geothermal heat out to the surface for extending the growing season in cold locations.
Perhaps weirder still, how about growing plants simply with
mechanical motion? I'd like to use the word "mechanosynthesis" here to fit in with photosynthesis, chemosynthesis and thermosynthesis, but unfortunately the word's already been taken by nanotechnologists
. Anyway! Keep in mind that nature *does* have a way of turning chemical energy at the microscopic level into motion at the macroscopic - we call it muscle. I can imagine a kind of a "reverse muscle", flexed and contracted by energy from a windmill or watermill, that would produce chemical energy for a plant's growth. I have no idea how such a being would evolve, but if there's a biochemical mechanism that could transform motion into chemical energy, then an organism could exist that actually uses it.
tl;dr Underground farming makes no sense, and there's a bunch of ways to make it make sense.