Skip to content

Automation ​

Automation runs standing orders for you on a timer, so routine errands carry on while you are away. There are five. Auto-scouting sends the scouts waiting at home to collect stashes and hunt herds near your villages; free lords get a fixed version with a short reach, and premium unlocks the settings. Two premium orders move goods by cart: auto-transport keeps each good between levels across your villages by caravan, and auto-selling sells what your villages hold above the levels you choose at the best market in reach. Auto-hiring, also premium, keeps each village's soldiers topped up to the numbers you set, and auto-fighting, the last premium order, marches on nearby camps and dens your villages are sure to beat.

Times on this page are game time at world speed 1. On a faster world the gaps between runs are shorter in real time, and the Automation panel shows both.

How often each order runs and how far it reaches are not yours to choose. The realm's admins set them for everyone, and the panel shows the current values next to each order. The numbers below are the defaults.

The basics ​

  • Open the Automation tab on the top bar and tick Auto-scout, Auto-transport, Auto-sell, Auto-hire or Auto-fight to turn it on. All are off for every lord until switched on.
  • Each village runs on its own clock. When a village's turn comes, it sends scouts it already has at home to the nearest suitable targets in range, then waits for the next run.
  • Auto-scouting never recruits scouts. Recruit them at the village hall as usual (see World map).
  • One of your scouts visits a target at a time. A stash or herd your own scout is already walking to is skipped.
  • Every scout sent, caravan sent, sale, training order and march is listed in the panel's log, newest first, with the village it came from.

Auto-scouting, free and premium:

FreePremium
Targetsresource stashes and deer herdsany of: stashes, deer herds, barrows, camps and castles, capitals
Range from each village15 cells25 cells
Gap between runs4 game hours2 game hours
Scouts sent per village per run11 to 5, your choice
Villagesallleave any out

Auto-transport (premium only): you pick the goods, a "keep at least" level and an optional "share above" level for each, how many carts each village keeps home (1 at first) and which villages take part. It runs every 2 game hours.

Auto-hiring (premium only): you set how many of each unit every village should own, how much treasury gold is never spent (500 at first), how many peasants each village keeps (10 at first) and which villages take part. It runs every 2 game hours.

Auto-fighting (premium only): you pick which tier I targets to attack (wolf dens, bandit camps, outlaw camps), the odds an attack needs (2 to 1 at first, 1.5 to 1 at least), the share of each unit kept home (25% at first), whether to scout first, and which villages take part. It looks 15 cells out and runs every 12 game hours.

Auto-selling (premium only): you pick the goods, how much of each every village keeps, an optional least price per unit, how many carts each village keeps home (1 at first) and which villages take part.

When a village runs ​

Each village has a "next run" time per kind of order. On every server tick (5 seconds) the engine looks for villages whose time has come:

  1. A village with no next-run time (auto-scouting just switched on, or a new village) runs at once.
  2. After a run, the next one is set to now plus the gap, whether or not anything was sent.
  3. If the gap gets shorter (premium starts, or an admin shortens it), a run that is further off than the new gap is brought forward to the new gap from now.

Turning auto-scouting off and on again does not reset the clock. A village that ran an hour ago on the free gap still waits its remaining three hours.

The rest of this section uses auto-scouting as the example; auto-transport, auto-selling, auto-hiring and auto-fighting each run on their own clock in the same way. When more than one order is due for a village in the same tick, they go in this order: scouting, transport, selling, hiring, fighting. So a village short of a good is filled by caravan before a neighbour sells its surplus, but only when the two runs fall due together.

Worked example, free lord, world speed 1: auto-scouting is switched on at 10:00. Every village sends one scout at 10:00, and the next runs are at 14:00. If the lord gets premium at 11:00, the premium gap of 2 game hours pulls the 14:00 runs in to 13:00, and from then on each village runs every 2 hours.

Choosing targets ​

At each run the village builds a list of candidates and sends a scout to each of the nearest, up to the scouts-per-run limit and the scouts it has at home.

A candidate must:

  • be one of the chosen target kinds;
  • lie within range, measured in a straight line from the village's site to where the target stands now;
  • not already have one of your scouts walking to it;
  • for stashes and herds, still have something left;
  • for camps, dens, old castles and capitals, not have a report of yours from the last 6 game hours. That is the same 6 hours for which a scout report is good enough to march on (see Military).

Target kinds and what a scout does there:

ChoiceMap entitiesWhat the scout brings back
Resource stashesstashup to 400 of the good
Deer herdsdeer herd80 meat
Barrowsbarrowgrave goods, or nothing if the dead stir
Camps, dens and castleswolf den, bandit camp, outlaw camp, old castlea fresh count of defenders
Capitalsterritory capitalsweather and the market's busiest goods

Herds and caravans move, so the scout walks to where the herd will be, exactly as when you send one by hand (see World map). Merchant caravans, tier II and higher AI targets, event hosts and other lords' villages are never chosen.

A scout sent automatically is an ordinary scout. It can be recalled from the map, its loot is capped by storage, and its report goes into your scout reports.

Auto-transport ​

Each good on the list has two levels, the same in every village taking part:

  • Keep at least (min). A village holding less than this, counting goods already on caravans heading to it, is short.
  • Share above (shareAbove). A village sends only what it holds above this. Left blank it equals keep at least, and it is never allowed below it.

Because a filled village ends at or under "keep at least", and "share above" is never lower, goods never bounce back and forth between two villages.

At each run, a village works through the goods on the list:

spare     = floor(stock - shareAbove)
shortfall = ceil(min - stock - incoming)        for each other village, capped at its free storage

Villages that are short are served biggest shortfall first, nearest first on a tie. Each gets min(spare, shortfall, free carts * 100), sent as an ordinary caravan (see Markets). A lot under 25 goes only if it fills that village's shortfall exactly; otherwise it waits for a later run. Free carts are counted as for auto-selling, so carts kept home are never used.

Worked example: three villages, wood with keep at least 300 and share above 500. Ashby holds 1,000, Bramble 0 and Cobham 100. Ashby has 4 free carts. Its spare is 1,000 - 500 = 500. Bramble is short 300 and Cobham 200. Bramble goes first and gets 300 (3 carts); Cobham gets min(200, 200, 1 * 100) = 100 with the last cart. On Ashby's next run Bramble is no longer short (its 300 is on the way), and Cobham still needs 100.

Villages left out neither send nor receive. A lord with one village sends nothing. Caravans only travel between your own villages.

Auto-selling ​

At each run, a village works out its surplus of every good on your list:

surplus = floor(stock - keep)

Goods with a surplus under 25 are skipped until a later run, so carts do not go out nearly empty. The rest are sold biggest first by worth (surplus * base price), as long as the village has free carts beyond the ones it keeps home:

free carts = carts allowed - carts on the road - carts kept home
lot        = min(surplus, free carts * 100)

For each lot the village looks at every market it may trade at (its own capital and any capital within 30 cells, see Markets), skipping markets shut by an event. It works out what the lot would fetch at each one after the holder's market tax, using the same price curve as a sale by hand, and sells at the one paying the most. The sale is an ordinary trade: the goods leave at once, the price is fixed when the carts set off, and the gold arrives when they are home.

With a least price set for a good, the average price per unit after tax must reach it. If no market pays that much for the whole lot, the lot shrinks by a cart load (100) at a time, then to 25, until some market does. If none pays enough even for 25, nothing of that good is sold this run.

Worked example: a rank 4 village has 4 carts, keeps 1 home and has none on the road, so 3 are free. It holds 1,000 wood with keep 300, and 500 stone with keep 400. Wood's surplus is 700 and stone's 100. Worth: wood 700 * 1 = 700, stone 100 * 1.5 = 150, so wood goes first with a lot of min(700, 3 * 100) = 300, using all 3 free carts. Stone waits for the next run.

Auto-selling never buys and never sends caravans. Keep levels and least prices are the same for every village. A good that is not on the list is never sold, whatever the village holds.

Auto-hiring ​

At each run a village goes through the units in the game's own order (commanders first, then soldiers and knights, then siege engines; see the units table) and orders the shortfall of each one you set:

shortfall = target - owned
owned     = at home + in training + away (armies, capital garrisons, levies, events)

Each order is cut to what the village can afford after the reserves, and to its caps:

count = min(shortfall,
            100,                                         most per order
            troop cap - soldiers owned,                  rank cap plus cards
            commander cap - commanders owned,            commanders only
            (peasants - peasants kept) / peasants per soldier,
            (gold - gold kept) / gold per soldier,
            stock / cost per soldier                     for every other cost: wood, iron, bows, pikes, swords)

Gold is the lord's treasury, shared by every village, so the reserve is too: a village never spends below it, whichever runs first. Costs are worked out at full price, so a training discount from a card only leaves more behind. Earlier units in the run use up gold, peasants and room before later ones.

The order goes to the barracks exactly as one placed by hand (see Military), so rank, research, a finished barracks and the queue of 5 orders all apply. A unit you cannot train yet is skipped; a full queue ends the run for that village.

Worked example: a rank 4 village with a barracks has 60 peasants, 1,000 gold in the treasury, 500 wood and no bows. Targets are 20 militia and 10 archers; 500 gold and 30 peasants are kept. Militia cost 15 gold and 5 wood: min(20, 100, cap room, 30 / 1, 500 / 15 = 33, 500 / 5 = 100) = 20 start training, using 300 gold. Archers need a bow each and there are none, so none start. On the next run the 20 militia in training count as owned, so nothing more is ordered.

Auto-hiring never disbands soldiers. A village holding more than its target keeps them.

Auto-fighting ​

Auto-fighting is held to small, safe fights on purpose. It only attacks tier I camps and dens: never other lords, capitals, the old realm's castles (walls are not counted, see below) or the shared tier II to V targets. Range is 15 cells and runs are 12 game hours apart by default, so a village marches twice a day at most.

At each run, a village does nothing if any army of its own is still out. Otherwise:

  1. It lists the chosen camps within range, nearest first.
  2. It works out the army it would send: every soldier at home and off the castle walls, less the share kept home (rounded up, per unit), plus one commander, the one with the most hit points. Siege engines stay home. With no commander, or no soldiers besides one, it does not attack.
  3. It walks the list and attacks the first camp it scouted in the last 6 game hours whose odds are good enough:
strength = sum over units of  count * (attack / attackSeconds) * hp / (1 - armour)
odds     = strength(army) / strength(defenders the scout counted)

Armour is capped at 0.9 in the sum. Siege engines that only strike walls add nothing. The defenders are those in your latest fresh report, so a camp that has grown since is judged as it was. If a report names a defender the game cannot match to a unit, that camp is never attacked.

The attack goes out as an ordinary army with the pillage goal (it makes no difference at camps, see Military), lined up in the default formation the moment it leaves. It fights as soon as it arrives, without the 120-second line-up window. Survivors, loot and Renown come home as for any army.

If no camp in range qualifies and "scout first" is on, the village sends one of its scouts at home to the nearest camp it has no fresh report on (and no scout already walking to). The attack can follow on a later run once the report is in.

Worked example: a village has 1 captain and 40 militia at home and keeps 25% home. It would send 40 - ceil(40 * 0.25) = 30 militia and the captain. A bandit camp 3 cells away was scouted an hour ago with 4 bandits. Militia have 70 hp, 8 attack every 1.2 seconds and 0.1 armour; bandits 60 hp, 9 attack every 1.2 seconds, 0.1 armour. The army's strength is far above twice the bandits', so it marches.

The strength sum is a rough guide, not a forecast. The real battle has ranged units, formations and luck in it, so keep the odds at 2 to 1 or higher if losses matter to you.

When premium ends ​

Your premium settings are kept but stop applying. For auto-scouting the free rule runs in their place: stashes and herds, 15 cells, every 4 game hours, one scout per village, every village. Auto-transport, auto-selling, auto-hiring and auto-fighting stop. Scouts, caravans, carts, armies on the march and soldiers already in training carry on. If premium returns, your saved settings apply again.

Settings an admin can change ​

Range and gap are live tuning values under Automation in the admin panel. They apply to every lord at the next run; a lord cannot change them.

SettingDefaultAllowed
automation.freeScoutRange15 cells1 to 400
automation.freeScoutEveryHours4 game hours0.05 to 1000
automation.premiumScoutRange25 cells1 to 400
automation.premiumScoutEveryHours2 game hours0.05 to 1000
automation.premiumScoutsPerRun5, the most scouts per run a lord may set1 to 10
automation.premiumSellEveryHours2 game hours0.05 to 1000
automation.premiumTransportEveryHours2 game hours0.05 to 1000
automation.premiumHireEveryHours2 game hours0.05 to 1000
automation.premiumFightRange15 cells1 to 400
automation.premiumFightEveryHours12 game hours0.05 to 1000

These keys replaced the older premium*MinHours floors. An override saved under an old key is ignored, so that order falls back to the default above until an admin sets it again. Auto-fight odds run from 1.5 to 10 to 1, and the share kept home from 0 to 90%. A lord may keep up to 20 carts home.

Interactions ​

  • World map: scouts, their speed, targets and reports.
  • Premium: what membership unlocks.
  • Military: armies, fresh scout reports and the default formation that auto-fighting uses.
  • Military: the barracks, training costs, troop and commander caps that auto-hiring works within.
  • Markets: prices, market tax, reach, carts and caravans, which auto-selling and auto-transport use as they are.
  • Military: fresh camp reports let you march; auto-scouting keeps them fresh when "Camps, dens and castles" is chosen.
  • Weather: storms slow scouts sent automatically just as they slow any other.
  • Ranks and Renown: scouts unlock at rank 1. Below it nothing is sent.

For maintainers ​

Source files:

  • server/src/features/automation/engine.ts: Automation (per-lord rules, next-run times, log of 50 entries, saved in the meta table under automation), the Runner interface each order implements, scheduling in tick.
  • server/src/features/automation/rules.ts: defaultRules, mergeScoutRule, mergeSellRule, mergeTransportRule, mergeHireRule and mergeFightRule (drop any range or gap a client sends, scouts per run held to the premium limit, sell list limited to market goods, transport list to goods a village stores, share above held at or over keep at least, hire list to trainable units, fight targets to tier I camps), carriable, effectiveRules (range and gap from tuning.automation(), the free scout rule, and selling, carting, hiring and fighting off, without premium).
  • server/src/features/automation/scout.ts: pickScoutTargets and scoutRunner. Sends through WorldLive.send.
  • server/src/features/automation/transport.ts: planShipments and transportRunner. Sends through the market's sendCaravan, counting goods on the way with incomingCaravans.
  • server/src/features/automation/fight.ts: strength, armyFor, planFight and fightRunner. Reads garrisons through GARRISON_UNIT, attacks through the military feature's planAttack (for the default formation) and sendArmy.
  • server/src/features/automation/hire.ts: planHires and hireRunner. Trains through the military feature's train, counting soldiers with owned, caps with capByRank and troopCapBonus. Reads gold from resources.gold directly, since a copy of a village's resources leaves the purse alias out.
  • server/src/features/automation/sell.ts: MIN_LOT = 25, bestSale, surpluses, sellRunner. Sells through the market's trade, pricing lots with saleValue and marketTaxOf.
  • server/src/features/market/index.ts: announceCarts saves and broadcasts carts after an automatic trade or caravan.
  • server/src/features/automation/index.ts: the feature, RUNNERS order (scout, transport, sell, hire, fight), the setAutomation message, pushes automation to the lord after changes and runs.
  • server/src/features/military/pve.ts: scoutFreshSeconds (6 game hours), reused for the fresh-report rule.
  • server/src/tuning.ts: automation block.
  • packages/protocol/src/features/automation.ts: wire types, AUTO_SCOUT_TARGETS, FREE_AUTO_SCOUT_TARGETS.
  • clients/web/src/features/automation/: the Automation panel.
  • Tests: server/src/features/automation/automation.test.ts.

A new kind of order is added as a Runner in RUNNERS in index.ts, a rule on AutomationRules, and a kind on AutomationKind.