Please be lenient, this is my first attempt in my life to make a procedurally generated world, and I myself feel that in many places I am doing nonsense, for the sake of artistic vision.
Advice is welcome. The goal of this procedural world is to serve as the basis for an adventure game that takes into account terrain tags and global interactions between settlements and the world.
The current map is the raw material for future biome distribution based on temperature, altitude, and other world features, such as the presence of an underground artery or necrosis around a dead artery.
The map scale is 1 pixel equals 2 kilometers; the average length of the continent from north to south is approximately 8,000 kilometers.
This architecture follows a "Spine-First / Anatomical Hydrology" …
Please be lenient, this is my first attempt in my life to make a procedurally generated world, and I myself feel that in many places I am doing nonsense, for the sake of artistic vision.
Advice is welcome. The goal of this procedural world is to serve as the basis for an adventure game that takes into account terrain tags and global interactions between settlements and the world.
The current map is the raw material for future biome distribution based on temperature, altitude, and other world features, such as the presence of an underground artery or necrosis around a dead artery.
The map scale is 1 pixel equals 2 kilometers; the average length of the continent from north to south is approximately 8,000 kilometers.
This architecture follows a "Spine-First / Anatomical Hydrology" paradigm, where the world is treated as a living organism rather than a geological accident. The pipeline is split into CPU-based structural generation and GPU-based fluid simulations.
Anatomical Framework (CPU)
The foundation of the world, determining shape and structure.
Spine Generation
-
Generates a central spinal column using a Catmull-Rom Spline.
-
Applies seeded random noise to create organic curvature (scoliosis/lordosis).
-
Calculates a widthProfile along the spine to define body segments (Head, Thorax, Abdomen, Limb).
2. Rib & Limb Growth
-
Ribs: Grow perpendicular to the spine tangent in the Thoracic region. They use logarithmic tapering and curvature to form the chest cavity.
-
Limbs: Generated from the "Shoulder" anchor point using vector math to create articulated joints (Shoulder -> Elbow -> Wrist -> Hand).
-
The Eye: A specific structure generated at the tail end of the spine.
3. Continent Flesh Generation (Hybrid CPU/GPU)
-
SDF Construction: Converts the skeletal structure (Spine + Ribs) into a Signed Distance Field.
-
Belly Mask: Generates a soft, warped oval mask for the abdominal region using Domain Warping noise to ensure organic asymmetry.
-
GPU Composition: The shape masks are sent to a WebGL shader (continentShaderSource) which:
-
Merges the Skeleton and Belly masks.
-
Modulates the shape with 3 layers of FBM Noise (Macro, Meso, Micro).
-
Applies a specific "Swamp" flattening logic to the abdominal area.
-
Result: modulatedHeightmap, continentMask (Land/Water boolean), and boneDensityMap (High density over ribs/spine).
4. Organ Placement (anatomical/organs.ts)
-
Metabolic Core: Scans the boneDensityMap to find the densest protected point in the Thorax.
-
Filtration Delta: Scans the terrain to find a point that is simultaneously:
Low elevation (Gravity well). 1.
Far from the Spine (Centrality). 1.
Far from the Coast.
Geology & Regions (CPU)
Defining the physical properties of the terrain.
Regional Masking:
- defines THORAX (High bone density area) and ORGANOID (Soft tissue area).
2. Geological Formation:
-
Combines the modulatedHeightmap with specific modifiers.
-
Bone Elevation: Adds height to pixels corresponding to bones (Mountains).
-
Delta Basin: Subtracts height around the Filtration Delta to create a gravity well for rivers.
-
Calculates the final elevationMap normalized between Ocean Floor (-1.0) and Peaks (1.0).
Vascular System (CPU)
The circulatory system that defines underground fluid paths.
Artery Generation:
-
Algorithm: Modified Space Colonization & A Pathfinding*.
-
Bone Avoidance: Pathfinding uses boneDensityMap as a cost function. Arteries actively route around ribs and spine segments, seeking soft tissue.
-
Attractors: Generates target points within the landmask to guide vessel growth.
2. Capillary Detailing:
- Uses recursive L-Systems to grow fine vessels from the main arteries.
3. Arterial Outlets:
- Identifies specific points where the vascular network is close to the surface or terminates. These become Source Points for the river system.
Anatomical Hydrology (CPU)
Rivers generated by anatomy, not only rain.
Magistral Channels:
-
Sources: Takes arterialOutlets as start points.
-
Target: The Filtration Delta organ.
-
Algorithm: Uses Weighted A* to find paths from sources to the Delta.
-
Physics: Heuristics prefer downhill slopes but allow carving through minor obstacles to reach the organ.
-
Output: mainChannelsMask – a map of "Great Rivers" that act as pre-carved gravity wells.
Atmospheric Simulation (GPU / WebGL)
A unified fluid dynamics simulation loop.
Initialization:
-
Generates static pressure maps based on Temperature (Thermal Lows) and Elevation (Orogenic Highs).
-
Initializes moisture based on water bodies (evaporationMap).
2. Navier-Stokes Loop (~200 Iterations):
-
Pressure Solver: Solves the Poisson equation for pressure.
-
Advection: Self-advection of velocity fields (Wind momentum).
-
Forces: Applies:
-
Coriolis Effect: Deflects wind based on latitude.
-
Planetary Wind: Pulls wind towards a pre-computed diagonal global flow texture.
-
Vorticity Confinement: Preserves swirling eddies.
-
Moisture Transport: Advects humidity scalar field using the calculated wind vectors.
Post-Processing & Final Hydrology (CPU)
Finalizing the map based on simulation data.
Precipitation Snapshot:
-
Instead of accumulating rain over time, calculates a Static Physics Snapshot.
-
Orographic Lift: Calculates the dot product of Wind Vectors and Terrain Gradient.
-
Rain Shadow: if Wind hits a slope -> Rain. If Wind goes down a slope -> Dry.
-
Result: A detailed precipitationMap.
2. Surface Hydrology:
-
D8 Flow Accumulation: Calculates runoff based on the precipitationMap.
-
Integration: Surface runoff is biased to flow into the mainChannelsMask (Magistral Rivers) created in Stage 4.
-
River Hierarchy: Calculates Strahler stream order to define river widths and branching.
3. Climate Classification:
- Combines Temperature (modified by vascular heat) and Moisture to classify biomes.
Rivers are a real pain in the ass; they never turn out the way I want. I’m stuck between the fact that they’re too capricious and difficult to control for such a large map. I tried the "droplets" algorithm, but it just couldn’t produce organic rivers, rather than a grid of broken glass. So, right now, I’m combining a precipitation map and the rivers that flow from it with an artificial main river network using the A* algorithm.
I think my work has become a bit jaded, and I’m looking for good criticism or advice on the generation results.
Also, here are the analysis results:
Analytics: Vessels
Arteries:
Count: 1,686
Avg. Length: 75.2 km
Max. Length: 96.0 km
Avg. Temp.: 30.7°C
Median Temp.: 30.7°C
Capillaries:
Count: 3,322
Avg. Length: 118.6 km
Max. Length: 144.6 km
Avg. Temp.: 28.4°C
Median Temp.: 28.6°C
Analytics: Winds
Flow Analysis:
Avg. Speed: 42.0 km/h
Median Speed: 25.4 km/h
Max. Speed: 777.8 km/h
Dominant: NE
Vorticity: 115.38
Analytics: Hydrology
Precipitation and Clustering:
Deserts (< 50): 22.4%
6931 zones | Avg. 64px | Max. 46763px
Steppes (50-250): 39.6%
7024 zones | Avg. 111px | Max. 118983px
Temperate (250-500): 13.6%
11365 zones | Avg. 24px | Max. 5505px
Humid (500-1000): 12.2%
7618 zones | Avg. 31px | Max. 17050px
Tropics (1000-2000): 8.8%
3954 zones | Avg. 44px | Max. 28133px
Monsoons (> 2000): 3.6%
1403 zones | Avg. 50px | Max. 4088px
Rivers:
Count: 33576
Avg. Length: 46 km
Median Length: 31 km
Longest: 3089 km
Analytics: Relief
Coastal Lowlands (0 - 200m): 14.0%
Plains (200m - 500m): 22.8%
Uplands (500m - 1000m): 34.1%
Plateaus (1000m - 2000m): 23.5%
Low Mountains (2000m - 4000m): 3.0%
High Ridges (4000m - 6000m): 2.2%
Alpine Peaks (> 6000m): 0.3%
Ruggedness Index: 1.2°
Ridge Count (>5.2km): 159
Mountain Area (% of land): 5.5%
Largest Ridge (% of land): 4.9%
Hypsometric Curve:
Analytics: Temperature
Static Analysis:
Polar (< -10°C): 0.0%
Tundra (-10°C - 5°C): 0.0%
Cool (5°C - 15°C): 7.1%
Temperate (15°C - 25°C): 31.3%
Subtropical (25°C - 30°C): 19.1%
Tropical (30°C - 40°C): 32.2%
Extreme (> 40°C): 10.3%
Dynamic Analysis:
Polar (< -10°C): 0.0%
Tundra (-10°C - 5°C): 0.5%
Cool (5°C - 15°C): 22.3%
Temperate (15°C - 25°C): 33.6%
Subtropical (25°C - 30°C): 18.0%
Tropical (30°C - 40°C): 21.6%
Extreme (> 40°C): 4.1%