Recently there has been some interest in implementing the long awaited water currents into the microbe stage, and after a bit of discussion in our chatroom, I have decided to go ahead and share some ideas on how this could be done.
First we need to decide on how currents work.
My idea is that the basis of currents will be reliant on a vector grid; similar, if not the same, as what is used to render our compound clouds in the microbe stage. The points of this grid will have a projection force assigned to them, dictating how strongly and which direction they push objects and clouds that come into contact with it. So basically, the force of currents would be rendered in a similar way to compound clouds. (For those unfamiliar with vector fields, Nunz provided this).
Next, we need to consider how the forces represented in this vector field are generated.
The current plan is that the computer first generates a path via sin(x) or some other capable equation, assigns a direction to the path, and then applies this (Hopefully finite) path within the vector grid. The path dictates the distribution of force projecting vectors, as well as the direction of their force.
Think of this as drawing your finger across a field of pins, knocking them down in the direction your finger travels. Lifting your finger, you would find a visual not unlike this.
(When I mentioned vertex in this concept, I meant vector).
These paths would spawn in a similar manner to other objects; occasionally being dropped into the play area at random to be interacted with.
With this method, the world would be littered with a bunch of water currents that begin and end rather suddenly. In reality currents don’t just stop in place; they shift, twist, and contort as they flow throughout the world never ending. And so I introduce the next step in generating currents in Thrive.
By continuously generating new segments to place at the end of a current each time the player approaches, we can effectively simulate currents with endless continuity and variance.
I believe that this can be achieved in some way by tracking when an active force vector is aimed towards an adjacent neutral vector, or perhaps by simply tracking where the generation of a current segment stopped.
I admit that the nature of generation is unfamiliar territory for me, so I am unsure about the feasibility of this design. Regardless, I hope that it at least provides insight and ideas for how we can go about implementing functional currents. Any and all feedback is appreciated.