Armors Unmessed

How to enforce armor bonuses no matter the player class

Amors' mess

Armor items give a protection against damage, but the exact amount of protection both depends on the item and the player class.
Consider this excerpt taken from The Chronicle of Deeds (the Hexen II manual):
The Paladin prefers to wear sturdy breastplates, and gains great benefits when doing so. However, breastplates do not fit well upon the necromancer's slight frame, and confer fewer benefits upon him than any other hero.
Obviously that means the item_armor_breastplate can be a nice or pretty lame protection depending on which player grabs it.

You may consider it is precisely what makes class-dependent items like armors so cool: they significantly change the gameplay and/or difficulty and contribute to a better replayability. On the other hand, as a mapper you may want more control on the protection you give, at least in some situations: because you know the player is just about to enter an especially dangerous place and needs the better possible armor... or because they deserve a rewarding enough recompense... or whatever.

In such situations the question is all about going from something like
Put an amulet here and the bonus value will be resolved at runtime depending on the player class.
Put a 10% bonus armor here and the actual item offering that protection will be resolved at runtime depending on the playerc class.
To solve this case, two options...

The classic laborious way...

  1. Put all four item_armor_whatever at he same spot
  2. Set up their spawnflags values a below:

    For your Assassin's eyes only


    For your Paladin's eyes only


    For your Necromancer's eyes only


    For your Crusader's eyes only


The settings above are for a +10 protection armor, but +5, +15 and +25 also exist. Here is the distribution of the values actually applied in-game by the HexenC code dealing with damage:

Paladin +5 +10 +15 +25
Crusader +15 +5 +25 +10
Necromancer +25 +15 +10 +5
Assassin +10 +15 +5 +25
Demoness +10 +15 +5 +25

mess Time for a digression now... Click on the emoji to collapse this section if you prefer to get directly to option #2.
About the values above, unfortunately they are not perfectly aligned with the armor items descriptions found in The Chronicle of Deeds. It shows in that excerpt:
Bracers fit over the forearm and are used to deflect enemy attacks. The deadly Assassin is highly trained in the use of bracers. Other heroes gain some benefit from bracers, though the Crusader, who knows little of their use, is least affected.
The text heavily suggests that bracers should be +25 for Assassin, which is untrue when you look at the table. Actually bracers are +25 for nobody, whereas breastplate is for 3 player classes over 5. Pretty unbalanced, isn't it? Although that's no big deal in itself, it shows that initially the guys at Raven had a slightly different (and more coherent) idea about the distribution of values. They obviously lacked consistency when they changed their mind later on and forgot to make the update everywhere.

Unreliable AC counter

It's even worse when it comes to the AC counter in the HUD. The values are not just slightly unalike: they are totally disaligned.

Indeed the AC calculation is performed by the game engine itself (not HexenC) from a similar table... with a different distribution! That's why the figure displayed in the HUD is always hopelessly irrelevant.
· · · End of digression · · ·
You'll have to reproduce the procedure described above and refer to the table each time you want to put an armor with guaranteed protection amount. That may pretty quickly become a hassle.

To make things even worse, please pay attention to the spawnflags values deciding whether an item is present or not for a given class. It happens to be the same value for both the Necromancer and Demoness. Yet the Demoness' armors values are aligned on the Assassin's ones, not on the Necromancer's ones (they are even diametrically opposite concerning the breastplate). WTF?!

Definitely armors in Hexen II are a mess, and you will never be able to get by completely with conventional means.
That's time to look at...

The Inky way!

  1. Download the accompanying zip file

  2. Put the mdl files in your game's models directory
    or in any directory configured in TrenchBroom to search for models.

  3. Each model represents an armor with the percentage of absorbed damage clearly written on it.

    Explicit armor items' mess

  4. Add the following lines in hexen2.fgd
    to see the models in TrenchBroom as above:
  5. @PointClass base(Item) studio("models/_tb_armor05.mdl") = item_armor_05 : "Armor 5%" []
    @PointClass base(Item) studio("models/_tb_armor10.mdl") = item_armor_10 : "Armor 10%" []
    @PointClass base(Item) studio("models/_tb_armor15.mdl") = item_armor_15 : "Armor 15%" []
    @PointClass base(Item) studio("models/_tb_armor25.mdl") = item_armor_25 : "Armor 25%" []
  6. Take the code in extension_items.hc and add it to items.hc
    after the vanilla code for amulet, bracers, helmet and breastplate, or include it as a separate file in progs.src at the bottom of the list.

  7. Recompile progs.dat

You've done it!
Now you can easily decide how much protection you give the player thanks to the explicit entities. Those will appear in TrenchBroom only but never in-game, where they will be replaced by the actual armor item giving the desired protection to the player according to their class (for example an item_armor_25 will be turned into an item_armor_amulet for a Necromancer, into an item_armor_breastplate for a Demoness, etc.).

Want to ask for clarification, report an issue with this trick or propose another one? Drop me an email If you use the trick please credit me and put a link to this website.