Skip to content

Move Policy cost modifiers to mod constants #12983

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ class PolicyManager : IsPartOfGameInfoSerialization {
}

fun getPolicyCultureCost(numberOfAdoptedPolicies: Int): Int {
var policyCultureCost = 25 + (numberOfAdoptedPolicies * 6).toDouble().pow(1.7)
val constants = civInfo.gameInfo.ruleset.modOptions.constants
var policyCultureCost = constants.policyBase + (numberOfAdoptedPolicies * constants.policyMultiplier).toDouble().pow(constants.policyExponent)
val worldSizeModifier = civInfo.gameInfo.tileMap.mapParameters.mapSize.getPredefinedOrNextSmaller().policyCostPerCityModifier
var cityModifier = worldSizeModifier * (civInfo.cities.count { !it.isPuppet } - 1)

Expand Down
5 changes: 5 additions & 0 deletions core/src/com/unciv/models/ModConstants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,11 @@ class ModConstants {
var pantheonBase = 10
var pantheonGrowth = 5

// Factors in formula for policy costs
var policyBase = 25
var policyMultiplier = 6
var policyExponent = 1.7
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually really don't like this, I'm thinking of using something like https://github.com/fasseg/exp4j to allow arbitrary functions given base values but this will require experimentation

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Civ6/Civ7 uses a predetermined cost per policy, such would probably be better implemented in a similar way as how tech costs are implemented currently. I'm not sure if there's much demand for highly costomizeable culture cost formulas, the difference in the formulae for regular policies in G&K and BNW can be implemented via mod constants like this, although Ideology policies are in their own 'pool' for culture cost calculation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to people in a Civ5 discord server, the ideology policies are in the same 'pool' as the regular policies, so I think the Civfanatics page where I read this is inaccurate on this.


var workboatAutomationSearchMaxTiles = 20

// Civilization
Expand Down
Loading