Skip to content
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

Implement Riot Damage in City Roads and Subway Stations. Adjust Fire and Blood placement over time. #79641

Merged
merged 11 commits into from
Feb 14, 2025

Conversation

QuillInkwell
Copy link
Contributor

Summary

Features "Minor Riot Damage Tweaks"

Purpose of change

Make adjustments to Riot Damage to fix a few issues:
The Riot Damage PP cannot be applied underground, even though there are structures where it would make sense to do so. Including a few Overmap terrains that were missed during the audit that attempted to remove all basements.

Riot Damage never applies to roads in cities even though it logically should.

Blood spawns outside long after the riots conclude. Even though it should have logically been washed away at that point.

Fire spawns aggressively throughout the city even long after the major fires should have died down. And spawns on any tile it wants, regardless of whether it makes for it be there.

Describe the solution

Remove the safeguard against applying the PP underground. Add a new flag for naturally occuring underground terrains that should be immune to the PP. Ensure the PP is not applied to properly flagged terrains. Subway stations are now included in the Riot Damage.

Riot Damage is now automatically applied to roads that are inside cities.

Outdoor blood spawning now scales down to 0 over the course of the first 30 days of the Cataclysm.

Fire spawn gradually scales down from 1 in 2,000 to 1 in 10,000 tiles over the first 14 days of the Catacylsm. After 3 days Fire will no longer spawn on non-flammable surfaces.

Describe alternatives you've considered

I really want to scale the intensity of the riots based on distance to the city center. But I am finding a bit challenging to pull that off. And this PR has already hit quite a few different things at once.

So I am inclined to leave that for another PR.

Testing

Loaded a world 30 days after the Cataclysm. Noted blood no longer spawns outside. Noted reduction in fire placement. Confirmed PP working underground.

Loaded a world 14 days after the Cataclysm. Noted reduction blood spawns outside. Noted Reduction in fire placement. Confirmed blood spawning outside in city roads.

Additional context

- Riot Damage automatically applies to all roads in cities
- Flame is only applied to flammable terrains and furniture
- Probability of blood placed outside scales down over the course of a month into the cataclysm
- Probability of placing flames declines over the course of the first week
@github-actions github-actions bot added <Documentation> Design documents, internal info, guides and help. [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display [C++] Changes (can be) made in C++. Previously named `Code` Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [Markdown] Markdown issues and PRs <Enhancement / Feature> New features, or enhancements on existing json-styled JSON lint passed, label assigned by github actions labels Feb 12, 2025
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
@github-actions github-actions bot added the astyled astyled PR, label is assigned by github actions label Feb 12, 2025
I put it in it's own if statement because I felt it got so long that it was just easier to read if I split it. But I could also chuck it into a variable and name the condition if that would be more preferable.
Copy link
Contributor

@moxian moxian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small wording nitpicks.

src/mapgen.cpp Outdated Show resolved Hide resolved
src/mapgen.cpp Outdated Show resolved Hide resolved
src/mapgen.cpp Outdated Show resolved Hide resolved
src/mapgen.cpp Show resolved Hide resolved
Copy link
Member

@RenechCDDA RenechCDDA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only minor nitpicks. This review should be considered commentary, not approval or dismissal.

-Extending a NATURAL_UNDERGROUND flag to suppress errors instead of actually addressing them is not good practice, I think. A failsafe isn't the worst thing in the world, but it should complain - loudly - when an unexpected condition is met. Are there any underground areas which have riot damage applied that we want to have riot damage?

-Scaling active fires with time is not unreasonable, but there is nothing that replaces them if the player doesn't visit. The buildings should be burned down if it's late enough. This is a different flavor of the same problem, but still a problem. Previously it was biased in the direction of the player, but it was chaotic and difficult to game, because all the fires were active. This is biased towards the player in a different way in that it lets them alter reality. By selectively approaching - or not approaching - cities players can pick and choose their level of damage.

Now, again, this is not meant to be considered approval or dismissal. I understand that it is a much more complicated idea to pre-burn-down the buildings, and I'm not saying that you have to do it. But that would be my approach.

@QuillInkwell
Copy link
Contributor Author

QuillInkwell commented Feb 13, 2025

-Extending a NATURAL_UNDERGROUND flag to suppress errors instead of actually addressing them is not good practice, I think. A failsafe isn't the worst thing in the world, but it should complain - loudly - when an unexpected condition is met. Are there any underground areas which have riot damage applied that we want to have riot damage?

My apologies I didn't put my best foot forward when writing this PR. To elaborate further: While it's true I did this in part because I wanted to silence the errors regarding maps I had missed. Which I see is a a very incorrect way of thinking. I did also do it because I wanted to include the Subway station in the Riot Damage. And felt it would be strange if I did not also include the lower levels of said mapgen.

My line of thinking was that the subway stations are important public infrastructure and it seemed logical people would be there and some level of fighting or damage would occur. But I couldn't make that happen without making the Post Processor work underground.

I am not married to the feature by any means though. And if it's preferred to limit it above ground locations. (especially to keep the error tracking while we hunt down the wrongly included maps). I'd be more than happy to revert this change.

-Scaling active fires with time is not unreasonable, but there is nothing that replaces them if the player doesn't visit. The buildings should be burned down if it's late enough. This is a different flavor of the same problem, but still a problem. Previously it was biased in the direction of the player, but it was chaotic and difficult to game, because all the fires were active. This is biased towards the player in a different way in that it lets them alter reality. By selectively approaching - or not approaching - cities players can pick and choose their level of damage.

My long term hope is that there might be a separate Post Processor for pre-burning buildings (Riot Arson?). And when the cataclysm starts most the riot fires are still burning. But die down over the course of the following weeks. While pre-burned structures become progressively more common in a sort of inversely proportional relationship.

I was putting the wind down on fires into this PR in anticipation of that. But I recognize doing it now may be a bit pre-mature, with no solution to replace the fires. I can also confess I am not entirely certain I could create the Riot Arson PP with my current abilities. At least I've struggled with trying to come with a workable solution for it thus far.

If it's desirable to leave fires as they are until the PP is created or a better solution presents itself, I could get behind that.

(Tangent Incoming)
Overall with Fire spawning and pre-burned building it would work a lot better for us I think if the game could be smarter about applying them on the city level. Like clustering burned down and or actively burning buildings using some kind of noise map overlay or maybe just random point selection that grows into a cluster using adjacent neighbors.

I believe it would just make a lot more sense to not always stumble on just one burning building but raging fires that have taken out entire blocks. Or encounter large sections of burned out buildings that form a sort of emergent story.

Doing things on the city level would open the door for some of the crazier ideas in the original write up by (I think) Erk. Cities destroyed by Kaiju and what not. Fun stuff like Fungaloid overtaken cities could be a thing.

I might look into it myself but no promises on my timeline for any of this. I would like to get back to working on Aftershock for a bit somewhat soonish.

(Edit) Oh, and thank you for taking time to review and comment on this PR.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Feb 13, 2025
@Zireael07
Copy link
Contributor

title says "minor tweaks" but those are actually really big (and welcome!) changes

@QuillInkwell QuillInkwell changed the title Minor Riot Damage Tweaks Implement Riot Damage in City Roads and Subway Stations. Adjust Fire and Blood placement over time. Feb 13, 2025
@QuillInkwell
Copy link
Contributor Author

title says "minor tweaks" but those are actually really big (and welcome!) changes

I thought that to myself last night as well. I had called it minor just in relation to the number of lines changed. But the title is somewhat unfitting when considering the scope of changes those few lines represent. I'll fix that.

@Maleclypse Maleclypse merged commit a881c85 into CleverRaven:master Feb 14, 2025
30 checks passed
@KittyTac
Copy link
Contributor

What writeup by Erk?

@ashGlaw
Copy link
Contributor

ashGlaw commented Feb 15, 2025

Thanks for doing this, Quill, it's very appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions [C++] Changes (can be) made in C++. Previously named `Code` <Documentation> Design documents, internal info, guides and help. <Enhancement / Feature> New features, or enhancements on existing Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. [JSON] Changes (can be) made in JSON json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display [Markdown] Markdown issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants