Files
settled-reach/server/data/climate_constants.toml
T
jpmschweitzerandClaude Opus 4.8 bb5069aa13 feat(simulation): district moisture spatial gradient (T-1080)
moisture_q was a single body constant (derive_moisture_q took only &BodyParams →
80 for every one of 2048 ocean-world districts), so vegetation/terrain/ecotones
were uniform — "nothing to fuzz" (the T-1080 believability bug).

- district_profile.rs: derive_moisture_q is now a body ceiling (hydrosphere+atmosphere)
  × per-district gradient — latitude (equator wet → pole dry), elevation (orographic/
  rain-shadow), continentality (100 − ocean_fraction_q). Integer/D-010, no new plumbing
  (elev_q/ocean_fraction_q/latitude_deg already reach build_district_profile). Mirrors
  D-240's temperature model. Coefficients in ClimateConstants + climate_constants.toml
  [moisture_gradient] (provisional; Q-123 calibrates). Tuned so a wet body stays mostly
  green with drier patches and a frozen body clamps mostly barren. + gradient unit test.
- region_profile.rs: region-tier moisture gets the region-latitude gradient (elevation/
  continentality are district-scale).
- Propagates to precipitation_class / vegetation_class / morphology_zone (all read
  moisture_q). D-239 §2 amended. Believability golden regenerated.

Probe (Arbour @ yolo): moisture_q distinct 1 → 49 (spread 0 → 48); 5/7 → 6/7 criteria.
Edict (frozen): moisture 0..20 ×21 — gradient within its low ceiling. Remaining fail
(vegetation-present) is the metric dividing by all-sampled incl. water on a 2/3-ocean
world — a Q-123 calibration concern, not a climate defect.

clippy --all-targets -D warnings clean; 1580 lib tests + harnesses pass.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 17:25:18 +02:00

100 lines
4.9 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Climate constants for district temperature derivation (T-1024, D-239 §2, D-240).
#
# Source-canonical — loaded by the Rust simulation at runtime.
# Changing these constants does NOT require a DB migration (runtime file, not DB).
# To tune: edit here, rerun the server, inspect Atlas temperature maps.
#
# Three tables are required:
# [planet_class_temperature] — per-class [cold_end, warm_end] °C band (D-240).
# [greenhouse_offset_c] — mean-annual base temperature offset by atmosphere class.
# [diurnal_amplitude_c] — day/night swing AMPLITUDE by atmosphere class.
#
# Temperature derivation formula (D-240):
# (cold, warm) = planet_class_temperature[planet_class] # envelope
# t_lat = warm - (warm - cold) * (|latitude_deg| / 90) # latitude lerp
# greenhouse modulates within the band
# elevation lapse pulls toward cold end
# seed nudge ±~3°C
# CLAMP to [cold, warm] — body can never derive outside its class band.
#
# No atmosphere → temperature_c = None (airless body; D-227).
# ---------------------------------------------------------------------------
# Planet class temperature envelopes (D-240).
# Each entry: [cold_end_c, warm_end_c] — the band a body of this class stays in.
# Prefix rules: "cold_*" shifts both ends ~10°C colder; "hot_*" ~10°C warmer;
# "warm_*" ~5°C warmer. Unknown class falls back to "temperate" band.
# ---------------------------------------------------------------------------
[planet_class_temperature]
frozen = [-90.0, -25.0]
ice = [-90.0, -25.0]
boreal = [-35.0, 12.0]
cold_arid = [-40.0, 20.0]
temperate = [-12.0, 28.0]
oceanic = [-12.0, 28.0]
subtropical = [ 2.0, 34.0]
warm_ocean = [ 2.0, 34.0]
tropical = [ 16.0, 40.0]
arid = [ -5.0, 45.0]
hot_arid = [ 20.0, 58.0]
volcanic = [ 30.0, 90.0]
geothermal = [ 30.0, 90.0]
[greenhouse_offset_c]
# Greenhouse warming contribution per atmosphere class — used as a fractional
# nudge toward the warm end of the class band, not an absolute Kelvin offset.
# "none" is not present — airless bodies skip the climate branch entirely (D-227).
# Values represent a 0.01.0 fraction of the band width to add toward warm end.
# thin=0.1 (slightly warmer), breathable/standard=0.25, toxic=0.25, dense=0.55
thin = 0.10
standard = 0.25
toxic = 0.25
breathable = 0.25
dense = 0.55
[diurnal_amplitude_c]
# Day/night swing amplitude (°C). The actual swing is ±amplitude around the
# mean temperature; the morning minimum is T_mean - amplitude, noon maximum is
# T_mean + amplitude. Thick/dense atmosphere = small swing (heat redistribution);
# thin/no atmosphere = large swing.
#
# "none" is excluded — airless bodies have no climate temperature (D-227).
# Values are plausible physics; tune without recompile by editing this file.
thin = 50 # ~50°C day/night swing: large, like Mars
standard = 15 # ~15°C: Earth-like moderate swing
toxic = 20 # intermediate: thick but maybe less redistribution
breathable = 15 # synonym for standard
dense = 3 # ~3°C: Venus-like near-uniform temperature
# ---------------------------------------------------------------------------
[hydrosphere_maritime]
# Maritime moderation (D-240): scales the equator→pole temperature gradient by
# hydrosphere. 1.0 = full gradient (dry world swings the whole class band);
# < 1.0 compresses toward the band midpoint (water-rich worlds are milder at
# both poles and equator). Keys = actual bodies.hydrosphere vocabulary in
# systems.db. "minimal"/"trace"/"none"/absent default to 1.0 in code.
liquid_water = 0.6 # large surface liquid — strongly moderated
ocean = 0.6
"ocean-coastal" = 0.6
extensive = 0.6
rivers = 0.8 # partial surface water — mild moderation
"rivers-lakes" = 0.8
moderate = 0.8
ice = 0.85 # frozen surface — slight moderation
subsurface_liquid = 0.9
subsurface = 0.95 # buried water — minimal surface effect
subsurface_ice = 0.95
# ---------------------------------------------------------------------------
[moisture_gradient]
# Per-district moisture spatial gradient (T-1080, D-239 §2). Integer points
# subtracted from the body's hydrosphere moisture *ceiling* so the field varies
# across the body instead of being a single constant (the bug: moisture_q = 80 for
# every district -> uniform vegetation/terrain). Wet at coast/lowland/tropics, drier
# toward interior/highland/poles. Provisional magnitudes — Q-123 calibrates. Mirrors
# the embedded ClimateConstants::default(); not yet loaded at runtime (TOML wiring is
# T-1032), kept in sync by hand like the other tables.
lat_penalty = 20 # lost equator->pole (x |latitude|/90)
elev_penalty = 15 # lost low->high elevation (x elev_q/100, rain-shadow)
continental_penalty = 20 # lost coast->interior (x (100 - ocean_fraction_q)/100)