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

fix: sewer rework #3681

Merged
merged 1 commit into from
Nov 15, 2023
Merged

fix: sewer rework #3681

merged 1 commit into from
Nov 15, 2023

Conversation

Vollch
Copy link
Contributor

@Vollch Vollch commented Nov 15, 2023

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:
image
There's no cut tunnels, all of them ends with entrance of some kind(specials, manholes).

@github-actions github-actions bot added src changes related to source code. JSON related to game datas in JSON format. labels Nov 15, 2023
Copy link
Member

@scarf005 scarf005 left a comment

Choose a reason for hiding this comment

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

image

seems to work correctly, LGTM.

@scarf005 scarf005 added this pull request to the merge queue Nov 15, 2023
Merged via the queue into cataclysmbnteam:upload with commit 8304c0d Nov 15, 2023
13 of 17 checks passed
@Vollch Vollch deleted the sewer branch November 15, 2023 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
JSON related to game datas in JSON format. src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants