Scale alliance cost by the bloc's share of all prestige - #98
Conversation
An alliance now costs more the larger the two factions are together, measured as their share of every faction's prestige. Relation types opt in with bloc-scaling in diplomacy.yml; the default alliance uses cost 1.5 and bloc-scaling 8. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (5)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 SummarySummary by CodeRabbit
WalkthroughRelation types can configure non-negative bloc scaling. RelationManager applies a prestige-share multiplier to eligible diplomatic costs. The ally configuration sets scaling to 8 and lowers its base cost from 3.5 to 1.5. Tests cover configuration loading and cost calculation edge cases. ChangesDiplomatic cost scaling
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~12 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant RelationManager
participant RelationType
participant FactionManager
RelationManager->>RelationType: Get bloc scaling
RelationManager->>FactionManager: Read factions for prestige totals
FactionManager-->>RelationManager: Faction prestige values
RelationManager->>RelationManager: Apply bloc-share multiplier to eligible cost
Suggested reviewers: Merge Risk: ⚪ Minimal · up to This adds an opt-in prestige-based cost modifier, and the default ally cost changes as described in the PR. No merge-blocking risk was found. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change is limited to diplomatic pricing. Pending alliance requests can still be accepted without checking their current capacity cost; this behavior predates the PR, but global prestige scaling adds another way for the cost to change before acceptance. The supported impact is bounded to faction relations and capacity policy. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Hardening Proposals
Comment |
What
An alliance now costs more diplomatic capacity the larger the two factions are together.
New cost for a relation type that sets
bloc-scaling:cost × prestige scale of the target × (1 + bloc-scaling × bloc share)Bloc share is the two factions' combined prestige divided by the prestige of all factions (0 to 1). Relation types without
bloc-scalingare priced exactly as before.The default
allyindiplomacy.ymlchanges fromcost: 3.5tocost: 1.5withbloc-scaling: 8.Why
The flat cost made an alliance between the two strongest factions as cheap, relative to their size, as one between two small factions. With live prestige on 2026-10-01 (alliance
cost: 2on live):Rollout
A server with its own
diplomacy.ymlkeeps its current alliance cost untilcost: 1.5andbloc-scaling: 8are set onallythere.Existing alliances are not broken when their cost rises; a faction over capacity only cannot set new relations.
Tests
RelationManagerDiplomaticCostTest: bloc share maths, off by default, negative and zero prestige.RelationLoaderWarPickableTest:bloc-scalingis read, defaults to 0, negative clamps to 0.mvn verify: 2506 tests pass.🤖 Generated with Claude Code