Files
settled-reach/server/data/climate_constants.toml
T
jpmschweitzerandClaude Opus 4.8 b6be9f5758 feat(simulation): planet_class temperature envelope, drop orbit/star inputs (T-1033, D-240)
Replace the sun-driven Stefan-Boltzmann temperature with the D-240 class-envelope
model. Temperature derives only from authored fields — no orbit/star physics.

- [planet_class_temperature] envelope table in climate_constants.toml (approved
  bands: frozen [-90,-25] .. hot_arid [20,58] .. volcanic [30,90]); cold_/hot_/
  warm_ prefix parsing; temperate fallback for unknowns.
- derive_temperature_c(params, constants, body_seed): band = envelope(planet_class);
  latitude lerps across it (equator=warm, pole=cold); atmosphere greenhouse +
  elevation lapse modulate within; small seed nudge for per-body variety; CLAMP to
  band — a body can never escape its class. Airless -> None.
- Delete the dead astrophysics: derive_distance_au, ClimateConstants::luminosity(),
  the [star_luminosity] table. Strip orbital_period_days/spectral_class/star_type/
  axial_tilt_deg from BodyParams + BodyParamsReader (read 3 cols from bodies, no
  star_systems join). DB columns left in place (no regen).
- New every_planet_class_derives_within_its_band test (13 classes x 5 atmo x 19 lat
  x 4 seeds, all in band) — the D-240 consistency guard.

Verified on 25 diverse real bodies: the worlds that derived to +356C now sit inside
their class bands (temperate capped at 28C). cargo test passes, clippy -D warnings
clean, fmt clean.

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

68 lines
3.1 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