Delays & Queues

4 min read

In many games, producing, consuming, and trading resources takes time. The time it requires to complete an action might be crucial for the game balance – think about all the games out there with a time-based economy.

Properties

Select a Delay to adjust it in the Properties panel on the right. The panel shows its label and note and its Trigger. Color, line width and text style are on the floating toolbar that appears above a selected node.

As with any other Node in a Machinations diagram, the Trigger is a row of five buttons: Agentic, Auto, On enable, Passive and On click. Read Trigger Mode to see how each choice affects activation. A new Delay starts as Passive.

Delay and Queue are two entries in the same toolbar menu: click the small arrow next to the hourglass button at the top of the canvas and choose Delay or Queue. The Properties panel of a Delay no longer has a Delay or Queue switch.

Delay properties panel with the label, a note line, the Behavior summary and the Trigger buttons: Agentic, Auto, On enable, Passive and On click.Delay properties panel with the label, a note line, the Behavior summary and the Trigger buttons: Agentic, Auto, On enable, Passive and On click.

Delays

Tip

The Delay button in the toolbarThe Delay button in the toolbarDelays (Q) can be used to delay the flow of Resources as they get distributed in your diagram. To get a Delay or a Queue, choose it from the arrow menu next to the hourglass button on the toolbar.

A Delay, and a Queue, shows the Resource types that can reach it as small marks in its corner. A Delay can process multiple Resources simultaneously. This means that all incoming Resources are delayed for the specified number of time steps regardless of the number of Resources currently being delayed.

Warning

The Formula on the Delay’s output connection indicates how many time steps a Resource is delayed.

Please note that this differs from most Formulas on Resource Connections, which ordinarily represent a flow rate.

This delay time is dynamic, and can be changed by other elements in the diagram via Formula Modifiers.

Examples for Delay

Please play the below Delay example diagram Step by Step. Notice the counter in the play bar (next to the Reset Button) and the flow of Soldiers through the model. It takes 5 steps to train a Soldier.

Here’s the step-by-step rundown:
Step 1: 3 Gold pieces are converted into a Soldier & sent to the Training facility (Delay node)
Step 2: First Soldier is in training (delayed), and a Second Soldier is commissioned  
Steps 3-5: both Soldiers are in training (delayed)
Step 6:  First Soldier is pushed to the Soldiers’ Pool. The second is still in training
Step 7: The Second Soldier is sent to the Soldiers’ Pool

Note

Other elements in the diagram can change the Delay setting through Formula Modifiers or triggers.

You may also specify a random delay time using the dice notation or parameters (called custom variables in older guides).

Check out the Buffer diagram below.

Here’s the step-by-step rundown for a Delay node with a Buffer Mechanic:
Step 1: 3 Gold pieces are converted into a Soldier & sent to the Training facility (Delay node)
Step 2: The First Soldier is in training (delayed). The State Connection checks if the Delay is empty. As long as a resource is held in the Delay, the Converter will be disabled, and no more soldiers can be trained.
Steps 3-5: Only the First Soldier is in training (delayed), and the Second Soldier waits until the Training facility is unlocked.
Step 6: The First Soldier completes the training, and it is pushed to the Soldier’s Pool
Step 7: Since the Training facility is now empty, the State connection is True, and the Second Soldier is sent to the Training facility by spending 3 gold pieces.
Steps 8-11: The Second Soldier is in training
Step 12: The Second Soldier is sent to the Soldiers’ Pool

Queues

Tip

The Queue button in the toolbarThe Queue button in the toolbarQueues (Q) processes only one Resource at a time. Choose Queue from the arrow menu next to the hourglass button on the toolbar.

Examples for Queue

In the Queue example below, play the diagram (Step by Step). In this case, orders from Build are queued and processed one at a time every 5 Time Steps.

Step-by-step rundown:
Step 1: 3 Gold are converted into the First Soldier & sent to the Training facility (Queue)
Step 2: The First Soldier is being trained (queued) for 1 step. Another 3 Gold are converted into the Second Soldier & sent to the Training facility (Queue), but their training has not started
Step 3-5: The First Soldier is being trained & the Second Soldier awaits in the queue
Step 6: The First Soldier gets pushed to the Soldiers’ Pool & the Second Soldier starts their training
Step 7-10: The Second Soldier is in training
Step 11: The Second Soldier gets pushed to the Soldiers’ Pool

Note

Delays and Queues can use State Connections that communicate the number of Resources they are currently processing (including the number of Resources waiting in a Queue to be processed).

See diagram below.