Skip to main content

Slot Spin

This node executes a complete slot machine spin operation using an external slot engine API.

The Slot Spin node provides a comprehensive slot machine engine with support for multiple game features and plugins.

The Slot Spin node is the core component for slot machine functionality. It communicates with an external slot engine API to perform complete spin operations, including reel generation, win calculation, and feature activation. The node supports various slot game plugins including free spins, cascading reels, and reel ways mechanics.

Inputs

Slot Configuration

DataDescription
RowsNumber of rows in the slot grid (1-7, default: 3)
ColumnsNumber of columns in the slot grid (1-7, default: 5)
Reel StripsArray defining the symbols available on each reel

Session

DataDescription
Session IDUnique identifier for the gaming session
SeedOptional seed for deterministic results

Game Parameters

DataDescription
Bet AmountThe amount wagered (1-10,000, default: 250)
Payout FormulaFormula for calculating payouts (default: "1.5 * x")
Initial Free SpinsStarting number of free spins (0-1,000)
Demo ParametersAdditional configuration object for demo mode

Plugins

DataDescription
Free SpinsEnable/disable free spins feature
Cascading ReelsEnable/disable cascading reels feature
Reel WaysEnable/disable reel ways feature

Free Spins Settings

DataDescription
MultiplierWin multiplier during free spins (1-10, default: 1)
Blocked ReelsArray of reel indices that don't spin during free spins

Cascading Reels Settings

DataDescription
Cascading LimitMaximum number of cascades (1-1,000, default: 5)

Reel Ways Settings

DataDescription
Min Consecutive SymbolsMinimum consecutive symbols for wins (1-7, default: 3)

Actions

SignalDescription
SpinTriggers a complete slot spin operation

Outputs

Events

SignalDescription
SuccessTriggered when spin completes successfully
FailureTriggered when spin encounters an error

Results

DataDescription
Full ResponseComplete response object from the slot engine

Note: Additional dynamic outputs are created based on the API response, such as Total Win, Winning Lines, Free Spins Remaining, etc.

Usage

The Slot Spin node serves as the primary interface to a sophisticated slot machine engine. It handles all aspects of slot gameplay including:

Core Functionality

  • Reel Generation: Creates symbol combinations based on reel strips
  • Win Detection: Identifies winning combinations and paylines
  • Payout Calculation: Computes winnings based on paytables and bet amounts
  • Feature Activation: Triggers bonus features like free spins

Plugin System

The node supports a modular plugin architecture:

  1. Free Spins Plugin

    • Triggers additional spins without additional bets
    • Applies win multipliers
    • Can block specific reels from spinning
  2. Cascading Reels Plugin

    • Removes winning symbols and drops new ones
    • Creates potential for multiple wins in one spin
    • Limited by the cascading limit setting
  3. Reel Ways Plugin

    • Alternative to traditional paylines
    • Wins based on consecutive symbols from left to right
    • Configurable minimum consecutive symbol requirement

Example Use Cases

  1. Traditional Slot Machines: 3x5 grid with paylines and free spins
  2. Modern Video Slots: Complex grids with multiple features
  3. Cascading Games: Tetris-like mechanics with falling symbols
  4. Ways-to-Win Games: 243+ ways to win instead of paylines

API Integration

The node communicates with the slot engine at: https://engine-typescript.vercel.app/api/v2/slot/spin

The request payload includes all configuration parameters, and the response contains:

  • Spin results (symbol positions)
  • Win calculations
  • Feature states
  • Updated session information

Error Handling

The node handles various error conditions:

  • Network connectivity issues
  • Invalid configuration parameters
  • API response errors
  • Timeout conditions

Errors are logged and trigger the Failure signal, allowing for graceful error handling in your application.

Session Management

  • Session ID: Automatically generated if not provided
  • Seed Control: Optional deterministic behavior for testing
  • State Persistence: Maintains game state across spins

Performance Considerations

  • Async Operations: All API calls are non-blocking
  • Response Caching: Full response is stored for access
  • Dynamic Outputs: Additional outputs created based on response structure
  • Memory Management: Large reel strips excluded from response storage