Cataclysm-BN icon indicating copy to clipboard operation
Cataclysm-BN copied to clipboard

Furniture generates inside wasp paper walls

Open RoyalFox2140 opened this issue 1 year ago • 10 comments

Describe the bug

I found that benches can spawn inside wasp paper walls.

Steps To Reproduce

  1. Find a wasp nest in the city
  2. See what furniture generated inside the paper walls

Screenshots

image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.19045.3448 (22H2)
  • Game Version: 61c1386 [64-bit]
  • Graphics Version: Tiles
  • LAPI Version: 1
  • Game Language: English [en_US]
  • Mods loaded: [ Bright Nights [bn], Elevated bridges [elevated_bridges], Craftable Gun Pack [craftgp], Alternative Map Key [alt_map_key], Fuji's Military Profession Pack [fuji_mpp], Arcana and Magic Items [Arcana], Craftable Bullet Casings [CasingCrafting], MST Extra [MST_Extra], Tankmod: Revived [Tankmod_Revived], Essence 2200 [Essence2200], Essence 2200 Tweaks [FoxTweaks], Nonperishable Overhaul [Nonperishable_Overhaul], No Addictions [No_Addictions], Limit Fungal Growth [limit_fungal_growth], Disable NPC Needs [no_npc_food], Urban Development [Urban_Development], Cataclysm++ [Cata++], C.R.I.T. Expansion [crt_expansion], Battle Maid Redux [battle_maid] ]

Additional context

No response

RoyalFox2140 avatar Oct 06 '23 01:10 RoyalFox2140

Also, smashing will target the bench and not the paper wall. I don't see this as a problem because benches shouldn't spawn in walls anyway, furniture should only spawn on passable terrain and thus should be the first target.

RoyalFox2140 avatar Oct 06 '23 01:10 RoyalFox2140

Tables are also plagued by this bug. See this. image

RoyalFox2140 avatar Oct 06 '23 01:10 RoyalFox2140

It appears to be map extras have no sanity checking to stop this from happening. I can use map editor to recreate this. See here that paper walls are correctly flagged as a wall, so clearly map extra generation is not stopping walls from generating onto furniture.

image

RoyalFox2140 avatar Oct 06 '23 03:10 RoyalFox2140

For this particular case, this makes actually sense : The bench was already there when the wasps came to make their nest and those pesky bugs made a wall around the bench and other existing furniture. Even with this interpretation, there is still the issue on the smashing targetting: the wall should indeed be targetted before the bench.

yagalone avatar Oct 07 '23 11:10 yagalone

For this particular case, this makes actually sense : The bench was already there when the wasps came to make their nest and those pesky bugs made a wall around the bench and other existing furniture. Even with this interpretation, there is still the issue on the smashing targetting: the wall should indeed be targetted before the bench.

Then how do wasps fully destroy a brick wall. Let's keep consistency here and delete any furniture or terrain that lands on a wasp paper wall.

RoyalFox2140 avatar Oct 07 '23 20:10 RoyalFox2140

For this particular case, this makes actually sense : The bench was already there when the wasps came to make their nest and those pesky bugs made a wall around the bench and other existing furniture. Even with this interpretation, there is still the issue on the smashing targetting: the wall should indeed be targetted before the bench.

Then how do wasps fully destroy a brick wall. Let's keep consistency here and delete any furniture or terrain that lands on a wasp paper wall.

Indeed, the most important is consistency. Either everything is destroyed (wall, furnitures and items) or everything is preserved (Existing hard walls are kept as they are, the furniture and items are enclosed in the paper wall)

I'm still partial to the second solution for "realism" reason (sorry for the gross word), but the first one might be easier to implement and does not change significantly gameplay (I remember smashing a well-positionned paperwall to access the inside of a secure building. This was an original and interesting way to bypass the usual access limitation)

yagalone avatar Oct 08 '23 06:10 yagalone

So, building wasp nests are buried in the hardcode here: https://github.com/cataclysmbnteam/Cataclysm-BN/blob/upload/src/map_extras.cpp#L258

Wilderness wasp nests are interesting, they're defined by JSON instead: https://github.com/cataclysmbnteam/Cataclysm-BN/blob/upload/data/json/mapgen/map_extras/nest_wasp.json

The JSON version still has a problem with this, but in practice the worst you'll likely see is a flower embedded in the wall. This can be fixed by either:

  1. JSONising urban wasp nests into an update_mapgen_id and remembering to use a furniture definition that tells it to place f_null wherever it places paper walls.
  2. Changing that weird function so that the part that goes m.ter_set( pod + point( x, y ), t_paper ); also clears out any furniture there.

chaosvolt avatar Oct 18 '23 15:10 chaosvolt

f_null does not delete furniture already placed.

0Monet avatar Feb 05 '24 15:02 0Monet

Hmm, damn. I was hoping that it would override any furniture in the specified tile.

chaosvolt avatar Feb 05 '24 15:02 chaosvolt

Found this in dock.json: "nested": { "a": { "chunks": [ [ "clear_furniture", 1 ] ] }, "b": { "chunks": [ [ "clear_furniture", 1 ] ] }, "c": { "chunks": [ [ "clear_furniture", 1 ] ] } }, { "type": "mapgen", "method": "json", "nested_mapgen_id": "clear_furniture", "//": "used to be able to clear furniture when using a 'rows' placement mapping, since f_null directly is ignored", "object": { "mapgensize": [ 1, 1 ], "set": [ { "point": "furniture", "id": "f_null", "x": 0, "y": 0 } ] } } Tested with mass_grave map extra and it seems to remove furniture.

0Monet avatar Feb 23 '24 17:02 0Monet