Garrison

To garrison a unit means to put it inside a unit or building. Once units are inside, the garrisoning building gains an attack, or a greater attack. Units can be garrisoned in a building by selecting the units the player wants garrisoned, holding ALT, and then right clicking the building. The player can also use the default hotkey 'G' with units selected and left or right click the desired building. Garrisoned units are safe from attacks until ungarrisoned and in Age of Empires II, they will slowly heal. If a building gets damaged to a certain degree, it is impossible to garrison units inside it and all units that were garrisoned are dropped out of that building.

Age of Empires II
In Age of Empires II, the buildings in which players may garrison units are:
 * Town Center: Up to 15 Villagers, foot archers, and/or infantry
 * Barracks1: Infantry
 * Dock1: Ships
 * Archery Range1: Archers
 * Stable1: Cavalry
 * Watch Tower/Guard Tower/Keep/Bombard Tower: Up to five Villagers, foot archers, and/or infantry
 * Castle2: Up to 20 of any non-siege unit
 * Siege Workshop1: Siege weapons
 * Monastery3: Monks and Relics


 * 1) Buildings may only garrison up to ten units trained at the building itself upon creation by means of a gather point. Once ejected, the dropped units cannot reenter the building.
 * 2) The Castle can normally only garrison non-siege units, but if the gather point is set to the Castle itself, Trebuchets and Organ Guns can be garrisoned inside, but cannot reenter after ejecting.
 * 3) The Monastery may only garrison Monks if the gather point is set on the Monastery itself. Monks may eject, but cannot reenter the building. Relics, however, may be garrisoned and ejected at any time.

There are several advantages to garrisoning units. While garrisoned, units are immune to damage or conversion. If the structure is destroyed or heavily damaged (remaining HP ≤ 20%), they are dropped out of the building without taking any damage to this point. Also, damaged units slowly regenerate while spending their time inside a building. Castles in particular have a faster regeneration rate than other buildings. Researching Herbal Medicine further increases the regeneration rate. Also, garrisoned Villagers and archers increase the damage output of Watch Towers, Guard Towers, Keeps, Castles, and Town Centers. That is very useful considering the fact that the garrisoned units do not take damage while dishing out plenty of their own. Finally, if the enemy scouts a building or has Spies researched, garrisoned units inside buildings will keep opponents guessing as to the true makeup of a player's army since there always are just flags on top of the building, no matter what kind of units or how many units are garrisoned inside.

If a building with units garrisoned in it gets converted, all the units that were garrisoned in the building will be automatically ejected.

Units can also garrison other units:
 * Transport Ship: Up to five units (up to 20 with Dry Dock researched)
 * Battering Ram: Up to four Villagers or infantry units
 * Capped Ram: Up to five Villagers or infantry units
 * Siege Ram: Up to six Villagers or infantry units
 * Siege Tower: Up to 10 foot soldiers

Unlike with buildings, garrisoned units are not ejected if the garrison units is heavily damaged. If a unit with garrison is converted, the garrisoned units are not converted, but stay inside the garrison unit. Only the new owner can eject the enemy units.

Age of Mythology
In Age of Mythology, the buildings in which players may garrison units are:
 * Town Center/Citadel Center: Up to 25 worker, foot archer, and/or infantry type units
 * Dock: Up to 10 naval units
 * Sentry Tower/Watch Tower/Guard Tower/Ballista Tower: Up to 5 worker, foot archer, and/or infantry type units
 * Manor: Up to 5 worker, foot archer, and/or infantry type units
 * Castle-type buildings (Fortress, Migdol Stronghold, Hill Fort, Palace, Castle): Up to 10 worker, foot archer, and/or infantry type units
 * Lighthouse: Up to 5 worker, foot archer, and/or infantry type units
 * All Military Buildings can garrison trained units inside themselves, however only when the gather point is set on itself.

Some general rules about garrison differ from Age of Empires II. Units may only garrison into a building once its construction is completed but can enter and exit at any time. If the building is destroyed or removed, units will be ejected and line up around its perimeter or head to a drop off point designated for that building. The drop off point can be another building in which units can garrison. Units garrisoned in a building will not regenerate HP and cannot be healed by healers but they can remain within regardless of how much HP it has left. Defensive structures do more damage as more units garrison within. There needs to be at least one ship garrisoned in a Dock for it to be able to attack. Units that are garrisoned within a building are not only protected from attacks but also from some god powers such as Locust Swarm, Fimbulwinter, or Great Flood. Monks cannot convert units garrisoned in a building.

The following units can also garrison other units:
 * Transport Ship
 * Longboat
 * Helepolis
 * Siege Tower
 * Leviathan
 * Roc

The Helepolis and Siege Towers are the only siege weapons in which units can garrison. As with buildings, their attack is increased for every unit they hold and they will eject their cargo if destroyed. These are especially useful for maps with large natural obstacles, such as Jotunheim (cliffs), Islands (water), and Deep Jungle (trees). Here, players can garrison units in the siege weapons then garrison the siege weapons in transport type units, reducing the amount of the latter that need to be trained. Both siege weapons can garrison up to 5 worker, foot archer, and/or infantry type units. Each civilization has its own variant of a Transport Ship. These can initially only garrison 10 units (12 for the Atlanteans) but that number doubles if the Enclosed Deck technology is researched. The Norse arrow ship, the Longboat, can also garrison 10 units and is also upgraded by Enclosed Deck. Furthermore, the Egyptians can train two myth units that can act as Transports. The Roc (the only airborne transport) and the Leviathan can garrison 15 and 20 units, respectively. These units are a more risky means of transport because if they are sunk or killed, all the cargo they carry will be killed as well. Charon’s Ferry and the Pirate Ship are transports that are exclusively encountered in the Fall of the Trident campaign. The Raft and Monkey Raft are Easter egg transports that can be found in the Scenario Editor.