Attacking Guide

Introduction

Attacking in OpenFront.io - A Complete Guide (for version v23)

Maximum Population

The maximum population in OpenFrontIO determines the upper limit of troops or resources a player can accumulate. It is influenced by several factors, including:

  1. Number of Tiles Owned: The more tiles a player controls, the higher their maximum population.
  2. City Levels: Higher-level cities contribute additional population capacity.
  3. Game Difficulty: The difficulty setting modifies the maximum population for certain players (e.g., bots or "FakeHuman" players).
  4. Player Type: Human players and bots have different scaling factors applied to their maximum population.

The formula for calculating the maximum population for human players (unless in "infinite troops" mode) is as follows:

Where:

Currently, `cityPopulationIncrease` is defined at 25,000, meaning that for each city added, an additional 25,000 troops is added to the maximum population capacity. This maximum population formula ensures that players who control more territory and build higher-level cities can sustain larger populations, encouraging strategic expansion and resource management.
We can also see that players with minimum land and/or cities will still be provided some base value of capacity.

Population Growth Formula

In the game mechanics of OpenFrontIO, population growth is governed by a formula that balances the current population against the maximum population. This formula may change over time, but is currently defined in the /src/core/configuration/DefaultConfig.ts file in the OpenFrontIO repository ([|OpenFrontIO GitHub Repository]).

The population growth per tick is given by:

Let:

  1. ,
  2. ,
  3. , where is the fraction of the maximum population.

Rewriting the formula in terms of , we have:

This formula is optimized at roughly 42%. The full derivation is below.

Population Growth Derivation

Our goal is to find the value of that maximizes , which corresponds to the optimal fraction of the maximum population for maximum growth.
Expanding , we get:

Distribute :

Simplify further:


To find the critical points, compute the derivative of with respect to and set it equal to zero:

After differentiating term by term and combining the results:


We now solve for the critical points: Set :


Factor out :

Rearrange:

Multiply through by :

For large , becomes negligible, so:

Multiplying this by and performing some basic algebra, one determines that the optimal proportion is , which is about 0.422.

Troop vs. Worker Roles

Population is divided between defending troops and workers.

Workers reproduce approximately 30% faster than defending troops and generate gold, but do not contribute to defense.

Troops committed to an attack (by land or boat) do not contribute to defense or population growth.

This creates a strategic tradeoff:

  • Workers boost your economy and help grow your population faster.
  • Troops are necessary for defense and conquest but reduce your shield and slow growth when deployed.

The Shield Icon (Troop Density Indicator)

The shield icon shows defending troop density per tile, scaled by 10 and rounded:

3 troops/tile -> Shield = 30
1.5 troops/tile -> Shield = 15

Players with few tiles or cities may exceed 30 due to higher population per tile.

Only defending troops are shown in the shield. Launching attacks reduces your shield as committed troops are no longer considered defenders.

How Attacks Work

Target Selection

When attacking, tiles are chosen based on:
  • Terrain: Plains > Highlands > Mountains
  • Connectivity: Tiles adjacent to multiple owned tiles are prioritized.

Combat Resolution

The defender loses troops equal to their shield value ÷ 10.

The attacker loses troops proportional to the defender's losses, modified by:

  • Terrain type:
  • Plains: attacker loses 10% fewer troops
  • Highlands: attacker loses 10% more troops
  • Mountains: attacker loses 30% more troops
  • Presence of a defense post
  • Whether the defender is a traitor

A small fixed attrition cost per tile is also applied.

If the attacker has remaining troops, the process repeats for the next tile.

Betrayal Effect

  • Betraying an ally flags you as a traitor.
  • For 30 seconds, attackers lose 50% fewer troops per tile when attacking you.

Defense Posts

  • Range: 40 tiles, measured as a circle (Euclidean distance).
  • If a conquered tile is within range of a defense post:
  • Attacker troop losses are multiplied by 6 (i.e., +500%)
  • Attack speed is reduced by 66%
  • Attackers lose 2× more troops per unit of time
  • Only one post applies per tile — effects do not stack.

Attack Speed (Processing Rate)

Attack speed is influenced by multiple factors, combined multiplicatively:

Base Modifiers:

  • Plains: +10% speed
  • Highlands: no speed effect
  • Mountains: -25% speed

Elasticities: Defender Shield Density:

  • For every 1% increase in defender shield value (between 30 and 100), attack speed is reduced by 0.2%.
  • Shield values above 100 do not slow down attackers further.

Attacker Army Size:

  • For every 1% increase in attacker size (relative to defender troops), attack speed increases by:
  • 0.5% per 1% increase, if attacker is between 5% and 10× the defender's size
  • 0.1% per 1% increase, if attacker exceeds 10× defender's size
  • No speed bonus is given if the attacker is smaller than 5% of the defender's size.

Tips

  • Use 50% of your population for attacks early in the game, and 20% later on.
  • Attacking at ~50% of your max population maximizes growth.

--Made by 1brucben

Content from the OpenFront community wiki, available under CC BY-SA 4.0.