Appearance
Castles
Every village has a castle plot: a square of ground with your keep in the middle. You build walls, towers, gatehouses, moats, traps and boiling oil on it, and station soldiers on the walls. When raiders or another lord attack the village, the battle is fought on this plot, so its layout decides how the fight goes.
Build times on this page are at world speed 1 and castle build speed 1. The server divides them by worldSpeed and by the castle speed described below.
The basics
- The plot is 32 by 32 tiles. A 4 by 4 keep stands in the middle and cannot be moved, built or demolished.
- The attacker wins by getting a commander to the keep. Everything you build is there to stop or slow that.
- Timber pieces are cheap, quick and weak. Stone needs the Stone Walls research and lots of stone, but lasts.
- Two pieces are built at a time. Up to 120 can wait in the queue. Wall lines can be dragged out and paid for in one go.
- Cancelling an unfinished piece refunds it in full. Knocking down a finished one refunds nothing.
- Archers, crossbowmen, pikemen and swordsmen can stand on walls, towers and gatehouses. Militia, knights, commanders and siege engines cannot.
- After a battle, broken pieces stay broken. One Repair order fixes everything at half the cost of the damage.
- Premium lords can save a castle layout or a garrison and apply it to another village.
- Every territory capital has a castle too, on the same grid with the same pieces. The body whose banner flies over the territory owns it and raises it level by level. See Capital castles.
The plot
The castle plot is a separate square grid from the village map. It is 32 by 32 tiles (castleContent.size). A new castle is founded the first time anything asks for it, with the keep at x = floor((32 - 4) / 2) = 14, y = 14, covering tiles 14 to 17 on both axes.
Pieces can be placed anywhere on the plot, as long as the whole footprint fits and does not overlap another piece. That includes the outer four rows where attackers deploy. An attacker can never be placed on a tile with a blocking piece; see Battles.
Pieces
| Piece | Category | Size | Cost | Build time | HP | Rank | Research | Troop slots | Notes |
|---|---|---|---|---|---|---|---|---|---|
| Keep | keep | 4 x 4 | 4000 | 16 | fixed, one per castle, cannot be damaged in battle | ||||
| Palisade | wall | 1 x 1 | 6 wood | 20 s | 180 | 1 Cottar | none | nobody can stand on it | |
| Wooden Tower | tower | 2 x 2 | 80 wood | 6 min | 450 | 2 Serf | Palisades | 4 | |
| Wooden Gatehouse | gate | 3 x 3 | 120 wood | 8 min | 900 | 1 Cottar | 2 | your troops pass, enemies must break it | |
| Stone Wall | wall | 1 x 1 | 12 stone | 75 s | 700 | 5 Yeoman | Stone Walls | 2 | |
| Small Tower | tower | 2 x 2 | 150 stone, 20 wood | 18 min | 1800 | 5 Yeoman | Stone Walls | 6 | |
| Great Tower | tower | 3 x 3 | 350 stone, 50 wood, 10 iron | 45 min | 3500 | 6 Reeve | Stone Walls, Watchtowers | 12 | |
| Stone Gatehouse | gate | 3 x 3 | 250 stone, 60 wood, 15 iron | 35 min | 3000 | 5 Yeoman | Stone Walls | 4 | your troops pass, enemies must break it |
| Ditch | ditch | 1 x 1 | 2 gold | 30 s | 0 | 1 Cottar | none | attackers wade it at 60% speed | |
| Moat | moat | 1 x 1 | 8 gold | 90 s | 0 | 7 Bailiff | Moats | none | only peasant levies may enter, and they fill it |
| Pitfall | trap | 1 x 1 | 15 wood | 2 min | 0 | 2 Serf | Palisades | none | hidden, 60 damage, springs once |
| Pitch Trap | trap | 1 x 1 | 12 pitch, 5 wood | 3 min | 0 | 7 Bailiff | Boiling Oil | none | 45 damage plus fire, springs once |
| Boiling Oil | defence | 1 x 1 | 20 iron, 25 pitch, 20 stone | 12 min | 300 | 7 Bailiff | Boiling Oil | none | must stand within 1 tile of a gatehouse; fires on its own |
| Ballista Tower | tower | 2 x 2 | 300 stone, 120 wood, 50 iron | 60 min | 2200 | 10 Banneret | Fortification | 2 | at most 4 per castle; fires on its own |
Self-firing pieces:
| Piece | Damage | Range (tiles) | Every | Splash radius | Burns |
|---|---|---|---|---|---|
| Boiling Oil | 90 | 3 | 15 s | 1.5 | yes |
| Ballista Tower | 45 | 10 | 4 s | none | no |
How each piece behaves in the fight (path costs, fire, traps, how fast moats fill) is on the Battles page.
Traps and any piece marked hidden never show on an enemy scout's report or on the attacker's deployment screen. The pitfall is marked hidden. The pitch trap is a trap, so it is left off reports as well.
Placement rules
The server checks, for each tile you place on:
- The piece is not fixed (you cannot build a second keep).
- Your rank is at least the piece's rank and every research it needs is done.
- The position is whole tiles and the footprint is inside the plot.
- The footprint does not overlap any piece, including queued pieces, pieces under construction and destroyed rubble, nor any other piece in the same request.
- The castle holds fewer than
maxCountof this piece. This counts every piece of that type, queued and destroyed ones too. - For Boiling Oil: a Wooden or Stone Gatehouse that is not destroyed (built, queued or in the same request) is within 1 tile. "Within 1 tile" means the gap between the two footprints is 0 or 1 tiles, diagonals included.
One request places one type of piece on up to 64 tiles (each tile is that piece's top-left corner). It is all or nothing: one bad tile, a full queue or too little in the purse and nothing is placed. The cost is cost x number of tiles, paid at once.
Gatehouses can be turned. rot 0 sits in a wall running along x, rot 1 in a wall running along y. Both gatehouses are 3 by 3, so the footprint is the same either way.
Building
Queue and slots
A castle builds two pieces at a time (constructionSlots = 2). Premium does not change this; premium build slots apply to the village, not the castle. Up to 120 pieces can be queued or under construction at once (maxQueue). Waiting pieces start in the order they were placed. When a piece finishes, the next waiting piece starts at the exact moment it finished, even if nobody was online, so a long queue runs through overnight without gaps.
A piece under construction has 0 hp and cannot be stood on or fight. It takes part in battles only once built, and is then at full hp.
Speed
castle speed = max(0.01, castleBuildSpeed tuning) x (1 + research castleBuildSpeed)
build ms = buildSeconds x 1000 / worldSpeed / castle speedThe research is Earthworks +10%, Fortification +20% and Castle Masons +20%, added together for up to +50% (Research). The speed is read when a piece starts building. Finishing a research later does not speed up pieces already under way.
Worked example: a ring of 40 stone walls.
cost 40 x 12 stone = 480 stone
time 40 walls / 2 slots = 20 rounds x 75 s = 1500 s = 25 min
with Earthworks and Fortification (x1.3): 75 / 1.3 = 57.7 s each -> 20 x 57.7 = 1154 s, about 19 minThe Castle Engineers and Siege Architects cards describe faster castle building, but the castle feature does not read them yet. Today they have no effect on castle construction.
Free traps
The Trapper's Kit card makes the next 5 traps free and Pit Diggers the next 15 (Cards and Crowns). The free count is kept on the castle and used up by trap placements (pitfalls and pitch traps) until it runs out.
Garrison
You choose which of the soldiers at home stand where. The garrison is a list of placements: a unit, a count and a tile. Setting the garrison replaces the whole list. The rules:
- Open ground: up to 4 soldiers per tile, of any unit.
- A piece: up to its troop slots in total, counted over the whole piece, not per tile. A small tower holds 6 whether you put them on one of its tiles or spread them over all four.
- Walls, towers and gatehouses take only units that can man walls: archers, crossbowmen, pikemen and swordsmen.
- The keep (16 slots) takes anyone on the castle screen. In battle, though, units that cannot man walls are moved off it to the nearest open ground.
- Nobody can stand on a palisade, a ditch, a moat, a trap, an oil pot, or on a piece that is not built.
- You cannot station more of a unit than the village has at home. At most 400 placements.
Stationed soldiers are still the village's troops; they are not used up. They cannot march with an army or found a village while stationed. Whenever the castle is looked at, the garrison is trimmed to fit: placements on pieces that have gone are dropped, and counts are cut to the troops actually at home, earlier placements first.
Soldiers at home who are not stationed still fight: they gather by the keep's corner. See Military.
In battle, elevated defenders take 40% less damage from arrows and bolts, can only be hit by ranged attackers (and by catapult and trebuchet splash), and archers on them shoot 2 tiles further. If the piece they stand on falls, they die with it.
Damage, repair and demolition
After a battle
Each piece that fought comes back with its remaining hp, divided back out of any wall strength bonus and rounded, never below 1 while standing. Pieces that fell come back with status destroyed and 0 hp. Sprung traps and filled moat tiles also come back destroyed. Destroyed pieces stay on the plot as rubble: they block placement, nobody can stand on them, and they do not fight.
Repair
One Repair order covers the whole castle. For every destroyed piece, and every built piece below full hp, it bills
fraction = 1 for a destroyed piece
fraction = 1 - hp / full hp for a damaged piece
bill[res] += ceil(cost[res] x 0.5 x fraction)You pay the whole bill or nothing. Damaged pieces are back at full hp at once. Destroyed pieces go back into the build queue and take their full build time again.
Worked examples:
stone wall at 350 / 700 hp: ceil(12 x 0.5 x 0.5) = 3 stone, instant
destroyed stone wall: ceil(12 x 0.5) = 6 stone, then 75 s to rebuild
destroyed stone gatehouse: 125 stone, 30 wood, ceil(7.5) = 8 iron, then 35 min
sprung pitch trap: 6 pitch, ceil(2.5) = 3 wood, then 3 minThe rounding is per piece and per resource, so twenty slightly scratched walls each round their stone up to at least 1.
The Stonemasons' Patch card restores every damaged or destroyed piece at once, free. It only touches pieces that have hit points, so sprung traps and filled moats still need a normal repair or rebuilding.
Cancelling and demolishing
A demolish order takes a list of pieces. Queued pieces and pieces under construction are refunded in full. Built pieces and rubble are removed with no refund. The keep cannot be demolished. Removing a piece drops any garrison placements standing on it.
Wall strength
Wall strength multiplies the hp of every piece with hit points (walls, towers, gatehouses, oil pots) for the length of a battle. It also makes those pieces count as more expensive ground in the attacker's pathing.
| Source | Bonus |
|---|---|
| Palisades research | +10% |
| Earthworks research | +5% |
| Stone Walls research | +15% |
| Concentric Walls research | +20% |
| Castle Masons research | +10% |
| Mortar and Stone card (one village, 12 h) | +20% |
| Iron-Bound Gates card (one village, 24 h) | +40% |
| Impregnable card (all villages, 48 h) | +60% |
All of them add together. With every research done that is +60%, so a 700 hp stone wall fights as 1120 hp. With Impregnable as well it is +120%, or 1540 hp. Damage taken is scaled back down when it is saved, so the bonus does not change what repairs cost.
Other defence research that matters here: Watchtowers and Arrow Slits (+10% each, archers on pieces), Moats and Concentric Walls (moat slowing +15% and +10%), Boiling Oil and Pitch Ditches (+20% each to the fire left by oil pots and pitch traps). See Battles for exactly where each applies.
Saved layouts
Premium lords can save the castle and the garrison as templates (Premium). Each kind holds up to 10 templates (templateCap).
- A castle template records every piece except the keep, by type, offset from the keep's corner and rotation. It includes pieces that were queued or destroyed when you saved.
- Applying it places each piece one at a time at the same offset from this village's keep, paying for each as it goes. A piece is skipped, with the reason, if it does not fit, is not unlocked or cannot be paid for. A piece of the same type already at that spot is left alone.
- A garrison template records each placement as unit, offset and count. Applying it fits what it can with the soldiers at home and reports every spot that came up short.
Because every keep sits at the same spot, a layout lines up the same in every village.
Camps, dens and old-realm castles
The world's own strongholds are built from a separate set of pieces, laid out from the site's id so the same site always looks the same.
| Piece | Size | HP | Notes |
|---|---|---|---|
| Palisade | 1 x 1 | 350 | 1 slot |
| Wooden Gate | 2 x 1 | 700 | gate |
| Stone Wall | 1 x 1 | 1400 | 2 slots |
| Gatehouse | 2 x 1 | 2200 | gate, 2 slots |
| Stone Tower | 2 x 2 | 2600 | 6 slots |
| Ballista Tower | 2 x 2 | 2400 | 2 slots; 70 damage, range 14, every 4 s, splash 0.6 |
| Boiling Oil | 1 x 1 | 300 | 22 damage, range 4, every 8 s, splash 1.3, burns |
| Moat | 1 x 1 | shallow: everyone can wade it | |
| Killing Pit | 1 x 1 | trap, 70 damage | |
| Pitch Ditch | 1 x 1 | trap, 15 damage, burns | |
| Keep, Chief's Tent, Lair | 4 x 4, 2 x 2, 2 x 2 | the objective |
- A wolf den is a 20 by 20 field: the lair in the middle, the wolves around it two to a spot, the pack leader beside it, and 4 killing pits scattered at random.
- A bandit camp is 24 by 24: the chief's tent, a 10 by 10 palisade ring with a wooden gate on a random side and archers or outlaws on every third palisade, bandits round the tent, and 6 traps (killing pits or pitch ditches) outside the ring. An outlaw camp has no palisade; its outlaws and archers stand in two rings round the tent.
- An outlaw fort (tier II) is 28 by 28: the chief's tent, a 14 by 14 palisade with a wooden gate on a random side and a wooden tower at each corner, a ditch ring three tiles out and 8 traps beyond it. Archers hold the towers, outlaws the palisade, bandits stand round the tent.
- A robber baron's keep (tier III) is laid out like an old-realm castle on a 36 by 36 field with stone towers and no ballistas, and adds bandits to the bailey.
- A warlord's stronghold (tier IV) is 44 by 44 with two stone rings (10 and 22 tiles across), corner towers on both, a gatehouse in each on the same side, 4 ballista towers inside the outer wall, oil and 6 traps at the outer gate and a moat. Crossbowmen take the walls archers leave, pikemen and bandits the yard between the rings, swordsmen the inner ring, knights the keep.
- The Usurper's citadel (tier V) is 48 by 48 with rings 10 and 24 tiles across, ballista towers at every ring corner and 8 more inside the outer wall. Only one wave of its garrison (700 soldiers) stands in any one battle; see Military.
- From tier III up, walls broken in an assault stay broken for the next one and mend by the same share per game hour as the garrison regrows (1% for a keep, 0.6% for a stronghold, 2% for the citadel). A fallen piece stands again, weak, as soon as any of it is mended.
- An old-realm castle is 36 by 36: a keep, a 16 by 16 ring of stone walls with a corner tower at each corner, a gatehouse on a random side, boiling oil just inside it, two killing pits and two pitch ditches outside it, and a moat ring three tiles beyond the walls. The towers are ballista towers when its pikemen and archers together number more than 80, stone towers otherwise. Archers man the towers and every other wall, pikemen stand inside the walls, swordsmen and captains round the keep.
Capital castles
Every territory capital has a castle on the same 32 by 32 plot with the same pieces as a village castle. It belongs to the body whose banner flies over the territory (see Lands and territories), and it starts out standing, so a capital nobody holds is not bare.
Levels
A capital is raised level by level rather than piece by piece. Each level is a fixed plan worked out from the world seed and the territory, so the gatehouse faces a different way from one capital to the next. Raising a level queues every piece of the new plan that is not there yet and pulls down the pieces the plan replaces (the palisade, when stone walls go up). Pulled-down pieces refund nothing, and the old wall is gone while the new one is built.
| Level | Name | What it adds |
|---|---|---|
| 1 | Walled keep | A ring of palisade 6 tiles out from the keep, a wooden gatehouse and two wooden towers on opposite corners. Every capital starts here. |
| 2 | Stone curtain | Stone walls in place of the palisade, a stone gatehouse and a small tower on every corner. |
| 3 | Great towers | A great tower on each flank and a ditch two tiles beyond the wall. |
| 4 | Moat and oil | Two ballista towers in the bailey, boiling oil inside the gate and a moat four tiles beyond the wall. |
| 5 | Citadel | An inner stone ring two tiles out from the keep with its own gatehouse, and two more ballista towers. |
Piece counts and the bill for each level are in the capitals reference. Raising a capital from level 1 to level 2 costs about 1,486 stone, 140 wood and 15 iron.
Rank and research gates do not apply at a capital: a body can build stone walls there before any of its lords has the Stone Walls research.
Who builds, and who pays
The leader and Castellans of the owning body, or of any body above it, can raise and repair the castle (see Guilds and houses). Any lord of the owning body can send goods (wood, stone, iron, pitch and other goods, not gold) from a village to the capital's stock. The goods leave the village at once.
A bill is paid from the stock first. Whatever the stock does not cover is bought with gold from the owner's treasury at the market base price of each good (wood 1, stone 1.5, iron 4, pitch 3; a good the market does not trade counts as 2). So a level 2 upgrade with an empty stock takes 2,429 gold from the treasury (1,486 x 1.5 + 140 + 15 x 4), and 1,486 stone sent in first brings that down to 200 gold. If the treasury cannot pay the rest, nothing is built.
Building speed is the admin's castleBuildSpeed alone; research and cards that speed up village castles do not apply. Two pieces are built at a time, as in a village.
Repairs work as in a village (half the cost of the damage) and are paid the same way.
The garrison
Any lord of the owning body can post troops to the capital from one of their villages. See Military for the march, recall and losses. The castle places them on its own: bowmen first on towers, then gatehouses, then walls, then other wall troops; troops that cannot man walls, and anyone left over, stand four to a tile in the three rings of ground round the keep.
Interactions
- Realm events: warlords, raiders and invaders storm capital castles; the garrison posted there defends them.
- Battles: how every piece behaves in a fight.
- Military: the soldiers you station, and the raids and armies that test your walls.
- Research: Palisades, Stone Walls, Watchtowers, Moats, Boiling Oil, Fortification and the wall strength line.
- Cards and Crowns: wall strength, free traps, repair and (not yet working) castle speed cards.
- Premium: castle and garrison templates.
- Ranks and Renown: rank gates on pieces.
- The Village and Markets: the stone, wood, iron and pitch you build with.
- World map: scouting what other castles look like, capitals included.
- Lands and territories: who owns a capital, the treasury that pays for it, and what taking a capital does.
For maintainers
Source files:
server/src/features/castle/content.ts:castlePieces,castleContent(size 32,constructionSlots 2,groundSlots 4,maxQueue 120,repairCostShare 0.5).server/src/features/castle/logic.ts:foundCastle,placementProblem,placePieces(64 per request),settleCastle,demolishPieces,repairCastle,validateGarrison(400 placements),fitGarrison, template items,applyLayout.server/src/features/castle/index.ts: records in metacastle:<villageId>,castleSpeed,installCastleApi, card hooksaddFreeTrapsandrepairCastleNow, premium template kindscastleandgarrison.server/src/features/military/pieces.ts: camp, den, old-realm and tiered target pieces and layouts (fort,fortress).server/src/features/capitals/logic.ts:capitalContent(levels,garrisonUpkeep),capitalLayout,upgradeDiff,startingCastle,placeGarrison,splitLosses.server/src/features/capitals/index.ts: capital records in metacapitals_v1, themayCommandCapitalgate (can(..., "castleWorks"): the leader or a Castellan, flowing down), paying from stock and treasury, garrisons and captures.server/src/features/registry.ts:castleApi, used by the military feature to read and write castles.packages/protocol/src/features/castle.ts: shared types and messages.server/src/tuning.ts:castleBuildSpeed,templateCap.
Gaps found while writing this page:
castleBuildSpeed()inserver/src/features/cards/index.tsis never called, so Castle Engineers and Siege Architects do nothing.- The Ditch says attackers wade it "at half speed"; the battle uses 0.6. Its
trap.slowsvalue, and the pitch trap's, are unused. - The keep accepts any unit on the castle screen, but in battle units that cannot man walls are moved to the ground.
layoutItemssaves queued and destroyed pieces in a template, not just built ones.- A capital's boiling oil is placed by the plan, not checked against the "within 1 tile of a gatehouse" rule. The plan puts it there anyway.
- There is no castle editor for capitals yet: the territory panel offers the next level and Repair, nothing piece by piece.