Game Development Reference
In-Depth Information
Unit
Goal
Count
Utility
Worker
20
1
0.998
Soldier
35
5
0.997
We build our third worker when we have eight soldiers, and so on.
Going the other way, let's assume that we only want to build eight soldiers.
Remember, however, that we biased the curves to build soldiers earlier. The results
are surprising. The builds alternate until we have five of each. Notice that we would
then have 63% of our soldiers built but only 25% of our workers! Only then do we
start building multiple workers before building another soldier. In fact, only after
building our tenth worker would we build our sixth soldier.
Unit
Goal
Count
Utility
Worker
20
10
0.750
Soldier
8
5
0.756
At 13 workers, we would build our seventh soldier and at 17 workers we build
our eighth soldier.
By normalizing the utility values so that they are represented on the same scale,
the formulas that we used to calculate the marginal utility for each unit type are
hidden from the comparison that determines what to build next. We were able to
concentrate on just the single “which is greater?� expression to determine what to
build next.
Soldiers, Sailors, Airmen… or Workers?
The worth of this uncomplicated method is even more apparent when we consider
adding more unit types. For example, even if we have 15 or 20 different types of
units, each with their own utility formulas, goal populations, and current counts,
we can trust that the normalized utilities are all on the same 0 to 1 scale. Therefore,
by sorting the list of units by their current utility values, we can select the highest
one as the “most important� to build. This selection process would still be valid
even if we changed the marginal utility formula for any of the unit types.
As we have seen, normalization is a process that helps us make sense of what
would otherwise be moving targets. It is a tool that we will use often.
Search WWH ::




Custom Search