-
-
Notifications
You must be signed in to change notification settings - Fork 947
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
Feature: BFS-based river generator #7213
Conversation
Loads of things still need improvement (list incomplete):
|
If the river generator is superior then I see no need to allow a choice. |
I don't think there's such a thing as an ultimate superior river generator, so a choice between different algorithms is IMHO appropriate |
Hmm yes, need work :) |
…n't seem to lead to nicer rivers
…ady existing water tiles
src/landscape.cpp
Outdated
} | ||
Slope slope = GetTileSlope(tile); | ||
if (slope != SLOPE_FLAT && !IsInclinedSlope(slope)) return; | ||
if (rd->visited == mode) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move this line above the GetTileSlope to avoid needing to calculate the slope and testing it all.
src/landscape.cpp
Outdated
} | ||
|
||
struct CompareRD { | ||
bool operator()(const RiverData* rd2, const RiverData* rd){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Spacing
…ing map data for "wrong" tiles
RiverData *rd = &riverdata[tile]; | ||
if (rd->visited == mode) return; | ||
rd->visited = mode; | ||
if (!IsValidTile(tile)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is riverdata[INVALID_TILE] valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should only access the border of void-tiles
How does this compare to the rainfall river generator patches? |
Honestly, i've never actually looked at that, and ic111 said he wants to get it to github, but doesn't really have time for it |
This pull request has been automatically marked as stale because it has not had any activity in the last month. |
This pull request has been automatically marked as stale because it has not had any activity in the last month. |
I have crudely merged an older version of the rainfall patches with the 1.10.1 release branch. https://github.com/InTheMorning/OpenTTD/tree/rainfall-1.10.1 I have not tested it extensively, but it seems to work okay so far. |
Very crude first iteration of a BFS-based river generator, inspired by https://www.redblobgames.com/x/1723-procedural-river-growing/