The fighter strains as he jams the iron pry bar between the seams of the heavy stone door. Veins stand out on his arms, his neck bulges, slowly the giant door opens. A chill wind escapes into the desert night and whips the rogue's feathered hair. The Great Byxarg's final resting place is open to plunder at last. The cleric hands the fighter the torch and he leads the way into the tomb. Somewhere in the darkness there is a low growl. “What do you think it is?” whispers the....
“Think it is! I don't care what it is, what the hell has it been eating for the last 2,000 years?”
“Well I am sure it snacks on animals passing through and....”
“Passing through! We just opened a door and cold air blew out! This place has to be sealed up tight as a drum. There was a positive pressure differential and the air inside was colder!”
“I think he snacks on moss....”
Now, I love a good kick in the door and loot as much as the next guy. And when the adventure starts at the front door and ends at the exit, there is good reason to let a lot of the whys slide. But a lot of the time you are going to want to make sure that your dungeon makes some kind of sense on a conservation of mass and energy level. Also, doing the extra leg work and developing some kind of ecology can make your dungeons more interesting and maybe even allow for emergent situations that can make the whole session a lot cooler.
Living things need energy and they need access to the basic building blocks of their body. Without energy they cannot move, breathe, think etc. Without the basic building blocks of life they cannot grow or heal. We are going to look at energy first. There are many ways that energy can be extracted from the environment for use by living things. On Earth photosynthesis rules supreme. Other sources of energy can be chemical reactions, nuclear reactions, heat, electricity etc. But on Earth most of the energy used by living things enters the system through photosynthesis.
Photosynthesis (simplified) is converting energy from light into a form usable by living things. It is not especially surface area efficient. Energy is measured in calories, a human being needs around 2,000 calories a day to function. In order to extract that much energy from the sun's rays a human would need to have several hundred square feet of photosynthetic surface area. This is why life that gets its energy through photosynthesis tends not to move around a whole heck of a lot (except in Middle Earth). Moving around burns energy, a lot of energy, trees tend not to jog.
So on Earth (as we know it) energy tends to enter the eco-system through mostly stationary life. In our case plants. Of course most dungeons are underground, this is a problem for the whole photosynthesis thing.
For the purposes of this discussion I am going to divide dungeons into three groups: those that see regular traffic from the outside world, those that rarely see traffic from the outside world, and those that are sealed off from the outside world. The last will be the toughest, and the most interesting. We are going to look at possible energy sources in your dungeon, life that can extract that energy, and how that energy moves its way up the food chain to the types of critters we like to kill.