New Hero Class Framework (NHCF) is additional module for Heroes V ToE that allows increasing the total amount of hero classes. First known origin of this patch was in HOMM5 Role Playing Edition by Magnomagus.
Features[]
Current state of NHCF increase hero class count from 8 to 73.
Architecture[]
Bringing NHCF into existence is possible due to technical implementations in the data.pak files shown below.
- Red background - necessary changes
- White background - optional changes
Configuration loaded during .exe runtime.

LUA engine configuration loaded during adventure map runtime (start of the game) - No class data is loaded in LUA.
Technical implementation[]
H5_Game.exe and H5_MapEditor.exe[]
Hex edit change increases exe hero class count capability from 8 to 73. As many of those IDs can be used in game, the one left empty will be skipped by the game engine without any repercussions for the engine stability. Patch is NewHeroClassFramework.yml.
types.xml[]

Create global unique hero class identifier (hero class ID):
- Find <Base><Tables><Item><dbid><XPointer> = /GameMechanics/RefTables/HeroClass.xdb#xpointer(/Table_HeroClassDesc_HeroClass<Base><Tables><Item><dbid><XPointer> = )
- Go to <EnumEntries> last item - HERO_CLASS_BARBARIAN.
- Add new item for each additional class while keeping the same format. There is no need to create an entry for all 73 slots. Replace XXX with class name.
<Item>HERO_CLASS_XXX</Item>

Enumerate the new unique hero class identifier by mapping it to numerical value:
- Find <Base><SharedClasses><Item><TypeName> = HeroClass.
- Go to <Entries> last item HERO_CLASS_BARBARIAN.
- Add new items below for each new hero class while keeping the same format. Replace XXX with hero class name and YYY with the next item value in order. For example: the one after Barbarian will be 9, next one 10 and so on.
<Item> <Name>HERO_CLASS_XXX</Name> <Value>YYY</Value> </Item>
GameMechanics\RefTables\HeroClass.xdb[]
Add connections between hero class ID and primary, skills, secondary skills and chances to get them through level up.
- Go to <Table_HeroClassDesc_HeroClass><objects><Item><ID> = HERO_CLASS_BARBARIAN.
- Add new items below for each new class while keeping the same format.
- <ID> set hero class name used in the steps above.
- <NameFileRef> point href= to a text file that will hold in-game class name the player will see. The root directory for this file is GameMechanics/RefTables/ so if href="HeroClass/HeroClassTest.txt" the game will look for it in GameMechanics/RefTables/ HeroClass/HeroClassTest.txt
- <SkillsProbs> this entry contains the mapping of all skills the class has access, so the hero may get them when he leveling up. The format for each mapping is:
- <SkillID> Skill ID can be found in data.pak/GameMechanics/RefTables/Skills.xdb.
- <Prob> value between 1 and 100 which represent the % the hero may be offered the skill when leveling up.
<Item> <SkillID>HERO_SKILL_XXX</SkillID> <Prob>X</Prob> </Item>
- <AttributeProbs> combined value of all parameters should be 100
- <OffenceProb> integer between 1 and 100 that defines the percent chance the hero will gain attack stats on level up
- <DefenceProb> integer between 1 and 100 that defines the percent chance the hero will gain defense stats on level up
- <SpellpowerProb> integer between 1 and 100 that defines the percent chance the hero will gain spellpower stats on level up
- <KnowledgeProb> integer between 1 and 100 that defines the percent chance the hero will gain knowledge stats on level up
- <PreferredSpellsFromSpellShop> ================== WORK IN PROGRESS ========================
- <AttributeProbs> combined value of all parameters should be 100
<Item> <ID>HERO_CLASS_TEST</ID> <obj> <NameFileRef href="HeroClass/HeroClassTest.txt"/> <SkillsProbs> <Item> <SkillID>HERO_SKILL_WAR_MACHINES</SkillID> <Prob>8</Prob> </Item> <Item> <SkillID>HERO_SKILL_DEFENCE</SkillID> <Prob>10</Prob> </Item> <Item> <SkillID>HERO_SKILL_DEMONIC_RAGE</SkillID> <Prob>10</Prob> </Item> <Item> <SkillID>HERO_SKILL_SHATTER_DESTRUCTIVE_MAGIC</SkillID> <Prob>5</Prob> </Item> <Item> <SkillID>HERO_SKILL_BARBARIAN_LEARNING</SkillID> <Prob>2</Prob> </Item> <Item> <SkillID>HERO_SKILL_OFFENCE</SkillID> <Prob>15</Prob> </Item> <Item> <SkillID>HERO_SKILL_SHATTER_LIGHT_MAGIC</SkillID> <Prob>5</Prob> </Item> <Item> <SkillID>HERO_SKILL_LUCK</SkillID> <Prob>8</Prob> </Item> <Item> <SkillID>HERO_SKILL_LEADERSHIP</SkillID> <Prob>10</Prob> </Item> <Item> <SkillID>HERO_SKILL_SHATTER_SUMMONING_MAGIC</SkillID> <Prob>5</Prob> </Item> <Item> <SkillID>HERO_SKILL_LOGISTICS</SkillID> <Prob>15</Prob> </Item> <Item> <SkillID>HERO_SKILL_VOICE</SkillID> <Prob>2</Prob> </Item> <Item> <SkillID>HERO_SKILL_SHATTER_DARK_MAGIC</SkillID> <Prob>5</Prob> </Item> </SkillsProbs> <AttributeProbs> <OffenceProb>45</OffenceProb> <DefenceProb>35</DefenceProb> <SpellpowerProb>5</SpellpowerProb> <KnowledgeProb>15</KnowledgeProb> </AttributeProbs> <PreferredSpellsFromSpellShop/> </obj> </Item>
UI\UIGameRoot.(UIGameRoot).xdb[]

Add connections between hero class ID and the hero class camera file:
- Go to <UIGameRoot><heroesCameras><Item><creatures><Item> = HERO_CLASS_BARBARIAN.
- Add new items below for each new hero class while keeping the same format.
- <Camera> href="" should point to a file name with hero class camera settings.
- <heroClasses><Item> set hero class name used in the steps above.
<Item>
<Camera href="/Cameras/Interface/HeroScreen/XXX.xdb#xpointer(/Camera)"/>
<heroClasses>
<Item>HERO_CLASS_XXX</Item>
</heroClasses>
</Item>
Cameras\Interface\HeroScreen\XXX.(Camera).xdb[]
Previous change created links, now the creature camera files have to be associated with the class. If they are not, game will crash upon launch as it cannot find them.
- Create a file Creature_XXX.(Camera).xdb for each new class with the dummy template below.
As an alternative <Camera href="" can point to already existing hero class camera.
<?xml version="1.0" encoding="UTF-8"?> <Camera> <Name/> <Pos> <x>4.60923</x> <y>-6.10921</y> <z>0.783314</z> </Pos> <Rot> <x>5.65767</x> <y>53.9048</y> <z>0</z> </Rot> <Rod>8.51464</Rod> <FOV>54.4316</FOV> <ClipDistanceMin>1</ClipDistanceMin> <ClipDistanceMax>500</ClipDistanceMax> <SrcName>Cameras\Interface\HeroScreen\HeroScreen_Knight.mb</SrcName> <RootJoint>camera_hero_screen</RootJoint> </Camera>
index.bin [1][]
Changes in this file will allow the user too see the new framework entities in the editor.
- open Heroes V editor in game editing mode.
- Select Resource -> Close Mod if that option is available. Note: It is necessary no mod projects to be opened otherwise no index.bin file will be generated
- From the game database drop down menu select "AdvMapObjectLink" table.
- A File tree will appear, browse to "MapObjects/_(AdvMapObjectLnk)/GenericHeroes"
- Right click on folder GenericHeroes -> New Object. This will create the new object link.
- Set a name for the new object - in this case it will be "HeroClass_10" and click OK.
- Repeat all steps above to create as many dummy hero classes as the framework capacity is required.
- Quit the editor and agree to save changes
- Go to <game folder>\data, there a number of new elements are present as follow:
- index.bin file that includes to all engine AdvMapObjectLink files including the new one that was just added
- MapObjects folder - that includes the newly created AdvMapObjectLink file for HeroClass_10
MapObjects\_(AdvMapObjectLink)\GenericHeroes\*.xdb[]
The newly created AdvMapObjectLink xdb files from the previous steps are meant to point at AdvMapSharedGroup hero list container and IconFile image shown in the Map Editor. Each of the newly created classes should have such file
<?xml version="1.0" encoding="UTF-8"?> <AdvMapObjectLink> <Link/> <RndGroup href="/MapObjects/_(AdvMapSharedGroup)/Heroes/HeroClass_10.xdb#xpointer(/AdvMapSharedGroup)"/> <IconFile>Icons\HeroClasses\HeroClass_10.dds</IconFile> <HideInEditor>false</HideInEditor> </AdvMapObjectLink>
- Link - this field is not used
- RndGroup - path to AdvMapSharedGroup
- Icon File - path to creature DDS/TGA format icon that will be used in inventory pane for that generic class. The root path begins from <game folder>/Complete folder so Icon path equal to "Icons\heroes\HeroClass_10.dds" will look for icon file in "<game folder>/Complete/Icons/heroes/HeroClass_10.dds"
- Hide in Editor - can be true or false depending on if this creature should be hidden in the editor or not
Each of the newly created hero class slots should have such file but because this is a template for framework, fields Link, RndGroup, Icon File should be left empty and Hide in Editor should be set to true as the inventory slot should stay invisible until there is no real class deployed.
<?xml version="1.0" encoding="UTF-8"?> <AdvMapObjectLink> <Link/> <RndGroup href=""/> <IconFile/> <HideInEditor>true</HideInEditor> </AdvMapObjectLink>
[]
This file type is container/list of AdvMapHeroShared files that are affiliated to certain hero class. Editor uses the file to randomize heroes placed by the generic class. This files are not required to build a framework, they are only required when new class is added so the game knows which heroes to choose from.
(Optional) <game folder>/Complete/*/*.dds[]
This is the icon presented in map editor inventory screen for the hero class. Its not required for framework nor for active class but can be added for flavour.
Example Template[]
To gain an idea of the amount of files required for a class mod, find the exe patch and NewHeroClassFramework_template.zip files on github. The EXE patch extends game up to 73 classes, the map editor index.bin file support up to 10 additional classes. One new class named "TEST CLASS" is added.
Install the template[]
- Download the files
- Apply the patch on H5_game.exe
- Extract NewHeroClassFramework_template.zip in <game folder>
Test the template[]

In game[]
- Open the patched exe and start a new game with Haven, where the hero of choice is "Maeve".
- Open the hero pane, her class should be "TEST CLASS" and should have a starting attack skill of 10.

In Editor[]
- Open the Map Editor and create a new empty map.
- in Tool Panel select Filter: Heroes (Generic), along the original classes HeroClass_10 should appear with its own yellowish icon.
- Select HeroClass_10 and place a hero on the map, it will always place Maeve as this is the only hero in this class list group.
Note[]
1. Only the vanilla "Warlock" class can use the elemental vision ability! You cannot add this skill to another class!
2. It is impossible for new classes to add a melee attack animation (automatically ranged)!
3. New classes cannot train troops in Heaven Castle without an additional patch! https://github.com/Might-Magic-Heroes-5-5/MMH55/blob/master/assembly/patches/MMH55%20production%20patches/for%20stripped%20exe/training_grounds_v1.1.yml


