Inspired by the intersection of procedural landscape generation tools, creative coding experiments with canvas-based physics, and the growing trend of interactive generative art toys. The idea was to merge terrain sculpting — like editing elevation data in mapping software — with autonomous agent simulation, creating a playground where your input directly shapes an emergent ecosystem that creatures then explore.
What is it?
Terra Forma is a real-time terrain sculpting playground. Paint mountains and valleys directly on the canvas, then watch autonomous creatures explore the world you create. Toggle weather systems — rain erodes peaks while wind pushes creatures across the landscape. Switch between color-coded biome views and topographic contour lines.
How does it work?
Heightmap grid: The canvas is backed by a 120×90 elevation grid. Every pixel on screen maps to a height value from 0% (ocean floor) to 100% (snow peak).
Gaussian smoothing: A blur pass runs every 15 frames so brush strokes blend into organic, natural-looking terrain instead of hard bumps.
Gradient lighting: Per-pixel surface normals are calculated from the heightmap, giving a pseudo-3D shading effect without WebGL.
Creature AI: Up to 30 autonomous agents spawn on land and navigate using terrain gradients — they climb toward comfortable elevations, descend from peaks, and wander in moderate zones.
Weather erosion: Rain particles gradually erode high ground and fill low areas. Wind adds atmospheric particles and pushes creatures eastward.
How to use it
Sculpt terrain: Click and drag on the canvas to raise elevation. Right-click (or switch to Lower mode) to carve valleys.
Brush & Power: Adjust brush size and stroke intensity with the sliders in the control bar.
View modes: Toggle between 🎨 Color (biome gradient palette) and ◎ Contour (slope-highlighted topographic lines).
Creatures: Click 🐾 Creatures to toggle autonomous agents on/off. They spawn on land and follow terrain physics.
Weather: Toggle 🌧 Rain for slow erosion effects, 💨 Wind for atmospheric particles and creature drift.
Tooltip: Hover over the canvas to see the biome name and elevation percentage at your cursor.
Clear: Hit ✕ Clear to reset everything back to flat water level.