Game Development Reference
In-Depth Information
This point exposes the fact that these optimizations are very situation-dependant.
In general, we can follow these rules:
Any change to a bucket size:
Rebuild edges
Large changes to bucket sizes:
Re-sort vector
Change in lopsided distribution:
Recalculate starting bucket
By no means is the above an exhaustive list. Depending on the number of ele-
ments in a vector, the relative sizes of the elements, the nature of the data, and even
how often the data is changed or accessed, we can select our optimization and search
methods to provide the best possible response.
For example, the only time that we would want to re-sort the vector and change
the start bucket is if we are dealing with very large data sets (e.g., hundreds of buck-
ets) or are doing many searches on a data set that changes rarely (or both). In either
case, we can see some minor gains in performance. However, we need to be aware
that the sort and recalculate optimizations should happen very rarely lest we give
back the gained time through the time it takes to perform the actual optimization.
H AND -C RAFTED R ESPONSE C URVES
Other than the occasional manual tweak, we have generated most of the response
curves in this chapter through a function of some sort. This is not a necessary lim-
itation. It is not only possible, but very useful to hand-craft a distribution to match
a desired effect.
Thinking back to our five dentists, we manually created a two-bucket response
curve representing the two bits of masticatory advice a dentist could offer to us:
sugarless gum or sugared gum. We also manually set our two sizes of four and one,
respectively to simulate the legendary “four out of five dentists surveyed� phenom-
enon. We also used this same approach to model the four types of guessers in the
Guess Two-Thirds Game. These are very small examples of hand-crafted distribution.
Applying this process to a more extreme example, rather than go through the
great pains that we went to in Chapter 11 to model the results of the Guess Two-
Thirds contest run by the University of Copenhagen that we explored in Chapter 6,
we could craft a 101-bucket response curve that exactly duplicated the results of the
study. Rather than breaking down the four groups and then modeling the distrib-
ution of the guesses for each group, we can simply create a single response curve
that holds the data for all 101 possible selections. By sizing the buckets according to
how the results appeared in the actual contest, we can generate a strikingly similar
distribution.
 
Search WWH ::




Custom Search