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.