feat(empire): Introduce yield multiplier for gold income to balance progression/difficulty scaling

Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
autocommit 2026-04-27 02:35:49 -07:00
parent 59dea7f358
commit dfc9fdcc03
2 changed files with 15 additions and 6 deletions

View file

@ -43,8 +43,15 @@ static func process_turn(player: RefCounted, game_map: RefCounted) -> void:
var params_json: String = _build_params_json(player)
var gd_economy: RefCounted = ClassDB.instantiate("GdEconomy") as RefCounted
var result: Dictionary = gd_economy.process_turn(cities_json, units_json, params_json)
player.gold_per_turn = int(result.get("net_gold", 0))
player.gold = int(result.get("new_gold", player.gold))
var net_gold: int = int(result.get("net_gold", 0))
# Apply per-yield difficulty multiplier to gold income only (warcouncil
# p1-29 H4, 2026-04-27). Net negative gold (upkeep > income) is NOT
# scaled — handicap should help income, not amplify deficits.
if net_gold > 0:
var gold_mult: float = GameState.get_effective_yield_mult(player, "gold")
net_gold = int(net_gold * gold_mult)
player.gold_per_turn = net_gold
player.gold = int(result.get("new_gold", player.gold)) + (net_gold - int(result.get("net_gold", 0)))
var disbanded_count: int = int(result.get("disbanded_units", 0))
if disbanded_count > 0:
_disband_cheapest(player, disbanded_count)

View file

@ -351,12 +351,14 @@ func _process_culture(player: RefCounted, game_map: RefCounted) -> void:
var tile_json: String = BuildableHelperScript.build_tile_yields_json(c, game_map)
var pre_culture: float = c.get_culture_stored()
var can_expand: bool = c.process_culture(tile_json)
# Apply culture_percent and border_growth_percent bonuses to the
# culture gained this turn. process_culture already added raw culture;
# we top up the stockpile by (raw_gain * total_pct) so wonders scale.
# Apply culture_percent + border_growth_percent (building bonuses) +
# per-yield difficulty culture_mult (warcouncil p1-29 H4, 2026-04-27)
# as compounding multipliers on the raw gain.
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 total_pct: float = cult_pct + border_pct
var difficulty_cult_mult: float = GameState.get_effective_yield_mult(player, "culture")
# Express the difficulty mult as a "percent" addition: 1.50 → +50%.
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