Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Roof tiles not falling down #32260

Closed
roaringjohn opened this issue Jul 9, 2019 · 7 comments · Fixed by #34694
Closed

Roof tiles not falling down #32260

roaringjohn opened this issue Jul 9, 2019 · 7 comments · Fixed by #34694
Labels
<Bug> This needs to be fixed Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@roaringjohn
Copy link
Contributor

Describe the bug

When burning down a building, some tiles above it are kept there. This is unrealistic.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Burn down a building

Expected behavior

Whenever a building is burned down, all the tiles above it should fall down as well.

Screenshots

Additional context

We need realism to be applied to all roofs so they don't defy gravity!

@Zireael07
Copy link
Contributor

Do you have z-levels on?

@roaringjohn
Copy link
Contributor Author

roaringjohn commented Jul 9, 2019

It does indeed occur with z-levels on.
image

@Zireael07
Copy link
Contributor

I believe roofs falling down is limited to z-levels only. Probably for performance reasons.

@roaringjohn
Copy link
Contributor Author

roaringjohn commented Jul 9, 2019

That world has z-levels enabled, though?

@Zireael07
Copy link
Contributor

Your first post says it doesn't happen, your second post says "it does indeed occur with z-levels on", so I assumed you didn't have z-levels on for the first post.

@roaringjohn
Copy link
Contributor Author

I don't know if that first world had z-levels on (it's not mine, after all). I could check without z-levels.

@roaringjohn
Copy link
Contributor Author

That first world had z-levels on, now that I've asked the guy.

@ZhilkinSerg ZhilkinSerg added (S2 - Confirmed) Bug that's been confirmed to exist <Bug> This needs to be fixed Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. labels Jul 11, 2019
mlangsdorf added a commit to mlangsdorf/Cataclysm-DDA that referenced this issue Oct 19, 2019
Fixes CleverRaven#34752

The solution to CleverRaven#32260 included in CleverRaven#34694 had three serious problems:
1. smashing a random floor tile would cause scores of nearby floor
tiles to collapse, possibly hundreds across multiple z-levels.
2. any vehicle that was above a collapsing floor would get bashed
into scrap metal
3. despite the collapse of all these floors and walls, the floors
on the next z-level up would remain.

So there was very weird behavior that didn't actually resolve the
issue of floating floors after the underlying level collapsed.

The solution is to substantially rewrite collapse_at(), as so:
1. collapse_at() is only called from bash_furn_ter() when a wall
supporting a roof collapses.
2. when a wall collapses, repeat the collapse check for any walls
on the z-level above it.
3. when a tile that is supporting a roof collapses, turn the tile
above it into open_air with no furniture but don't destroy it (which
might destroy any vehicles - unsupported vehicles should fall and
be destroyed that way).

Also, perform the collapse_at() checks for adjacent tiles during
bash_furn_ter() - collapse_at() already checks those adjacent tiles,
so that was doubling their chances of collapse.

collapse_check() now checks the terrain below the current terrain.
It is still possible for a wall supported on several sides but not
supported by anything below to not collapse, but it's less likely.
mlangsdorf added a commit to mlangsdorf/Cataclysm-DDA that referenced this issue Oct 20, 2019
Fixes CleverRaven#34752

The solution to CleverRaven#32260 included in CleverRaven#34694 had three serious problems:
1. smashing a random floor tile would cause scores of nearby floor
tiles to collapse, possibly hundreds across multiple z-levels.
2. any vehicle that was above a collapsing floor would get bashed
into scrap metal
3. despite the collapse of all these floors and walls, the floors
on the next z-level up would remain.

So there was very weird behavior that didn't actually resolve the
issue of floating floors after the underlying level collapsed.

The solution is to substantially rewrite collapse_at(), as so:
1. collapse_at() is only called from bash_furn_ter() when a wall
supporting a roof collapses.
2. when a wall collapses, repeat the collapse check for any walls
on the z-level above it.
3. when a tile that is supporting a roof collapses, turn the tile
above it into open_air with no furniture but don't destroy it (which
might destroy any vehicles - unsupported vehicles should fall and
be destroyed that way).

Also, perform the collapse_at() checks for adjacent tiles during
bash_furn_ter() - collapse_at() already checks those adjacent tiles,
so that was doubling their chances of collapse.

collapse_check() now checks the terrain below the current terrain.
It is still possible for a wall supported on several sides but not
supported by anything below to not collapse, but it's less likely.
mlangsdorf added a commit to mlangsdorf/Cataclysm-DDA that referenced this issue Oct 20, 2019
Fixes CleverRaven#34752

The solution to CleverRaven#32260 included in CleverRaven#34694 had three serious problems:
1. smashing a random floor tile would cause scores of nearby floor
tiles to collapse, possibly hundreds across multiple z-levels.
2. any vehicle that was above a collapsing floor would get bashed
into scrap metal
3. despite the collapse of all these floors and walls, the floors
on the next z-level up would remain.

So there was very weird behavior that didn't actually resolve the
issue of floating floors after the underlying level collapsed.

The solution is to substantially rewrite collapse_at(), as so:
1. collapse_at() is only called from bash_furn_ter() when a wall
supporting a roof collapses.
2. when a wall collapses, repeat the collapse check for any walls
on the z-level above it.
3. when a tile that is supporting a roof collapses, turn the tile
above it into open_air with no furniture but don't destroy it (which
might destroy any vehicles - unsupported vehicles should fall and
be destroyed that way).

Also, perform the collapse_at() checks for adjacent tiles during
bash_furn_ter() - collapse_at() already checks those adjacent tiles,
so that was doubling their chances of collapse.

collapse_check() now checks the terrain below the current terrain.
It is still possible for a wall supported on several sides but not
supported by anything below to not collapse, but it's less likely.
kevingranade pushed a commit that referenced this issue Oct 22, 2019
Fixes #34752

The solution to #32260 included in #34694 had three serious problems:
1. smashing a random floor tile would cause scores of nearby floor
tiles to collapse, possibly hundreds across multiple z-levels.
2. any vehicle that was above a collapsing floor would get bashed
into scrap metal
3. despite the collapse of all these floors and walls, the floors
on the next z-level up would remain.

So there was very weird behavior that didn't actually resolve the
issue of floating floors after the underlying level collapsed.

The solution is to substantially rewrite collapse_at(), as so:
1. collapse_at() is only called from bash_furn_ter() when a wall
supporting a roof collapses.
2. when a wall collapses, repeat the collapse check for any walls
on the z-level above it.
3. when a tile that is supporting a roof collapses, turn the tile
above it into open_air with no furniture but don't destroy it (which
might destroy any vehicles - unsupported vehicles should fall and
be destroyed that way).

Also, perform the collapse_at() checks for adjacent tiles during
bash_furn_ter() - collapse_at() already checks those adjacent tiles,
so that was doubling their chances of collapse.

collapse_check() now checks the terrain below the current terrain.
It is still possible for a wall supported on several sides but not
supported by anything below to not collapse, but it's less likely.
ArcanErasmus pushed a commit to ArcanErasmus/Cataclysm-DDA that referenced this issue Oct 23, 2019
…4866)

Fixes CleverRaven#34752

The solution to CleverRaven#32260 included in CleverRaven#34694 had three serious problems:
1. smashing a random floor tile would cause scores of nearby floor
tiles to collapse, possibly hundreds across multiple z-levels.
2. any vehicle that was above a collapsing floor would get bashed
into scrap metal
3. despite the collapse of all these floors and walls, the floors
on the next z-level up would remain.

So there was very weird behavior that didn't actually resolve the
issue of floating floors after the underlying level collapsed.

The solution is to substantially rewrite collapse_at(), as so:
1. collapse_at() is only called from bash_furn_ter() when a wall
supporting a roof collapses.
2. when a wall collapses, repeat the collapse check for any walls
on the z-level above it.
3. when a tile that is supporting a roof collapses, turn the tile
above it into open_air with no furniture but don't destroy it (which
might destroy any vehicles - unsupported vehicles should fall and
be destroyed that way).

Also, perform the collapse_at() checks for adjacent tiles during
bash_furn_ter() - collapse_at() already checks those adjacent tiles,
so that was doubling their chances of collapse.

collapse_check() now checks the terrain below the current terrain.
It is still possible for a wall supported on several sides but not
supported by anything below to not collapse, but it's less likely.
va5h pushed a commit to va5h/Cataclysm-DDA that referenced this issue Oct 23, 2019
…4866)

Fixes CleverRaven#34752

The solution to CleverRaven#32260 included in CleverRaven#34694 had three serious problems:
1. smashing a random floor tile would cause scores of nearby floor
tiles to collapse, possibly hundreds across multiple z-levels.
2. any vehicle that was above a collapsing floor would get bashed
into scrap metal
3. despite the collapse of all these floors and walls, the floors
on the next z-level up would remain.

So there was very weird behavior that didn't actually resolve the
issue of floating floors after the underlying level collapsed.

The solution is to substantially rewrite collapse_at(), as so:
1. collapse_at() is only called from bash_furn_ter() when a wall
supporting a roof collapses.
2. when a wall collapses, repeat the collapse check for any walls
on the z-level above it.
3. when a tile that is supporting a roof collapses, turn the tile
above it into open_air with no furniture but don't destroy it (which
might destroy any vehicles - unsupported vehicles should fall and
be destroyed that way).

Also, perform the collapse_at() checks for adjacent tiles during
bash_furn_ter() - collapse_at() already checks those adjacent tiles,
so that was doubling their chances of collapse.

collapse_check() now checks the terrain below the current terrain.
It is still possible for a wall supported on several sides but not
supported by anything below to not collapse, but it's less likely.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bug> This needs to be fixed Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants