Machinations Documentation
  • What is Machinations?
  • ☉Getting Started
    • Explore
    • Interface
    • Framework Basics
    • How-To Videos
  • ▷ Simulations
    • Run Modes
    • Charts
  • ⦽ Basic Nodes
    • Pools
    • Sources
    • Drains
  • ⇢ Connections
    • Resource Connections
    • State Connections
      • Label Modifiers
      • Node Modifiers
      • Triggers
      • Activators
    • Labels
  • ⧰ Advanced Nodes
  • Converters & Traders
  • Gates
    • Sorting Gates
    • Trigger Gates
    • Mixed Gates
  • Registers
    • Math.js Functions
  • Delays & Queues
  • End Conditions
  • Artificial Player
  • ✑ Nodes Properties
    • Activation Modes
    • Pulling & Pushing Resources
    • Filter (Colour Coding)
  • ⚯ Collaboration
    • Live Collaborative Editing
    • Public Diagrams
    • Google Sheets
    • Tags
  • ♔ Accounts
    • User Profile
    • Pricing
    • Billing Policy
    • Team Management
  • ☆ Tips
    • Shortcuts
    • Best Practices
  • ⚙️Unity Plugin (UP) & API
    • Game Engine Plugin
    • Quick Start
    • Main Concepts
    • Real-Time Sync
    • Unity Integration Guide
    • Known Issues
    • Key Features
      • Game-Aware Analytics
      • Local Cache
      • Game State Awareness
      • Data Formats & Handoff
  • ≏ Evolution
    • Changelog
    • Framework Diff Log
  • 〄 Localisations
  • 🇷🇺 RU by Lev "evlko" Kobelev
Powered by GitBook
On this page
  • Delays
  • Queues

Delays & Queues

delay and queue up Resource flows

PreviousMath.js FunctionsNextEnd Conditions

Last updated 4 years ago

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.

Same Node, 2 actions:

Delays

In a Machinations diagram, use a Delay Node to delay the flow of Resources as they get distributed in your diagram.

A delay is represented by a small circle with an hourglass inside.

Note that this is different from most Labels on Resource Connections, which ordinarily represent a flow rate.

This time is dynamic, it can be changed by other elements in the diagram via Label Modifiers.

Here's the step by step rundown: Step 1: Three Gold are converted into a Soldier & sent to Delay Steps 2 - 6: the Soldier is delayed Step 7: Resource gets pushed to the Soldiers Pool.

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.

Other elements in the diagram can change the delay setting through label modifiers.

Or you can specify a random delay time using dice notation.

Queues

Delays can be turned into Queues. A Queue has 2 hourglass symbols instead of one.

Queues process only one Resource at a time.

Step by step rundown: Step 1: Three Gold are converted into a Soldier & sent to Queue Step 2: Initial Soldier is being Queued for 1 step. Another three Gold are converted into a Soldier & sent to Queue Step 3-5: the first Soldier is delayed & the second Soldier waits in queue Step 6: the first Soldier gets pushed to the Soldiers Pool & the second Soldier starts being delayed Step 6-10: the second Soldier is delayed Step 11: the second Soldier gets pushed to the Soldiers Pool

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).

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

In the example below, notice the count of running steps in the bottom right corner, and the flow of the Soldiers Resource. It is delayed by 5 steps.

In the example below, notice the counter of running steps in the bottom right corner, and the flow of the Soldiers Resource. In this case, orders from Build are queued and processed 1 at a time, every 5 steps.

🔧
🔧
Label