3D Land and Water Coding Experiment

This simulation was inspired by the video game "From Dust," which features compelling land and water physics. I developed an algorithm to model how water flows downhill across terrain.

Video

Technical Approach

The core concept uses a pair of 2-dimensional arrays containing the height of land and water at each coordinate in the grid. The system calculates water movement and adjusts height values accordingly.

The workflow involved:

Mountain Springs Animation

Water emitters at hilltops release finite water quantities that flow into a valley through the algorithm.

Sea Mountain Rising Animation

A land emitter pushes a mountain from the ocean floor while water responds by cascading downhill, naturally creating circular wave patterns.

Limitations

My algorithm fails to ever resolve the water to a natural state of a flat surface. I also acknowledge my coding approach wasn't object-oriented - this was a proof-of-concept rather than production-quality work.

I have great admiration for Ubisoft's achievement with From Dust, particularly their dynamic water foam textures and realistic flow visualization.

Originally published on blog.mikerandrup.com

Back to Home