Game Development Reference
In-Depth Information
Notice that we do not have to reference the amount of weight the character is
carrying or the maximum amount that he can carry. We have rolled all of that in-
formation into the tidy package of the factor W normalized . We can always expect a
value of between 0 and 1 regardless of how much the character can carry or how
much he has on him at the time.
Nonlinear Normalization
There are times when a direct mapping of values provided by the linear normaliza-
tion method above does not suit our purposes. Thinking back to the chapters on
utility (especially increasing and decreasing marginal utility), we often need a way
of representing the changes in a number that reflects a particular formula. Using
the same approach as we did with linear normalization, we can generate normalized
values that fall within a certain range (such as between 0 and 1). Instead of using a
constant to normalize the values, however, we can use a normalizing function . The
specifics of how we would go about this vary widely depending on the type of for-
mula we are using. The end requirement is that our values lie within a specified range.
I N T HE G AME
Are We There Yet?
One of the examples we used earlier in Chapter 8 was building squads and armies.
We used this example to show the effects of marginal utility—both increasing and
decreasing. However, as with the weight example above, it could be awkward to
constantly change the marginal utility formula based on a differing number of sol-
diers. At times, we may want to achieve a threshold of having four soldiers. At
other times, for other tasks, we may want 10. For bigger, more aggressive jobs, we
could say that 20 is enough. Even changes in the difficulty level of the game could
warrant having slightly different numbers.
To accommodate these variable requirements, we need to normalize our mar-
ginal utility curve so that it scales to the number of units we are trying to create. We
begin by deciding that our utility values for each soldier will range from 0 to 1.
More accurately, they will range from 1 down to 0 as we add additional soldiers. We
then set the utility of the n th soldier to the following formula, with goal being the
number of soldiers that we will be satisfied with acquiring.
Search WWH ::




Custom Search