From f7e70c18441a6225bce416ce4ebe3e9b89b2260e Mon Sep 17 00:00:00 2001 From: Natalie Date: Mon, 8 Jun 2026 00:02:02 -0700 Subject: [PATCH] =?UTF-8?q?feat(@projects/@magic-civilization):=20?= =?UTF-8?q?=E2=9C=A8=20add=20env=20var=20for=20tunable=20worldgen=20ticks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- .../crates/mc-sim/src/bin/dominion_bench.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/simulator/crates/mc-sim/src/bin/dominion_bench.rs b/src/simulator/crates/mc-sim/src/bin/dominion_bench.rs index d69e6002..ef38321e 100644 --- a/src/simulator/crates/mc-sim/src/bin/dominion_bench.rs +++ b/src/simulator/crates/mc-sim/src/bin/dominion_bench.rs @@ -35,6 +35,17 @@ const EVOLUTION_TICKS: u32 = 50_000; const TOTAL_TURNS: u32 = 500; const SEED: u64 = 42; +/// Worldgen evolution depth, overridable via `DB_EVO_TICKS` for fast probes +/// (the 50k default is overnight-bench fidelity; a probe of the *turn* loop +/// does not need full deep-time worldgen). Defaults to `EVOLUTION_TICKS`. +fn evolution_ticks() -> u32 { + std::env::var("DB_EVO_TICKS") + .ok() + .and_then(|s| s.parse::().ok()) + .filter(|&n| n > 0) + .unwrap_or(EVOLUTION_TICKS) +} + /// Map size scales with player count so each player has ~2,300 tiles. fn map_size_for(num_players: usize) -> i32 { std::env::var("DB_MAP_SIZE") @@ -181,7 +192,7 @@ fn run_scenario_with_profiles(num_players: usize, all_profiles: &[ProfileJson]) let start = std::time::Instant::now(); // ── World generation ──────────────────────────────────────────────────── - eprintln!("# Generating {map_size}×{map_size} map with {EVOLUTION_TICKS} ecology ticks..."); + eprintln!("# Generating {map_size}×{map_size} map with {} ecology ticks...", evolution_ticks()); let climate_physics = ClimatePhysics::new("{}", "[]", "{}"); let mut flora = FloraEngine::new(); let mut fauna = EcologyEngine::new(); @@ -235,7 +246,7 @@ fn run_scenario_with_profiles(num_players: usize, all_profiles: &[ProfileJson]) let mut climate = climate_physics; let world_age = WorldAgeConfig { - evolution_ticks: EVOLUTION_TICKS, + evolution_ticks: evolution_ticks(), max_expected_tier: 10, guaranteed_t10: 0, };