Game Development Reference
In-Depth Information
A Different Edge
We will notice one problem with the numbers that we have generated above when
we try to use a response curve to select an option, however. Remember that to use
a response curve, we need to generate a number between 0 and whatever the outer-
most edge is—that is, the edge of the last bucket. In the case of the example above,
that edge is 3.88. Because some random number generators tend to yield integers,
however, we would have to do a conversion from the integer result to generate a
number between 0 and 3.88. While we certainly could do that conversion, there is
another approach we could take.
Remember, the actual values of the weights themselves do not matter—only
the proportion between them. Therefore, to avoid this problem, we could multiply
the weight formula by a coefficient. The result is the same but has the benefit of
converting our bucket edges to integers instead of decimal values.
The actual coefficient that we should select is a little difficult to ascertain, how-
ever. Again (say it along with me, folks), it is a very problem-specific issue. The main
consideration is that we want to achieve enough granularity to express subtleties in
the sizes of the buckets. Because we are going to have to round to the nearest whole
number, if the coefficient is too small, we risk rounding similar numbers off to the
same size when we would rather they remain distinctly different. For example, if
we were to multiply the weight scores above by a coefficient of 2, we would get the
following numbers:
Name
Weapon
Score
Weight
Edge
%
Evil Genius
R/L
7.7
2.00
2.00
25.8
Boss Man
R/L
8.5
1.82
3.82
23.5
Baddie 3
R/L
18.1
0.86
4.68
11.1
Evilmeister
R/L
19.3
0.80
5.48
10.3
Evil Genius
M/G
22.6
0.68
6.16
8.8
Baddie 3
Shotgun
26.9
0.58
6.74
7.5
Baddie 3
M/G
27.4
0.56
7.30
7.2
Baddie 2
R/L
33.1
0.46
7.76
5.9
Note that only the weights and the edges changed. The percentage scores and
the percentages are still the same. This process is not changing the distribution of
choices; we are only attempting to make selecting a choice a more accurate process.
The problem we would still have with the above data is that the granularity is
still too coarse. If we rounded the data off, we would have two 2s, five 1s, and even
Search WWH ::




Custom Search