4
Templates
Alexandru Macocian edited this page 2026-02-25 16:58:54 +01:00

Templates

This document describes the template encoding formats

Overview

Guild Wars uses Base64-encoded bitstreams to store character information in shareable template codes. All templates use a modified Base64 alphabet with + and / as the 62nd and 63rd characters, and all binary values are interpreted in lowest-bit-first (LSB) order.

Base64 Lookup Table:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=

Template Type Detection

The first 4 bits of any template determine its type. This allows parsers to identify and route templates appropriately:

Header (First 4 bits) Template Type Description
1 Equipment Template PvP armor/weapon loadout
0, 2-13 Legacy Skill Template Pre-April 2007 builds (header = version)
14 Current Skill Template Post-April 2007 builds
15 Extended Template Extension of the templates format for custom templates

Skill Template Format

Skill templates encode a character's profession combination, attribute point distribution, and equipped skills.

Legacy Skill Template (Pre-April 5, 2007)

Templates generated before the April 5, 2007 update use the header value as the version number directly.

Legacy skill template structure

Bits Field Description
4 Version Version number (0-13), also serves as header
2 Profession Length Read this value, then p = value * 2 + 4
p Primary Profession Profession ID
p Secondary Profession Profession ID (0 = None)
4 Attribute Count Number of attributes with points
4 Attribute Length Read this value, then a = value + 4
Per attribute:
a Attribute ID Attribute identifier (a bits each)
4 Attribute Points Base points (1-12)
4 Skill Length Read this value, then s = value + 8
8 times:
s Skill ID Skill identifier (s bits each, 0 = empty slot)

Note: See variable length encoding for details on how the length is calculated


Current Skill Template (Header 14)

Templates generated after the April 5, 2007 update use header value 14 to indicate the new format.

Current skill template structure

Bits Field Description
4 Header Always 14 (indicates new template format)
4 Version Version number (currently always 0)
2 Profession Length Read this value, then p = value * 2 + 4
p Primary Profession Profession ID (p bits each)
p Secondary Profession Profession ID (0 = None)
4 Attribute Count Number of attributes with points
4 Attribute Length Read this value, then a = value + 4
Per attribute:
a Attribute ID Attribute identifier (a bits each)
4 Attribute Points Base points (1-12)
4 Skill Length Read this value, then s = value + 8
8 times:
s Skill ID Skill identifier (s bits each, 0 = empty slot)
1 Tail Optional trailing bit (0)

Note: See variable length encoding for details on how the length is calculated


Equipment Template Format

Equipment templates encode a PvP character's armor and weapon configuration, including item types, mods/inscriptions, and dye colors. These templates always start with header value 1.

Equipment structure

Bits Field Description
4 Header Always 1 (identifies as equipment template)
4 Item ID Size Number of bits for item IDs (typically 9)
4 Mod ID Size Number of bits for equipment mod IDs (typically 9)
3 Item Count Number of items (max 7: 1 weapon set + 5 armor pieces)
Per item:
3 Item Type Equipment slot type
Item ID Size Item ID Equipment piece identifier
2 Mod Count Number of mods/inscriptions on this item
4 Dye ID Dye color applied to item
Per mod:
Mod ID Size Mod ID Inscription/mod identifier

Extended template (Header 15)

Header 15 tells the parser that we're handling a custom template.

Extended template structure

Bits Field Description
4 Header Always 15
8 Type Dictates the type of template (1 means party loadout)
variable Data Actual template data

Known extended template types:

Type Definition
1 Party loadouts

Party loadouts

Party loadouts are an extended template that store information about party composition, such as heroes and behaviors.

Since this is still experimental, a version field is reserved for incremental upgrades to the loadout schema.

Bits Field Description
Extended template bits
4 Version Version number

Known versions:

Version Definition
1 v1

Party loadouts v1

Bits Field Description
Extended template bits
Version field
4 Party Size Number of party members (1-8)
Per party member:
2 Member Type Type of party member
6 Hero ID Only if hero member type
2 Hero Behavior Behavior mode
variable Build Template Skill template

Embedded Build Template Format

Each party member's build is encoded using the standard skill template structure without the header and version bytes:

Bits Field Description
2 Profession Length Read value, then p = value * 2 + 4
p Primary Profession p bits
p Secondary Profession p bits
4 Attribute Count Number of attributes
4 Attribute Length Read value, then a = value + 4
Per attribute:
a Attribute ID a bits
4 Attribute Points Base points (1-12)
4 Skill Length Read value, then s = value + 8
8 times:
s Skill ID s bits (0 = empty slot)

This reuses the existing encoding logic while avoiding redundant header/version data per party member.

Note: See variable length encoding for details on how the length is calculated


Variable length encoding

The "length" fields store a code that determines how many bits are used for subsequent IDs. This allows smaller templates when only low-numbered IDs are needed.

Field Code Value Bits per ID Max ID
Profession Length (2 bits) 0 4 15
1 6 63
Attribute Length (4 bits) 0 4 15
2 6 63
Skill Length (4 bits) 0 8 255
1 9 511

Constants

Profession IDs

ID Profession
0 None
1 Warrior
2 Ranger
3 Monk
4 Necromancer
5 Mesmer
6 Elementalist
7 Assassin
8 Ritualist
9 Paragon
10 Dervish

Attribute IDs

ID Attribute
0 Fast Casting
1 Illusion Magic
2 Domination Magic
3 Inspiration Magic
4 Blood Magic
5 Death Magic
6 Soul Reaping
7 Curses
8 Air Magic
9 Earth Magic
10 Fire Magic
11 Water Magic
12 Energy Storage
13 Healing Prayers
14 Smiting Prayers
15 Protection Prayers
16 Divine Favor
17 Strength
18 Axe Mastery
19 Hammer Mastery
20 Swordsmanship
21 Tactics
22 Beast Mastery
23 Expertise
24 Wilderness Survival
25 Marksmanship
29 Dagger Mastery
30 Deadly Arts
31 Shadow Arts
32 Communing
33 Restoration Magic
34 Channeling Magic
35 Critical Strikes
36 Spawning Power
37 Spear Mastery
38 Command
39 Motivation
40 Leadership
41 Scythe Mastery
42 Wind Prayers
43 Earth Prayers
44 Mysticism

Equipment Type IDs

ID Type
0 Weapon
1 Shield/Focus
2 Chest
3 Legs
4 Head
5 Feet
6 Hands

Dye IDs

ID Color
2 Blue
3 Green
4 Purple
5 Red
6 Yellow
7 Brown
8 Orange
9 Gray (or none)
11 Non-dyeable item

Party Member Type

Type Value
Player 0
Henchman 1
Hero 2

Hero Behaviors

Value Behavior Description
0 Fight Hero actively engages enemies
1 Guard Hero defends/follows (default)
2 Avoid Hero avoids combat

Hero IDs

Heroes are identified by their in-game IDs:

ID Hero Profession
1 Norgu Mesmer
2 Goren Warrior
3 Tahlkora Monk
4 Master of Whispers Necromancer
5 Acolyte Jin Ranger
6 Koss Warrior
7 Dunkoro Monk
8 Acolyte Sousuke Elementalist
9 Melonni Dervish
10 Zhed Shadowhoof Elementalist
11 General Morgahn Paragon
12 Magrid the Sly Ranger
13 Zenmai Assassin
14 Olias Necromancer
15 Razah Any (configurable)
16 M.O.X. Dervish
17 Keiran Thackeray Paragon
18 Jora Warrior
19 Pyre Fierceshot Ranger
20 Anton Assassin
21 Livia Necromancer
22 Hayda Paragon
23 Kahmu Dervish
24 Gwen Mesmer
25 Xandra Ritualist
26 Vekk Elementalist
27 Ogden Stonehealer Monk
28-35 Mercenary Heroes 1-8 Any
36 Miku Assassin
37 Zei Ri Ritualist


See Also