1. Hey Guest, is it this your first time on the forums?

    Visit the Beginner's Box

    Introduce yourself, read some of the ins and outs of the community, access to useful links and information.

    Dismiss Notice

Collapsable mining shafts / earth tunnels

Discussion in 'Suggestions & Ideas' started by braidedheadman, Nov 29, 2014.

Mods: Rainbows
  1. braidedheadman

    braidedheadman Shipwright

    Messages:
    13
    Preamble:
    Ever seen one of those tunnels that stretch from one spawn tent to the other? None of these tunnels have any kind of structural support, relying solely on the strength of compact dirt, stone, and bedrock (sometimes gold?) to remain open. It got me thinking the other day; why don't these tunnels and the builders who live in them experience cave-ins?

    Proposal:
    There ought to be a material cost to building structures deep underground. That is to say that builders should be required to place wood or stone bracing over a periodic interval of distance in order to have a properly and safely engineered tunnel or at least reduce the risk of collapse; bracing spaced further apart risks collapsed sections.

    :dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt:
    :dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt:
    :dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt:
    :dirt::dirt::dirt::castle_wall::castle_wall::castle_wall::dirt::dirt::dirt::dirt::dirt::castle_wall::castle_wall::castle_wall::dirt::dirt::dirt::dirt::dirt::castle_wall::castle_wall::castle_wall::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::castle_wall::castle_wall::castle_wall::dirt::dirt:
    :dirt_bg::dirt_bg::dirt_bg::dirt_bg::castle_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::castle_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::castle_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt::dirt::dirt::dirt::dirt::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::castle_bg::dirt_bg::dirt_bg::dirt_bg:
    :dirt_bg::dirt_bg::dirt_bg::dirt_bg::castle_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::castle_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::castle_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt_bg::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt_bg::dirt_bg::dirt_bg::dirt_bg::castle_bg::dirt_bg::dirt_bg::dirt_bg:
    :dirt::dirt::dirt::castle_wall::castle_wall::castle_wall::dirt::dirt::dirt::dirt::dirt::castle_wall::castle_wall::castle_wall::dirt::dirt::dirt::dirt::dirt::castle_wall::castle_wall::castle_wall::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::castle_wall::castle_wall::castle_wall::dirt::dirt:
    :dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt:
    :dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt:
    :dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt::dirt:

    Without bracing, dirt tunnels, especially deep ones, should collapse and fill in with fresh dirt after a period of time proportionate to their depth. Wood braces, while cheap, would be less reliable and/or require tighter spacing at greater depths to prevent tunnel collapses. Stone braces would support dirt over wider intervals and more reliably at greater depths. Anyone caught in a collapsed tunnel should be crushed.

    Auxiliary:
    This raises an interesting idea: Ventilation requirements for shafts and tunnels.

    Should builders be required to dig ventilation shafts to the surface? Could any connection to surface air provide ventilation as long as at least one end of the tunnel is connected to fresh air? Or maybe a connection every, say, 30-50 blocks apart? For those trapped in a collapsed or inadequately ventilated tunnel; should they not suffer suffocation effects similar to drowning in water, albeit slower? It doesn't necessarily need to be a 1x1 tunnel straight up but it would be an interesting way to thwart tunnelers from the surface if you can find and plug their air supply! 25252525

    Similarly, tunnel sections can be deliberately collapsed by breaking the braces, inducing suffocation.
     
    Clev, Osmal, BillyWeedman and 15 others like this.
  2. kittycity

    kittycity Haxor

    Messages:
    256
    That would be pretty cool but I would doubt it would happen.

    But the suffocating in blocks sounds better than just teleporting out of them. It also fixes the bug of lag blocking to teleport into bases
     
  3. Apronymous

    Apronymous Bison Rider

    Messages:
    326
    ^ This.

    If this ever did get implemented,I'd see it encouraging more door spam underground.
    But (non-cancerous) door spam is usually a good thing (especially in tunnels), so I doubt I'd complain.
     
  4. TROPICALear5

    TROPICALear5 Shopkeep Stealer

    Messages:
    38
    i think this would work and i would like it. i hate rats which stay in holes for the whole match i wish it was more challenging for them. thanks:thumbs_up::thumbs_up:
     
  5. Fernegulus

    Fernegulus Bison Rider

    Messages:
    400
  6. 8x

    8x Elimination Et Choix Traduisant la Realité Forum Moderator Staff Alumni Tester
    1. The Young Blood Collective - [YB]

    Messages:
    1,325
    This would be fun for a mod, a "sandbox realistic mining" or something like that. I lieks, it would take building (digging, mining) into something interesting, like underground quests.
     
    Fernegulus likes this.
  7. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    Interesting ideas, but a couple of issues that I see:
    - How do you make it apparent to the player that what they are doing is unsafe (by structural integrity or lack of air)?
    - How do you make it apparent how to make the tunnel safe?
    - How would the dirt above behave when a tunnel caves in? Or do you propose new dirt is spawned (from the back wall)?
     
    SirDangalang likes this.
  8. J-man2003

    J-man2003 Haxor

    Messages:
    352
    Would require major amounts of coding
     
  9. zampanothechimera

    zampanothechimera Shopkeep Stealer

    Messages:
    110
    how long did it take you to make this
     
  10. Asu

    Asu THD Team THD Team Forum Moderator

    Messages:
    1,580
    No, it wouldn't. But it would be very slow as far I can tell.
    I don't think this will ever happen, except in a (heavy) mod.
     
  11. J-man2003

    J-man2003 Haxor

    Messages:
    352
    Yeah, saying that tunneling is an overused strategy if this was added it would break the game.
     
  12. braidedheadman

    braidedheadman Shipwright

    Messages:
    13
    Sorry for the late reply everyone!

    ^ How would it break the game, exactly? What's your argument to support this claim? It's just a material and engineering requirement that can, in theory, be mitigated entirely by wood alone; an unlimited, quickly produced resource in KAG that every builder should be carrying with them in large quantities anyway.

    I think you've missed the point. The coding would check for the support structure pattern, which in this case, at a minimum, consists of 6 wood or stone blocks on the ceiling and floor portions of the tunnel and wood/stone back wall in the middle connecting the two (think of an I-beam support structure), spaced across regular intervals governed by depth. I realize it's not exactly a 'pretty solution' but we must work with what we've got. Doors themselves, excluding their backwall component, would not contribute to the load-bearing portions within the support structure ( ie: a door with a blown out backwall, rare but does happen, would provide no support) nor would they function as load bearing structures in and of themselves outside of it, missing as they are the cieling and floor portions of the I-beam pattern. Solitary doors or even lengthy rows of doors without the support of I-Beams at regular intervals awould simply be consumed/replaced by dirt in the event of a cave in within the affected area.

    Point #1 & #2:
    Making it apparent to the player that their structure is unsafe could be achieved with a certain "grace period" before a major collapse event occurs. Suppose the player places their supports too far apart. A subtle clue that they may have underestimated their engineering requirements could be indicated by one or more "micro-collapses" in the form of single-block dirt tiles regenerating on the floor of the tunnel. Regular builders would soon learn what their engineering requirements will be at a given depth through experience - or through community education on forums or wiki articles. Old players should be reading the change logs as they come; new players will learn from old players what is required, what works and what does not.

    This would hold true for any structures that aren't part of the I-beam pattern (ie: incomplete or damaged I-beams, walls without structural support, etc). Wood structures and backwalls, including stone, are utterly consumed. Stone blocks in structures involved in a cave in event might turn into poor-value crushed stone deposits (less than 10 stone units recoverable).

    Tunnel-digging knights pretending that their swords are combination shovel-pickaxes are SOL if they think that their tunnel will lead them to salvation without the support of a builder.

    Point #3:
    For the sake of ease of coding and for gameplay/mechanical considerations, I don't see any need for the proposed changes to affect tiles and structures above the tunnel in the event of a collapse. We don't need a return to carved-out landscapes before kegs and other explosives were tweaked to eliminate terrain damage. When simulating a collapsed tunnel, dirt blocks would simply regenerate, replacing dirt backwall tiles with solid dirt at a rate proportionate to the tunnel's depth (ie: how many of either solid and/or dirtwall tiles are above the tunnel) and in proportion to the soundness of the builder's support structures and their correct spacing.

    I'm not sure I understand. How long did it take for me to draw the visual aid? I don't know.... 5-10 minutes? How long did it take me to come up with the idea? Short answer: Just a few minutes to put my thoughts down in written form. Long answer: Months of playing the builder class, getting to know its nuances and how it and other classes interact with structures in KAG and realizing that subterranean structures have no engineering or material constraints placed upon them whatsoever and could therefore do with an investigation into their balance. All this, months before these ideas began to coalesce into anything as concrete as what we see here.
     
  13. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    A comment about "rats" in the game reminded me of this old suggestion. I would actually like to bring this one up again.

    Builders digging tunnels is a big issue actually, because knights and archers can't really do much about it, at any significant depth. There's also the side effect that such tunnels are harder to spot so that the rats/moles get very close without being detected, while on the other hand, when they are easier to spot (not so deep or entrance is clearly visible), they tend to draw a lot more attention than dirt. By that I mean that players are more worried about destroying doors rather than dig around them, which is normally much faster. While I wouldn't suggest changing that, closing off (collapsing) old tunnels would ensure they lose the attention that isn't needed any longer. Players will worry less about doors packed in dirt.

    I think, therefore, it would make some sense to let dirt blocks that are not on the surface (collision line check?) "re-spawn" after a certain time (lets say every 5-10 minutes), but instead of forcing the player to place specific blocks like sketched here, perhaps adding backwalls could prevent, or delay, collapses. A tell for when a tunnel is in danger of collapsing (short time remaining) could be some simple particles trickling down.

    I've always also felt erosion a big problem, but that's not as easy to fix in an intuitive manner. However, filling up old tunnels and caves could help a little bit. I doubt it's ever going to happen, but anyway. Just wanted to put the idea out there again.
     
    Last edited: Apr 21, 2016
    Magmus likes this.
  14. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    It'd be doable in a mod for sure - i'd be too worried about the performance implications to seriously consider anything like this for vanilla though.
     
    J-man2003 and EhRa like this.
  15. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    I do realize it might be too costly performance-wise on multiplayer servers, even at low frequencies, or perhaps especially then. Maybe it could be more relevant in sandbox/solo modes. Saying that it's doable in a mod is practically just dismissing it entirely. "Anything" is possible in a mod. It's just not likely ever going to happen, because no one cares enough to do it (even if they knew how).

    What if the dirt regeneration was more random? Let's say the server every 10 seconds picks one, or a few, random empty, non-backed underground tile(s) and fills it/them up. I'm not sure if the effect would be worth it though, but I think that, in general anyway, small things like this makes the game world seem a bit more lively and interesting. I mean, the game doesn't strictly need chickens, fish or grain either, but they're there nonetheless.
     
    J-man2003 and EhRa like this.
  16. EhRa

    EhRa Ooooooof Staff Alumni Donator
    1. KRPG

    Messages:
    810
    Something like, after say 5 minutes, a dirt walked open space has say a 5% chance (or less) to fill in.
     
  17. Geti

    Geti Please avoid PMing me (poke a mod instead) THD Team Administrator Global Moderator

    Messages:
    3,730
    People care enough to suggest it. Perhaps someone cares enough to code it up. I'm just being honest, it's not something I'm interested in having added to the overhead of vanilla servers.

    The way to do it without too much overhead would be to essentially:
    Code:
    //example regenerating dirt script
    #define SERVER_ONLY
    int current_tile = 0;
    
    void onTick(CRules@ this)
    {
    	CMap@ map = getMap();
    	int tilemapsize = map.tilemapwidth * map.tilemapheight;
    	//adding a large prime and then looping around the tilemap means we'll check every tile eventually
    	current_tile = (current_tile + 1046527) % tilemapsize;
    	Vec2f position = getTileWorldPosition(current_tile);
    
    	int type = map.getTile(current_tile).type;
    	if(type == tile_ground_back)
    	{
    		//raycast check for dirt above here if you dont want all holes filling in
    		map.server_SetTile(position, tile_ground_d0);
    	}
    	else if(type <= tile_ground_d0 && type >= tile_ground_d1)
    	{
    		if(type == tile_ground_d1)
    		{
    			map.server_SetTile(position, tile_ground);
    		}
    		else
    		{
    			map.server_SetTile(position, type - 1);
    		}
    	}
    }
    (not tested, but that's the general idea)
    but if you try this you'll find that it fills in all sorts of dirt that you wouldn't really want it to, and doesn't allow anything more than solid dirt maps - no caves or holes or other interesting things, or at least they'll start getting filled in over time.

    As I've said, I'm not interested in it being part of vanilla - but if someone wanted it as a mod, for sandbox or whatever reasons, the code is there for you to tinker with. Don't say I never give you anything.
     
    toffie0, Osmal, TheBloodyWolf and 6 others like this.
  18. Clev

    Clev Resident Stoner Staff Alumni Donator Tester

    Messages:
    106
    I'm sorry but that was the most eloquent way of saying no that I've ever witnessed in my life so I have to thank you Geti.
     
    Last edited: Apr 24, 2016
  19. Vermilicious

    Vermilicious Ballista Bolt Thrower

    Messages:
    232
    Expecting your players to also be adept programmers, in my mind, is a mistake. There are some dedicated people here, but they are relatively few, and even fewer actually agree on anything. There are many good reasons for rejecting ideas for the vanilla game, of course, but don't expect people to accept a "no", then go on learn programming and lastly figure out how KAG works. A player is more likely to give up his thought, keep playing for a little while without the feature and eventually perhaps lose interest in the game entirely. Anyway, I'm sorry for spending time on such points (again), but really, I'm still a bit surprised at the level of dismissal from KAG officials to suggestions from the community (in general). Really nice of you to supply some example code though, for those that wish to pursuit this (now or later). Personally, I'm "busy" trying to motivate myself to continue my previous/current projects.
     
    J-man2003 likes this.
Mods: Rainbows