Game Development Reference
Another example of this type of tree is the job trees defined for each of the character
races in Final Fantasy Tactics Advance (FFTA). Characters must develop a certain
number of skills at one or more jobs before new job choices and their corresponding
skills become available. For these kinds of trees think of the string of lights on a
Christmas tree—the ones that won't light up if any of the individual lights is faulty. In
this case, the job won't become available if any of the preconditions is not met. You
find the faulty light by replacing each one until the string lights up again. Likewise,
there should be a set of tests for this tree that leaves out each precondition one at a
time, plus a test where they are all satisfied.
The new settings and behaviors should be checked each step along the way. In addition
to checking that the job is available at the end of the tree, also check that it does not
become available prematurely before all of the necessary conditions have been met.
Most of the FFTA job paths are straightforward. The Blue Mage and Illusionist jobs
are not available until you require your character to learn abilities from two other
jobs—White Mage and Black Mage. These job trees for Human characters are shown
in Figure 13.4.
Figure 13.4 Blue Mage and Illusionist job trees for Humans in FFTA.
Define the tree feature tests for a particular job by providing the test values for each
of the nodes along the tree branches. Tables 13.1 and 13.2 show the test case you
should end up with for the trees in Figure 13.4.