Skip to content

Remove salt water from swamps #78419

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

Merged
merged 7 commits into from
Apr 30, 2025
Merged

Conversation

harakka
Copy link
Member

@harakka harakka commented Dec 8, 2024

Summary

Content "Remove salt water from swamps"

Purpose of change

Remove random pools of salt water from swamps. Salt water swamps don't really exist in NE, there's some coastal salt marshes but our general swamp terrain doesn't represent that.

Describe the solution

  • Switch t_swater terrains with t_water in vanilla, TropiCata and Rural Mapgen mods since these terrains were obviously just copypasted from vanilla
  • Remove saltwater pond map extras from these as well
  • Make the saltwater pipe construction impossible to start but leave it and intermediate steps in obsoletion files
  • Leave saltwater pump and well in main game files with comment added so that people who built these can still use them
  • Leave comment in obsoletion files about removing the associated c++ code when obsolete data is removed
  • Move saltwater pond map extras to innawood

Describe alternatives you've considered

Testing

  • Generate a world and check there's no more random pools of salt water in swamps.
  • Generate Innawoods world and check there's still saltwater in swamps
  • Fulfill the prerequisites (crafting workshop 2 or something like that) for the saltwater pipe and observe it's not constructable
  • Craft it prior to this change and observe it's still present

Additional context

@github-actions github-actions bot added [JSON] Changes (can be) made in JSON Map / Mapgen Overmap, Mapgen, Map extras, Map display Mods: TropiCataclysm 🌴 Having to do with the tropical region mod for DDA. astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions labels Dec 8, 2024
@PatrikLundell
Copy link
Contributor

If you remove the salt water swamps you should also remove the salt water pipe/pump from the workshop 2 expansion, as well as the salt water pump.

@github-actions github-actions bot added the Fields / Furniture / Terrain / Traps Objects that are part of the map or its features. label Dec 8, 2024
@harakka
Copy link
Member Author

harakka commented Dec 8, 2024

@PatrikLundell I'm not really familiar with faction camp stuff, instead of deleting do you know if these could be updated with reasonable effort to work on the sea shore where salt water is still available? I took a quick look at the recipes and I'm mildly scared, and it isn't immediately obvious to me where the definition is for what OMT these are buildable on.

@moxian
Copy link
Contributor

moxian commented Dec 8, 2024

This will have a huge impact on Innawood, since salt is required for curing leather (which, in turn, is required for pottery and affordable clothing). Without salt water from swamps, I believe the only source of salt would be occasional rock salt in caves. Perhaps this should be left in for Innawood specifically (while breaking realism and consistency with vanilla)?
cc @Light-Wave to comment

@harakka
Copy link
Member Author

harakka commented Dec 8, 2024

Yeah no problem doing that for Innawood if that's needed.

@PatrikLundell
Copy link
Contributor

The salt water pipe logic looks for a swamp tile and then plunks down a well in a fixed location in that tile. That would be wonky to do with a ocean shore tile, as you wouldn't really know whether it would be built on land or on the water.
Converting the fixed approach to using logic might be possible by building a construction "map" on the fly, but it probably wouldn't be trivial, and it would add to the issue if you'd account for the actual construction cost when previewing it (as you'd have to first create this map for the preview, and then again for the actual construction).

Finally, making it available close to the ocean only would be a rather limited use case, not the least because that's where the cities are.

Ripping the pipe out might be a bit tricky, because there might be people who are in the process of building it, and there might be people who've planned to make use of a swamp eventually (and would be able to do it, because the swamp has already been generated, and thus already has salt water in it). You don't really have to do anything to the pump or the well (I think there's a special salt water version of it as well), since they're only used by this functionality, and thus have no other usages.
You could just remove the job starting the construction process, which would allow those who have commenced the project to finish it, while blocking new attempts.
Otherwise it would be tricky to determine whether a swamp is an old one or a new one, which probably would require scanning the swamp for salt water tiles (and that would include scanning candidates).
Leaving the functionality unchanged would allow people to get salt water from swamps that don't have any salt water in them, and scanning for salt water would be increasingly futile as new games would never have them.

The functionality of the salt water pipe construction is that it allows you to build a pipe between a swamp at some maximum distance to the workshop expansion version 2 by generating a number of construction tasks consuming pipes (and fittings) to simulate the construction of a pipe between the swamp and a pump at the expansion. This pipe can only cross a fixed set of terrain (forest, field, road, and possibly a few more). The process first generates a job to create a well in the swamp and a simulated pipe to the edge of it, and then jobs to create simulated pipe sections, until the simulated pipe reaches the edge of the workshop tile, after which the last job adds a simulated pipe and a pump.
"Simulated" means the terrain is modified as if it had been dug up, a pipe burrowed, and the trench filled up again, but obviously the game doesn't support that, so it's just a terrain indication in the form of bare dirt (and the loss of the pipes "buried"). The pipe pathing consists of segments of half a tile that's either orthogonal or diagonal from the edge/corner to the "center" and then from the "center" to the edge/corner. ("center", because there are 4 tiles surrounding the actual center point). These sections are fixed building blocks that fit together to form the simulated results of burying a pipe across the stretch from the swamp to the pump.

@Light-Wave
Copy link
Contributor

This would make Innawood runs near impossible unless you find an ocean, so I would appreciate it if you kept the salty bogs in Innawood, yes.

@harakka harakka marked this pull request as draft December 8, 2024 14:24
@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Dec 8, 2024
@github-actions github-actions bot added the Crafting / Construction / Recipes Includes: Uncrafting / Disassembling label Apr 27, 2025
@github-actions github-actions bot added the Mods: Innawood 🌲 Anything to do with Innawood mod label Apr 27, 2025
@harakka harakka marked this pull request as ready for review April 27, 2025 15:54
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Auto-requesting reviews from non-collaborators: @Light-Wave

@harakka
Copy link
Member Author

harakka commented Apr 27, 2025

Okay, this is now hopefully ready for review. I moved the saltwater pond map extras to Innawood as well instead of removing them.

The solution for tackling the saltwater pipe faction camp stuff is a bit involved. I moved the files to obsolete folder and added an impossible requirement for the first crafting step. The saltwater pump and well can't be migrated without losing saltwater access functionality from existing games so they have to be left in the main game files.
The c++ code backing the saltwater pipe stuff added in #55026 has to also be left in for now. I left comments in the obsoletion files that it can be removed after 0.I, although I suspect there's some weird corner cases there because the implementation is pretty involved including some pipeline specific save data.

I considered alternatively to migrate the pumps to freshwater ones but if someone has gone to the trouble of building this, I guess they deserve to keep it.

@github-actions github-actions bot removed the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 27, 2025
@harakka
Copy link
Member Author

harakka commented Apr 27, 2025

Ahh, mx_pond_swamp is referred to by bunch of other mods that just copypaste the full regional_map_settings from vanilla, that's annoying. I guess I'll have to move it back since I really don't want to try to do surgery on those mods' regional_map_settings.

Just removed them from there too since saltwater ponds in absence of saltwater swamps don't really make sense in either of those.

@github-actions github-actions bot added the BasicBuildPassed This PR builds correctly, label assigned by github actions label Apr 27, 2025
@kevingranade kevingranade merged commit 2fa282b into CleverRaven:master Apr 30, 2025
43 of 63 checks passed
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 Crafting / Construction / Recipes Includes: Uncrafting / Disassembling 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 Mods: Innawood 🌲 Anything to do with Innawood mod Mods: TropiCataclysm 🌴 Having to do with the tropical region mod for DDA.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants