Repository navigation
Slow prosperity growth past 80 and add workshop trade upkeep - #45
Conversation
Province prosperity is unchanged up to prosperity-soft-cap (80). Past it the excess grows with a square root, so each point is worth less (half at 140, a third at 240) without a hard ceiling. This stops guilds from stacking production into the same provinces to run them far past 80. Workshops now add 1% trade upkeep per level, like guild halls and storehouses already do, so reinvesting in production levels off instead of compounding forever. 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 (7)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review. 📝 WalkthroughWalkthroughThe change adds configurable diminishing growth to province prosperity and adds a ChangesProsperity Soft Cap
Workshop Trade Upkeep
Priority: ⬇️ Low Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Feature Suggested reviewers: Merge Risk: ⚪ Minimal · up to The change appears mergeable after normal checks. Existing server configurations still need the documented workshop modifier added manually. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The change uses existing calculation and income paths, with no identified new security boundary bypass. An existing recalculation order could briefly leave displayed or saved income out of step with newly capped prosperity. Retained concerns
Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 12 functions across 5 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
I twitch my nose at curves that bend, Comment |
Summary
Two changes so the richest trade guilds level off instead of compounding forever. Collection stays 1:1: a guild still collects exactly its trade share of a province's prosperity.
Province.calculateProsperitynow runs the final value throughProsperitySoftCap. Up toprosperity-soft-cap(80) nothing changes. Past it the excess grows with a square root (cap + 2S(√(1 + (p − cap)/S) − 1), S =prosperity-soft-cap-scale= 20). The curve is smooth at 80 and has no ceiling. Each extra point is worth half at 140 and a third at 240. Setting either value to 0 turns it off.trade_upkeep 0 0.01(1% per level). Guild halls (1%) and storehouses (2%) already did, so workshops were the one upkeep-free way to keep growing.Why
In a simulation on the live Main data (trade flood, production and prosperity copied from this code), YevaKeepers and The_Chisels reinvesting everything (+600/day from grinding) grew net trade income from about 600 to over 3,000/day within 90 days. Their helper guilds could also pool workshops into the same provinces, pushing a single province past 570 prosperity.
Today the cap touches one province on Main (province 15: 81.78 → about 81.7). Workshop upkeep costs guilds with workshops about 1% of trade income per level; Yeva and Chisels lose about 12% on day one.
Deploy note
The plugin does not overwrite existing configs. On each server, add
- trade_upkeep 0 0.01underworkshops.modifiersinplugins/SimpleFactions/Guilds/branches.yml. The twoprosperity-soft-capkeys default to 80 and 20 when missing fromconfig.yml.Test plan
mvn package: all 2,068 tests pass, including the newProsperitySoftCapTest(unchanged below the cap, smooth at the seam, half value at cap + 3S, no ceiling, 0 turns it off)🤖 Generated with Claude Code