top of page

Beginner Course – Phase 1: Editing Troop Trees
 

Lesson 1: Understanding Troop Trees

Objective:
 

By the end of this lesson, you will be able to:

  • Explain what a troop tree is and how it functions in Bannerlord.

  • Understand how troops progress through upgrades.

  • Recognize the importance of troop trees for gameplay, balance, and faction identity.

  • Identify troop trees in-game using the Encyclopedia.

  • Begin thinking about how to modify or design new troop trees in your own mods.

What is a Troop Tree?

​

In Mount & Blade II: Bannerlord, a troop tree is the visual and logical representation of how soldiers within a faction progress from basic recruits to elite warriors.

This tree begins with the Tier 1 recruit, usually marked by is_basic_troop="true" in XML. As troops gain experience from battles, they can be upgraded to higher-tier units by the player, using denars (in-game currency).

Each upgrade step is defined in the XML file spnpccharacters.xml using the <upgrade_targets> tag.

​

Real Example:

​

The Empire’s basic recruit is imperial_recruit. In-game, this unit can be upgraded to either:

  • imperial_infantryman (a melee path), or

  • imperial_archer (a ranged path).

Each of these has its own possible upgrades, eventually reaching high-tier units like imperial_legionary or imperial_veteran_archer.

Upgrade Paths and Structure
 

Every troop can have zero, one, or multiple upgrade targets. These are defined inside the <upgrade_targets> tag within a troop's XML block.

XML Example:

<NPCCharacter id="imperial_recruit"
name="{=ODTkZaNE}Imperial Recruit"
level="6"
occupation="Soldier"
culture="Culture.empire"
is_basic_troop="true">
  ...
  <upgrade_targets>
    <upgrade_target id="NPCCharacter.imperial_infantryman" />
    <upgrade_target id="NPCCharacter.imperial_archer" />
  </upgrade_targets>
</NPCCharacter>

Each <upgrade_target> refers to another troop’s id value.

  • No upgrade_targets? That troop is the final form (elite unit).

  • One upgrade_target? A linear progression.

  • Two or more? The player can choose between multiple specializations.

This branching design introduces strategic decisions, both for AI factions and the player.

3. The Role of Troop Trees in Gameplay

​

Troop trees are more than technical definitions—they shape how each faction feels and performs in-game. Let’s break this down:
 

a) Faction Identity

Each culture in the game (Empire, Vlandia, Battania, Khuzait, Sturgia, Aserai) has a unique troop tree that reflects its historical and gameplay identity.

  • Empire: Balanced tree with strong infantry and good archers.

  • Vlandia: Emphasis on crossbowmen and noble heavy cavalry.

  • Battania: Strong ranged units (bows) and lightly armored skirmishers.

  • Khuzait: Dominated by mounted archers and light cavalry.

  • Sturgia: Heavy infantry and shock troops with axes.

  • Aserai: Mix of skirmishers and fast cavalry.
     

When modding, you can:

  • Reinforce these themes by enhancing certain units.

  • Break conventions and introduce asymmetry (e.g., giving Empire camels).

  • Create entirely new faction trees with unique strengths and weaknesses.
     

b) Player Progression

Players often start with weak recruits and rely on troop trees to grow powerful armies. A well-designed troop tree should:

  • Offer multiple paths (e.g., archers or infantry).

  • Reward investment with stronger units.

  • Introduce new roles at higher tiers (e.g., cavalry, shock troops, support).

Changing these elements directly alters how a faction plays.
 

c) Game Balance

Because all factions have troop trees, their combat viability and strategic depth depend on how those trees are structured. Editing stats, skills, and equipment without considering the whole tree may unbalance the game.

This is why understanding and testing changes to troop trees is essential. A poorly balanced troop tree can:

  • Make a faction too powerful in auto-resolved battles.

  • Make the player’s army overpowered too early.

  • Break progression logic if upgrade paths are missing or inconsistent.

4. How to View Troop Trees in the Game

​

You can visualize any faction’s troop tree directly in-game using the Encyclopedia.

Steps:

  1. Start a game in Campaign or Sandbox mode.

  2. Press the N key to open the Encyclopedia.

  3. Navigate to the Troops tab.

  4. Filter by culture (e.g., Empire, Vlandia).

  5. Click on a troop such as "Imperial Recruit."

  6. Click the “Troop Tree” button or locate the tree graphic on the page.

Tip: Examine the structure of different factions:

  • How many tiers?

  • How many branches?

  • When do cavalry units appear?

  • Which units are clearly stronger?

Taking screenshots or notes will help when planning your custom trees.

​

5. Activity: Compare Three Factions

Launch the game and pick three different cultures (e.g., Empire, Vlandia, Battania). For each one:

  • Identify the Tier 1 recruit.

  • Map out the troop tree until Tier 6 or 7.

  • Note when ranged and cavalry units appear.

  • Observe differences in branching (single-path or multiple options?).

This will give you a working mental model of how Bannerlord designs its faction trees and helps prepare you for editing them.

​

​

Upgrade Paths  and  Structure visual example


Imperial Recruit


  Imperial Infantryman

                          └── Imperial Legionary
                   â””── Imperial Archer
                                    └── Imperial Veteran Archer


Imperial Veteran Infantryman

Recruit

Soldier

Archer

Veteran Soldier

Spearman

Expert Soldier

Beginner Course – Phase 1: Editing Troop Trees
Lesson 2: Basic XML Structure for Troops

Objective

By the end of this lesson, you will be able to:

  • Recognize the key XML structure used to define a troop in Bannerlord.

  • Identify and understand the role of important XML tags and attributes.

  • Begin editing troop entries confidently, starting with small changes.

  • Understand how Bannerlord reads and uses this data to build in-game units.

Where Are Troops Defined?
 

All regular troop units in Bannerlord are defined inside the file:

.../Mount & Blade II Bannerlord/Modules/SandBoxCore/ModuleData/spnpccharacters.xml

This file contains hundreds of <NPCCharacter> blocks. Each block represents a single troop, including:

  • Recruits

  • Infantry and archers

  • Noble cavalry

  • Bandits, mercenaries, villagers

  • Lords and companions (we'll cover heroes later)

You will be editing or duplicating these blocks to create or modify troops.

Nested Tags Inside <NPCCharacter>
 

Now let’s look at what goes inside the opening and closing tags. This includes face, skills, upgrades, and equipment.
 

a) Appearance – <face>

Defines how the troop looks (age, facial features, etc.). For regular troops, this can be very simple.

​

<face> <face_key_template value="BodyProperty.fighter_empire" /> </face>
 

In more advanced use, you might see:

​

<face> <BodyProperties version="4" age="25" weight="0.5" build="0.5" key="long_string_here" /> </face>
 

You can copy the face section from other troops if you're unsure. Appearance affects immersion, not gameplay.
 

b) Skills – <skills>
Each troop has specific skills defined as:

​

<skills> <skill id="OneHanded" value="20" /> <skill id="Polearm" value="20" /> <skill id="Athletics" value="10" /> </skills>
 

These values influence how troops perform in combat.

Common skills for regular troops:
 

  • OneHanded

  • TwoHanded

  • Polearm

  • Bow

  • Crossbow

  • Throwing

  • Riding

  • Athletics
     

Try comparing multiple Tier 2 troops to get a feel for what values are typical. Values increase with higher tiers.
 

c) Upgrade Targets – <upgrade_targets>

This defines who the troop can become through upgrades.
 

Example:

<upgrade_targets> <upgrade_target id="NPCCharacter.imperial_infantryman" /> <upgrade_target id="NPCCharacter.imperial_archer" /> </upgrade_targets>
 

Use only one <upgrade_target> for linear trees. Two or more creates branching choices for the player.
 

d) Equipment – <Equipments>
 

This defines what gear a troop spawns with. Usually contains one or more <EquipmentRoster> blocks.
 

Example:

​

<Equipments> <EquipmentRoster> <equipment slot="Item0" id="Item.peasant_pitchfork_2_t1" /> <equipment slot="Head" id="Item.leather_cap" /> <equipment slot="Body" id="Item.tunic_with_shoulder_pads" /> <equipment slot="Leg" id="Item.empire_horseman_boots" /> </EquipmentRoster> </Equipments>
 

Some troops use multiple rosters to allow for gear variation.
Slots include: Item0 (main weapon), Head, Body, Leg, Gloves, Cape, etc.

This is the main container tag for any troop unit.

<NPCCharacter 
    id="imperial_recruit"
    name="{=s3IJIFUw}Imperial Recruit"
    level="6"
    occupation="Soldier"
    is_basic_troop="true"
    culture="Culture.empire">

Explanation of key attributes:
 

  • id: A unique identifier for this troop. Crucial for referencing it elsewhere. Example: id="imperial_recruit".
    Note: Every id across the game must be unique. If two troops share an ID, the game may crash or behave unpredictably.

  • name: The in-game name shown to players. Usually in localized format: {=Key}Name.
    This helps translation and localization. You can also use plain text for small mods (e.g., name="Test Soldier").

  • level: Numeric value defining the troop's level (used in upgrade cost, battle power, and wages). Tier 1 units are usually level 6–8. Elite units can go up to level 26+.

  • occupation: Common values: "Soldier" for normal troops, "Lord", "Wanderer" for heroes.

  • culture: Links the troop to a culture defined in spcultures.xml. Example: "Culture.empire". This affects recruitability and faction visuals.

  • is_basic_troop: Optional attribute (true or false). If set to true, this troop is considered the culture’s recruit unit.

  • is_hero: If present and set to "true", the unit is treated as a lord or companion (covered later). Regular troops don't include this.

Full Simplified Example

<NPCCharacter 
    id="imperial_recruit" 
    name="{=s3IJIFUw}Imperial Recruit" 
    level="6" 
    occupation="Soldier" 
    is_basic_troop="true" 
    culture="Culture.empire">

  <face>
    <face_key_template value="BodyProperty.fighter_empire" />
  </face>

  <skills>
    <skill id="OneHanded" value="20" />
    <skill id="Polearm" value="20" />
    <skill id="Athletics" value="10" />
  </skills>

  <upgrade_targets>
    <upgrade_target id="NPCCharacter.imperial_infantryman" />
    <upgrade_target id="NPCCharacter.imperial_archer" />
  </upgrade_targets>

  <Equipments>
    <EquipmentRoster>
      <equipment slot="Item0" id="Item.peasant_pitchfork_2_t1" />
      <equipment slot="Body" id="Item.tunic_with_shoulder_pads" />
      <equipment slot="Leg" id="Item.empire_horseman_boots" />
    </EquipmentRoster>
  </Equipments>

</NPCCharacter>

   Practice Task:
 

  • Open spnpccharacters.xml using VS Code or Notepad++.

  • Use the search function to find imperial_recruit.

  • Read through the entire <NPCCharacter> block and compare it to the one in this lesson.

  • Try to identify each section (name, skills, upgrade_targets, etc.).

Next Steps and Preparation

​

In the next lesson, you'll learn how to duplicate and modify a troop, which includes:

​

  • Giving it a new id

  • Adjusting its equipment and stats

  • Placing it correctly in the troop tree

  • Testing it in-game

bottom of page