Game Development Reference
In-Depth Information
Baddie 2
Pistol
54.2
333
22,861
1.43
Boss Man
Pistol
100.0
180
23,041
0.77
Evil Genius
Pistol
257.7
70
23,111
0.30
Baddie 4
R/L
634.7
28
23,139
0.12
Baddie 4
M/G
637.0
28
23,167
0.12
Baddie 4
Pistol
654.5
28
23,195
0.12
Evil Knievel
Pistol
1,339.7
13
23,208
0.06
Evil Knievel
Shotgun
1,339.7
13
23,221
0.06
Evil Knievel
R/L
1,339.7
13
23,234
0.06
Evil Genius
Shotgun
1,777.0
10
23,244
0.04
Evilmeister
Shotgun
2,183.4
8
23,252
0.03
Boss Man
Shotgun
2,421.3
7
23,259
0.03
Baddie 2
Shotgun
2,428.8
7
23,266
0.03
Baddie 4
Shotgun
2,531.1
7
23,273
0.03
There are a few things to notice about this data. First, a quick glance shows that
our selections at the bottom are all but disqualified from consideration. We only
have a 1% chance of selecting one of the 12 worst options combined . But the per-
centages for the good choices are not that much different from what they were
when we were only considering eight options. Our best option, Evil Genius with the
rocket launcher, represented 16.5% of the choices originally. In this variation, it will
occur slightly more than 10% of the time.
However, we have now included more potential options from which our agent
can select. In particular, the 9th through 12th options are in play with reasonable
frequency. Our original arbitrary choice of selecting from only eight options had
excluded these choices despite having similar scores to the top eight. Only after the
12th item (Baddie 2 with the machine gun), when the score jumps from 16.3 to
27.1, does the percentage chance of occurrence drop from around 5% to below 3%.
We only have to make two changes to our code. One is to pass the total num-
ber of buckets into GetResult() rather than the 25% (or whatever) that we had
calculated and passed before.
The other, more beneficial change is that we can now remove the call to
std::sort() that we had made prior to calling BuildEdges() and GetResult() .
Because we're now selecting from all of our options, we no longer have to be con-
cerned with the order in which they appear in our vector. The sizes of the buckets
determine the probability of selection, not the order in which they appear. If we're
processing a decision many times—especially if it is for many agents—sorting the
Search WWH ::




Custom Search