Game Development Reference
In-Depth Information
Figure 5.13 illustrates a node with two modifiers. The number of resources in C will
be equal to three times the number in A, minus two times the number in B.
FIGURe 5.13
node modifiers
affect the number of
resources in a pool.
Node modifiers can have labels that are fractions, for example +1/3 or -2/4. In this
case, the number of resources of a target node is modified by the value indicated by
the fraction's numerator every time there is a change to the number of resources on
the origin divided by the fraction's denominator and rounded down. Thus, when
the number of resources on an origin node changes from 7 to 8, the number of
resources on the target is lowered by 2 if the modifier is -2/4, but if the modifier is
+1/3, the number of resources on the target node does not change.
This sounds complex, but a simple example of the use of node modifiers can be
found in a real game. In The Settlers of Catan, players gain one point for every village
in their possession and two points for every city in their possession. The number of
villages is one origin node, the number of cities is a second origin node, and both
modify the target node, which is the player's number of points.
TriGGers
Triggers are state connections that connect two nodes or connect an origin node to
the label of a resource connection. Triggers are identified by their label, which is an
asterisk (*). Triggers do not change numeric values the way label and node modifi-
ers do. Rather, a trigger fires when all the inputs of its origin node become satisfied: :
when each input brings in the number of resources to the node as indicated by its
flow rate. A firing trigger will in turn fire its target. When the target is a resource
connection, the resource connection will pull resources as indicated by its flow rate.
A node that has no inputs will fire outgoing triggers whenever it fires (either auto-
matically or in response to a player action or to another trigger).
NOTE Triggers are
commonly used to fire
passive nodes that do
nothing until the trig-
ger fires them. This
enables you to set up
a passive node that
fires only when certain
circumstances arise in
the game.
Triggers are commonly used in games to react to the redistribution of resources. For
example, in Monopoly players might transfer money to the bank in order to trigger
the transfer of property from the bank into their possession. This can be represented
as the diagram in Figure 5.14 .
 
Search WWH ::




Custom Search