Jump to content

Formulas: Difference between revisions

From OpenDominion
Oment (talk | contribs)
mNo edit summary
ODWikiBot (talk | contribs)
Regenerate formulas from Round 50 source
 
Line 1: Line 1:
This is just a collection of formulas for easy reference. It's highly recommended that you read the corresponding article to understand conditions or criteria when the formula may deviate.
This page lists commonly referenced source-backed formulas. Most formulas are affected by race, spell, tech, wonder, hero, and other modifiers after the base value is calculated.


== Construction ==
== Exploration ==


[[Construction]] costs [[platinum]] and [[lumber]].
The platinum cost per explored acre is based on current land before exploring:


=== Platinum Cost ===
<code>0.6 * Land^1.299 + LowLandAdjustment</code>


<code>850+([Total Land]-250)*1.53</code>
If Land is below 1520:


=== Lumber Cost ===
<code>LowLandAdjustment = -0.001 * Land^2 + 1.91 * Land - 593</code>


<code>88+([Total Land]-250)*0.35</code>
At 1520 land and above, LowLandAdjustment is 0. The final per-acre platinum cost is rounded after exploration-cost modifiers are applied.


== Espionage and Magic ==
The draftee cost per explored acre is:


There are two formulas which determine the chance of success for [[espionage]] [[ops]] and offensive [[magic]] [[spells]].
<code>floor(Land / 150) + 3</code>


=== Info Ops ===
== Construction ==
 
<code>0.8 ^ (2 / ((Your Ratio / Defender Ratio) * 1.4) ^ 2))</code>


=== Black Ops ===
Base construction costs use explored and conquered acres:


<code>0.8 ^ (2 / ((Your Ratio / Defender Ratio) * 1.2) ^1.2))</code>
<code>Platinum = round(850 + ConqueredAcres + 1.25 * ExploredAcres)</code>


== Land Gains ==
<code>Lumber = round(87.5 + ConqueredAcres / 4.25 + 0.285 * ExploredAcres)</code>


[[Land]] conquered by attacker (and lost by target) during [[invasion]] is calculated according to this formula.
Construction-cost modifiers are applied after the base cost. Platinum construction cost cannot be reduced below 20% of base cost, and lumber construction cost cannot be reduced below 25% of base cost.


If target is less than 55% the size of the attacker:
== Rezoning ==


<code>0.80 * ( 0.304 * ((Target Size/Attacker Size)^2) - 0.227 * Target Size/Attacker Size + 0.048) * Attacker Size</code>
<code>Platinum = round(250 + 0.6 * ExploredAcres + 0.2 * ConqueredAcres)</code>


If target is greater than or equal to 55% but less than 75% the size of the attacker:
Factory and other rezone-cost modifiers are applied after the base cost.


<code>0.80 * (0.154 * (Target Size/Attacker Size) - 0.069 * Target Size/Attacker Size) * Attacker Size</code>
== Operations ==


For 75% and up:
Information operation success chance is based on relative spy or wizard ratio:


<code>0.80 * (0.129 * (Target Size/Attacker Size) - 0.048 * Target Size/Attacker Size) * Attacker Size</code>
<code>Chance = 0.8 ^ (2 / ((RelativeRatio * 1.4) ^ 1.2)) + StrengthModifier</code>


=== Land Generation ===
Theft and black-op success chance uses:


The amount of acres gained by the attacker is twice the amount conquered.
<code>Chance = 0.7 ^ (2 / ((RelativeRatio * 1.3) ^ 1.2)) + StrengthModifier</code>


<code>Land Conquered * 2</code>
StrengthModifier is based on the attacker's current spy/wizard strength minus the target's current strength. Final chances are clamped by operation type.


== Prestige ==
== Land Loss and Gains ==


[[Prestige]] is gained and lost using two different formulas.
Successful invasions first calculate target land lost from attacker land, land ratio, and war status. The base land-loss multiplier is 0.75, with higher multipliers for unilateral and mutual war.


=== Prestige Gain ===
If LandRatio is below 0.55:


<code>60 * Land Ratio </code>
<code>Segment = 0.304 * LandRatio^2 - 0.227 * LandRatio + 0.048</code>


* Only generated on successful invasions where Land Ratio > 75%.
If LandRatio is at least 0.55 and below 0.75:
* Prestige cannot exceed your land size when prestige is added.


=== Prestige Loss ===
<code>Segment = 0.154 * LandRatio - 0.069</code>


<code>Prestige * 0.05</code>
At 0.75 LandRatio and above:


=== Prestige Bonus to OP ===
<code>Segment = 0.129 * LandRatio - 0.048</code>


[[OP]] bonus is multiplicative, meaning it is added to OP bonuses like any other bonus.
<code>TargetLandLost = max(10, floor(Segment * 0.75 * AttackerLand * WarMultiplier))</code>


<code>Bonus + Prestige / 10000</code>
The attacker gains the target land lost plus generated land equal to the target land lost.


=== Prestige Bonus to Population and Food ===
== Prestige ==
[[Population]] and [[food|food production]] bonus from prestige is ''multiplicative''.
 
<code>Bonus * (1 + Prestige / 10000)</code>


== Rezone ==
Attacker prestige gain starts from the target's land ratio and land size:


The cost of [[rezoning]] is determined by the following formula.
<code>Gain = min(LandRatio * 200 - 115, 70) + max(0, DefenderLand - 750) / 100</code>


<code>(Land - 250) * 0.6 + 250</code>
Prestige gain is then affected by morale and other prestige-gain modifiers. Defender prestige loss is 5% of defender prestige, capped by the attacker's prestige gain when applicable.

Latest revision as of 22:11, 1 July 2026

This page lists commonly referenced source-backed formulas. Most formulas are affected by race, spell, tech, wonder, hero, and other modifiers after the base value is calculated.

Exploration[edit]

The platinum cost per explored acre is based on current land before exploring:

0.6 * Land^1.299 + LowLandAdjustment

If Land is below 1520:

LowLandAdjustment = -0.001 * Land^2 + 1.91 * Land - 593

At 1520 land and above, LowLandAdjustment is 0. The final per-acre platinum cost is rounded after exploration-cost modifiers are applied.

The draftee cost per explored acre is:

floor(Land / 150) + 3

Construction[edit]

Base construction costs use explored and conquered acres:

Platinum = round(850 + ConqueredAcres + 1.25 * ExploredAcres)

Lumber = round(87.5 + ConqueredAcres / 4.25 + 0.285 * ExploredAcres)

Construction-cost modifiers are applied after the base cost. Platinum construction cost cannot be reduced below 20% of base cost, and lumber construction cost cannot be reduced below 25% of base cost.

Rezoning[edit]

Platinum = round(250 + 0.6 * ExploredAcres + 0.2 * ConqueredAcres)

Factory and other rezone-cost modifiers are applied after the base cost.

Operations[edit]

Information operation success chance is based on relative spy or wizard ratio:

Chance = 0.8 ^ (2 / ((RelativeRatio * 1.4) ^ 1.2)) + StrengthModifier

Theft and black-op success chance uses:

Chance = 0.7 ^ (2 / ((RelativeRatio * 1.3) ^ 1.2)) + StrengthModifier

StrengthModifier is based on the attacker's current spy/wizard strength minus the target's current strength. Final chances are clamped by operation type.

Land Loss and Gains[edit]

Successful invasions first calculate target land lost from attacker land, land ratio, and war status. The base land-loss multiplier is 0.75, with higher multipliers for unilateral and mutual war.

If LandRatio is below 0.55:

Segment = 0.304 * LandRatio^2 - 0.227 * LandRatio + 0.048

If LandRatio is at least 0.55 and below 0.75:

Segment = 0.154 * LandRatio - 0.069

At 0.75 LandRatio and above:

Segment = 0.129 * LandRatio - 0.048

TargetLandLost = max(10, floor(Segment * 0.75 * AttackerLand * WarMultiplier))

The attacker gains the target land lost plus generated land equal to the target land lost.

Prestige[edit]

Attacker prestige gain starts from the target's land ratio and land size:

Gain = min(LandRatio * 200 - 115, 70) + max(0, DefenderLand - 750) / 100

Prestige gain is then affected by morale and other prestige-gain modifiers. Defender prestige loss is 5% of defender prestige, capped by the attacker's prestige gain when applicable.