Heroes 5 Wiki

New Artifact Framework (NAF) is additional module for Heroes V ToE that allows increasing the total amount of artifacts.

Features[]

Current state of NAF increase artifact total count from 96 to a value of choice. New artifacts are included in random generated maps (RMG/ARMG). The current guide will increase the value by 1 as each new entry requires to be filled with artifact details, otherwise if slot with no artifact data exists, game will crash.

Architecture[]

Bringing NAF into existence is possible through EXE edits and technical implementations in the data.pak files shown below.

  • Red background - necessary changes
  • White background - optional changes

Configuration loaded during .exe runtime.

Technical implementation[]

H5_Game.exe and H5_MapEditor.exe[]

Hex edit change increases exe creature count capability from 96 to 97. All new entries must have configured artifacts otherwise game will crash during play. Patch for exes is called

types.xml[]

Create global unique artifact identifier (creature ID):

  • Find <Base><Tables><Item><dbid><XPointer> = /GameMechanics/RefTables/Artifacts.xdb#xpointer(/Table_DBArtifact_ArtifactEffe<Base><Tables><Item><dbid><XPointer> = ct).
  • Go to <EnumEntries> last item - ARTIFACT_PRINCESS.
  • Add new items below for each additional artifact while keeping the same format. Replace XXX with artifact ID.
<Item>ARTIFACT_XXX</Item>

Enumerate the new unique artifact identifier by mapping it to numerical value:

  • Find <Base><SharedClasses><Item><TypeName> = ArtifactEffect.
  • Go to <Entries> last item ARTIFACT_PRINCESS.
  • Add new items below for each new artifact while keeping the same format. Replace XXX with creature ID. Replace YYY with the next numerical value. The first below ARTIFACT_PRINCESS will be 97, next will be 98 and so on.
<Item>
   <Name>ARTIFACT_XXX</Name>
   <Value>YYY</Value>
</Item>

Increase enumeration size:

  • Find <Base><SharedClasses><Item><Attributes><TypeName> = Table_DBArtifact_ArtifactEffect
    1. Inside Table_DBArtifact_ArtifactEffect Item find <Attributes><__ObjectData><Attributes><Item><Key> = ref_table_num_objs. Change its <Data> element from 97 to desired value which should be 1 + number of total artifacts.
    2. Inside Table_DBArtifact_ArtifactEffect Item find <Fields><Item><Constraints><Item><__ObjectData><MaxElements> = 97 and change that value to desired new value which should be 1 + number of total artifacts.



GameMechanics\RefTables\Artifacts.xdb[]

Map artifact ID to data specifics and adventure map MapObject file.

  • Go to <Table_DBArtifact_ArtifactEffect><objects><Item><ID> = ARTIFACT_PRINCESS.
  • Add new item below for each additional artifact while keeping the same format.
    • <ID> Replace XXX with artifact ID.
    • <NameFileRef> href="" should point to a text file that will present in-game artifact name.
    • <DescriptionFileRef> href="" should point to a text file that will present in-game artifact description.
    • <Model> This value is not used, the adventure map model for the artifact is taken from ArtifactShared Href file defined below. As a default value set "/_(Model)/TerrainObjects/Water/SeaChest.(Model).xdb#xpointer(/Model)" for each new artifact.
    • <Type> define artifact rarity, this value can be
      • ARTF_CLASS_MINOR - minor rarity
      • ARTF_CLASS_MAJOR - major rarity
      • ARTF_CLASS_RELIC - relic rarity
      • ARTF_CLASS_GRAIL - Grail artifact
    • <Slot> defines the slot the artifact is equipped at.
      • PRIMARY - Main hand
      • SECONDARY - Second hand
      • SHOULDERS - back/shoulder
      • CHEST - Armor slot
      • HEAD - Head armor
      • NECK - Necklace piece
      • FINGER - Ring
      • FEET - Boots/Shoes
      • MISCSLOT1 - token/rune slot
      • INVENTORY - Artifact that cannot be equipped but only stays in hero inventory.
    • <Icon> href="" should point at a XDB file which holds the link to 2D image that will be used as artifact icon.
    • <CostOfGold> artifact purchase value in shops
    • <AIValue> How valuable is the artifact for the AI player
    • <CanBeGeneratedToSell> Can be true or false. True means artifact can appear in Artifact merchant shops.
    • <HeroStatsModif> Define stat bonuses artifact will grant when equipped.
    • <ArtifactShared> Define link to the MapObject share file which is required in order the object to exist on adventure map.
    • <AvailableForPresets> Can be true or false. True means artifact can appear in Duel mode.
    • <PresetPrice> Artifact cost in Duel mode setup.
<Item>
	<ID>ARTIFACT_XXX</ID>
	<obj>
		<NameFileRef href="/Text/Game/Artifacts/Res_Wood/Name.txt"/>
		<DescriptionFileRef href="/Text/Game/Artifacts/Res_Wood/Description.txt"/>
		<Model href="/_(Model)/TerrainObjects/Water/SeaChest.(Model).xdb#xpointer(/Model)"/>
		<Type>ARTF_CLASS_MINOR</Type>
		<Slot>INVENTORY</Slot>
		<Icon href="/Textures/HeroScreen/Artifacts/ResWood.xdb#xpointer(/Texture)"/>
		<CostOfGold>8000</CostOfGold>
		<AIValue>2600</AIValue>
		<CanBeGeneratedToSell>true</CanBeGeneratedToSell>
		<HeroStatsModif>
			<Attack>0</Attack>
			<Defence>0</Defence>
			<Knowledge>0</Knowledge>
			<SpellPower>0</SpellPower>
			<Morale>0</Morale>
			<Luck>0</Luck>
		</HeroStatsModif>
		<ArtifactShared href="/MapObjects/Artifacts/ResWood.(AdvMapArtifactShared).xdb#xpointer(/AdvMapArtifactShared)"/>
		<AvailableForPresets>true</AvailableForPresets>
		<PresetPrice>0</PresetPrice>
	</obj>
</Item>

index.bin (optional)[1][]

Changes in this file will allow the user too see the new Artifacts in the Map editor.

  • Open Heroes V editor in game editing mode.[2]
  • 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
  • Open View -> Game Database -> Game Database Window 0
  • In the drop down menu select "AdvMapObjectLink" table.
  • A File tree will appear, browse to "MapObjects/_(AdvMapObjectLnk)/Artifacts" this is where custom artifacts will reside.
  • Right click on "Artifacts". This will create the new object link.
  • After that right click on folder Artifacts-> New Object.

  • Set a name for the new object, in this case it will be "Artifact97.(AdvMapObjectLink)" and click OK.
  • Repeat all steps above to create as many artifact objects as you need.
  • 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 references to all engine AdvMapObjectLink files including the new one that was just added
    • MapObjects folder - that includes the newly created AdvMapObjectLink file for the artifacts

MapObjects\_(AdvMapObjectLink)\Artifacts\*.xdb[]

The newly created AdvMapObjectLink xdb files created from the previous step are found in <game folder>/data/MapObjects/_(AdvMapObjectLink)/Artifacts/ and are meant to point at AdvMapMonsterShared artifact file and IconFile image that is to be shown in the Map Editor.

<?xml version="1.0" encoding="UTF-8"?>
<AdvMapObjectLink>
	<Link href="/MapObjects/Artifacts/artifact_97.(AdvMapMonsterShared).xdb#xpointer(/AdvMapMonsterShared)"/>
	<RndGroup/>
	<IconFile>Icons\Artifacts\artifact_97.dds</IconFile>
	<HideInEditor>false</HideInEditor>
</AdvMapObjectLink>
  • Link - path to creature AdvMapMonsterShared file
  • RndGroup - this field is not used
  • Icon File - path to creature DDS/TGA format icon that will be used in inventory pane. the root path begins from <game folder>/Complete folder so Icon path equal to "Icon/artifacts/artifact_97.dds" will look for icon file in "<game folder>/Complete/Icon/artifacts/artifact_97.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 artifacts slots should have such file.

References[]