Files
settled-reach/server/data/climate_constants.toml
T
jpmschweitzerandClaude Opus 4.8 def70eaf37 feat(simulation): D-239 three-carrier foundation (T-1023/1024/1026)
First foundation slice of the Atlas-to-tile derivation model (epic T-974),
building the carrier layer ahead of its T-1027+ consumers.

T-1026 — Anti-squaring domain warp (D-239 §4): stateless pure
fn(seed,body_id,pos)->(f64,f64), ±8m, f64 to the final voxel then as-i32
truncation for IEEE-754 cross-target determinism. New domain_warp.rs,
SeedDomain::DomainWarp; golden-vector + cross-thread tests. Position math
only — D-010 integer discipline preserved downstream. Marked dead_code
until the T-1028 VoxelColumn pipeline consumes it.

T-1023 — RegionProfile carrier (D-239 §1,§10): new RegionProfile +
TectonicClass/GlaciationGrade/PrecipitationClass enums + BodyParams; derived
per-region river_threshold replacing the global 200 for tile consumers.
regions: BTreeMap on BodyWorldState, populated via the cascade's new
RegionProfile layer (runs when body_params is Some, else falls back to
Settlement). D-010 integer discipline, BTree ordering.

T-1024 — District climate primitives (D-239 §2): nullable temperature_c +
moisture on RegionProfile, mean-annual scalar (no clock dep; dynamic branch
deferred to Q-105). Hybrid inputs — new bodies.axial_tilt_deg column imported
from planet-gen body-defs (populate_axial_tilt_deg, 2611 bodies), luminosity
and orbital distance derived at runtime; greenhouse + diurnal-swing tables in
source-canonical climate_constants.toml. D-239 implementation note added.

cargo test: 1498 passed, 0 failed. clippy clean (pre-existing
large_enum_variant only). make check-systems-db: stamp fresh.

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

59 lines
2.6 KiB
TOML

# Climate constants for district temperature derivation (T-1024, D-239 §2).
#
# Source-canonical — loaded by the Rust simulation at runtime.
# These values mirror the tuned constants from tooling/planet-gen/planet_simulation.py.
# Changing these constants does NOT require a DB migration (runtime file, not DB).
# To tune: edit here, rerun the server, inspect Atlas temperature maps.
#
# Two tables are required:
# [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-239 §2):
# T_base = T_stellar_equilibrium + greenhouse_offset_c[atmosphere]
# T_mean = T_base + latitude_term + elevation_lapse_term
# T_diurnal_amplitude = diurnal_amplitude_c[atmosphere]
#
# No atmosphere → temperature_c = None (airless body; D-227).
[greenhouse_offset_c]
# Greenhouse warming contribution per atmosphere class (°C above bare rock).
# "none" is not present — airless bodies skip the climate branch entirely (D-227).
# Values from planet_simulation.py STAR_LUMINOSITY + greenhouse table.
thin = 8
standard = 33
toxic = 33 # treated as standard greenhouse for thermal purposes
breathable = 33 # synonym for standard
dense = 80
[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
# ---------------------------------------------------------------------------
# Stellar luminosity lookup (relative to Sol = 1.0).
# Midpoint per spectral type, matching planet_simulation.py STAR_LUMINOSITY.
# Used to derive distance_au at runtime from orbital_period_days via Kepler's 3rd law.
#
# These values are also used to compute T_stellar_equilibrium:
# T_eq_K = 278.5 * (luminosity ^ 0.25) / sqrt(distance_au)
# ---------------------------------------------------------------------------
[star_luminosity]
O = 100000.0
B = 1000.0
A = 10.0
F = 2.5
G = 1.0
K = 0.4
M = 0.04