Game Development Reference
In-Depth Information
Pools and Resources
The most basic node type in a Machinations diagram is the pool . A pool is a location
in the diagram where resources gather. Pools are represented as open circles, while
the resources that are stored in a pool are represented as smaller, colored circles that
stack on them ( Figure 5.2 ). If there are too many resources in a pool to show them
as stacks, the tool displays a number instead.
T IP You can change
the threshold at which
the tool switches from
displaying stacks to
displaying numbers in
a pool. With the pool
highlighted, enter a
value in the display
Limit box at the side
panel. The default is
25. if you enter a value
of zero, the pool will
always display a num-
ber, unless it is empty.
You can set a different
value for each pool you
create.
FIGURe 5.2
Pools and resources
Pools are used to model entities. For example, if you have a resource called money
and an entity called the player's bank account, you would use a pool to model the
bank account. Note, however, that pools cannot store fractional values, only integers.
The bank account would have to contain only whole dollars or to be characterized
in terms of cents rather than dollars.
Machinations uses different colors to distinguish among different types of resources.
A pool can contain resources of more than one type, which means that it can
be used to model compound entities. However, until you are familiar with the
Machinations framework, it is best not to mix different resources in a single pool.
It is easier to have separate pools to, for instance, represent the health, energy, and
ammunition of a single player, than it is to have one pool with different colored
resources to represent all of them.
Resource Connections
Individual resources can move from node to node through a Machinations diagram
along resource connections that are represented as solid arrows connecting the nodes
of the diagram ( Figure 5.3 ).
FIGURe 5.3
resource connections
Resource connections can transfer resources at different rates . A label beside the
resource connection indicates how many resources can move along the connection
in a single time step. If a resource connection has no label, its rate is considered
to be 1. You can also make a resource connection transfer an unlimited number of
resources in a single time step by using the word all as the resource connection's label.
To help you see how an internal economy works, the Machinations Tool shows
the resource flow by animating the movement of the resources along the resource
connections. When the tool runs, you will see the resources traveling along the con-
nection lines from one node to another.
 
Search WWH ::




Custom Search