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
  • 1. Direct Commands
  • 1.1 Fire Node:fire(node)
  • 1.2 Fire Multiple Nodes: fireAll(node, node...)
  • 1.3 Fire Sequence of Nodes
  • 2. If Statements

Artificial Player

PreviousEnd ConditionsNextActivation Modes

Last updated 5 years ago

Note: machinations.io does not have an Artificial Player Node. However, most situations solved with the AP Node in the original version, may be modelled with existing Components.

This article deals with a few examples of how to to this.

1. Direct Commands

1.1 Fire Node:fire(node)

Fire a specific Node on the diagram

1.2 Fire Multiple Nodes: fireAll(node, node...)

Fire multiple Nodes simultaneously

1.3 Fire Sequence of Nodes

1.3.a In order: fireSequence(node, node...)

1.3.b Randomly:fireRandom(node, node...)

2. If Statements

You can emulate conditional commands like if(condition)commandusing multiple components.

Here's a simple example of how to emulate if(pool>2)fire(source)

Here's such an example: if(pool>3&&pool<8)fire(source)

The passive Register verifies if the value "a" - equal to the number of Resources in "pool" at every time-step - is larger than 3 and smaller than 8. This returns a binary result (1-true; 0-false). As long as the value of the passive Register is >0, "source" is active and produces resources.

Here's how to emulate theif(Resources>4) fireRandom(Consume, Upgrade) example

The Pool Resources fills with more than 4 Resources before randomly choosing between a Consume or Upgrade action, with a probability of 30% by 70%, respectively.

To emulate the statement above, use a . Note that the order in which the gate sends Resources along its outputs is determined by the order in which these outputs were added to the diagram.

To fire multiple Nodes randomly, use a to trigger each Node and balance the probability with which each Node is fired, to fit your needs.

If you're trying to model a more complex if statement, you can use to calculate conditions. Note that in machinations.io Registers support all math.js functions.

Studying Game Mechanics: Advanced Game Design, "Chapter 8: Simulating and Balancing Games - Artificial Players in Machinations" (Dormans, Adams, 2012)?

📚
👩‍🎓
💡
Registers
💡
Deterministic Sorting Gate with weighted outcomes
Random Sorting Gate with probable outcomes