Monster Type Spawn Distribution

Luhkoh

Well-known member
Mar 13, 2020
423
696
93
29
USA
Introduction
Hi everyone. I was looking into the rate at which different monster types spawn in different areas. In particular this came up while working on my pitzerker simulator, so of primary interest to is pits and ancient tunnels, and those are the two areas I will mostly discuss. But this should apply to all areas other than act 5, where the "ranged preference" makes things more complicated. I will not be discussing Act 5 in this thread.

The available discussion and data on this, to my knowledge, is quite limited. I think I have a working hypothesis for the spawn rates that has a good chance of being correct, but it is not confirmed. So if anyone has any more information on the issue, or finds something that contradicts this, or just has something to add to the discussion, let us know here! In particular @onderduiker might have some insight. But anyways I will present what I have found and my conclusions from it, and will update my pitzerker simulator with these numbers.

And I had a whole lot of help so far on this. In particular, big thanks to @art_vandelay for digging up the link I will be discussing shortly, and to @ResTTe for counting boss types in the pits over 50 runs.

First a note on terminology. Only 3 types of monsters are selected to spawn in a given map on a given run. I will be discussing the two issues below as separate concepts:

1. The likelihood of selection - the the probability of being one of the 3 monsters selected for the map/run
2. The distribution of the 3 boss type that have been selected - after the 3 bosses are selected how many of each (proportionally and on average) are placed in the map

Discussion
So when I first made my pitzerker simulator, I assumed that all 4 of the unique monster types in pits had equal chances of spawning. Or in other words, that any given bosspack encountered had a 25% chance of being any one of devilkin, archer, bone warrior, or dark stalker. As stated above, only 3 types of monsters are selected to spawn in a given map on a given run, but I assumed they were all equally likely to be selected and had equal distribution, so the 25% chance would be accurate over a long number of runs. However this is wrong.

There is a value in monstats.txt called "rarity" that influences the spawn rates of different monster types in some way. In the pits, the archers have a rarity value of 1, while the other monsters have a rarity value of 2. These values can easily be viewed on the amazon basin (example link). My initial reaction was to say ok, instead of 25% for all 4 types, maybe archers are 1/7 and the others are 2/7. But @art_vandelay told me he thought this was wrong. Admittedly, it warranted much more thought as those numbers shouldn't be true in any situation, as we will explore next.

I looked around a little bit for an explanation of the rarity value, and found a "monstats.txt guide" on phrozen keep. This guide states that the rarity value affects the likelihood of selection and not the distribution, but then art_vandelay found and sent me this link:

LINK

This is a link from the amazon basin forum discussing the same issue, and @onderduiker performed an interesting test there. The most relevant bit posted by onderduiker:
I tested this by allowing only one of two monster types to spawn in the same game, one of which had rarity 9 and the other rarity 1: if the above were true, then 90% (9/(9+1)) of games should contain the rarity 9 monster. However, after 50 games the percentage containing the rarity 9 monster was exactly 50%: 25 games contained one monster, the other 25 contained the other... although when I allowed both to spawn in the same game, the rarity 9 monster was much more common (both had had their group size reduced to 1, so that wasn't a variable).

In my opinion this pretty directly disproves the statement from the monstats guide about rarity affect selection rather than distribution. I think it a reasonable takeaway, from this test alone, that selection is equally likely for all monster types and distribution is linearly controlled by the rarity value. Definitely some assumptions and inferences are present in making that conclusion, but until more is known, I think it is definitely enough to move ahead with.

If this mechanism is correct, we can calculate the likelihood that any given boss pack in the pits is an archer (over a large number of runs) as follows:
Code:
Chance of archer NOT being selected = 3/4 * 2/3 * 1/2 = 1/4
Chance of archer being selected = 1- 1/4 = 3/4
Average proportion of archers on map after positive selection = 1/5 (archers rarity divided by sum of the rarities of the three monsters selected)
Average chance boss pack is an archer = 1/5 * 3/4 = 3/20

It would be a little tougher (but still doable) to calc the "average proportion on map after positive selection" for the other monsters since the sum of the rarities would depend on whether archers were selected or not. Fortunately we can skip this and get the chance for the other 3 monsters by doing (1 - 3/20) / 3 = 17/60.

Lastly, @ResTTe did 50 pitruns and counted the number of times each monster appeared, and got the following results:
Code:
Monster    Number   Percent
-------    ------   -------
Devilkin    131     30.47%
Stalker     105     24.42%
Archer       53     12.33%
Warrior     141     32.79%
TOTAL       430

This is a very small sample size and so ofc should not be expected to give anywhere close to a precise answer. Nevertheless, I think that this empirical data, which is reasonably close to the predicted value, is a bit of extra support for it's likelihood of accuracy.

Pit and AT Spawn Rates
The term "spawn rate" here is being used to mean "the probability of a given boss being a certain monster type over a very large number of runs". Not sure if that's the best term for it, but I definitely don't want to type out that descriptor all the time :). Below are the spawn rates one gets from using this methodology to determine the rates in the pit and in the ancient tunnels. I will be updating my pitzerker simulator with these values unless/until more information is available that gives me a better value to use.

The Pit
Code:
Monster   Rarity   Spawn Rate
-------   ------   ----------
Devilkin    2       17/60
Stalker     2       17/60
Archer      1        3/20
Warrior     2       17/60

Ancient Tunnels
Code:
Monster   Rarity   Spawn Rate
-------   ------   ----------
Plague      2       13/40
Invader     1        7/40
Embalmed    1        7/40
Mage        2       13/40