Files
nethack/include
PatR 0fe6a731df fix #H2204 - mkclass() mon selection distribution
That #H number isn't a typo.  This finally fixes--at least improves--
something reported eight years ago.  The monster types chosen by
mkclass() could be way off in some circumstances.  Cited example was
repeated same-race sacrifice by chaotic hero on dungeon level 20; it
produced about twice as many incubi as succubi even though they're
the same as far as difficulty goes.  (No changes in the intervening
years had any discernable effect; that was still reproducible.)
The report also mentioned that ndemon() threw away the result from
mkclass() and retried quite often and suggested that mkclass() be
taught to filter by alignment when caller cared about that.

This seems to even things out, although it also made harder monsters
chosen more often.  A test program generated these numbers when
picking a chaotic demon 10000 times (level 1 hero on dungeon level 20,
so not realistic; actually probably level 0 hero since the program
didn't initialize struct u.)  Third column is the number of times the
monster type was chosen with the old mkclass(), fourth is same for
the new one.
    mkclass() calls    27315 10000
286 succubus            2800  3309
288 incubus             5552  3262
291 marilith             973   780
292 vrock                477  1617
293 hezrou               150   626
294 bone devil            46   247
295 ice devil              2   107
296 nalfeshnee             0    23
297 pit fiend              0    15
298 sandestin              0     4
299 balrog                 0    10
Note that vrock has generation frequency 2 and marilith only 1, so
getting twice as many vrocks as mariliths should be expected.

I temporarily changed ndemon() to ask for lawful demons instead of
chaotic ones and got this.
    mkclass() calls    15762 10000
287 horned devil        3197  3375
289 erinys              4991  3339
290 barbed devil        1812  3286

I also ran it for dragons with any alignment (so the outcome was
never thrown away; 10000 calls were needed for 10000 picks) instead
of demons of specific alignment and am suspicious of the outcome.
    mkclass() calls    10000 10000
140 baby yellow dragon  1124     0
141 gray dragon         1096  1096
142 silver dragon       1073  1099
143 red dragon          1061  1126
144 white dragon        1077  1128
145 orange dragon       1141  1118
146 black dragon        1154  1049
147 blue dragon         1137  1123
148 green dragon        1137  1154
149 yellow dragon          0  1107
There may be a flaw in the test program.  Or else old mkclass() was
not very good at picking dragons.
2018-12-16 14:21:30 -08:00
..
2018-11-11 10:29:52 -05:00
2018-09-10 21:13:10 +03:00
2015-05-25 09:21:31 +09:00
2015-05-25 09:21:31 +09:00
2016-10-10 16:18:20 +03:00
2015-05-25 09:21:31 +09:00
2015-05-25 09:21:15 +09:00
2018-11-27 07:38:03 +02:00
2015-10-17 13:15:46 +03:00
2018-04-25 15:00:13 -04:00
2018-04-25 15:00:13 -04:00
2018-04-25 15:00:13 -04:00
2018-12-10 09:00:50 -05:00
2015-05-25 09:21:31 +09:00
2015-05-25 09:21:31 +09:00
2015-05-25 09:21:31 +09:00
2018-04-25 15:00:13 -04:00
2018-12-10 09:00:50 -05:00
2018-12-15 19:31:42 -05:00
2015-05-25 09:21:15 +09:00
2018-12-07 09:29:01 -05:00
2018-04-25 16:54:50 -04:00
2018-04-25 15:00:13 -04:00
2018-04-25 16:54:50 -04:00
2015-05-25 09:21:15 +09:00
2018-04-25 15:00:13 -04:00
2018-04-25 15:00:13 -04:00
2015-10-17 13:15:46 +03:00
2015-11-17 02:26:17 -08:00
2018-04-25 15:00:13 -04:00
2018-04-25 16:54:50 -04:00
2018-04-25 15:00:13 -04:00
2018-04-25 15:00:13 -04:00
2018-04-25 16:54:50 -04:00
2018-04-25 15:00:13 -04:00
2015-05-25 09:21:31 +09:00
2018-09-22 14:08:28 -04:00
2015-05-25 09:21:31 +09:00
2018-04-25 15:00:13 -04:00
2018-04-25 16:54:50 -04:00
2015-05-25 09:21:31 +09:00
2018-04-25 15:00:13 -04:00
2018-04-25 15:00:13 -04:00
2018-04-25 15:00:13 -04:00
2018-10-20 23:14:33 -04:00
2017-11-02 13:37:53 +02:00
2015-05-25 09:21:31 +09:00
2015-05-25 09:21:31 +09:00
2015-11-17 02:26:17 -08:00
2017-10-10 21:47:35 +03:00
2015-05-25 09:21:31 +09:00
2015-05-25 09:21:31 +09:00
2015-10-17 18:47:31 +03:00
2018-04-25 15:00:13 -04:00
2018-12-15 19:27:08 -08:00
2015-05-25 09:21:31 +09:00
2018-11-20 19:09:05 -05:00
2018-04-25 15:00:13 -04:00
2018-04-25 16:54:50 -04:00
2018-04-25 15:00:13 -04:00
2018-11-27 18:21:58 -08:00
2015-05-25 09:21:31 +09:00
2018-04-25 15:00:13 -04:00
2015-10-17 18:47:31 +03:00
2015-05-25 09:21:31 +09:00
2018-12-04 22:22:43 -05:00
2015-05-25 09:21:31 +09:00
2018-12-08 17:56:20 -05:00
2017-10-10 15:56:18 -07:00
2015-05-25 09:21:31 +09:00
2015-05-25 09:21:31 +09:00