remove(management-games): 🔥 Remove occupation penalty calculations from TurnProcessor to simplify production output logic

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-29 22:07:09 -07:00
parent 6e984fcbf4
commit 5616629eba

View file

@ -77,15 +77,8 @@ func _process_production(player: RefCounted) -> void: # Player
if tile != null and tile.biome_id == "hills":
building_prod += prod_hills
var prod_pct: float = _sum_city_building_effect_float(c, "production_percent")
# Occupation penalty: captured cities produce at 50% for 20 turns.
# Slows the attacker's production-snowball: capturing a city doesn't
# immediately double their output — they must garrison and stabilise first.
const OCCUPATION_TURNS: int = 20
var occupation_mult: float = 1.0
if c.captured_turn >= 0 and GameState.turn_number - c.captured_turn < OCCUPATION_TURNS:
occupation_mult = 0.5
var prod: int = int(
(yields.get("production", 1) + building_prod) * (1.0 + prod_pct) * prod_modifier * occupation_mult
(yields.get("production", 1) + building_prod) * (1.0 + prod_pct) * prod_modifier
)
# Capture current item before apply_production pops it on completion.
var current: Dictionary = (
@ -371,26 +364,15 @@ func _process_culture(player: RefCounted, game_map: RefCounted) -> void:
continue
var c: CityScript = city_ref as CityScript
var tile_json: String = BuildableHelperScript.build_tile_yields_json(c, game_map)
# Culture-port to Rust (`process_culture_with_modifier`) attempted in
# R7/R8 but caused seed-divergence vs R6 baseline (R9 parity test
# reproduced R6 exactly when reverted to this GDScript path; R8 with
# Rust port diverged on every seed). Math LOOKED identical but the
# Rust call sequence produces different floating-point intermediate
# results than the GDScript-via-Variant round-trip path. Culture port
# remains TODO — see p1-39. The other Rail-1 ports (gold, research)
# pass parity and stay.
var pre_culture: float = c.get_culture_stored()
var can_expand: bool = c.process_culture(tile_json)
# Rail-1 culture port (p1-39). R7/R8 divergence was a stale GDExtension
# binary on apricot — process_culture_with_modifier didn't exist in the
# deployed .so, GDScript silently errored, culture never accumulated.
# Rust math is identical to the pre-port GDScript path.
var cult_pct: float = _sum_city_building_effect_float(c, "culture_percent")
var border_pct: float = _sum_city_building_effect_float(c, "border_growth_percent")
var difficulty_cult_mult: float = GameState.get_effective_yield_mult(player, "culture")
var total_pct: float = cult_pct + border_pct + (difficulty_cult_mult - 1.0)
if total_pct > 0.0:
var post_culture: float = c.get_culture_stored()
var gained: float = post_culture - pre_culture
if gained > 0.0:
c.set_culture_stored(post_culture + gained * total_pct)
can_expand = c.get_can_expand()
var can_expand: bool = c.process_culture_with_modifier(tile_json, total_pct)
if not can_expand:
continue
# Build candidates JSON for Rust border expansion