Beginner Protection (Truce)
Towns receive a protection window (protection_until) that shields them from incoming attacks. There are two ways a town can gain protection: at creation (beginner protection) and after being successfully attacked (post-attack truce). Launching an attack immediately forfeits the attacker’s own protection.
How it works
Beginner protection
When a player creates their first town (POST /api/v1/towns/), the town receives a protection_until timestamp set to:
protection_until = now + beginner_protection_hours / time_scaleThe beginner_protection_hours value is configured per realm (default: 72 hours), and the actual window is divided by the realm’s time_scale — a realm at 3.0 grants a third of the configured hours. During this window no other player can send an attack against the town.
Only your first town ever receives this shield. In realms that allow more than one town per player, every additional town — founded by dispatching an army — starts with protection_until: null and is attackable immediately. The shield exists to protect a brand-new player’s only town while they learn the game; a town founded this way is founded by a player who already owns at least one other town, so there is nothing left for the shield to protect. Without this rule, a player could plant an un-attackable forward base next to a rival while continuing to attack from their other towns.
Post-attack truce (defender)
When an attacker wins a battle against a player-owned town, the defender’s town automatically receives a new protection window:
protection_until = now + post_attack_protection_hours / time_scaleThe post_attack_protection_hours value is configured per realm (default: 8 hours), scaled the same way as beginner protection above. This gives defenders a short breathing period to rebuild after being raided.
Rules:
- Only granted when the attacker wins — a failed attack grants no protection.
- Only applies to player-owned towns — NPC/barbarian towns never receive post-attack protection.
- If the defender already had a
protection_untilset (e.g., from beginner protection or a prior attack), it is overwritten with the new window. - Setting
post_attack_protection_hours: 0disables post-attack truce for that realm. The free realm runs with it disabled: winning an attack there grants the defender no truce, and you can attack the same town again immediately.
Attack rejection
If a player attempts to attack a town whose protection_until is in the future, the request is rejected with HTTP 400:
Target town is under protection and cannot be attacked.Scouts and support missions are not blocked — only attacks. This holds even when a protected target’s garrisoned scouts screen an incoming scouting mission and kill some or all of the attacker’s scouts: those deaths are the screen doing its job, not an attack, so they neither require nor break protection on either side.
Forfeiting protection
The moment a player launches an attack their own town’s protection is immediately cleared (protection_until is set to null). This is irreversible — a player cannot both hide behind protection and attack others.
Scouting does not forfeit protection — including when your own scouts die breaking, or failing to break, a target’s screen. Losing a screening fight is not an attack, so it never touches protection_until on either side.
Attacking a valley does not forfeit protection either — whatever the intent, and even when another player holds the valley (Evony: “scouting or attacking a valley does not break Beginner’s Protection, even if another player holds it”). Only an attack on a town does.
API fields
protection_until is exposed on:
GET /api/v1/towns/andGET /api/v1/towns/{id}—TownResponse.protection_until(ISO-8601 datetime ornull)GET /api/v1/state/—TownStateResponse.protection_untilinsidestate.towns[]
A null value means the town is not protected.
Configuration
Both protection durations are set in the realm YAML config. Setting either to 0 disables that protection type entirely for that realm.
# src/lib/config_files/<realm>/<season>.yamlbeginner_protection_hours: 72post_attack_protection_hours: 8