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
| Data | Description |
|---|---|
| Rows | Number of rows in the slot grid (1-7, default: 3) |
| Columns | Number of columns in the slot grid (1-7, default: 5) |
| Reel Strips | Array defining the symbols available on each reel |
Session
| Data | Description |
|---|---|
| Session ID | Unique identifier for the gaming session |
| Seed | Optional seed for deterministic results |
Game Parameters
| Data | Description |
|---|---|
| Bet Amount | The amount wagered (1-10,000, default: 250) |
| Payout Formula | Formula for calculating payouts (default: "1.5 * x") |
| Initial Free Spins | Starting number of free spins (0-1,000) |
| Demo Parameters | Additional configuration object for demo mode |
Plugins
| Data | Description |
|---|---|
| Free Spins | Enable/disable free spins feature |
| Cascading Reels | Enable/disable cascading reels feature |
| Reel Ways | Enable/disable reel ways feature |
Free Spins Settings
| Data | Description |
|---|---|
| Multiplier | Win multiplier during free spins (1-10, default: 1) |
| Blocked Reels | Array of reel indices that don't spin during free spins |
Cascading Reels Settings
| Data | Description |
|---|---|
| Cascading Limit | Maximum number of cascades (1-1,000, default: 5) |
Reel Ways Settings
| Data | Description |
|---|---|
| Min Consecutive Symbols | Minimum consecutive symbols for wins (1-7, default: 3) |
Actions
| Signal | Description |
|---|---|
| Spin | Triggers a complete slot spin operation |
Outputs
Events
| Signal | Description |
|---|---|
| Success | Triggered when spin completes successfully |
| Failure | Triggered when spin encounters an error |
Results
| Data | Description |
|---|---|
| Full Response | Complete 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:
-
Free Spins Plugin
- Triggers additional spins without additional bets
- Applies win multipliers
- Can block specific reels from spinning
-
Cascading Reels Plugin
- Removes winning symbols and drops new ones
- Creates potential for multiple wins in one spin
- Limited by the cascading limit setting
-
Reel Ways Plugin
- Alternative to traditional paylines
- Wins based on consecutive symbols from left to right
- Configurable minimum consecutive symbol requirement
Example Use Cases
- Traditional Slot Machines: 3x5 grid with paylines and free spins
- Modern Video Slots: Complex grids with multiple features
- Cascading Games: Tetris-like mechanics with falling symbols
- 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