Deterministic game simulation

One environmental model for atmosphere, survival, and combat.

LittleEnvironment is a dependency-free ESM toolkit for connecting celestial time, weather, lighting, physiology, attributes, status effects, progression, and saves. Its simulation runs without a browser or a renderer.

Interactive demos

Weather

Climate transitions and camera-bounded rain, snow, ash, and fog.

Open weather demo

Combat

Armour mitigation, shields, critical hits, and frostbite ticks.

Open combat demo

Architecture

Time and climate

Continuous time is normalised to [0, 1). Calendar changes occur only on day rollover, while weather transitions interpolate a compact climate matrix.

Headless first

Core modules in src/ contain no DOM, Canvas, or WebGL assumptions. Renderer adapters consume plain light frames and particle data.

Physiology

Core temperature evolves smoothly with environmental delta, thermal resistance, and a configurable exchange rate. Hunger, thirst, stamina, and oxygen update at sub-second precision.

Combat and effects

Attributes cache their effective values until invalidated. Effects process all elapsed tick intervals, retaining the fractional remainder.

Thermodynamic heat balance

dTbody / dt = (Tenvironment − Tbody) / (Iinsulation + Kthermal) × Rexchange

Layered attributes

clamp(((base + Σflat) × (1 + Σadditive)) × Π(1 + multiplicative), min, max)

Local development

npm test
npm run build
python3 -m http.server 8000

Open this documentation from the local server rather than directly from the filesystem, so the browser can load the generated ESM bundle.