-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Rework river generation #38894
Closed
Diabolus-Engi
wants to merge
21
commits into
CleverRaven:master
from
Diabolus-Engi:fix-river-overmap-boundaries
Closed
Rework river generation #38894
Diabolus-Engi
wants to merge
21
commits into
CleverRaven:master
from
Diabolus-Engi:fix-river-overmap-boundaries
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Merge with upstream
Merge with upstream
Adds a degree of polish
todo: add smooth variable sine waves.
Co-Authored-By: Anton Burmistrov <[email protected]>
size_t instead of int for loops. Co-Authored-By: anothersimulacrum <[email protected]>
ZhilkinSerg
added
<Enhancement / Feature>
New features, or enhancements on existing
[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`
labels
Apr 7, 2020
Does this fix #39382? |
No, it's entirely unrelated. This PR changes how the rivers are placed, but that issue is about the local mapgen for lake shores in that particular overmap layout. |
8 tasks
Procyonae
pushed a commit
to Procyonae/Cataclysm-DDA
that referenced
this pull request
Jun 2, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
<Enhancement / Feature>
New features, or enhancements on existing
[JSON]
Changes (can be) made in JSON
Map / Mapgen
Overmap, Mapgen, Map extras, Map display
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.
Summary
SUMMARY: Bugfixes "Reworks river generation on overmap."
Purpose of change
Reworks river generation so that they cross overmap boundaries better and flow more realistically.
Fixes: #36630
Fixes: #38036
Describe the solution
Adds river nodes for the overmap to track entry/exit points of rivers so that they can be continued with more accuracy to adjacent overmaps. Also includes the size of the river. This provides some method continuity for rivers and can later be used to maintain other properties for the river such as fish populations, contaminates perhaps.
Reworks plotting of the river and generation by using a quadratic bezier curve, coupled with part of the original weighted random walk method that helps to create varied river sizes while the bezier curve allows bends in the river. The control points probably still need some work, but hoping to catch the eye of someone who knows more math than myself for that.
Changes the polishing of rivers to apply terrain mask based on adjacent tiles. I found this implementation to be a little cleaned than the original.
Rivers have a chance to generate branches of a smaller scale that will merge into the river further down and also generate branches to a random nearby point.
Rivers will 'pool up' creating small lakes if they haven't terminated on the overmap boundary.
TODO:
Describe alternatives you've considered
Well, I originally set out just to fix overmap river borders. After many days of wrestling with the current implementation and testing various alternative methods, I found it was unfeasible to continue without rewriting a lot of the river generation.
Once elevations are added, then we can advance further into erosion models etc that would provide realistic rivers. While I played with the idea of using perlin noise, I opted against it in favor of waiting for elevations.
Testing
Generate a new map, teleport to adjacent overmaps and follow the rivers between overmaps.
Additional context
(Slightly outdated pre-random branches)
(Updated)