HP and Casual Formulae for enemies

Hello,

Does anyone know the formula for HP on monsters? I figured out the ones for attack, armor, PSI gained, final hit and such, but not for HP.

For example, for the vanilla Revenant, this is the data available in data_enemy,xml:

<stats hp="8" armor="0" speed="1" str="1" psi="2" gold="1" xp=".5"/>
<levelup hp="13" armor="0" speed="0" str="0" psi="0.2" gold="0.3" xp="0.1"/>  

Speed, PSI, Gold and XP work as usual. However, looking for the HP in-game, this is the progression:

Level | Expected HP | Real HP
    1             8         8
    2            21        21
    3            34        35
    4            47        50
    5            60        66
    6            73        82
    7            86        99
    8            99       117
    9           112       136
   10           125       155
   11           138       175
   12           151       196
   13           164       217
   14           177       240
   15           190       263
   16           203       287
   17           216       311
   18           229       336
   19           242       362
   20           255       389  

Similar behavior happens for all the other monsters. Does anyone know why?

Also, in Casual difficulty, monsters have decreased HP, Attack and Armor, but I can’t figure out by how much it is decreased.

Knowing these would greatly help me in automating content creation for the wiki. Currently I have to do all battles in all difficulties and take notes of every monster’s HP.

Thank you in advance.

That is a nasty bug, when a round spawns a level 100 enemy (for example), the game will randomly choose from about ~99.9 to ~100.5 or something like that.
Oh and stats are halved in Casual.

EDIT: If you want to know, you can use the mod function to export data only, then you can open data_enemy.xml or data_enemy_plus.xml for monster stats, and the appropriate map file in the maps folder.

Thank you for the reply! I shall address some points:

— Begin quote from "MenDude"

That is a nasty bug, when a round spawns a level 100 enemy (for example), the game will randomly choose from about ~99.9 to ~100.5 or something like that.

— End quote

Yeah, I noticed that sometimes the preview for a wave shows certain stats and then, when monsters are spawned, they come with 1 more point in a stat or something, probably due to that bug…

— Begin quote from "MenDude"

Oh and stats are halved in Casual.

— End quote

I’m almost sure it is less than half… for instance:
[list]
:1hbq7yzh]Monstrosity LVL 25 on Casual: HP 520, Att 13, Armor 28./:m:1hbq7yzh]
:1hbq7yzh]Monstrosity LVL 25 on Normal: HP 2123, Att 45, Armor 70./:m:1hbq7yzh][/list:u:1hbq7yzh]

— Begin quote from "MenDude"

EDIT: If you want to know, you can use the mod function to export data only, then you can open data_enemy.xml or data_enemy_plus.xml for monster stats, and the appropriate map file in the maps folder.

— End quote

Yes, I did that already, the exported data is being invaluable for my wiki updates. That xml code in my original post is from data_enemy.xml. Problem is, everything makes sense looking from the data_enemy.xml stats, except for HP… and that’s the only reason I still need to fight all battles, to take note of HP values for each enemy.

XP and Scrap increase as expected (using the values in tag for LVL 1 and on tag for each additional level). Armor, PSI gained, even attack damage works as expected as well. However, even though the HP for LVL 1 monsters is the same you would expect from seeing the XML, for higher levels it grows completely different. HP in-game follows a somewhat exponential pattern, contrary to the linear pattern you would expect from seeing the xml data.

In my original post there is an example of that. The game’s data_enemy.xml says a Revenant (common Revenant) has base HP = 8 and receives HP+13 for every additional level (that’s the piece of xml code I pasted there). However, testing inside the game gives different values for LVL 3 and up. The higher the level, the higher is the difference from what is in the xml and what really happens: a LVL 60 Revenant has 2068 HP in the game, when it should have 775 HP according to the xml (8 + (13 * 59) = 775).

Oooh, HP seems to be calculated differently then, to make the game scale up with the player on difficulty (so that a LVL 60 Revenant wont have that low amount of HP), I’ll try to figure out how it’s done.

Ok, I found it.

For monsters’ HP, formula is:

MaxHP = BaseHP + (Lvl-1) * LvlUpHP * Multiplier  

Multiplier = 1 + ((Lvl-1) / 35)

where BaseHP is the monster’s HP at level 1. Both BaseHP and LvlUpHP are found in the XML (BaseHP = 8 and LvlUpHP = 13 for the common Revenant).


For casual mode, armor is 40% of normal and attack is 30% of normal.

In casual, the HP stats of monsters (BaseHP and LvlUpHP) are also 40% of normal mode, and that Multiplier is made “1”… because of that, HP of monsters is much much lower in Casual.


Phew, now it will be much faster to make the battle articles in the wiki :smiley:

Oh, that will help alot when making mods!