Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose of change
Mostly to remove sewers generation from
generate_sub()
. To eventually(after mutable mines) remove whole that loop iterating over all overmap tiles.And it also fixes few sewers-related bugs, such us when sewer entrance is disconnected from tunnel(due to missing end mapgen), or when sewer leads to the point with no entrance at all(due to lack of manhole in city center).
Describe the solution
Sewer mapgens combined in one function, to implement mapgen for end tiles, and reduce clutter.
Roads used to override manholes due to terrains order in overmap_connections.json, fixed now. Chance to generate manhole reduced from 1/2 to 1/8 to compensate increased amount.
City centers now have manholes - sewer specials connects to center, so it need to way in. Also, all manholes generate subways during city generation, so it won't need to iterate whole map searching for manholes later on.
Each town have its own isolated sewer, with no connections between cities. Such connections makes some sense for subways, but definitely not for sewers. And it's not very fun if sewers and subways would had basically same layout.
Describe alternatives you've considered
Building sewers connections right in
build_city_street()
. But this way it would steal undergrounds from potential basements, it's safer to juggle a vector around.Porting jsonified sewer from DDA. That's... an option. But replacing 20 lines of code wth 1000 lines of json is... meh. I'd rather delegate it to lua eventually.
Joining sewers of overlapping cities. Still considering.
Testing
Generated bunch of overmaps.
Additional context
Sewers of different cities:
There's no cut tunnels, all of them ends with entrance of some kind(specials, manholes).