Game Development Reference
In-Depth Information
FIGURe 5.24
eating dots to score
points
In the real game, Pac-Man eats dots 100% of the time until he returns to a place he
has already been, at which point he eats dots 0% of the time. We had to approxi-
mate this somehow, so we used a diminishing probability of successfully eating a
dot every time the Eat Dot converter is clicked. In our model, the probability of eat-
ing a dot is initially set to 100%, modified by a label modifier that reflects changes
in the Dots pool. If the number of dots in the Dots pool changes between one time
step and the next, that change is multiplied by the label on the state connection,
and the result is applied to the percentage on the resource connection. When a dot
is consumed (say, from 50 dots to 49), the change in the state of the Dots pool is -1.
Multiply that by +1% and you get -1%, and that reduces the probability of success-
fully eating a dot by 1% on the next time step.
T IP don't be confused
by the fact that the
probability of success-
fully eating a dot goes
down even though the
state connection that
controls it is labeled
+1%. remember that
the function of the state
connection is to trans-
mit the change in its
origin pool (multiplied
by its label). Because
in this case the change
is always negative,
the state connection
actually transmits a
negative value.
The process of creating these approximations is one of the trickier aspects of mod-
eling a game with Machinations, and you have to think carefully about what your
decisions mean. We chose numbers that feel good to us, but we could have used
others. For example, we could have chosen a rate of change of 0.25% instead of 1%
for successfully eating a dot. This would represent a very skilled player who spends
little time in parts of the maze where he has already been—he's eating new dots
most of the time.
In some respects, it's easier to model a new game than an existing one. When you
use Machinations to design a new game, you can set up anything you want. The
tool's greatest strength is that you can experiment and adjust the details as much
as you like.
The Fruit Mechanism
The fruit mechanism ( Figure 5.25 ) works similarly to the dot mechanism. However,
in contrast to dots, a fruit will appear from time to time and disappear automati-
cally if Pac-Man doesn't eat it. These extra mechanics are represented by the source
and the drain that are connected to the fruit pool. The fractional rates indicate that
the fruit source produces a fruit once every 20 iterations and is drained once every
5 iterations. This means a fruit will appear once every 20 iterations and disappear 5
iterations later. The interactive node that represents the Eat Fruit action has a fixed
chance of 50% to actually succeed. This approximates the difficulty of catching the
fruit as it moves through the maze. However, eating a fruit will produce 5 points
instead of 1 as eating a dot does.
NOTE in the real
game, fruit appears
only twice in a level
and offers an escalating
number of bonus points
depending on which
level it is. We don't
implement multiple lev-
els of the game, so we
made the fruit process
shorter, simpler, and
more frequent so that it
is easier to observe.
 
Search WWH ::




Custom Search