Game Development Reference
In-Depth Information
resources at a steady rate, while others consume resources at random rates or inter-
vals. You can also make a drain consume everything its input resource connection is
attached to by labeling the resource connection with all. (A toilet is a good example:
When flushed, it drains all the water in the cistern, no matter how much it is.) You
could in principle represent a drain as a pool with no outputs, but to indicate that
the resources that flow to a drain are consumed and have no further impact on the
game, it is better to use a drain node.
FIGURe 5.19
drains
Drains are useful for representing processes that remove resources from an economy
permanently. This might include the effect of wear or friction in a physical system
or the consumption of ammunition when a weapon is fired in a shooter game.
Converters
Converters convert one resource into another. They are represented as a triangle
pointing to the right with a vertical line through it ( Figure 5.20 ). Converters are
designed to model things like factories that turn raw materials into finished prod-
ucts. A windmill, for example, turns wheat into flour. Converters act exactly as a
drain that triggers a source, consuming one resource to produce another. As with
sources and drains, converters can have different types
of rates to consume and produce resources as specified by their inputs and outputs.
For example, a converter representing a sawmill might turn one tree into 50 boards
of lumber.
FIGURe 5.20
converters
Since converters are constructed from drains and sources, it is possible to create a
special construction that might be called a limited converter that can produce only a
limited amount of something as its output. A limited converter is the combination
of a drain and a limited source. Figure 5.21 shows two equivalent alternatives to
construct a limited converter.
FIGURe 5.21
Two ways to build a
limited converter
 
Search WWH ::




Custom Search