CleverRaven / Cataclysm-DDA

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

Copse map extra has a chance of furniture spawning in trees #58610

Open NetSysFire opened 2 years ago

NetSysFire commented 2 years ago

Describe the bug

This appears to be mx_trees_map. You know, the random tiny forests you can encounter in fields.

Steps to reproduce

  1. Find a copse. This will require patience because due to randomness, not every one is faulty.
  2. Examine the furniture, in this case mostly flowers.
  3. Suddenly, after harvesting (assuming this is a flower, something that gets removed after harvest), you see a tree.

Expected behavior

Furniture does not spawn on trees. This is minor for flowers but could lead to unharvestable trees or bushes.

Screenshots

No response

Versions and configuration

Additional context

No response

PatrikLundell commented 2 years ago

Yes, I've seen flowers spawn on trees and bushes (although at the base: the title led me to think chests and the like were spawned at the Z level above...). I'm not sure if I've seen boulders as well as something else. I'm fairly sure I've seen this in copses, as per the OP, but can't say for sure I haven't seen it elsewhere.

NetSysFire commented 2 years ago

I think the cause of this is "flags": [ "ALLOW_TERRAIN_UNDER_OTHER_DATA" ],.

And you are right, the title could be improved, which I just did. Thanks for bringing it to my attention.

PatrikLundell commented 2 years ago

Yes and no...

Changing the flag to wipe stuff will wipe all items from the map, so you wouldn't find stuff like rocks, etc. either, which is more things removed than what we'd want.

What we'd want is to remove things only when the random selection isn't a "groundcover" value, but there is currently no support for linking entries of different categories together in palettes. The (cumbersome and error prone) work around I know of is to define "chunks" that, in this case, links terrain and furniture together such that the non groundcover chunks don't have any furniture (or "f_clear" to be sure to clear anything the underlying map has placed, if there is one: don't know if that's the case), while the groundcover ones contain the furniture options. Then, instead of using a palette, each corresponding location would be the placement of a chunk with percentages for each of the chunk variants.

I'm not sure if chunks can have the flag. If that's the case you'd have the ALLOW flag for the groundcover chunks and the ERASE one for the others.