Modding:units

You will find below a step by step process required to create a new unit.

Note that this process is not entirely problem-free or complete as of its first version.

## Unit Attributes and Statistics

mesh="Units/AstraMilitarum/Guardsman"
Mesh is a similar thing to a model, yet not completely a model, it defines the shape of the object by connecting vertices into shape. This is used to define how your model will look in game. Meshes can be found at Data/Video/Meshes/...

material="Units/AstraMilitarum/Guardsman"
Material is kinda of an advanced form of Textures, it contains more information than texture that is usually a single image that covers a model. Material usually have additional information and layers. Models can be found at Data/Video/Textures/...

idleAnimation="Units/AstraMilitarum/GuardsmanIdle"
Sets an idle animation for this unit, without it, the unit would stand without any movement or visible behavior.

position
Flying units have an additional value "position" that is represented by 3 values (in e.g. 0 0 64). The last value is representing the distance between ground and the sky, the higher the value the higher the object is placed from the ground.

idleAnimationCount="3"
Sets the amount of used idle animations from the unit's animation pool.(?Slightly unsure?)

idleContinuously="1"
Sets if the unit should display idle animation continuously or just once and then never display it again.

Scale="1 1 1"
Defines X,Y and Z size of the model on the Strategic map, when model stands in front of you...
X defines how long it is from front to back.
Y defines how tall it is down to top.
Z defines how long it is from left to right.

Please note, that value 1 1 1 is not always a default one, as some models are bigger or smaller by default.

bloodBone="Chest"
Sets the particles/VFX for death animation (Where blood or explosion should start when unit is killed).

walker="1"
Defines if the unit is a walking type or flying/Hovering (used to calculate if unit can pass above the water pools and penalties through forest/rivers).

group size="8" rowSize="4" memberDeltaX="80" memberDeltaY="64"
Group size shows how many models are used in squad in total, rowSize represents how many rows are from left to right. MemberDeltaX and MemberDeltaY defines the distance value between each model, X for Front/Back and Y for Left/Right distance.

Weapon name="Lasgun"
Defines the statistics of the weapon that will be visible in unit's UI in the right-bottom corner of the screen between the icons and units statistics. All Weapons data can be found in Data/World/Weapons...

beamWeapon mesh="Weapons/AstraMilitarum/GuardsmanLasgun
There are 5 types of weapon so far in game beamWeapon, projectileWeapon, missileweapon, flamerWeapon and grenadeWeapon (used only for abilities so far), a correct type must be set for correct weapon. Similar to Unit's mesh, a proper Weapon's mesh must be used for the unit to avoid issues while launch the game or producing the units. Weapon meshes can be found in Data/Video/Meshes/Weapons...

material="Weapons/AstraMilitarum/GuardsmanLasgun
Similar to Unit's material, each weapon needs a proper material to cover the mesh, without the material the game may not start or cause some serious graphical issues. Weapon materials can be found in Data/Video/Textures/Weapons...

bone="RightHandBone"
All Models have a several attachment bones, where all other objects can be attached and used. To check the bones you need to convert the unit's .msh fire to blender or 3dsmax file and check it, usually when adding a new weapon that fits the unit model (in e.g. Flamethrower to an Imperial Guards) you don't have to change this value. (PS. Developers said they will provide a tool for mesh editing in the future, god bless them).

muzzleBone="GuardsmanLasgunMuzzle0"
This bone shows where firing particles/VFX are attached and starts when unit is assigned an attack order, without properly attached muzzlebones the game may not start or lead to some graphical issues. Usually when giving a unit a new weapon its good to check what is the previous muzzlebone of the unit that was using this weapon.

fireInterval="0.5"
Defines how often weapon's shooting particles/VFX are displayed when attack order is issued, higher value means less projectiles while lower value increases the projectiles quantity.

weapon name="FragGrenade" slotName="FragGrenade" enabled="0"
Weapon name defines the name of the ability and the slotName defines the place in the UI and is later used to trigger the ability when is selected from UI. enabled="0" means that the ability is not available from the start and needs to be researched first.

grenadeWeapon muzzleBone="LeftHandBone"
Similar to any weapon used in game, grenades have a muzzleBone which defines where exactly (left hand for grenades) the grenade's projectile should appear and fly toward the enemy when the ability is used.

<armor set="4"/>
Sets the armour of the unit, both against the melee and range attacks. Acceptable values are between 1 to 12.

<meleeArmorPenetration set="0.0">
Sets the armour penetration for melee attacks if the unit has any melee attacks. (Please note, that most melee attacks has their own armour penetrating value).

<food set="-1.0"/>
Sets the food upkeep for the unit each turn.

<foodCost set="10.0"/>
Sets the one time food cost to pay when the unit is recruited and taken into production line.

<hitpointsMax set="2.0"/>
Sets the health pool of the whole squad, each point is multiplied by the group size. For e.g. An Imperial Guard squad with 8 men in total and each having 2 hitpointsMax, would give 16 Health in total, with 1 model dying each time the group loses 2 Health.

<meleeAccuracy set="6"/>
Determines the accuracy in melee combat, because game is using table top rules, even when the unit cannot perform a direct melee attack, this value is used to reduce incoming damage from enemy melee attacks.

<meleeAttacks set="1"/>
The number of melee attack this unit can perform when attack order is issued to the unit.

<oreCost set="10.0"/>
Sets the one time ore cost to pay when the unit is recruited and taken into production line.

<meleeDamage set="1"/>
Sets the unit's melee damage according to table top rules (1 for Imperial guardsman due to having 3 strength) Damage values can be precised after a dot in e.g. a unit can have 2.4 damage value or 3.5, those values are multiplied by the number of the models used in squad, so 2 models having 2.4 damage would give 4.8 in total.

<moraleMax set="6"/>
Sets the maximum morale for the unit, nothing much to say, the more morale the longer unit can fight without penalties for dying allies in combat.

<movementMax set="2"/>
How far the unit can move on flat surface without any environmental obstacles like rivers or forests.

<productionCost set="24.0"/>
How much "Production/time" it takes to create this unit. Please note, that unlike Civilization games, Gladius - Relics of War has a separate production line for every type of produced army, infantry and buildings can be created Simultaneously with different speed.

<rangedAccuracy set="6"/>
Determines the unit's range accuracy and damage it deals when shooting an enemy, calculations are simliar to the one performed in the table top rules.

<increaseInfantryScore set="1.0"/>
How much score is increased on the graph at the end of the game for producing this unit.

<action animation="Units/AstraMilitarum/GuardsmanAttack"
beginFire="0.35" endFire="2.5"/>
This determines what attack animation is used when the unit is issued an attack order, also "beginFire" and "endFire" can be modified to change when the projectiles' particles/SFX should start and end. Please note, that setting those value without changing the animation duration, may lead to issues where model is still shooting at the enemy, but no projectiles are visible or vice vera. Changing two aforementioned values does not increase or shorten the duration on whole animation, only the duration when attack projectiles are visbile.

<throwGrenade weaponSlotName="FragGrenade" cooldown="10"
requiredUpgrade="AstraMilitarum/FragGrenade">
<model>
<action animation="Units/AstraMilitarum/GuardsmanGrenade"
beginFire="0.833333333333"/>
</model>
weaponSlotName refers to previously mentioned ability on UI and button to trigger this ability "FragGrenade" both are required to make the ability work. Cooldown shows how many turns must pass after the ability was used to make it usable again.
requiredUpgrade states what upgrade must be researched to unlock this ability because in previous string, the "Enabled=0" was set to zero, so this ability is not available from the beginning.
action animation shows what animation will be used when the order will be issued to the unit.
beginfire similar to standard attack order is also used in abilities to notify the game when the grenade should appear after the "FragGrenade" ability was used, basically its a display delay for the right moment for grenade to appear in order to create a fluent animation.

<mediPack cooldown="10" requiredUpgrade="AstraMilitarum/MediPack">
<model>
<action bone="ChestBone"
sound="Actions/Heal"/>
</model>
<targets>
<selfTarget>
<conditions>
<unit>
<damaged/>
</unit>
</conditions>
<areas>
<area affects="Unit">
<modifiers>
<modifier>
<effects>
<hitpointsFraction add="0.5"/>
</effects>
Since Cooldown and requiredUpgrade was described in previous line I will skill to "action bone="ChestBone" this determines where the VFX for healing should be displayed, similar to death particles, default place is on the chest.
Sound is used to determine what SFX will be played during using the ability.
<Target> and <SelfTarget> determines where the ability will be used, in this case the ability is a self target ability that needs a <conditions> which is a damaged unit (any amount of damage, even 0.1 damage is good) then area is scanned for valid target, its important because if this ability would be given to in e.g. a Building and the area would affect "units" this ability might not work, because there would be no "units" in selftargeted title. The last part is the effect with heal the fraction (50% of the current lost HP).

<traits>
<trait name="ExtraInfantryArmour" requiredUpgrade="AstraMilitarum/ExtraInfantryArmour"/>
<trait name="VoxCaster" requiredUpgrade="AstraMilitarum/VoxCaster"/>
</traits>
Trait determines what upgrades will affect the unit, trait is given to the unit if the upgrade is researched. Both Traits and Upgrades can be found in Data/World/Traits... and Data/World/Upgrades...

## How to Create a New Unit

In this step by step process, we would detail how a unit such as an Imperial Guard Conscripts could be created.

## How to make new Unit Icons

In order to make a Icon you will need 2 tools ether: Adobe Photoshop and NVIDIA DDS plugin \*OR\* GIMP with DDS plugin.

With one of these, (This guide will use Photoshop with Nvidia) There are 2 types of icons in the Gladius, there are the "Normal" type (160x160 Ress) and the Overlay type (30x30 Ress).

In order to find the icons in "Steam\steamapps\common\Warhammer 40000 Gladius - Relics of War\Data\Video\Textures\Icons".

The Folder structure is downward branching at this point, The Unit folder has Icons divided into factions, the Building folder has building Icons divided into factions.

The Overlay is almost completely like the unit folder only that it carries the smaller images.

The larger images are for the interfaces on your screen, like when your looking at the options in your cities or at a units actions. The overlay icons are the once that hover over the units and buildings.

1. If you have your units ready and looking to make a icon, start of with making a 160x160 ress image, and then make another layer and then click the little lock on the Background layer and delete the Background layer. We want a transparent background.
2. A important thing to think about your Icon is that it should be iconic and descriptive of the unit that its attached to.
3. If this is your first Icon or if you feel like you lack in artistic ability or the proper tools find a picture that you find iconic for this faction. Try pick a image that is in profile as most the game unit icons are in profile, so it'll blend well. This is of course not a necessity as the truest point is to make it Iconic and recognizable.
4. We will place our image in Photoshop, for this example we will use a Death Korps of Krieg Guardsman, making the image a stencil.
5. Next we make another empty layer to start making our Icon lines in, you can make as many layers as you feel you need for this, one per piece of the icon is good as it can help you edit things without destroying other things.
6. First of take the Eraiser and set it to Pencil, then take the Brush and change that to the Pencil. We are working with pixels and we need to be precise. Now in the empty layer start shaping with the lasso tool a portion of the image, here I form out the helmet.
7. Now form every part that is part of the Iconic face or helmet and fill them with the bucket tool. But remember that we want to use contrasts as well so leave about 3-4 pixel gaps in the model otherwise it wont show on the screen when playing.
8. Now hide the stencil image and then \*Save it\* as a .dds file with DXT5, and under the name you needed.
9. Boot up the game and see what it looks like ingame, if you don't like what it looks like make changes and maybe ask others for aid.
10. Now when you are confident in your creation you need to make the image 30x30 ress and export it under the same name but place the image in"Steam\steamapps\common\Warhammer 40000 Gladius - Relics of War\Data\Video\Textures\Icons\Overlay\Units" or the equivalent.
11. When your done, you can do something kind to a stranger and feel proud of yourself! Hay you got a cool Icon into a video game!