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

Reworked lake shore mapgen for better connection with rivers #3275

Merged
merged 1 commit into from
Sep 27, 2023

Conversation

Vollch
Copy link
Contributor

@Vollch Vollch commented Sep 26, 2023

Summary

SUMMARY: Bugfixes "Reworked lake shore mapgen for better connection with rivers"

Purpose of change

Fixes #3185. More pics below.

Describe the solution

Original mapgen shrinks away from lakes, and then tries to adjust shore points when it see familiar patterns. Due to their amount covering of all possibly layout it's very difficult tasks.
New mapgen works differently - it doesn't care that much about lakes, instead it looks for precise positions of junctions, and attach shores to them.

This approach have its pros and cons. I always know where shoreline should be connected. But determining how to connect them between each others it's a bit more difficult task, which... i didn't solved. Currently it connect two closest valid points, it works well, but can break apart 3-way conjunction which could been connected if done right(first two pics below illustrates that, connected junctions, and disconnected). It looks tidy, no cut edges, but never the less that's wrong. Knowing all points i can tell myself where lines should ideally be after performing bunch of permutations in my head, but i didn't managed to algorithmize it(don't make me write 1000 lines of if's to cover all cases individually).
Another issue is that overall coastline a bit more blocky. Not river-style blocky, but since it's mostly ignorant to lakes that removed one of sources of entropy.
At this point i'm running out of ideas how it can be improved, so suggestions are welcome.

Describe alternatives you've considered

I tried to make adjustment to old mapgen, but haven't got any significant result beyond fixing few layouts individually.
Another solution might be reworking place_lakes so it'll floodfill toward rivers more aggressively, washing out stray river tiles. But there still should be a river\lake border somewhere.

Testing

Teleported around, looking at mapgen.

Additional context

Left ones are original mapgen, right ones - reworked. Overmap layout is exactly same.
3way
3wayleft
inner corner
2coasts
2rcorner
city

@github-actions github-actions bot added the src changes related to source code. label Sep 26, 2023
@scarf005 scarf005 enabled auto-merge September 26, 2023 22:16
@scarf005 scarf005 disabled auto-merge September 26, 2023 22:16
@scarf005 scarf005 self-assigned this Sep 26, 2023
@scarf005 scarf005 self-requested a review September 26, 2023 23:05
@scarf005 scarf005 added this pull request to the merge queue Sep 27, 2023
Merged via the queue into cataclysmbnteam:upload with commit ca88d01 Sep 27, 2023
@Vollch Vollch deleted the lake branch September 27, 2023 03:52
scarf005 pushed a commit to scarf005/Cataclysm-BN that referenced this pull request Sep 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src changes related to source code.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bad shore mapgen when river meets lake
2 participants