Bay 12 Games Forum

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 ... 5 6 [7] 8

Author Topic: Cave-in system  (Read 2180 times)

Deimos56

  • Bay Watcher
  • [PREFSTRING: unicorpion]
    • View Profile
Re: Cave-in system
« Reply #90 on: May 22, 2012, 06:48:29 pm »

If checks don't happen often, there might be the possibility of something remaining totally unsupported hovering in the air for a month until the game realizes what's going on.

[PHYSICS:CARTOON]?
Logged
I'm curious what the barely conscious ai wrote about.
Well that went better than expected.  He went nuts and punched a rabbit to death, then the dogs and the whole dining hall ripped him to shreds.

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: ACCEPTABLE]
    • View Profile
Re: Cave-in system
« Reply #91 on: May 22, 2012, 07:59:01 pm »

Well, if you insist on a more concrete solution...

I could see a fast-and-dirty check that takes place in realtime with any given excavation to check for serious problems, like completely cutting the last support out from under something, so that cave-ins that occur because you have supports holding up a wall that all collapse at once will cause that sort of intentional cave-in immediately when the game sees something like a wall just hovering in mid-air, and it would probably be best to have some checks for something like 10 straight tiles of overhang with no support to fall apart very quickly.

Beyond that, you could have a delayed every 500 or 1000 ticks check of all tiles that are potentially modified based upon drawing a cone upwards from the tiles you mined to schedule them all for having a support test. 

I still say that shear forces on "overhangs" or "ceilings" are more important than compressive stresses (the kind of stress where you rest an entire mountain on one soap pillar). 

I would think we could just start with whatever shear force will cause a generic stone ceiling under the strain of generic stone tiles to collapse, and then just extrapolate from there what all the other densities of stones/metals/woods/etc. and shear forces that will snap those same materials.  This will, however, unfortunately mean that when we get real data for some of these things, stones like chalk and sandstone are probably going to snap like twigs.  There may be nothing for it but to try to reinforce those walls with different materials.

In fact, I think it would be a better solution to have a "reinforce wall" type of construction, where you add supports into a wall tile.  This could be used to put, for example, wooden beams in a dirt wall to keep it from collapsing, or putting steel crossbars to reinforce a chalk or rock salt wall and ceiling.  Alternately, it could be done as a "replacement" wall, where you mine and replace what you mine with walls or supports at the same time.

We should aim for a generic ceiling to be able to handle 3 tiles of straight overhang at a time.  That's enough for the 6x6 rooms.  We can easily fit workshops in that, and we might be able to work stockpiles that have walls or supports every 5x5 tiles or 4x4 tiles. 

OK, I'm not entirely sure my math will be correct on this, so someone feel free to correct me, here... The formula itself would be based upon leverage - the biggest strain will be on the tile that is attached to the wall, as I said before:  (Side View):

#
####
#
#####

The underlined tile is under the most strain.  It will snap when it hits its Shear Fracture value, which for generic stone is 15000.  Therefore, I'm calibrating the formula here to make it so 4 tiles of overhang produces just over 15000 shear strain.

Now, not all these tiles are equal - the further they overhang, the more leverage they have in pulling down.  To keep things simple, I'll assume that only half the first tile's weight applies to shear force, because we're averaging the distance away from the wall.  The next tile's weight counts 1.5 times.  The third, 2.5 times.  The fourth, 3.5 times.  Because, for this example, we are using an uniform material, we can just add these averages together for ease, and it adds up to 4.5 times the mass of a tile for a 3-tile overhang, and 8 tiles the mass of a tile for a 4-tile overhang. Since we're aiming for the difference to be between being under or shooting over 15000, having nearly double the leverage makes for a nice wide strike zone for our arbitrary formula.

The default density of stone from the template is 2670.  Assuming some generic constant for the volume of a tile, we can multiply the default density by the leverage by the constant to find the total shear strain of this example, we could say, since the numbers add up nicely for this example, that the constant for volume is just 1. 

For the 3-tile overhang, 4.5 * 1 * 2670 = 12015 < 15000, so the 3-tile overhang only exerts a shear force of 12,015 urists, and the wall can withstand 15,000 urists before failing, so the wall stays.

For the 4-tile overhang, 8 * 1 * 2670 = 21360 > 15000, so the 4-tile overhang exerts more than enough shear strain for the stone tile to fail, and a cave-in will occur. 



I also want to point out, however, that we can have different thicknesses for all these materials.  We have walls, which take an entire tile, we have floors, which take some arbitrarily small volume of a tile, and we could hypothetically have some sort of arch tile or truss support beams or something, as well.  These could all have different masses, and have different thicknesses that are used when determining how much shear strain they will withstand. 

You could, for example, make a room that occupies a 2 z-level tall area.  Its sides on the second z-level are walls, but then it just becomes floors on the z-level above them every tile beyond that.  This way, you could create a sort of "arch" in the ceiling, because floors and walls have different thicknesses.

Code: [Select]
_________
##     ##
#       #
#########

In this case, the leverage equation is different, because that wall tile is much thicker than the floor tile, so the floor tiles the wall tile supports put much less shear strain on the wall tile, relatively speaking.  In fact, the first floor tile may be what snaps first. 

If we had some sort of support that could be attached to walls to act as a truss that supports an overhanging ceiling or a bridge, this could become more smooth, and allow longer stretches, or allow players to make ceilings from less functional materials.

Code: [Select]
_____________
###/     \###
#/         \#
#############

Ultimately, however, I think that a more realistic cave-in system would cause players to either avoid materials like rock salt as a material to build their fortresses within in favor of materials more like granite, or else to replace all their walls or fortify them with wood or other materials that are lighter building material. 
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
The Economy isn't like a big truck.  It's more like a series of rubes.

Improved Farming
Class Warfare

King Mir

  • Bay Watcher
    • View Profile
Re: Cave-in system
« Reply #92 on: May 22, 2012, 09:24:46 pm »

Well, if you insist on a more concrete solution...
I should know better than ask for such a thing in a thread you're in. Guaranteed wall of text.

Quote
In fact, I think it would be a better solution to have a "reinforce wall" type of construction, where you add supports into a wall tile.  This could be used to put, for example, wooden beams in a dirt wall to keep it from collapsing, or putting steel crossbars to reinforce a chalk or rock salt wall and ceiling.  Alternately, it could be done as a "replacement" wall, where you mine and replace what you mine with walls or supports at the same time.
Yep, I suggested this feature earlier. In addition to pillar construction that could be placed under other buildings.

Quote
We should aim for a generic ceiling to be able to handle 3 tiles of straight overhang at a time.  That's enough for the 6x6 rooms.  We can easily fit workshops in that, and we might be able to work stockpiles that have walls or supports every 5x5 tiles or 4x4 tiles. 
For most rock, that seems reasonable. For dirt, that's too wide.

Quote
OK, I'm not entirely sure my math will be correct on this, so someone feel free to correct me, here... The formula itself would be based upon leverage - the biggest strain will be on the tile that is attached to the wall, as I said before:  (Side View):

#
####
#
#####

The underlined tile is under the most strain.
Realistically, the tile under the most strain should actually be the wall, unless it's reinforced on the other side, or has a different thickness than floors:

Code: [Select]
.
 ####
 %
######
Though, that would change if you add a counter weight were added to the structure.

Consider:
Code: [Select]
.
 #####
 ####
 ###
 ##
 #
######
A building like this should eventually fall over, with the bottom most wall breaking first.

Quote
Ultimately, however, I think that a more realistic cave-in system would cause players to either avoid materials like rock salt as a material to build their fortresses within in favor of materials more like granite, or else to replace all their walls or fortify them with wood or other materials that are lighter building material.
Which would be great. Different usefulness for different stone is a much needed feature in DF, because there are so many different stone types that are functionally identical.
Logged
To tread the sharp edge of a sword
To run on smooth-frozen ice,
One needs no footsteps to follow.
Walk over the cliffs with hands free.

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: ACCEPTABLE]
    • View Profile
Re: Cave-in system
« Reply #93 on: May 23, 2012, 12:28:10 am »

I should know better than ask for such a thing in a thread you're in. Guaranteed wall of text.

I thought that was what you were asking for... "detailed" usually does not imply "brief".

Consider:
Code: [Select]
.
 #####
 ####
 ###
 ##
 #
######
A building like this should eventually fall over, with the bottom most wall breaking first.

Yes, I was thinking of it like a shelf where the supports for the shelf will fail before the wall itself does.  It would depend on how the thing is constructed, but in some cases, you'd be right, the wall would fail if it were solidly enough connected to the overhang.

The main pillar just plain being crushed, however, is sort of what I mean by the notion of the soap bar supporting the mountain problem.  These inverted pyramids may cause a problem where the overhang does actually cause a cave-in on its own, depending on how the physics of it plays out - those stress calculations I was mentioning would still apply for shear forces starting at least with the second-to-bottom-most tile potentially being snapped by all those other things built off it overhanging. 

... But I'm not really sure how those calculations would go, and it's too late at night for me to try to figure them out. 

The problem of the upside-down pyramid type of structure is that if we start declaring them no longer possible, we need to have an entirely different formula working on them.

Real walls, as I said earlier in the thread, either become thicker the lower down you go, or they use different types of materials to make up the bulk of the wall with some reinforcing materials that become thicker as you go downward.  The bottoms of most skyscrapers are more steel than anything else, with steel beams that are tremendous, but which become thinner as you go up. 

For any given building material, what you'd find is that walls would have to be built at a certain slope.  Basically, you'd need to have a formula where you would measure enough walls built on top of a given wall, and then say that if there aren't walls to the side of that wall, then it will be crushed.  If there are walls to the side of it (it's part of a base of a tower that is several tiles wide), then you would have to check the other nearby tiles to find which ones are at the edges of this base of the pyramid, and see if they are crushed, or if the base is broad enough to not be crushed.  This would naturally lead to a certain minimum slope of a wall for a given material type.

Of course, this is actually just a backwards way of thinking about that whole "cascade" stress check I was talking about earlier.
« Last Edit: May 23, 2012, 12:34:50 am by NW_Kohaku »
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
The Economy isn't like a big truck.  It's more like a series of rubes.

Improved Farming
Class Warfare

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: Cave-in system
« Reply #94 on: May 23, 2012, 12:35:19 am »

Quote
(Side View):

#
####
#
#####

The underlined tile is under the most strain.
Realistically, the tile under the most strain should actually be the wall, unless it's reinforced on the other side, or has a different thickness than floors:

Code: [Select]
.
 ####
 %
######
Though, that would change if you add a counter weight were added to the structure.

I believe the top-down view of the first example would be:
Code: [Select]
#######
#.....#
####..#
#.....#
#######

In which case the underlined tile would be the one bearing the most mechanical stress, and with the least neighbors to bear it up.  As in the vanilla game as-is, support would not extend diagonally.

Interestingly enough, the current supports that are in-game already offer support for the square above them and the ones north, south, east, and west of that tile.  The only thing that's missing from Kohaku's suggested support addition is the ability for it's support to extend laterally in the same way.  You could have the supports go straight down as is:

Code: [Select]
Side View:
  ###
 #| |#
# | | #
#######

In this example, all wall tiles are about equally supported, as are all ceilings.  In a 7x7 2 z-level high room.  The Supports in-game already do not block movement.  As a bonus they can be hooked up to switches and destroyed, which depending on the material you made a room that shape out of, might not even collapse the room.
« Last Edit: May 23, 2012, 12:45:22 am by Jeoshua »
Logged
I like fortresses because they are still underground.

breadman

  • Bay Watcher
    • View Profile
Re: Cave-in system
« Reply #95 on: May 23, 2012, 02:19:24 pm »

If a Dwarf is told to mine out a tile, a quick calculation is made of what will happen to the surrounding area when he does.  If it's determined that mining out a tile will cause a cave-in, the dig job gets canceled just as it would when the Dwarf is told to dig into a reservoir of water or magma.

Urist McMiner cancels dig: Unstable Stone.

For even more Fun, you could have this happen with a percentage based on the miner's skill.  Dabbling miners won't ever cancel due to instability, but legendary miners always will.
Logged
Quote from: Kevin Wayne, in r.g.r.n
Is a "diety" the being pictured by one of those extremely skinny aboriginal statues?

kaenneth

  • Bay Watcher
  • Rider of the Night Fury
    • View Profile
    • Terrible Web Site
Re: Cave-in system
« Reply #96 on: May 23, 2012, 03:14:28 pm »

The problem is we only have a display granularity the size of tiles.

I's easy enought to imagine to imagine that if a wall was rendered in quarter-tiles it would be:

  #
  #
  #
  #
 ##
 ##
 ##
 ##
###
###
###
####
####
####
####

but it's just displayed as:

#
#
#
#
Logged
Jeeze. Any time I want to be sigged I may as well just post in this thread.
That is an application of trigonometry that never occurred to me.
I'm getting cake.

Jeoshua

  • Bay Watcher
  • God help me, I think I may be addicted to modding.
    • View Profile
Re: Cave-in system
« Reply #97 on: May 23, 2012, 07:58:00 pm »

Why is that a limitation in any way?  With the current system everything... EVERYTHING is the size of a tile or smaller.  From Dragons to Fleas.  Pebbles to Boulders to Walls.

I guess I'm just not understanding you.  Why would this help a cave-in system?  To have more tiles to calculate, that is.  It's "easy enough to imagine" that they're any shape you want, but as far as the game is currently concerned... they're not.
Logged
I like fortresses because they are still underground.

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: ACCEPTABLE]
    • View Profile
Re: Cave-in system
« Reply #98 on: May 23, 2012, 10:02:16 pm »

Why is that a limitation in any way?  With the current system everything... EVERYTHING is the size of a tile or smaller.  From Dragons to Fleas.  Pebbles to Boulders to Walls.

I guess I'm just not understanding you.  Why would this help a cave-in system?  To have more tiles to calculate, that is.  It's "easy enough to imagine" that they're any shape you want, but as far as the game is currently concerned... they're not.

Because declaring a wall to be .5 meters thick even though it occupies a 2-meter thick tile, and then making the base of the wall to actually be 2 meters thick would significantly change the mass of the wall, and in turn, make it structurally more stable against the compression fracture force. 

Otherwise, we would have to literally make a 4-tile thick wall if a wall were tall enough to require the base of the wall be four times as thick as the top. 
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
The Economy isn't like a big truck.  It's more like a series of rubes.

Improved Farming
Class Warfare

King Mir

  • Bay Watcher
    • View Profile
Re: Cave-in system
« Reply #99 on: May 24, 2012, 12:38:21 am »

How about treating each tile as if it has the mass of a thin wall and the compressive strength of the thickest wall that could fit in the tile?
Logged
To tread the sharp edge of a sword
To run on smooth-frozen ice,
One needs no footsteps to follow.
Walk over the cliffs with hands free.

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: ACCEPTABLE]
    • View Profile
Re: Cave-in system
« Reply #100 on: May 24, 2012, 10:07:06 am »

How about treating each tile as if it has the mass of a thin wall and the compressive strength of the thickest wall that could fit in the tile?

Aside from the fact that it's total bullshit? 

It's probably one of the only things that will make sense.  Either that, or when we build or designate engraving for walls, we can determine thickness, but even then, we'd need to have some sort of visual clue as to how thick a wall actually is before that could make sense.  So bullshit physics is probably the best answer. 

In fact, I still think it's probably best to just give up on the idea of walls being destroyed by "crushing" altogether, and only focus upon cave-ins caused by insufficiently supported overhangs. 

Players can at least pretty easily grasp the concept that if you're going to have giant open areas in a cave that you better reinforce the ceiling somehow.  The notion that you can build a limestone wall 4 stories high, but a granite wall 5 stories high, and steel walls 15 stories high are kind of getting finicky. 
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
The Economy isn't like a big truck.  It's more like a series of rubes.

Improved Farming
Class Warfare

King Mir

  • Bay Watcher
    • View Profile
Re: Cave-in system
« Reply #101 on: May 27, 2012, 11:58:31 am »

In fact, I still think it's probably best to just give up on the idea of walls being destroyed by "crushing" altogether, and only focus upon cave-ins caused by insufficiently supported overhangs. 

Players can at least pretty easily grasp the concept that if you're going to have giant open areas in a cave that you better reinforce the ceiling somehow.  The notion that you can build a limestone wall 4 stories high, but a granite wall 5 stories high, and steel walls 15 stories high are kind of getting finicky.
Realistically compression is not a problem at all when building from stone. It's lateral forces. That's why you need buttresses for cathedrals. Not because the stone at the bottom can't take the weight, but because the ceiling pushes the walls out. And that can't be modelled with compressive forces alone. Rock is formed under very high pressure, it can handle it. But it can still topple over sideways.

Soil on the other hand, can't handle pressure, so any decent size building should be built on bedrock.
« Last Edit: May 27, 2012, 12:27:51 pm by King Mir »
Logged
To tread the sharp edge of a sword
To run on smooth-frozen ice,
One needs no footsteps to follow.
Walk over the cliffs with hands free.

NW_Kohaku

  • Bay Watcher
  • [ETHIC:SCIENCE_FOR_FUN: ACCEPTABLE]
    • View Profile
Re: Cave-in system
« Reply #102 on: May 27, 2012, 07:13:50 pm »

Well, there's a reason the bent pyramid was bent - it would have been unstable at its original angle.  Later pyramids were built on shallower angles. 

However, more-or-less, yes, you worry about the wall falling over if it doesn't have a broader base than its top more than its whole structure collapsing under most circumstances (although there's still the "whole mountain on a single support" concept to deal with - you could still perfectly balance extreme weight on a narrow wall or support). 

We also aren't talking at all about one of the most critical elements of modern skyscraper building, which is how much leeway they have for the wind.  Some of the things they do nowadays are probably not something we will see in-game, but tall enough buildings will sway dozens of feet in the wind on their top floors, and have faces that block enough of the wind to cause wind gusts of hundreds of miles an hour.  Again, nobody thought this was a big deal in the real world until Galloping Gertie went and collapsed. 

Naturally, however, I doubt many people are going to be making a 300-z-level tall skyscraper just to stick it in the eye of the Burj Khalifa, and those that do would probably turn off wind forces, anyway. 



Anyway, not much point in talking about the real forces that I don't think need to be modeled - it really mostly comes down to whether or not wood walls snap or stone walls fall over.  There's a reason real-life castles had stone wall exteriors and wood floors and interior walls.
Logged
Personally, I like [DF] because after climbing the damned learning cliff, I'm too elitist to consider not liking it.
The Economy isn't like a big truck.  It's more like a series of rubes.

Improved Farming
Class Warfare

King Mir

  • Bay Watcher
    • View Profile
Re: Cave-in system
« Reply #103 on: May 27, 2012, 11:05:57 pm »

Well if we wanna go about this methodically, then we need a set of scenarios the we explicitly decide which should be modelled realistically, and which are not so important. Then any detailed system could be evaluated on how well it models the most critical scenarios.
Logged
To tread the sharp edge of a sword
To run on smooth-frozen ice,
One needs no footsteps to follow.
Walk over the cliffs with hands free.

Learner

  • Bay Watcher
    • View Profile
Re: Cave-in system
« Reply #104 on: July 10, 2012, 09:50:04 pm »

I suppose that if you want an easy way to be warned about which rocks when mined will cause cave-ins, then make those tiles flash, like damp blocks that are next to hidden underground lakes, or warm blocks next to lava. If anything, I'd rather live with weird buildings and stone shapes then without. (Of course, rocks can still very easily carry a lot of support.)
Logged
Before you criticize someone, walk a mile in their shoes first.

Then, when you've walked a mile and start to criticize him, he has to run a mile after you in his socks.
Pages: 1 ... 5 6 [7] 8