Hospital
The Hospital is a building that houses wounded soldiers after combat. Each level of the Hospital increases the number of wounded units it can accommodate.
Building the Hospital
Build and upgrade the Hospital like any other building:
POST /api/v1/buildings/{ "town": "<town_uuid>", "yaml_id": "Hospital"}Wounded Capacity
The Hospital’s wounded_capacity field (per level) defines how many wounded units each level can hold. A town may hold several Hospitals, and their capacities add up — the total capacity for a town is:
total_wounded_capacity = Σ (wounded_capacity_per_level × level)summed over every Hospital in the town. Towns without a Hospital (or with Hospitals only at level 0) have zero wounded capacity.
Checking Capacity
The wounded_capacity for each building type is returned by:
GET /api/v1/buildings/typesEach entry in the response includes a wounded_capacity field (integer, 0 for non-Hospital buildings).
How Wounds Happen (Combat Casualties Split)
When defenders lose units in battle, the town’s own share of the losses is split between killed and wounded using the realm’s wounded_ratio config value (default 0.5 — half of all losses become wounded). A reinforcing party’s share of the losses never enters your Hospital: those troops are an ally’s, and they die.
tentative_wounded = floor(losses × wounded_ratio)actual_wounded = min(tentative_wounded, remaining_hospital_capacity)killed = losses − actual_woundedWounded units are added to the town’s wounded_units pool on the Town object. Units that exceed the hospital’s remaining capacity are killed outright.
- Unit types are processed in alphabetical order (deterministic, no RNG).
- The
attackrecord exposes the full killed / wounded / captured breakdown (PRD B.5.5):units_killed_defender— per-type count of defenders killed outright, reinforcements’ dead included.units_wounded_defender— per-type count of defenders sent to the hospital.hero_captured— boolean;truewhen the attacker’s hero was captured on a total loss.defender_hero_captured— boolean;truewhen the battle captured the defender’s leading hero (see two-sided capture).units_lost_defender— total defender losses (killed + wounded); kept for backward compatibility.
- Attacker losses are always counted as killed (attackers have no hospital on the battlefield).
Killed units also shrink population — see Troop deaths — on the home town of whichever side lost them (the defender’s town for units_killed_defender, the attacker’s origin town for its losses). Wounded units are not deaths: they never leave population, and healing them later adds nothing back to it. A town’s population only refills through the normal tick economy, so Cottages — not the Hospital — throttle how fast an army rebuilds after a costly battle.
Penicillin
A Penicillin running on a town raises that town’s wounded share for 7 days: 30% of the units that would have been killed are wounded instead, i.e. the effective ratio becomes
wounded_ratio = 1 − (1 − base) × (1 − 0.30)which at the shipped base of 0.5 takes the wounded share from half to 0.65 and the killed share from half to 0.35.
Two limits are worth knowing:
- The hospital still caps it. The extra wounded fill the same beds as the ordinary ones, so a full Hospital converts them straight back into dead. Penicillin buys a better split, never free capacity.
- Defenders only. Restfall gives an attacking force no wounded split at all (its hospital is at home), so a Penicillin on your own town does nothing for an army you send out. That is a pre-existing rule of restfall’s hospital, not something the item introduces.
Several Penicillins do not add up: the larger magnitude applies and the extra ones extend the window; the bonus that priced a given battle is recorded in that battle’s replay snapshot.
Healing Wounded Units
Start healing a batch of wounded units in one of your towns:
POST /api/v1/towns/{town_id}/heal{ "unit_type_id": "swordsman", "count": 5}- Requires a Hospital building at level ≥ 1.
- Resources are deducted immediately (cost =
healing_cost_per_unit×count, realm config). - The wounded units are removed from the
wounded_unitspool instantly and enter the healing queue. - When the healing order completes (after
healing_time_per_unit_seconds×countseconds, divided by the realm’stime_scale), the units are moved to the active garrison (units) by the background resolver. They rejoin the food bill at the order’sfinished_atexactly — the town is settled up to that instant at the garrison it had until then — never for the hours before (see Levels change at the finish instant). - Returns the updated
TownResponsewith the newwounded_unitsandhospital_capacity.
Hospital Capacity in Town Responses
GET /api/v1/towns/ and GET /api/v1/towns/{id} now include hospital_capacity (total capacity of all Hospital levels in that town) alongside wounded_units. The game state endpoint (GET /api/v1/state/) also exposes both fields per town.
Recovering a Wounded Hero
A hero becomes WOUNDED after leading a total loss against an NPC target. Pay the hero_recovery_cost (realm config) to restore the hero to IDLE:
POST /api/v1/heroes/{hero_id}/recoverResources are deducted from the hero’s current town. The hero is immediately set to IDLE.
Captured Heroes (no ransom)
A hero becomes CAPTURED after leading a total loss in PvP — either as the attacking hero whose army was wiped (held at the defender’s town), or as the defending town’s leading hero when the defence was wiped (held at the attacker’s origin town — see two-sided capture).
The old victim-paid instant ransom (POST /api/v1/heroes/{hero_id}/ransom, hero_ransom_cost) is removed: a captured hero’s fate belongs to the captor, who chooses to persuade or release them. If the captor releases the hero (or the holding town is razed or its owner deletes their account), the hero returns to you IDLE at your oldest town.
Related Systems
- Hospital window — the in-game Hospital window (§8.14) shows current wounded counts and allows initiating heals.