Experience

Experience (XP) is the means by which Units and Heroes gain additional levels, increasing their base attributes and - in the case of heroes - gaining skill points with which to purchase skills.

To level up a unit or hero requires 40 XP per current level, i.e. 40 XP to reach level 2, another 80 XP to reach level 3, and so on. While heroes are able to level up indefinitely, units have a level cap of 10.

Each level on a unit gives +20% to their base, , , , and and the unit's upkeep is increased by 1  per level.

Each level on a hero gives +10%, , , , and. Hero upkeep is increased by an amount of equal to 2 + 0.5 * (Level - 2), so it increase by 2 upon reaching level 2, by 2.5 on reaching level 3, and so on. It should be noted that other factors contribute to a hero's upkeep beyond level though.

Common Sources
All units and heroes gain a base 1 XP per turn, though there are a number of ways to gain more experience, especially for heroes. There are, however, two methods that units and heroes have in common to increase their XP.

Combat
Upon defeating a unit, all surviving units will be awarded an amount of XP equal to: 0.1 * cost of defeated unit * (1 + 0.2 * level).

Fast Learner
The capacities Fast Learner 1, 2, and 3 increase a unit's or hero's XP gains by 25%, 50%, and 75% respectively. While all Drakken units and heroes, Cetassa, Difore, and Haukea Wai all have the Fast Learner 1 capacity by default, other units can be given level 1, 2, or 3 of the capacity via the Adamantian Bracelet accessories. Naval units can be granted the Fast Learner 3 capacity by being equipped with the Pedagogitor accessory.

Units
For units, the primary way to gain XP is through combat, but there are a few other ways to gain XP:

Technological Era
Newly trained units are automatically leveled to whatever technological era the empire creating them is in, i.e. while in Era III, units will be created at level 3. However, this comes with an increased cost as well.

City Improvements and Technology
A number of City Improvements provide either an experience bonus to newly-made units, or additional experience per turn to units garrisoned in a city. Stronghold Architecture and Imperial Kennels provide an additional +1 and +2 XP per turn respectively to units garrisoned in a city where those constructions are built, including Militia. If a city has built the Conscription Center and Army Manual improvements, then units trained in that city will be granted an additional 40 XP and 100 XP respectively upon completion.

There are also a number of faction-specific city improvements that provide XP bonuses to newly-trained units. Additionally, the Cultist have two technologies that function similarly, but are active as soon as they are researched. We Are Legion grants +40 XP to units recruited on converted villages, while All Beings Are Siblings provides +100 XP to all newly-recruited units.
 * Necrophages: Givers of Remembrance, +100 XP when recruiting a unit
 * Drakken: Oologic Nursery, +25 XP when recruiting a unit
 * Morgawr: Main Maritime Academy, +80 XP when recruiting a naval unit
 * Kapaku: Koni School of Elite Riders, +100 XP when recruiting a unit

Hero Skills
The hero skill No Idle Hands grants an additional 1 XP per turn on units for each level of the skill. This applies to units in an army led by a hero with this skill, as well as units (including militia) garrisoned in a city governed by a hero with this skill.

Heroes
Heroes have a number of ways they can gain experience depending on how they are assigned. However, the Forgotten also have access to the Learn from Others technology, which provides a bonus 3 XP per turn on all heroes, as well as another 3 XP per turn for every hero that is assigned as a Spy.

Generals
In addition to engaging in combat, heroes assigned to lead an army have a number of opportunities to gain experience. To begin with, generals gain an additional 1 XP per turn for each unit in the army they lead, but they also gain experience whenever an army they lead performs the following actions:

Governors
Governors primarily gain their XP by being governor of a city when a construction is completed, granting XP equal to 0.0824 * cost of construction + 1 (at normal game speed). However, they also gain an additional 1 XP per turn for each non-Militia unit garrisoned on the city.

There is also The Octagon city improvement, which provides +20 XP per turn on the Governor of the city it's built in, but can only be built in one city.

Spies
Heroes that are infiltrated on cities gain an additional 4 XP per turn from the Spying capacity.

They also gain an XP reward for performing infiltration actions, the amount being equal to 3 * the level of the action they performed. The only exception to this is the Forgotten's Dust Opportunists infiltration action - only available during Dust Eclipses - which provides 5, 7, and 10 XP for levels 2, 3, and 4 of the action.