A planetary geology simulator with a C# .NET backend for simulation and a TypeScript/Vite/Three.js frontend for display. GeoTime models the full 4.5 billion year evolution of an Earth-like planet — from plate tectonics and volcanic eruptions to erosion, climate, weather, vegetation, and soil formation.
GeoTime uses a client-server architecture where all computation-heavy simulation runs on the .NET backend, and the frontend only handles rendering and user interaction:
┌─────────────────────┐ REST API ┌─────────────────────────┐
│ Frontend (TS) │ ◄─────────────────────► │ Backend (C# .NET) │
│ │ │ │
│ • Three.js globe │ POST /api/planet/gen │ • Planet generation │
│ • Cross-section 2D │ POST /api/sim/advance │ • Tectonic engine │
│ • UI shell / HUD │ GET /api/state/* │ • Surface processes │
│ • Layer overlays │ POST /api/crosssection │ • Climate & weather │
│ │ │ • Vegetation engine │
│ │ │ • Biomatter engine │
└─────────────────────┘ │ • Cross-section engine │
└──────────────────────────┘
cd backend
dotnet restore
dotnet build
dotnet run --project GeoTime.Api # Starts API server on http://localhost:5000
dotnet test "GeoTime.Tests/GeoTime.Tests.csproj" # Run backend tests
Optional GPU diagnostic:
cd backend
dotnet run --project GeoTime.Diagnostic
Each backend process writes a JSONL performance log for optimization analysis. On startup the console prints the path, and the frontend logs it in the browser console after connecting.
backend/GeoTime.Api/logs/GEOTIME_PERF_LOG_DIR or GeoTime:PerfLogDirectory in configurationGET /api/diagnostics/sessionLogged events include:
session_start / session_end — machine, .NET, and process metadataplanet_generate — generation wall time, plate/hotspot counts, compute backendsimulation_advance — per-engine tick timings, GPU activity, adaptive-resolution overhead, feature detection, event depositionapi_request — wall time and response size for every /api/* callclient_advance_cycle / client_planet_generate — frontend round-trip timings, FPS, and stats mirrored from the APIExample analysis:
# Slowest simulation advances
rg '"event":"simulation_advance"' backend/GeoTime.Api/logs/*.jsonl
npm install
npm run dev # Start dev server (connects to backend at localhost:5000)
npm run build # Production build (tsc + vite)
npm run test # Run unit tests (Vitest)
npx playwright test --reporter=list # Run E2E tests (Playwright)
Playwright is configured to start the backend API and frontend preview on 127.0.0.1 for E2E runs.
Set the backend URL via environment variable if needed:
VITE_API_BASE=http://localhost:5000 npm run dev
The unreal/GeoTimeUE/ directory contains an Unreal Engine 5 project that connects to the same C# backend via the REST API and renders the terrain using UE5's landscape and procedural tools.
Prerequisites:
Steps:
cd backend
dotnet run --project GeoTime.Api
unreal/GeoTimeUE/GeoTimeUE.uprojecthttp://localhost:5000GET /api/unreal/terrain-meta — terrain dimensions and scaleGET /api/unreal/heightmap-raw — raw 16-bit heightmap bytesGET /api/unreal/terrain-tile/{x}/{y}/{lod} — streamed terrain tilesGET /api/unreal/camera — camera position/orientationPUT /api/unreal/camera — update camera state (auto-sets mode: firstperson < 0.1 km altitude, orbit otherwise)backend/)GeoTime.Core/Models/ — Enums, data models (RockType, SoilOrder, PlateInfo, etc.)GeoTime.Core/Proc/ — Seeded PRNG (Xoshiro256**), simplex noise, planet generatorGeoTime.Core/Kernel/ — Event bus, simulation clock, event log, snapshot managerGeoTime.Core/Engines/ — All geological simulation engines (tectonic, erosion, glacial, weathering, pedogenesis, climate, weather, vegetation, biomatter, cross-section)GeoTime.Core/SimulationOrchestrator.cs — Top-level simulation managerGeoTime.Api/Program.cs — REST API endpointsGeoTime.Tests/ — xUnit backend tests (412 passing in latest full proof)GeoTime.Diagnostic/ — optional console utility for GPU compute mode/device diagnosticssrc/)src/api/backend-client.ts — REST API client for backend communicationsrc/shared/types.ts — Shared TypeScript type definitionssrc/render/ — Three.js globe renderer, icosphere mesh, cross-section Canvas 2D renderersrc/ui/ — DOM-based app shell with HUD, sidebar, inspect panel, timelinetests/ — Vitest unit tests (430 passing in latest full proof)e2e/ — Playwright browser tests (102 passing in latest full proof)| Method | Endpoint | Description |
|---|---|---|
| POST | /api/planet/generate | Generate new planet (body: { seed: number }) |
| POST | /api/simulation/advance | Advance simulation (body: { deltaMa: number }) |
| GET | /api/simulation/time | Get current time and seed |
| GET | /api/state/heightmap | Get height map array |
| GET | /api/state/platemap | Get plate assignment map |
| GET | /api/state/temperaturemap | Get temperature map |
| GET | /api/state/precipitationmap | Get precipitation map |
| GET | /api/state/biomassmap | Get biomass map |
| GET | /api/state/biomattermap | Get biomatter density map |
| GET | /api/state/organiccarbonmap | Get organic carbon map |
| GET | /api/state/plates | Get plate info |
| GET | /api/state/hotspots | Get hotspot info |
| GET | /api/state/atmosphere | Get atmospheric composition |
| GET | /api/state/events?count=N | Get geological event log |
| GET | /api/state/inspect/:cellIndex | Inspect a grid cell |
| POST | /api/crosssection | Get cross-section profile |
See migration.md for the full migration plan from the original all-frontend TypeScript architecture to the current client-server design.
A planetary geology simulator with a C# .NET backend for simulation and a TypeScript/Vite/Three.js frontend for display. GeoTime models the full 4.5 billion year evolution of an Earth-like planet — from plate tectonics and volcanic eruptions to erosion, climate, weather, vegetation, and soil formation.
GeoTime uses a client-server architecture where all computation-heavy simulation runs on the .NET backend, and the frontend only handles rendering and user interaction:
┌─────────────────────┐ REST API ┌─────────────────────────┐
│ Frontend (TS) │ ◄─────────────────────► │ Backend (C# .NET) │
│ │ │ │
│ • Three.js globe │ POST /api/planet/gen │ • Planet generation │
│ • Cross-section 2D │ POST /api/sim/advance │ • Tectonic engine │
│ • UI shell / HUD │ GET /api/state/* │ • Surface processes │
│ • Layer overlays │ POST /api/crosssection │ • Climate & weather │
│ │ │ • Vegetation engine │
│ │ │ • Biomatter engine │
└─────────────────────┘ │ • Cross-section engine │
└──────────────────────────┘
cd backend
dotnet restore
dotnet build
dotnet run --project GeoTime.Api # Starts API server on http://localhost:5000
dotnet test "GeoTime.Tests/GeoTime.Tests.csproj" # Run backend tests
Optional GPU diagnostic:
cd backend
dotnet run --project GeoTime.Diagnostic
Each backend process writes a JSONL performance log for optimization analysis. On startup the console prints the path, and the frontend logs it in the browser console after connecting.
backend/GeoTime.Api/logs/GEOTIME_PERF_LOG_DIR or GeoTime:PerfLogDirectory in configurationGET /api/diagnostics/sessionLogged events include:
session_start / session_end — machine, .NET, and process metadataplanet_generate — generation wall time, plate/hotspot counts, compute backendsimulation_advance — per-engine tick timings, GPU activity, adaptive-resolution overhead, feature detection, event depositionapi_request — wall time and response size for every /api/* callclient_advance_cycle / client_planet_generate — frontend round-trip timings, FPS, and stats mirrored from the APIExample analysis:
# Slowest simulation advances
rg '"event":"simulation_advance"' backend/GeoTime.Api/logs/*.jsonl
npm install
npm run dev # Start dev server (connects to backend at localhost:5000)
npm run build # Production build (tsc + vite)
npm run test # Run unit tests (Vitest)
npx playwright test --reporter=list # Run E2E tests (Playwright)
Playwright is configured to start the backend API and frontend preview on 127.0.0.1 for E2E runs.
Set the backend URL via environment variable if needed:
VITE_API_BASE=http://localhost:5000 npm run dev
The unreal/GeoTimeUE/ directory contains an Unreal Engine 5 project that connects to the same C# backend via the REST API and renders the terrain using UE5's landscape and procedural tools.
Prerequisites:
Steps:
cd backend
dotnet run --project GeoTime.Api
unreal/GeoTimeUE/GeoTimeUE.uprojecthttp://localhost:5000GET /api/unreal/terrain-meta — terrain dimensions and scaleGET /api/unreal/heightmap-raw — raw 16-bit heightmap bytesGET /api/unreal/terrain-tile/{x}/{y}/{lod} — streamed terrain tilesGET /api/unreal/camera — camera position/orientationPUT /api/unreal/camera — update camera state (auto-sets mode: firstperson < 0.1 km altitude, orbit otherwise)backend/)GeoTime.Core/Models/ — Enums, data models (RockType, SoilOrder, PlateInfo, etc.)GeoTime.Core/Proc/ — Seeded PRNG (Xoshiro256**), simplex noise, planet generatorGeoTime.Core/Kernel/ — Event bus, simulation clock, event log, snapshot managerGeoTime.Core/Engines/ — All geological simulation engines (tectonic, erosion, glacial, weathering, pedogenesis, climate, weather, vegetation, biomatter, cross-section)GeoTime.Core/SimulationOrchestrator.cs — Top-level simulation managerGeoTime.Api/Program.cs — REST API endpointsGeoTime.Tests/ — xUnit backend tests (412 passing in latest full proof)GeoTime.Diagnostic/ — optional console utility for GPU compute mode/device diagnosticssrc/)src/api/backend-client.ts — REST API client for backend communicationsrc/shared/types.ts — Shared TypeScript type definitionssrc/render/ — Three.js globe renderer, icosphere mesh, cross-section Canvas 2D renderersrc/ui/ — DOM-based app shell with HUD, sidebar, inspect panel, timelinetests/ — Vitest unit tests (430 passing in latest full proof)e2e/ — Playwright browser tests (102 passing in latest full proof)| Method | Endpoint | Description |
|---|---|---|
| POST | /api/planet/generate | Generate new planet (body: { seed: number }) |
| POST | /api/simulation/advance | Advance simulation (body: { deltaMa: number }) |
| GET | /api/simulation/time | Get current time and seed |
| GET | /api/state/heightmap | Get height map array |
| GET | /api/state/platemap | Get plate assignment map |
| GET | /api/state/temperaturemap | Get temperature map |
| GET | /api/state/precipitationmap | Get precipitation map |
| GET | /api/state/biomassmap | Get biomass map |
| GET | /api/state/biomattermap | Get biomatter density map |
| GET | /api/state/organiccarbonmap | Get organic carbon map |
| GET | /api/state/plates | Get plate info |
| GET | /api/state/hotspots | Get hotspot info |
| GET | /api/state/atmosphere | Get atmospheric composition |
| GET | /api/state/events?count=N | Get geological event log |
| GET | /api/state/inspect/:cellIndex | Inspect a grid cell |
| POST | /api/crosssection | Get cross-section profile |
See migration.md for the full migration plan from the original all-frontend TypeScript architecture to the current client-server design.