Skip to content

New Burned-out mapgen does not respect Z-levels #80826

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

Open
DukePaulAtreid3s opened this issue May 4, 2025 · 4 comments
Open

New Burned-out mapgen does not respect Z-levels #80826

DukePaulAtreid3s opened this issue May 4, 2025 · 4 comments
Assignees
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Map / Mapgen Overmap, Mapgen, Map extras, Map display (S2 - Confirmed) Bug that's been confirmed to exist

Comments

@DukePaulAtreid3s
Copy link
Contributor

Describe the bug

In the new post-fire mapgen, multilevel structures will be burned inconsistently. This is best demonstrated by looking at the bookshop and the neighboring apartment in the attached savefile.

Attach save file

Peshastin-trimmed.tar.gz

Steps to reproduce

N/A

Expected behavior

For buildings to burn more evenly, not having pristine floors supported by burned out ones or vice-versa.

Screenshots

Z Level 1

Image

Z Level 2

Image

Versions and configuration

  • OS: Windows
    • OS Version: 10.0.22621.4317 (22H2)
  • Game Version: cdda-experimental-2025-04-30-1653 [64-bit]
  • Graphics Version: Tiles
  • Game Language: System language []
  • Mods loaded: [
    Dark Days Ahead [dda],
    Disable NPC Needs [no_npc_food],
    Portal Storms Ignore NPCs [personal_portal_storms],
    Sky Island [skyisland],
    Bionic Professions [package_bionic_professions],
    Mind Over Matter [mindovermatter],
    Mythical Martial Arts [MMA],
    Bombastic Perks [bombastic_perks],
    Tamable Wildlife [Tamable_Wildlife]
    ]

Additional context

Related to #80753

@DukePaulAtreid3s DukePaulAtreid3s added the (S1 - Need confirmation) Report waiting on confirmation of reproducibility label May 4, 2025
@PatrikLundell
Copy link
Contributor

PatrikLundell commented May 5, 2025

That's a result of the post processing being applied on a Z level per Z level basis, rather than on the map as a whole. You'd have to move the processing out of the loop and have the logic apply the the same decisions on all Z levels to get a somewhat consistent result ("somewhat", because the current logic won't yield a sensible result for pre burnt buildings, as you'd end up with levitating burnt floors, but it ought to be possible to simply erase all floors above the ground level to get it consistent).

And, if you do end up erasing everything above ground, test to verify it works over save/load cycles so we're not bitten by uniform map data save reduction issues (I don't think it will happen, but it should still be checked).

@RenechCDDA
Copy link
Member

I think the way to 'resolve' this would be to finish switching over to the future implementation I mentioned in the PR introducing it: Instead of burning the entire OMT, some random contiguous area is burned.

Basically it'd be broken up like the blood generators. Instead of just one overall "Place blood" generator you'd have e.g. A "Burn a room" generator with X number of attempts, a "Burn a square area" generator, a "Burn a circular area" generator.

This is just my intention of how I'll work on it.

There's nthing wrong with Patrik's suggestion, and making the process "aware" of other sections of the map being placed will probably be useful in the future.

@RenechCDDA RenechCDDA added (S2 - Confirmed) Bug that's been confirmed to exist Map / Mapgen Overmap, Mapgen, Map extras, Map display [C++] Changes (can be) made in C++. Previously named `Code` and removed (S1 - Need confirmation) Report waiting on confirmation of reproducibility labels May 5, 2025
@RenechCDDA RenechCDDA self-assigned this May 5, 2025
@RenechCDDA
Copy link
Member

Oh one thing that I don't have any clear idea of how to tackle is roofs: Roofs are unaffected by the burning, which can look odd from a z-level up. Not sure what I'm going to do about that, just replacing all roofs with a burnt roof isn't very interesting.

We could have sections of the roof collapse or whatnot, but that would definitely require us to be "aware" of the other processes running, as Patrik pointed out.

I really don't think we want to add a "burnt roof" specifically, or at least not hardcoding that as well. The current implementation requires hardcoding a (incredibly generic) "burnt floor" and "burnt wall", we'd like less of that - not more.

@PatrikLundell
Copy link
Contributor

The logical problem with a generator for a burnt room is that you'd need some way to justify why it doesn't spread further. The same thing goes for an area, but if it's an open area it may make sense (like the trails and parks that currently end up as bare earth throughout the tile.

You can't have anything above a burnt house with the current logic, because the burnt walls are half walls (as you can see and shoot over them), so they're incapable of supporting anything. Thus, with the current logic, everything above a burnt house should just be removed as having collapsed.
If the logic is made more advanced, such as burning a room only, there's a need for some logic to deal with the roof, which I would suggest should be just removal above the burnt room (transitively upwards), or, if you want to be fancy, some collapse light logic (i.e. the current collapse logic, but without any actual collapsing, but rather removal of tiles that are deemed to have collapsed). There's a significant risk that would take time, however.

I agree burnt roof wouldn't be helpful, and that unsupported roofs should simply be removed (completely for the current burning logic, and potentially partially of partial burning is implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[C++] Changes (can be) made in C++. Previously named `Code` Map / Mapgen Overmap, Mapgen, Map extras, Map display (S2 - Confirmed) Bug that's been confirmed to exist
Projects
None yet
Development

No branches or pull requests

3 participants