Gamasutra is part of the Informa Tech Division of Informa PLC

This site is operated by a business or businesses owned by Informa PLC and all copyright resides with them. Informa PLC's registered office is 5 Howick Place, London SW1P 1WG. Registered in England and Wales. Number 8860726.

Gamasutra: The Art & Business of Making Gamesspacer
The Designer's Notebook: Machinations, A New Way to Design Game Mechanics
arrowPress Releases
June 14, 2021
Games Press
View All     RSS

If you enjoy reading this site, you might also want to check out these UBM Tech sites:


The Designer's Notebook: Machinations, A New Way to Design Game Mechanics

August 16, 2012 Article Start Previous Page 2 of 3 Next

State Changes

The state of a Machinations diagram refers to the current distribution of resources among its nodes. When the resources move from one place to another, the state changes. In the Machinations framework, you can use state changes to modify the flow rates of resource connections. In addition, you can trigger nodes to fire, or activate or deactivate them, in response to changes in resource distribution.

To make this possible, Machinations offers a second class of connections called state connections. State connections indicate how changes to the current state of a node (the number of resources in it) affect something else in the diagram.

State connections are shown as dotted arrows, leading from the controlling node and going to a target, which can be either a node, a resource connection, or, rarely, another state connection. Labels on the state connection indicate how it changes the target.

There are four types of state connections that are characterized by the type of elements they connect and their labels. The four types are label modifiers, node modifiers, triggers, and activators. In this condensed version of the chapter, we'll concentrate on two: label modifiers and activators.

Label Modifiers

Remember that a label on a resource connection determines how many resources can move through that connection in a given time step. Label modifiers connect an origin node to a target label of a resource connection (or even another state connection).

A label modifier indicates how state changes in the origin node modify the current value of the target label at the current time step as indicated by the state connection's own label. The new value takes effect in the next time step. The amount of the change in the origin node is multiplied by the label multiplier's own label.

So, if the label modifier says +3 and the origin node increases by 2, then the target label will increase by 6 in the next time step (it will add 3 twice, once for each change in the origin node). However, if the label modifier says +3 and the origin node decreases by 2, then the target label will decrease by 6.

The blue dotted line is a label modifier.

The label of a label modifier always starts with a plus or minus symbol. For example, in the figure above, every resource added to pool A adds 2 to the value of the resource flow between pools B and C. Thus, the first time B is activated, one resource flows to A and three resources flow to C. The second time, one resource still flows to A, but now five resources flow to C.


Activators connect two nodes. They activate or inhibit their target node based on the state of their origin node and a specific condition. The activator's label specifies this condition. Conditions are written as an arithmetic expression (for example, ==0, <3, >=4, or !=2) or a range of values (for example, 3-6). If the state of the origin node meets this condition, then the target node is activated (it can fire). When the condition is not met, the target node is inhibited (it cannot fire).

Advanced Node Types

Pools are not the only possible nodes in a Machinations diagram. In this section, we will describe several more types of nodes that you can use, including special nodes for the four economic functions (sources, drains, converters, and traders) that I originally described in Fundamentals of Game Design.


In contrast to a pool, a gate does not collect resources. Instead, it immediately redistributes them. Gates are represented as diamond shapes that often have multiple outputs. Instead of a flow rate, each output is labeled with a probability or a condition. The first type of outputs are referred to as probable outputs while the others are referred to as conditional outputs. All outputs of a single gate must be of the same type.

Probabilities can be represented as percentages (for example, 20 percent) or weights indicated by single numbers (for example, 1 or 3). In the first case, a resource flowing into a gate will have a probability equal to the percentage indicated by each output. The sum of these probabilities should not add up to more than 100 percent. If the total is less than 100 percent, there is a chance that the resource will not be sent along any output and be destroyed instead.

In the case of weights, the chance that a resource will flow through a particular output is equal to the weight of that output divided by the sum of the weights of all outputs of the gate. In other words, if there are two outputs, one with a weight of 1 and the other with a weight of 3, the chance that a resource will flow out the first one is 1 in 4, and the chance that it will flow out the second one is 3 in 4.

An output is conditional when it is labeled with a condition (such as >3 or ==0 or 3-5). In this case, all conditions are checked every time a resource arrives at the gate, and one resource is sent along every output whose condition is met. The conditions might overlap; this can lead to duplication of resources or, when no condition is met, to the destruction of the resource.

Gates have one of two distribution modes: deterministic distribution and random distribution. A deterministic gate will distribute resources evenly according to the distribution probabilities indicated by percentages or weights if it has probable outputs. When it has conditional outputs, it will count the number of resources that have passed through it every time step and will use that number to check the conditions of its outputs. (It can be convenient to think of a deterministic gate with conditional outputs as a counting gate.) Note that the count starts over each time step, so if one resource arrives, a deterministic gate has no special symbol and is represented as a small open diamond.

A random gate generates a random value to determine where it will distribute incoming resources. When it has probable outputs, it will generate a suitable number (either a value between 0 percent and 100 percent or a number below the total weights of the outputs). When its outputs are conditional, it will produce a value between 1 and 6 to check against the conditions, just as if the diagram rolled a normal six-sided die. Random gates are marked with a die symbol.

Gates are very powerful and include a number of other features that we don't have room to discuss here. Below are a few types of gates.


Sources are nodes that create resources. They are represented as a triangle pointing upward. Like any other node in a Machinations diagram, sources can be automatic (the default), interactive, passive, or it can activate once before a diagram starts. An example of an automatic source is the steady regeneration of the protective shields of the player's star fighter in Star Wars: X-Wing Alliance. The action to build armies in Risk would be modeled as an interactive source of armies, and passing Go in Monopoly would be a passive source of money that is triggered by a game event. The rate at which a source produces resources is a fundamental property of a source and is indicated by the flow rates of its outputs.


Drains are nodes that consume resources; a resource that goes into a drain disappears permanently. The Machinations framework includes a special drain node represented as a triangle pointing downward. The rate of a drain is determined by the flow rate of its input resource connection. Some drains consume resources at a steady rate, while others consume resources at random rates or intervals. You can also make a drain consume everything its input resource connection is attached to by labeling the resource connection with all.


Converters convert one resource into another. They are represented as a triangle pointing to the right with a vertical line through it. Converters are designed to model things like factories that turn raw materials into finished products. 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.


Traders are nodes that cause resources to change ownership when fired: Two players could use a trader to exchange resources. Machinations diagrams represent a trader as a vertical line over two triangles that point left and right. Use traders when a given number of resources of one type is exchanged for (not converted into) a given number of another type. This is ideal for any situation that resembles shopping: the merchant receives money, and the customer receives goods in a stated proportion (the price). If either the merchant or the customer does not have the necessary resources, the trade cannot take place. Fallout 3, in which all traders' supplies are limited, is a good example.

An interactive trader (note the doubled lines). When clicked, it exchanges three red resources for two blue ones.

Putting It Together

That's the end of the excerpt from chapter 5 of Game Mechanics, but I now want to show you a few things you can make with Machinations. Here's a diagram that shows all of the elements I introduced earlier.

Several of the Machinations elements.

Going from left to right, we have an automatic source (the * next to the source designates it as automatic), which initially generates 2 resources every time step, and sends them to a passive pool. The pool is the origin of a state connection (the dotted arrow) that reduced the label on its input resource connection by 0.1 for each arriving resource. After 20 iterations, the label will be down to zero and the source won't send any more.

The pool is connected to an interactive converter that takes three resources in and converts them to five whenever it is clicked. The five output resources then go into a random gate that sends 25 percent of them back to the pool, and 75 percent to a drain, where they disappear. The trader off to the right is not yet hooked up to anything.

Article Start Previous Page 2 of 3 Next

Related Jobs

innogames — Hamburg, Germany

Junior Game Designer - Elvenar - Event Design & Live Ops
California College of the Arts
California College of the Arts — San Francisco, California, United States

Unranked, Adjunct Faculty, Animation Program
Insomniac Games
Insomniac Games — Burbank, California, United States

Technical Artist - Pipeline

Loading Comments

loader image