Erosion Improvements / 2024 Working Docker#270
Open
Ygryega wants to merge 1 commit intoMindwerks:masterfrom
Open
Erosion Improvements / 2024 Working Docker#270Ygryega wants to merge 1 commit intoMindwerks:masterfrom
Ygryega wants to merge 1 commit intoMindwerks:masterfrom
Conversation
river_erosion Improvements:
Consistency in Naming and Formatting:
Standardized variable names and formatting for readability.
Handling Elevation Values:
Ensured elevation values are handled correctly to avoid invalid states.
Inclusive Loop Ranges:
Adjusted loop ranges to cover all relevant points more effectively.
Debugging Information:
Added detailed debugging messages for easier troubleshooting.
Addressed Issues:
Fixed potential elevation handling issues and loop inclusiveness.
river_flow Improvements:
Encapsulation of Logic:
find_nearest_river: Added helper function to merge with nearby rivers.
handle_wrapping: Added helper function for world boundary wrapping.
add_path: Added helper function to manage path updates and current location.
Simplified Flow Control:
Reduced nested conditions to improve function readability and maintainability.
Improved Readability:
Minimized complexity and deep nesting by breaking tasks into smaller functions.
Ensured consistent variable naming and formatting.
Enhanced Error Handling:
Provided clearer error messages and improved handling of unexpected cases.
Efficient Path Management:
Streamlined path management using add_path to reduce redundancy.
Addressed Issues:
Improved handling of edge cases and avoided spawning impossible rivers (lakes).
cleanup_flow Key Improvements:
Initialization:
Set celevation to float('inf') initially to include the first point.
Elevation Adjustment:
Corrected elevation values to ensure smooth flow.
Remove Isolated Points:
Added logic to remove points that do not fit the flow pattern based on neighbors.
Explanation:
cleaned_river: Ensured elevation consistency and adjusted values as needed.
final_river: Removed isolated points by checking neighbor validity, keeping valid points only.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
river_erosion Improvements:
river_flow Improvements:
cleanup_flow Key Improvements: