Game Development Reference
In-Depth Information
In our computer plus warranty example, the values we used were either based
on the cost of something (i.e., money) or the percentage chance that something
would happen. By limiting the value references to money, we don't have to concern
ourselves with converting between two different types of values. For the sake of
continuity, we will stick with that formula here to best mimic the warranty example.
It is a staple of real-time strategy (RTS) games to construct buildings of some
sort for whatever reason. These buildings cost money to produce and are, therefore,
a valuable commodity much like the computer. Once we have spent the money for
the building—let's just say it is a barracks—we would rather not lose the building
by having it damaged or destroyed by the enemy. Put simply, we want to keep our
investment intact. To do so, it may behoove us to protect our investment against
damage or destruction.
One common method of protecting buildings in a game such as this is to build
defensive structures such as towers. A tower could repel invaders that would seek to
damage our building. Of course, towers also cost money to build. Spending money on
a tower is a big decision because the money could be spent elsewhere, for example,
on more military or on other, more productive buildings. So, what sorts of factors
must go into our decision to build an accompanying tower hovering over our
beloved barracks?
Certainly, we must have a value associated with the construction of our barracks.
How much did it cost us? We can assume that a total destruction of the barracks
would require a replacement cost that is equal to the original construction cost. We
can also assume that there is a cost of repairing any damage that is done to the bar-
racks. Therefore, we should be able to assign a cost of repairing the damage done to
the barracks with or without the tower present. Of course, for all of this benefit that
the tower provides, we need to know what the cost of building a tower is.
Once the values of building and repair are established, we also need to know
what the likelihood of the barracks being attacked is. We will assume that the bar-
racks could be attacked by a small force, a large force, or not at all. If the tower is
present, the difference between the two sizes of attacking forces is reflected in the
amount of damage done. If there is no tower, a large force will destroy the barracks,
whereas a small force will only damage it heavily before they are driven off.
We must note that this is different from our warranty example in that, with a
warranty in place, we paid nothing for a repair or replacement. The only cost was
that of the warranty itself. In this case, some of the entries represent the cost of the
tower plus the cost of damage done despite the presence of the tower.
Search WWH ::




Custom Search