Add flow field dynamics to rivers - #106
Open
ETcodehome wants to merge 21 commits into
Open
Conversation
…into riverParticles
…into riverParticles
…into riverParticles
…into riverParticles
…into riverParticles
ETcodehome
marked this pull request as ready for review
August 15, 2026 01:02
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.
Adds simple flow field dynamics to FTF's river generation system.
Rivers that don't have flow are not particularly compelling. There is a significant gameplay improvement if rivers naturally have a flow direction and strength. Addressing the issue downstream of terrain generation via third party mods is often computationally expensive and/or results in a lot of flawed inferences about river directions.
Instead we have made flow behavior simulated with preset hooks for the new behavior.
New preset configuration toggles
Implementation Details
Boat Dynamics
Ongoing Validation Tools
Implemented a diagnostic renderer that can be toggled in via flipping the toggle in code.
FlowFieldDebugRenderer.java
At close visual range flow magnitude will be displayed per cell.
Other testing
Ensured that Paper server could load happily (ignoring the additional flowfield data

Performance
Lean. 1 byte per cell of data. Adds a quarter kilobyte per chunk send to players.
Encodes the flowfield information as a single byte flowfield per x z, split 5 bits direction vector, 3 bits magnitude.
Radians encoded in 2^5 (32 states) = 11.6 degree increments, plus 2^3 (8 states) magnitude levels for strength.
Future Work
It's likely prudent in future to include an API for third party mod compatibility. I dabbled with this on the "experimentCreateCompat" branch. The main use case is cross compatibility with Create mod water wheels where flat water could push wheels based on flow strength. The changeset got a little wild because we don't currently have any concept of an api currently and I want to ensure that if we do implement one its structurally sound from day one and suitable as an extensible example. As such I think we should revisit this after the next release when the risks involved are lower.