Underground/Interior Construction - Tunneling, Dirt, Collapses

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.

I sense !!FUN!!

Great idea, I’ve always felt like this game was missing some proper DF-like tunneling. :stuck_out_tongue_winking_eye:

Addition; constructable support beams. This creates a square area (3x3 around the center) which cannot collapse unless the beam is destroyed first. This allows you to dig without fear of cave-ins by placing support beams every 2 tiles in a tunnel(not a big deal digging one tile outside of the support radius, since the adjacent tiles at risk of additional cave-in are supported by the beams and will not collapse). These support beams do not block movement, and are constructed out of 4 two-by-fours and nails, plus appropriate tools.

Does that mean you can dig about a 10 long crawlway with open spaces either side (and exits on both sides) and pretty much make a long open tunnel really quickly?

[quote=“Hyena Grin, post:3, topic:1099”]Great idea, I’ve always felt like this game was missing some proper DF-like tunneling. :stuck_out_tongue_winking_eye:

Addition; constructable support beams. This creates a square area (3x3 around the center) which cannot collapse unless the beam is destroyed first. This allows you to dig without fear of cave-ins by placing support beams every 2 tiles in a tunnel(not a big deal digging one tile outside of the support radius, since the adjacent tiles at risk of additional cave-in are supported by the beams and will not collapse). These support beams do not block movement, and are constructed out of 4 two-by-fours and nails, plus appropriate tools.[/quote]
Uh, nails are a fairly scarce resource at last check. Perhaps lashing the 2x4s together with ropes, etc or using logs, as alternatives to nails?

How are nails scarce?

Go around houses/evac shelters smash tables
???
Profit!

Nails? How are nails that scarce? You can get them by knocking down doors, smashing windows, breaking fences, smashing furniture… meanwhile rope is kinda tough to find and costs a huge amount of thread (and/or string) to make, nothing of which actually drops thread. You just have to hope you’ll find some in a house. And rope itself only spawns sporadically in hardware stores and sporting good stores.

Granted in the new update you should be able to find more string from smashing windows, but even that pales in comparison. I mean you need a stupid amount of thread/strings to make one rope, while smashing a window often gives you enough nails to use in a simple construction task.

Basically, I’ve never had problems with nails, but rope? I hate rope in construction. But I can’t think of a reason why some amount of rope couldn’t also be used. I just think you’d run out awfully quickly. Logs makes sense as an option also. Shouldn’t need to be two-by-fours, if you can’t find a wood saw.

On a side note, I can’t think of a reason why there’s not a recipe to convert scrap metal/etc into nails.

OK, fine, nails can be had if I go around cannibalizing furniture/structures. Righty-ho.

So how would it work, exactly?

Implementation wise, every z-level could have up to 6 units of dirt. A normal, ground-level square will have 3 units of dirt. An underground dirt wall will have 6. This is because each level will be separate into two parts - the main level and sub level.

So, we have a level:
[tt]
Normal:
@ Main level, Empty
####### Sublevel

Digging a hole:
@_ The ‘_’ is a dirt mound
##=#### The ‘=’ is a shallow pit

@= The ‘=’ is a dirt pile
##u#### The ‘u’ is a deep pit

@# The ‘#’ is a dirt heap

#### We can now see the level beneath.

<- Main Level
<- Sub-level

(Imagine the @ here is one more level down, on that dirt mound)
_ #
##@#### Moving into the hole will drop you down to the lower dirt heap, allowing you to keep digging
##=### You can move dirt to an adjacent wall, and it will be move to the top of that wall,

so long as it is less that 6 levels of dirt “higher” than your character.

^- Here the character is standing on 2 units of dirt, meaning he is 1 level lower the z-level 0. To the right, there are 6 units of dirt - he can’t add to that pile, since there’s a different of 7 units. But the mound to the left is only 5 units higher, and thus valid to move dirt to.

= # A dirt pile to the left, and a heap to the right. 2 an 3 units of dirt, respectively.
##@#### Here, the character is standing on a mound of dirt in z-level -1. (remember, imagine he’s one line lower)
##-### But now there seems to be a problem. There’s no valid places to put additional dirt. At least here in 2d land.

The right is now 8 units higher, and the left is 7. We’ve trapped ourselves in a hole!

Of course, the actual game is not a 2d sidescroller, so we’ll just turn things sideways, and…
_ We’ve turns sideways, and moved a unit of dirt over. This was only 5 units higher.

#### We have no successfully dug ourselves into a hole! Unfortunately, we now really do have nowhere left to move dirt.

##@### So we can’t keep moving downwards.

But we could move a unit from the side to the square we are on, getting a bit of height.

[/tt]

This is also actually indicative of some other changes I’d like to see to z-levels. Fall damage based on ‘units’ fallen, rather than levels. So you could dig a trench, and then dig a gradual path into that trench with successively fewer units of dirt.
[tt]
@ This guy can safely walk left without even making a check!

-=#

##=####
#######
[/tt]

This also means if you jump from a roof onto, say, a heap of dirt (instead of flat ground) it’s a lot safer.

This could be useful if when z-levels are done, you have to climb onto the roof to finish building it. I don’t think many people can build a roof from the inside of the building.

how would you climb out of the holes? Now we need stairs to move between levels. You must also think about the existing underground levels, how deep are they? how much would i have to dig to access a bunker from underneath? or a lab?

There could be extendable ladders that you could find in sports shops or something.

Ramps, same way you do in real life.

And I want to introduce a climbing system, that also makes use of the units difference. So you can run and climb up things, and if you jump from a piece of terrain with some extra stuff on it you’ll have a lower difficulty.

Hardware stores, certainly. Possibly a larger grocery’s Hardware aisle might have one but unlikely. Milsurp might have one.

My idea of the ladders:

  1. Ladders must be carried at hand.
  2. (a)pply ladder on ground, you can apply only if there is :
    a) Tall enough thing on diagonal/cardinal direction
    b) You apply ladder to a pit or to space where there is Z-level one lower.
  3. Move to ladder (500 movement points)
  4. Ignore all height related checks.
  5. You are free to move to any Z or Z+1 level (if ladder is on ground) or Z or Z-1 level (if ladder is on pit or at lower Z-level).

Or there could be stepladders, less rare and you can still climb onto a roof or higher floor, but at the cost of more movement points and perhaps some nutrition/thirst.

Awesome thread with awesome ideas.
One of the most frequently asked question about the gameplay is “How can I dig my own basement?”. The answer was: “You cannot do this because of the odd z-level handling and stairs behavior”. And here we have another awesome idea in prev. post: ladders! But how do stairs work now in code? As far as I can remember, they just ‘warp’ player between levels.

I think underground construction needs a lot of changes in game mechanics.

an idea for all this “useless” dirt - dirt walls? add water, mud walls? i see dirt walls as being a very basic defence line - just mounds of dirt in a line. works like a shrub for all intents, slows entities down, but still easy enough to get over. something i feel should be able to be constructed anyway.

From the sounds of it, the dirt will have to be piled into mounds anyway. You could just arrange a line of mounds, and I think they would slow movement. (or they could)

That said, it would be kinda cool if you could convert dirt mounds into dirt walls with some logs/two-by-fours but constructing retaining walls for the mound. It was a pretty common way to build up low walls in early fort construction.

Just a suggestion, when you’re working on this - might you be able to do something to track what level items have ‘fallen’ to and leave them at that level when a pit is being filled in? I’d love to have the ability to bury fallen soldiers and scientists. Also, for that matter, I think it would be hilarious if you could wait for a Zed to fall into a pit and then start burying it. But, burying zombies ‘alive’ aside, I think it would also open up an option to put graveyards in with the new churches and to let players do a little after hours digging. (And if you can ‘bury’ Zeds ‘alive’, I think it would be pretty entertaining if digging up graves had a chance of unearthing reanimated skeletons or something. Not sure how that would work into the lore, though: I die pretty early on and haven’t unearthed too much of it yet.)