EGOS Docs
Introduction
EGOS Homev1.0
  1. Docs
  2. Egos Cloud
  3. Game Engine

Game Engine

Previous

Architecture

Next

Controller Overview

    Game Engine

    Understanding the EGOS logic and game engine

    3 min read

    Game Engine

    The EGOS Game Engine is a powerful visual programming system that executes your game logic in real-time.

    Core Concepts

    Logic Flows

    Flows are the building blocks of game logic. Each flow consists of:

    • Trigger - What starts the flow
    • Conditions - Optional checks before execution
    • Actions - What happens when the flow runs

    Node Types

    Triggers

    TriggerDescription
    Component State ChangedDevice input detected
    Variable ChangedVariable value updated
    Timer FiredScheduled event
    Game StartedGame session begins

    Conditions

    ConditionDescription
    Compare ValuesCheck if values match
    ExpressionCustom JavaScript expression
    All/AnyCombine multiple conditions

    Actions

    ActionDescription
    Set Component StateChange device output
    Set VariableUpdate game variable
    DelayWait before continuing
    Execute FlowRun another flow

    Visual Editor

    The flow editor provides:

    ┌──────────────────────────────────────────┐ │ Flow: "Button Controls LED" │ ├──────────────────────────────────────────┤ │ │ │ ┌─────────┐ ┌─────────┐ │ │ │ Trigger │────▶│ Action │ │ │ │ Button │ │ Set LED │ │ │ │ Pressed │ │ ON │ │ │ └─────────┘ └─────────┘ │ │ │ └──────────────────────────────────────────┘

    Keyboard Shortcuts

    • Ctrl + Click - Add connection
    • Delete - Remove selected node
    • Ctrl + Z - Undo
    • Ctrl + S - Save flow

    Variables

    Variables store game state:

    // Example variable usage { "puzzlesSolved": 3, "timeRemaining": 1800, "hintUsed": false }
    Warning

    Variables are reset when a new game session starts unless marked as persistent.

    Execution Model

    1. Event arrives (button press, timer, etc.)
    2. Triggers evaluated - matching triggers fire
    3. Conditions checked - must all pass
    4. Actions executed - in sequence or parallel

    Parallel Execution

    Multiple flows can execute simultaneously:

    Flow A: Button 1 → LED 1 Flow B: Button 2 → LED 2 ↓ Both run in parallel

    Best Practices

    Pro Tip

    Keep flows focused on single responsibilities. Use variables to coordinate between flows.

    1. Name flows descriptively - "Button 1 Opens Door" not "Flow 1"
    2. Use variables for state - Don't chain complex conditions
    3. Test incrementally - Verify each flow works before adding more
    4. Document complex logic - Add comments to non-obvious flows