Game Development Reference
In-Depth Information
Given the above functions, we could set the appropriate values and call the
function PurchaseWarranty() to get our answer at any time. In this case, we are
using the values from the original example.
// Set the appropriate values
mComputerPrice = 1400;
mWarrantyPrice = 300;
mRepairCost = 200;
mRepairOdds = 0.2f;
mReplaceOdds = 0.1f;
bool ShouldWeGetWarranty;
// So, should we purchase the warranty
// with the values set above?
ShouldWeGetWarranty = PurchaseWarranty();
Relative Utility
As simple and comprehensive as the above solution seems to be, there is another
factor we have yet to consider with our warranty purchase. We have left out the no-
tion of the utility that an individual may place on a working computer. How much
is it worth to us to avoid downtime on a computer? How much is that computer an
integral part our lives? If it breaks and we cannot fix it, are we in dire need?
I know that if my computer were to break, my entire life would be on hold until
such time as it was repaired or replaced. A warranty is a necessity for me. (In fact, I
happen to have next day, on-site with accidental damage coverage… I can get my
computer repaired or replaced faster than I can get in to see my doctor.) On the
other hand, my mother would probably not even realize something was wrong
with her computer for months. She can spend that money elsewhere on things that
she can actually get usage out of.
These sorts of ruminations get a little beyond the scope of this chapter. We will
attempt to approach this level of depth later on in the topic.
I NTHE G AME
Protecting the Barracks
While the above scenario is a familiar one to us in real life, I am not aware of too
many games where the AI agents purchase a computer, much less have to decide
whether or not to purchase a warranty for it. However, by using a little creativity it
is not hard to envision a scenario in which the concept is easily applied.
 
Search WWH ::




Custom Search