Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: Digging in the dirt (next version)  (Read 995 times)

slMagnvox

  • Bay Watcher
  • Attend Party
    • View Profile
Digging in the dirt (next version)
« on: June 05, 2007, 07:08:00 am »

If I dug a hole down into the hillside -and I've been under the impression I'll be able to in upcoming versions- through some kinda non-rock soil type of dirt, should the dirt-cave collapse if it got any bigger than say, 3x3?

Added to the list of ways to conveniently dispose of dwarves?  Flood room, drawbridge, digging their own grave.

Logged

hactar1

  • Bay Watcher
    • View Profile
Re: Digging in the dirt (next version)
« Reply #1 on: June 05, 2007, 08:50:00 am »

I don't think the cave-in mechanics have been decided at this point.  With the Z-axis, things become more difficult, because even a 2x2 chunk should fall if you dig out everything above and around it.  Maybe dirt will be given a weaker stability rating; I don't know.

Extrapolating from the glacier screenshot on the dev_next page, if you dig down a couple levels in the dirt, you'll hit bedrock and be able to start a regular stone fortress.

Logged

slMagnvox

  • Bay Watcher
  • Attend Party
    • View Profile
Re: Digging in the dirt (next version)
« Reply #2 on: June 05, 2007, 04:03:00 pm »

A little after I posted this I read a thread in the General Discussion forum that said collapses were out temporarily.  I haven't really tried that hard to keep up with the FotF thread.  I missed hearing any talk about new collapse behavior, which has at least been talked about before, just not sure where.
Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Digging in the dirt (next version)
« Reply #3 on: June 06, 2007, 02:15:00 am »

I haven't planned it out completely, though I have some somewhat vague notions.  I didn't really want to get into until I got there, but rock hovering in midair should definitely fall down, and this might also apply to any "sand tiles" (sand is not yet a custom fluid) or other loose soil tiles.
Logged
The Toad, a Natural Resource:  Preserve yours today!

Zereth

  • Bay Watcher
    • View Profile
Re: Digging in the dirt (next version)
« Reply #4 on: June 06, 2007, 03:39:00 am »

quote:
Originally posted by Toady One:
<STRONG>I haven't planned it out completely, though I have some somewhat vague notions.  I didn't really want to get into until I got there, but rock hovering in midair should definitely fall down, and this might also apply to any "sand tiles" (sand is not yet a custom fluid) or other loose soil tiles.</STRONG>

Although dwarves should be able to build retaining walls to keep sand or dirt tiles from collapsing into neighboring tiles, which would require less material and work than a floodgate. (although "less material" only matters once we're keeping track of sub "log", "chunk of rock", or "metal bars" amoutns of stuff.)

And should also probably display like smoothed walls do, since you could do this to an area as small as one tile if you really wanted to.

Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Digging in the dirt (next version)
« Reply #5 on: June 06, 2007, 04:15:00 pm »

Could you take a look at a system I described in this thread, Toady? It seems plausible enough... Material hardness is already in, I presume, so reducing it basing on distance to nearest support should be doable..
Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Digging in the dirt (next version)
« Reply #6 on: June 06, 2007, 11:31:00 pm »

The problems come up with the details of the implementation and trying to keep the CPU/stoage under control. For instance, I'd like to catch things like (crosssection looking from side):

code:

XXXXXXXX...XXXXXXXX
.XXXXXXX...XXXXXXX.
..XXXXXX...XXXXXX..
...XXXXX...XXXXX...
....XXXX...XXXX....
.....XXX...XXX.....
......XX...XX......
.......XX.XX.......
........XXX........
.......__X__.......
_______X___X_______

X = wall
. = air
_ = floor


This is not a local problem.  Weight/pressure needs to be tracked, ideally, if I can do that.  The problem is there is a massive spike shaped thing pointing down at one pillar, and the pillar itself has a hallway under it.  Having a hallway under a wall should be fine though, in many cases, as long as the weight of the ceiling has a way around, but not if there is too much weight being localized so severely.  It could easily look like:

code:

XXXXXXXX...XXXXXXXX
.XXXXXXX...XXXXXXX.
..XXXXXX...XXXXXX..
...XXXXX...XXXXX...
...XXXXX...XXXXX...
...XXXXX...XXXXX...
...XX.XX...XX.XX...
...X...XX.XX...X...
...X....XXX....X...
...X...__X__...X...
___X___X___X___X___

X = wall
. = air
_ = floor


which is more stable, but perhaps not enough, depending on exactly how much the stuff weighs.  But it's tricky to divide up how much goes where and what the loads are.  When I get to this point, I'll be looking for specific solutions.

I'm not sure what I'll actually be able to get away with, since there are a lot of calculations, and I haven't thought about the actual algorithms all that much yet because the time hasn't come.  I've just drawn a bunch of diagrams of worst-case scenarios.  And everybody will come up with worse physics-defying monstrosities when they are mining.

Logged
The Toad, a Natural Resource:  Preserve yours today!

Jaqie Fox

  • Bay Watcher
  • Genuine Girl Techie!
    • View Profile
Re: Digging in the dirt (next version)
« Reply #7 on: June 07, 2007, 01:05:00 am »

cave-ins are never immediate (ok maybe not NEVER but you get the point) perhaps you could split it into say... every 20 frames, a calc is done on a certain portion of the fortress, a certain cube of area.  Ignore areas that haven't been dug into (or at least lessen the calcs done there to every 150 frames, concentrating on what the player can see) each area is done in turn, until you come back to the first area that has been calced for possible cave-in situation.  that should lessen the load severely on cave-ins.  You can actually use this trick for a lot of things in a game like this.
Logged

Sean Mirrsen

  • Bay Watcher
  • Bearer of the Psionic Flame
    • View Profile
Re: Digging in the dirt (next version)
« Reply #8 on: June 07, 2007, 05:10:00 am »

......  damn. I tried writing an explanation to an extension of my system right now, but I kinda got tangled up in details.  :) I guess I'll write a more comprehensive 'guide' to it later.

Basically, if you run a check every minute or so for 'outstanding' clusters of rock and other cells, then add up their mass and reduce them by the hardness of all cells connected to them from other areas, you should get your desired effect. Mass and hardness would have to be properly made up first for it to work. Like, the hardness of a rock cell should be enough to uphold a pillar of 5 same cells.

Edit: wait, no. I meant "add up the mass and reduce the hardness of all connected cells". As in, a stockpile of steel columns will severely decrease the hardness of rock below it, so much so that digging a 1 wide tunnel under it could break the floor.

[ June 07, 2007: Message edited by: Sean Mirrsen ]

Logged
Multiworld Madness Archive:
Game One, Discontinued at World 3.
Game Two, Discontinued at World 1.

"Europe has to grow out of the mindset that Europe's problems are the world's problems, but the world's problems are not Europe's problems."
- Subrahmanyam Jaishankar, Minister of External Affairs, India

hactar1

  • Bay Watcher
    • View Profile
Re: Digging in the dirt (next version)
« Reply #9 on: June 07, 2007, 10:23:00 am »

Whatever the final decision, IMHO the rule needs to be both easy to understand (so new players can potentially learn it by doing) and easily to calculate in your head.  Right now, looking for 7x7 squares is easy.  You can build your fort the way you want it without too much time spent calculating what is stable and what isn't.  Scrolling up and down between z-levels and calculating advanced structural mechanics isn't many people's idea of fun, nor is having 1000 tons of rock fall on your farm because your made your 3rd-floor apartments too porous.

If the algorithm needs to be complex, perhaps miners could give a warning if they start to dig out an unsafe square, much like how the wet-rock warnings supposedly work.  "The rock shifted under my pick" or something.  Come to think of it, doing the calculations once before every mining action is probably fairly efficient, since you don't have to calculate anything when/where there is no mining going on.

Logged

Toady One

  • The Great
    • View Profile
    • http://www.bay12games.com
Re: Digging in the dirt (next version)
« Reply #10 on: June 08, 2007, 01:06:00 am »

I was thinking of doing the calculation when you are designating the dig.  In either case, it seems like the day's of accidentally cave-ins based on not understanding simple geometric rules are over, depending on how things turn out.  Certainly not going to leave a cryptic system in to squash fortresses at random.  That wouldn't be fun for very long.

edit:  I mean the calculation for the warning.  Other calculations would have to be done at other times.

[ June 08, 2007: Message edited by: Toady One ]

Logged
The Toad, a Natural Resource:  Preserve yours today!