Game Development Reference
In-Depth Information
W EIGHTED R ANDOM FROM A LL C HOICES
Let's recap a few points. Our algorithm adapts to changing numbers of options. It
automatically puts those options into the proper distribution to account for how well
(or poorly) the option scored when we analyzed our situation. The question is, if our
algorithm takes all of that into account, why are we limiting our choices anyway?
We have already noted not only the difficulty in determining an abstract cutoff
point, but we have noted that by having a cutoff point at all, we risk disqualifying
potentially viable options. Looking back at our original data for the Dude example,
while we cut off the options at eight, the difference in score between the first 12
options is minimal. Why wouldn't we consider those extra four?
Thankfully, the weighted random approach biases our results toward the
options we want and biases away from the options we don't. We have reduced
the options that are very bad to having almost no chance whatsoever of being
picked. To see this effect, we can run the weighting algorithm on all 32 of our
possible options.
Name
Weapon
Score
Weight
Edge
%
Evil Genius
R/L
7.7
2,343
2,343
10.07
Boss Man
R/L
8.5
2,114
4,457
9.08
Baddie 3
R/L
9.7
1,860
6,317
7.99
Evilmeister
R/L
9.8
1,834
8,151
7.88
Evil Genius
M/G
10.8
1,670
9,821
7.18
Baddie 3
Shotgun
11.2
1,607
11,428
6.90
Baddie 3
M/G
12.6
1,430
12,858
6.14
Baddie 2
R/L
13.1
1,374
14,232
5.90
Evilmeister
M/G
13.8
1,303
15,535
5.60
Evil Knievel
M/G
14.4
1,254
16,789
5.39
Boss Man
M/G
14.8
1,221
18,010
5.25
Baddie 2
M/G
16.3
1,106
19,116
4.75
Baddie 1
R/L
27.1
666
19,782
2.86
Baddie 3
Pistol
28.7
628
20,410
2.70
Baddie 1
M/G
28.8
627
21,037
2.69
Baddie 1
Shotgun
29.4
613
21,650
2.63
Baddie 1
Pistol
38.6
468
22,118
2.01
Evilmeister
Pistol
44.0
410
22,528
1.76
Search WWH ::




Custom Search