Game Development Reference

In-Depth Information

paths are derived from the baseline by varying where possible, returning to the base-

line path and following it to reach the OUT Terminator. The process continues until

all flows in the diagram are used at least once.

Baseline paths are more comprehensive than minimum paths, but still more econom-

ical than trying to cover every possible path through the diagram. They also introduce

small changes from one path to another, so a game defect can be traced back to the

operations that were different between the paths that passed and the one(s) that failed.

One drawback of baseline paths is the extra effort to generate and execute the paths

versus using the minimum path approach.

Still using the TFD in Figure 11.13, create a baseline path starting at the IN box and

then traveling across the most number of states you can in order to get to the OUT

box. Once you get to the
NoGunNoAmmo
state from flow 1, the farthest distance to the OUT

box is either through
HaveGun
and
HaveGunHaveAmmo
or through
HaveAmmo
and

HaveGunHaveAmmo
. Take the
HaveGun
route by taking flow 2, followed by flow 4, and exiting

through flow 13. This results in the baseline path of 1, 2, 4, 13.

The next thing to do is branch wherever possible from the first flow on the baseline.

These are called “derived�? paths from flow 1. Flow 2 is already used in the baseline, so

take flow 9 to
HaveGunHaveAmmo
. From there flow 8 puts you back on the baseline path.

Follow the rest of the baseline along flows 2, 4, and 13. The first derived path from

flow 1 is 1, 9, 8, 2, 4, 13.

Continue to check for other possible branches after flow 1. Flow 11 comes out from

NoGunNoAmmo
and has not been used yet so follow it to
HaveAmmo
. Then use flow 10 to

return to the baseline. Finish this path by following the remainder of the baseline to

the OUT box. This second path derived from flow 1 is 1, 11, 10, 2, 4, 13.

At this point there are no more new flows to cover from
NoGunNoAmmo
, so move along the

next flow on the baseline, which is flow 2. Stop here and look for unused flows to fol-

low. You need to create a path using flow 3. Since it comes right back to the
HaveGun

state, continue along the remainder of the baseline to get the path 1, 2, 3, 4, 13. The

only other flow coming out of
HaveGun
is flow 7, which puts you right back on the base-

line at flow 2. The final path derived from flow 2 is 1, 2, 7, 2, 4, 13.

Now on to flow 4! Flow 4 takes you to
HaveGunHaveAmmo
, which has three flows coming

out from it that aren't on the baseline: 5, 6, and 8. We already used flow 8 in an earli-

er path, so there is no obligation to use it here. Flows 5 and 6 get incorporated into

your baseline the same way since they both go back to the
HaveGun
state. The derived

path using flow 5 is 1, 2, 4, 5, 4, 13 and the derived path for flow 6 is 1, 2, 4, 6, 4, 13.