Game Development Reference
In-Depth Information
To see this process in action, we will now plug in some numbers. Let's assume
that our current goals and counts for workers and solders are:
Unit
Goal
Count
Utility
Worker
20
5
0.938
Soldier
20
5
0.984
By setting the goals and counts equal to each other, we show that the priority
for soldiers is, indeed, higher. Let's assume that we have built a few more soldiers
and see how this changes.
Unit
Goal
Count
Utility
Worker
20
5
0.938
Soldier
20
8
0.936
Once we have built our eighth soldier, the utility for the next soldier drops to
the point where it is now less than the utility for the next worker. Our next build,
therefore, would be our sixth worker. The utility of our seventh worker is 0.910,
meaning we would build yet another soldier. Eventually, as we acquire more of each
type, the count of workers catches up to the soldiers. (Specifically, we would build
two workers in a row a couple of times. At a count of 18, the number of workers
matches that of the soldiers, and they alternate again from that point.)
Different Goals for Different Folks
While this is all well and good, the power of using normalized utility is when we are
working with unequal goals. For example, using the same utility formulas, let us as-
sume that we would like to have 35 soldiers and 20 workers. At the beginning, our
data would look like this:
Unit
Goal
Count
Utility
Worker
20
0
1.000
Soldier
35
0
1.000
After building one of each, the next four builds are of soldiers. Once we have
five, the normalized utility of the next soldier falls to 0.997, while the normalized
utility of the second worker is 0.998. Therefore, only after we have five soldiers
would we build our second worker.
Search WWH ::




Custom Search