Game Development Reference
In-Depth Information
Now, most of us will recognize this exercise as not much more than the word
problems that were so maligned back when we were in math classes in school. (I
never understood why people griped about the word problems so much. I kinda
liked them! But then again, here I am writing a book on the mathematics of game
AI.) Just like those word problems, the trick is putting things into their proper
frame of reference.
For instance, we know by the rules of the game that a warrior takes three turns
to produce. We also know that it takes five turns to produce our settler unit. For the
sake of visualization, let's assign those to variables.
Time to produce a warrior:
TW = 3
Time to produce a settler:
TS = 5
If we were to produce our settler and warrior exploration team, it would take
us eight turns:
Subtracting that from the 20 turns during which we know we are going to be
safe from attack leaves us with 12 turns. If we were to take the remaining 12 turns
and build nothing but warriors, could we make our quota of four to have a suitable
defense when the attacks come? I don't mean to be pedantic about this. I know we
have all done this in our heads about three paragraphs ago. I'm merely trying to
express a point… bear with me.
To do that, we need to express the equation not in terms of turns per warrior,
but in terms of warriors per turn. Knowing that it takes three turns to produce a
warrior, we know that we can produce one-third of a warrior per turn. Twelve
turns of producing one-third of a warrior each gives us the following:
So, it would seem that we will be able to complete our four warriors in time for
that magical twentieth turn deadline.
Search WWH ::




Custom Search