CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.47k stars 4.15k forks source link

Vandalized libraries have open air spaces leading down a z-level that turn into dirt on a save-load #62692

Closed Ilysen closed 1 year ago

Ilysen commented 1 year ago

Describe the bug

See title - the vandalized variants of libraries, as well as the collapsed tower, spawn riddled with holes leading down a z-level. These holes can lead to solid dirt tiles, or down a z-level into stuff like sewers. Once you save and load the game, the open spaces will be replaced by dirt. These can take the place of both floors as well as walls.

Steps to reproduce

  1. Find or spawn in a vandalized library.
  2. Approach the library naturally - do not teleport, as this will spawn dirt tiles straight away instead of open air. No idea why, it just does!
  3. Observe many holes bashed into the ground and walls.
  4. Save and reload; note how the holes disappear.

Expected behavior

The terrain shouldn't be destroyed at all! If it is, however, it should at least leave foundations and not open space, and at bare minimum should not change upon a save-load.

Screenshots

Here's a looted library shown before and after a save-load.

Versions and configuration

Additional context

This appears to be a consequence of the bash def in the library's mapgen. The relevant code uses a bash strength of 9999 as well as providing no options or logic to let it skip terrain, meaning that both terrain and furniture are treated equally - with max-strength bashes. This could potentially be fixed by using the destroyed_furniture nested mapgen ID, but it wouldn't fix the overall problem caused by the map extra.

andrei8l commented 1 year ago

Some previous related issues #54237 #61552.

The holes are caused by bash mapgen function bashing the terrain as you've noted, and the holes are filled up by auto-roofing which runs at the wrong time (on map::load(), but not on map::shift()).

Fixing the first issue probably only requires wrangling the decade-old map::bash_ter_furn(). Fixing the second one properly is quite complicated.

Ilysen commented 1 year ago

Oh yeah hrm, I guess this is a duplicate. I dug around in the issue tracker beforehand, but I probably missed it. Not sure if I should close this or not, as this one has a lot more information? I guess I'll leave it up to the triage folks

Night-Pryanik commented 1 year ago

Closing as duplicated.