Page 1 of 3

[Mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sat Mar 25, 2017 18:32
by FaceDeer
Inspired by the world of Dwarf Fortress, this mod adds a series of vast cavern layers to the depths of Minetest with a variety of biomes that are populated with a variety of underground flora and other new features.


New "trees" include:
  • Tower caps
  • Goblin caps
  • Black caps
  • Nether caps
  • Fungiwood
  • Spore trees
  • Tunnel tube
  • Bloodthorn
  • Torchspine
New farmable plants include:
  • Plump helmet
  • Pig tail
  • Cave wheat
  • Sweet pods
  • Dimple cups
  • Quarry bushes
Cavern Layers

The underground is divided into a number of cavern "layers" with a variety of biomes and other features distributed throughout. As one goes deeper one will find increasingly bizzare flora and exotic environments that provide new challenges and opportunities for players.

The uppermost layer is home to relatively conventional tree-like fungal growths of Fungiwood and Tower-Cap mushrooms. These provide a source of underground wood. Also found in this region are plump helmets (an edible farmable mushroom), and cave wheat (a pale grass-like growth whose seeds can be ground for flour).

The next layer down has more exotic growths. Here you can find Goblin Cap mushrooms, the squatter cousins of the Tower Caps. Spore Trees sprout in the warmer and wetter corners of the caverns, raising a climbable three-dimensional mesh or hyphyae above the ground that emits a gentle rain of spore powder. Tunnel Tubes grow in the hottest regions - tall, curved stalks with fruiting bodies at the tips that burst violently when ripe. Smaller growths found here include plump helmets, cave wheat, pig tails (a fibrous fungus that can be grown and harvested for thread) and sweet pods (whose fruiting bodies can be milled for sugar or processed into syrup).

In the third cavern layer yet stranger forms of life flourish in the hostile conditions. The coal-black caverns of the Black Cap forests, rich with carbonaceous deposits that have accumulated over millions of years and lit by smouldering Torchspines, are found here. The frigid Nethercaps, blue-tinted mushrooms leaching heat out of their environment in ways that shouldn't be thermodynamically possible, fill their caverns with ice and snow. In the hotter areas the vicious Bloodthorn grows, with wicked spines that suck moisture from anything they can pierce. In caves too dry to support biological life enormous glowing crystals grow instead. Smaller plants that can be found here include quarry bushes (farmable for their spicy leaves) and dimple cups (whose eponymous parts can be ground to produce a brilliant blue dye).

Below the third layer are the shores of the Sunless Sea, the ultimate destination of all water that flows downward through the twisty caves of Minetest. Familiar growths crowd its fertile shores, with Tower Cap, Goblin Cap, Fungiwood and Spore Trees able to take root in this relatively hospitable zone. The caverns of the Sunless Sea are vast in extent but are mostly flooded with water, and below the surface grows treacherous Snareweed and underwater citadels of softly-glowing Cave Coral. Twisting rivers connect the various caverns of the Sunless Sea.

Below the Sunless Sea are seas of a more dangerous sort: lakes of oil and the magma ocean. These caverns are filled with dangerous substances, though there are riches to be had as well; mineral growths fed by the heat and pressure and bountiful fuel sources.

At the very foundation of the world lies an ancient impenetrable realm. There are signs that life once existed here but it is now long gone. Its dead hollows rest on a layer of Slade, a dense material impervious to conventional mining efforts.

Other Features

The giant caverns generated by this mod differ slightly from the default giant caverns found in some mapgens, they use an additional source of noise to generate more ledges and horizontal floors. They also contain stalactites and stalagmites of various sizes - from single-node spikes decorating the default twisty tunnels to mountainous behemoths in the main caverns that can reach tens of meters in diameter and hundreds of meters in height.

The trees and plants mentioned above are all farmable, but in contrast to the usual farmable plants and trees they only grow in the *absence* of bright light. Attempting to plant them in sunlight will kill them. A set of recipes is added for cooking the edible ones into a variety of biscuits, stews, and roasts, and sweet pods can be refined into syrup.

Some of the other cave decorations provide dim bioluminescent lighting in some caverns. Cave moss and hanging glow-worms are most common. There is also non-glowing floor fungus found coating the stone in less hospitable biomes, capable of spreading to adjacent cobblestone structures like a slow-creeping infection.

A more comprehensive guide can be found here.

Synergies with other mods

Note: This mod depends on the latest version of the utility mods subterrane and mapgen_helper.

"dynamic liquid" is recommended to provide Dwarf Fortress-like fluid dynamics and to deal with any water that might spill into caverns.

"magma_conduits" is recommended for a Dwarf Fortress like magmatic landscape. If not magma conduits, it is at least recommended that mapgen magma be disabled on whatever mapgen you're adding this mod to; mapgen magma is difficult for lua mapgens like this to tidy up and it will often spill into caverns setting large swaths of fungal forests on fire.

The "doc" mod is supported to provide in-game documentation for all of the new items and nodes this mod adds.

"ropes" are very useful for navigating some of the large open spaces this mod provides. "airtanks" could be handy in some of the more hostile areas, and "wielded_light" or similar mod for dealing with darkness.

"radiant_damage" greatly increases the danger of the Magma Sea if heat radiance is enabled, as well as several of the rare crystals in the deeper layers that emit Mese radiation if that damage type is enabled.


License: MIT

All-in-one download: DFCaverns Modpack v2.0 (get this if you just want to install it and run)

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sun Mar 26, 2017 01:56
by qwertymine3
I don't play dwarf fortress - but I took a look around in creative:

Great work so far - all of the caves are well designed and look nice.
It is also nice to see that they all present differnet challenges / rewards to the player. Leaving mese ore inside the lava tunnels is a nice touch to that effect.
I would also recommend using the dynamic liquids mod - as that would make the uppermost layer much more fun.

The transitions between the different levels need some work though:
The transition from the water-filled caves to the first large open caverns can generate a cavern with a roof of water which grinds the game to a halt when it flows.
It would be nice if the near-surface lava tunnels sprouted into a volcano on the surface - rather than just being cut off.

This would probably go well with a mobs mod - but that would obviously be a long-term goal, if at all.

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sun Mar 26, 2017 04:12
by FaceDeer
Thanks for the feedback! Comments from a non-DF player are greatly welcome too, helps me to know that the mods' appeal is more than just "cool, always wondered what a tower cap looked like" :)
qwertymine3 wrote: It is also nice to see that they all present differnet challenges / rewards to the player. Leaving mese ore inside the lava tunnels is a nice touch to that effect.
Once I get the lava sea implemented properly I think I'll be removing most of the non-lava mese ore and putting some giant mother lodes down there. :)

Differentiating the various biomes is definitely going to be an ongoing effort as I continue working on this thing. I've gone a bit beyond Dwarf Fortress with some of the details, such as making the farmable plants somewhat biome-specific. I am considering restricting their ability to grow to certain depths so that you'd need to have a continuing presence down there, not just a single seed-gathering run.
qwertymine3 wrote: The transitions between the different levels need some work though:
The transition from the water-filled caves to the first large open caverns can generate a cavern with a roof of water which grinds the game to a halt when it flows.
Yeah, the cave tsunamis are a tricky thing to fix. That's the main reason I've left the lava sea empty for now, a cave tsunami is messy enough when it's just water. For the time being I console myself that the worst of the CPU grind resolves itself in a few minutes as the water towers collapse, and then the cavern's water stays fairly stable after that.
qwertymine3 wrote: It would be nice if the near-surface lava tunnels sprouted into a volcano on the surface - rather than just being cut off.
Probably the subject for a whole other mod. :) This has been my first real foray into mapgen modding, I've learned a lot while doing it but one of the main things I've learned is that it can be annoyingly hard. Mapgen only "sees" one chunk of the map at a time so coordinating things over larger distances (such as the water level inside a cavern) can be tricky. You may have seen a few cave trees or giant stalactites in the caverns that have been cut in half by chunk boundaries, for example. Still working on that.
qwertymine3 wrote: This would probably go well with a mobs mod - but that would obviously be a long-term goal, if at all.
Indeed, and mob-making is something I haven't touched on at all yet so I'd have no idea where to get started on that. :) I could easily add spawners for existing mobs into the caverns, though, that's a more likely near-term thing I'll do.

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sun Mar 26, 2017 09:53
by burli
I really like those gigantic caverns, but only to fly around. I don't know how they should work an a normal game. If you hit such a cavern from the top you may see just darkness because the ground is out of the render distance. And it is impossible to get down without an endless rope or something like a parachute. Digging around will be frustrating.

I also don't like the excessive use of liquids. It's a problem if the cavern hits a normal cave with water.

And because of the height you can't enjoy the atmosphere cause you can't see the top of the cave

But I like the decoration of your mod. Never heard of DF

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sun Mar 26, 2017 10:20
by FaceDeer
You might find my sounding line and ropes mods useful for navigating large caverns like these. I've found that a 50m rope is often sufficient for climbing down from the ceiling, and only very rarely is a 100m rope not enough.

Draw distance depends in part on client settings, I'm usually able to see the ceiling when I'm down on the cavern floor. Varies with the size of the cavern, of course, and also to some degree on how I've entered the cavern - if I came in at floor level from the side the ceiling might not have actually been generated yet. The cave generation code has hooks to make dimensions configurable, I'll put them into the mod's settings next time I sit down to do more work on it so you can shrink things to your taste. I'll see about adding a setting to disable the flooded caverns, too, though personally I've rather been enjoying the challenge of cave diving.

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sun Mar 26, 2017 14:16
by azekill_DIABLO
looks like a very good mod!

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Tue Mar 28, 2017 16:49
by texmex
I tried to try the mod out, but all I could find was the stalactites, stalagmites and some fungi. Went down to about -3700. Is there something else to do? Did I get a bad seed? (I put df2 as seed on mgv7)

I also get random lava lakes and flows at the surface.
+ Spoiler

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Tue Mar 28, 2017 17:22
by burli
Noticed that too

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Tue Mar 28, 2017 17:51
by FaceDeer
The giant caverns are somewhat sparsely distributed under the default settings, most of the underground is still solid stone. You may have just had bad luck with that seed. I'm working with a test map with seed "6" right now and when I go straight down from the origin there's a small Tower Cap cavern around the -500 mark (with more if you head in the +X direction, a bigger Tower Cap cavern is at 200, -500, 0) and a large Tunnel Tube/Spore Tree cavern at the -1700 mark. You can change the cavern dimensions a bit in the mod's advanced settings but I haven't experimented with them much myself so I can't guarantee nice-looking caverns if you fiddle with them.

The random lava lakes are a feature, they're the upper ends of vertical lava veins meant to emulate how lava is distributed in Dwarf Fortress. If you don't want them to punch all the way through to the surface you can remove the surface soil types from the "wherein" table of the lava ore registration in init.lua, though that could lead to a bit of a dangerous situation for the player when there's a layer of sand generated over lava. :)

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sun Apr 02, 2017 22:22
by FaceDeer
I've just updated the farming code to use node timers, so farm plants will now grow while you're not present and have a more consistent growth time. This is in line with modern farming mods (I rolled my own plant growth code rather than using existing farm mods directly so that I could have better control over it).

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Mon Apr 03, 2017 05:02
by duane
Very nice! You're gonna shame me into sprucing up my own caves.
+ Spoiler
Got a little forest fire going where a bunch of lava broke out here.
+ Spoiler
And the lava tubes have some peculiar shapes. It reminds me of what happened when I used to feed fractional numbers into an index function, but I didn't notice anything like that in the code.
+ Spoiler

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Mon Apr 03, 2017 07:35
by FaceDeer
Thanks! I've tried to keep the various underground plants and features segregated into somewhat self-contained lua files, so if you want to pull any bits out for use in your own caves I hope it won't be too difficult. :)

The lava tubes are just "vein" style ore deposits with the noise stretched vertically to make them mostly run up and down, so they get a bit distorted at the few spots where they curve over to run horizontally. I'm not too concerned with that since I figure it's unlikely many players are going to go on exploratory expeditions through tunnels filled with liquid hot magma like this. Though I do need to do some more work with lava for the "lava sea" cavern layer (a standard part of Dwarf Fortress's deep-world geology), I'll see if I can think of a way to make the surface lava vents a bit less destructive while I'm at it. Maybe add a stone rim around them when they hit air.

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sun Apr 09, 2017 02:27
by FaceDeer
I've split the lava mapgen modification into a separate stand-alone mod, magma_conduits. If you're using dfcaverns then next time you update I'd recommend installing magma_conduits to maintain the same behaviour. In particular, the removal of default mapgen lava is now magma_conduits' responsibility. The giant caverns generated by subterrane don't play well with default mapgen lava, unfortunately.

Once I've got dfcaverns a bit more polished I'm going to bundle up the various mods that make it Dwarf Fortressy into a modpack. Currently the list is: subterrane (required), dynamic_liquid, and magma_conduits.

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sun May 28, 2017 02:43
by dawgdoc

Are your CaveRealms and Subterrane mods designed to work with MT/MTG 0.4.15 (Stable) or only with the -dev versions? If they are intended to work with 0.4.15 I will post debug text in the Subterrane thread, if appropriate.

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sun Jun 04, 2017 23:01
by FaceDeer
I developed them using a -dev version, but I'm willing to make changes for the sake of 0.4.15-release compatibility if they're not too troublesome. By all means, file issues - worst I can do is say "no" :)

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Tue Jun 06, 2017 04:32
by dawgdoc
FaceDeer wrote:I developed them using a -dev version, but I'm willing to make changes for the sake of 0.4.15-release compatibility if they're not too troublesome. By all means, file issues - worst I can do is say "no" :)
Since 0.4.16 came out sooner than I expected, I will probably upgrade MT versions as the simplest fix. (I'm waiting those few days to let others do the scouting.)

Re: [mod] Dwarf Fortress style caverns [dfcaverns][0.9]

Posted: Fri Jun 01, 2018 02:44
by FaceDeer
Been a while, but I just merged a significant update into the master branch of dfcaverns. New in this version:
  • Created the Sunless Sea, an expansive half-flooded cavern layer between the bottommost "dry" cavern layer and the Lava Sea below that.
  • Added three biomes for the Sunless Sea: barren, cave coral, and snareweed. Cave coral and snareweed both have dim light emission to add visibility to the underwater areas. Snareweed is painful.
  • Added new gigantic stalagmite, stalactite, and columnar formations to all cavern levels.
  • Reduced flooding in the "wet" cavern biomes. There's still a lot of water sloshing around in some of them, but this should get rid of situations where there's a giant wall of water bisecting a cavern. For those who just don't like cave diving at all there's a setting to eliminate almost all of the flooding entirely.
  • Added "flawless mese blocks" hanging from the ceiling of the lava sea caverns in some areas.
  • Clusters of large hexagonal glowing red crystals on the ceilings of dry, deep caverns (in particular bloodthorn caverns) to add visibility in some biomes where glow worms don't survive.
  • New mesh-based tunnel tube nodes to make them more tubular.
  • Extra coal added to black cap caverns, and black cap gills made into excellent raw materials for torch-making - black cap biomes remain pitch black but now there's plenty of supplies for making lots of torches quickly there.
  • Floor fungus is a bit more disgusting now
  • Added a bit of glow to Nethercap gills. Doesn't do much to illuminate the caverns as a whole, granted, but it looks nice and is visible from a distance.
  • Added a soft glow to cave moss, which gives a good view of the shape of the floor in the damper biomes. Floor fungus is the dry-biome carpet vegetation and it remains unlit. Flooded caverns are also still not well lit. I think variety is nice, and some caverns should remain scary yawning chasms of blackness.

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Tue Sep 11, 2018 09:47
by redblade7
I've been having instability with caverealms since came out, and it doesn't seem to be maintained, except for some fixes by you and others. Is dfcaverns backwards compatible with caverealms?

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sat Oct 20, 2018 23:57
by FaceDeer
Afraid not, they're divergent mods with the same basic idea. Fortunately the day-job project that sucked all my free time into a vortex of business for the past few months is nearing its end point, and I'm looking forward to getting back to a little Minetest. Since I revamped a version of Caverealms that works with Subterrane I should be able to bugfix for both of them when I do.

Re: [mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Mon Dec 31, 2018 19:57
by FaceDeer
At last, I think I'm done version 1.0 of this mod.

A month ago I started to have some free time again and I dug up this mod to look for any low-hanging fruit I might be able to poke at. I thought to myself "I'm not fond of the random scattering of stalactites and stalagmites this mod makes. Real stalactites and stalagmites form 'curtains' because water drips from along cracks. I should change that."

A month later, I've done a complete top-to-bottom rewrite of Subterrane, created the Mapgen_helper mod out of utility methods I made in the process, split DFCaverns into a group of associated sub-modules for better organization, rearranged the biomes to make the different cavern layers more distinctive, created several new decorative items and a new tree type, added underground rivers and lakes, replaced the magma sea's mapgen code entirely, and added two whole new cavern layers - a layer with lakes of oil and natural gas, and an "underworld" layer that finally completes the original vision of replicating Dwarf Fortress's underground world in Minetest.

Here's a somewhat-comprehensive guide to the stuff this mod adds.

Here's a download link to the complete modpack with subterrane and mapgen_helper dependencies included - I'll create a full release on GitHub once this has been out for a little while and I haven't heard any "you blew everything up!" bug reports.

Here's a big archive of map PNGs I made of a test world if you'd like a visual sense of the scale and distribution of these caverns. I generated a map using mapgen v7, seed "5", stretching from -2000,-3200,-2000 to 2000,300,0. The magma_conduits mod was also installed, if you're wondering where those volcanoes came from. I used minetestmapper to generate a map slice every 50 meters of elevation from 0 down to -3200.

Let me know if anything goes wrong or just isn't right, this was a pretty major renovation.

Re: [Mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Tue Jan 01, 2019 08:00
by texmex
Woop! This is huge! Congrats on the release, Facedeer!

Re: [Mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Tue Jan 01, 2019 10:41
by FaceDeer
Thanks. As is often the case with Minetest mods, I bit off a much bigger task than I was expecting it to be but just kept on charging ahead anyway.

I'm interested in bug reports and suggestions regarding gameplay and balance as well as just "this thing crashes" stuff, BTW. Though I should note that some of the types of regions I added are genuinely meant to be horrible unfair no-good places that a player has to be careful not to die in. I should probably recommend airtanks and maybe wielded_light.

I should probably start looking into how mobs work, to put even worse hidden fun stuff at the bottom of the world. :) But I'm still in a mapgen-oriented headspace so not right away. Maybe something more mineralogical first, or another stab at deep_roads.

Re: [Mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sat Jan 05, 2019 00:54
by jas
I installed this on and am running it on Looking forward to checking it all out. :)

Re: [Mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Fri Mar 01, 2019 17:20
by Germain

I encounter some error (with Minetest :
ERROR[Main]: ModError: Failed to load and run script from /usr/share/games/minetest/mods/dfcaverns/df_caverns/init.lua:
ERROR[Main]: attempt to call field 'register_layer' (a nil value)
ERROR[Main]: stack traceback:
ERROR[Main]: in main chunk
ERROR[Main]: [C]: in function 'dofile'
ERROR[Main]: .../share/games/minetest/mods/dfcaverns/df_caverns/init.lua:14: in main chunk
So, I commented theses line in mods/dfcaverns/df_caverns/init.lua until there is no similare errors:
-- dofile(modpath.."/level1.lua")
-- dofile(modpath.."/level2.lua")
-- dofile(modpath.."/level3.lua")
-- dofile(modpath.."/sunless_sea.lua")
But, I'm ever happy for this mod at this time :)

Thanks a lot

Re: [Mod] Dwarf Fortress style caverns [dfcaverns]

Posted: Sat Mar 02, 2019 02:05
by FaceDeer
My guess would be that you didn't install the "subterrane" mod (or possibly the "mapgen_helper" mod that subterrane depends on). That's the mod that provides the register_layer method that's failing in this case. I'm a little puzzled, though, since that mod is in the depends file so there should have been a warning rather than a runtime error like that. I'll take a look to make sure it's all set up right as soon as I get home in a few hours.