I’d like to see some changes to how the underground works, and especially once we get z-levels working properly, open up a lot of possibilities.
Part 1: Digging through dirt
Dirt ‘walls’ squares can be dug from the side or from above.
When you select the “dig” action, you select a “dig from” and a “dig too”. The dig from square is reduced one dirt level, and the dig too square is increased by one. If the square contains a large container, like a wheelbarrow, trunk, or crate, that container will instead be “filled” with dirt.
If you are above, and dig a pit three levels deep, it will “burst through” to the z-level below and become a hole. So, shallow pit -> deep pit -> hole.
From the side, you will be able to dig up to three levels of passage. Crawlway, Tunnel, Open Space. Crawlways make the player move very slowly, and prevent you from accessing your inventory and give big penalties to melee combat. I’d also love if they made you only able to see and shoot in one direction, but we’ll see about that. Tunnels are hands-and-knee spaces with moderate penalties to movement and combat, basically rubble equivalents (without a chance of hurting yourself). Open spaces are just normal squares. Vehicles and large monsters cannot fit into crawlspaces or tunnels.
If the space above is open, this instead becomes Dirt Heap instead of Crawlway, and Dirt Mound instead of Tunnel.
You can ‘pack’ a dirt space to reinforce it a bit with the right tools and materials (or mutations), assuming it has at least one unit of dirt still left in it, or construct actual reinforcements in ‘tunnel’ or above spaces. Spaces dug out by monsters are usually ‘packed’ automatically. 'pack’ed reinforcement is made of and thus consumes a unit of dirt.
When you dig a dirt wall from the side and there is dirt ground above it, there will be a chance of collapsing based on the number of adjacent (and diagonal) dirt walls (3% chance), crawlways/tunnels/open dirt spaces(12% chance), packed crawlways/tunnels/open dirt spaces(6%), and open reinforced dirt spaces(1%). If the dirt square above has already been dug out some, this chance increases, 10% for shallow pit and 25% for a deep pit, although this also reduces the amount of dirt that collapses.
A collapsing space will move dirt from the above ‘ground’ square, and may also pull in some neighbouring above squares if there is a resulting hole. That dirt is added to the current square or adjacent squares (if adjacent squares have 2 units less dirt than the current square).
If a space collapses, redo the collapse check for all neighbours.
Part 2: Tunneling monsters
Some monsters will have the ability to tunnel. These will usually have the following:
Dirt is moved from square in front to square directly behind monster.
Square the monster is on is always considered a “solid wall” for collapse calculation purposes.
Dug squares are always considered “packed”.
This means that if a Graboid, for example, digs through the ground, they will leave a ‘crawlway’ behind - just in case the player really wants to follow them! (unless it collapses, of course)
Part 3: Pushing dirt
Players and some monster will also have the ability to “push” dirt. This will move a unit of dirt from a square to the one directly behind it. If that square is full, it will instead move it to one of the diagonals behind it, randomly. If there is no empty square behind it, the action will fail.
This is most like to come into play when encountering, say, a hulk. If you crawl through a one space wide crawlway, don’t expect the hulk to give up just because he can’t follow you! He’ll smash the dirt to the square behind it, turning that crawlway into a tunnel and the space behind it into a tunnel. Then he’ll do it again, turning the first square into an open space and creating a nice pile of dirt on the other side, which he can now access from the diagonals (unless it’s a long hallway, in which case this process will be repeated for as long as he can!).
This runs the same risk of collapsing as digging does.