Skip to content

Commit

Permalink
Reinforcements calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
wvpm committed Jan 10, 2024
1 parent e6c62c1 commit b8a5439
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion docs/simulation/calculations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,29 @@ POPs:
owners: total size of owner POPs in state
workers: number of employed workers in RGO
max(0.5: Hardcoded minimum of half the RGO income.
2*: Hardcoded value.
2*: Hardcoded value.
Military:
Reinforcements per army:
formula: 5 * round(supply factor * sum of unit reinforcements * REINFORCE_SPEED * local reinforce rate * (1 + reinforce_rate) * (1 + reinforce_speed) / 5)
supply factor:
if unit received all its supplies: 1
else: complex graph, see https://www.desmos.com/calculator/pc9bbrsixz
unit reinforcements: 1000 * max_strength * unit reinforce rate
max_strength: as defined in /units/<unit>.txt
1000: (max_)strength is defined in thousands of soldiers. Reinforcements per army uses the number of soldiers.
unit reinforce rate:
if unit is mobilised: 0.5
else if pop is too small for a single unit: 0.5
else if pop supports too many units: number of units it can support / number of supported units
else: 1
REINFORCE_SPEED: defines.military.REINFORCE_SPEED
local reinforce rate:
if location owner == army owner: 2
else if has military access (via treaty or allies in war): 1
else if is exiled: 0
else if location controller is hostile: 0.1
else if location is uncolonised: 0
else: no clue
reinforce_rate: sum of reinforce_rate modifiers from tech
reinforce_speed: sum of reinforce_speed modifiers on country
5 * round() / 5: round to multiple of 5

0 comments on commit b8a5439

Please sign in to comment.