cataclysmbnteam / Cataclysm-BN

Cataclysm: Bright Nights, A fork/variant of Cataclysm:DDA by CleverRaven.
https://docs.cataclysmbn.org
Other
686 stars 269 forks source link

Roof lacking over mansion sections #3023

Open SarcophagusTablets opened 1 year ago

SarcophagusTablets commented 1 year ago

Describe the bug

As in the title, roof seems to be lacking in some parts of the mansion.

There are other places where this happens, like in cathedrals, so I suspect there's some roof tile type that is bugged out (I don't know much about mapgen currently, though tried looking at jsons).

Steps To Reproduce

  1. Create a default world and survivor.
  2. Enable debug menu, go into map -> overmap editor -> add terrain special -> Mansion_Road, add it somewhere. I actually observed it on a naturally occurring one.
  3. Teleport to z +1 elevation around one of the corners of the mansion.
  4. Observe no roof. On z +2 strange gaps are visible as well.
  5. Optionally spawn also a cathedral and teleport to z +2 near the back. Here the hole reaches all the way to the ground level.

Screenshots

noroof1 noroof2 noroof3

Versions and configuration

Additional context

No response

mythosmod commented 1 year ago

Had a look into this - the terrain used is t_glass_roof which is spawning as expected, it is just marked as having tr_ledge which means it is treated as open air - removing tr_ledge means you can walk across without issue - the question is should you be able to walk across a skylight?

image

{ "type": "terrain", "id": "t_glass_roof", "name": "skylight", "description": "A giant sheet of glass inserted into the roof, lets light pass through.", "symbol": "o", "looks_like": "t_linoleum_white", "color": "cyan", "move_cost": 2, "trap": "tr_ledge", "flags": [ "TRANSPARENT", "NO_FLOOR", "INDOORS" ], "bash": { "str_min": 3, "str_max": 6, "sound": "glass braking!", "sound_fail": "whack!", "bash_below": true } }

chaosvolt commented 1 year ago

it is just marked as having tr_ledge which means it is treated as open air

If I recall, that's a hack to allow it to let light through. For some dumb reason skylights don't properly work unless it counts as not even having a floor at all.

mythosmod commented 1 year ago

Ah that makes sense, although it looks like leaving the flags set is letting light through even with the ledges removed - I have closed the curtains on both levels in the room and appear to still be getting light, however blowing up the skylight then causes flat roof to spawn below it in mid air as in the third pic (though this appears to be linked to bash below possibly? It happens if you blow up the roof too)

Anyways, if we want walkable skylights I think removing tr_ledge will still let light through, however I wonder if it would be worth creating a FRAGILE_FLOOR tag that gives a warning and then either breaks immediately if the player\NPC is over a certain weight (transforming with tr_ledge) or has a certain chance of breaking every time it is stepped on? Could be used for other things too (farm shed roofs etc.)

image

image

image

mythosmod commented 1 year ago

Ah actually perhaps not a tag but a trap, create a new one in trapfunc.cpp