Xgenia Slot Engine Components Architecture
This comprehensive section provides detailed analysis of each internal component graph, their sophisticated node connections, data flow patterns, and integration points as meticulously defined in the project.json configuration. Each component represents a specialized subsystem designed for optimal performance, maintainability, and mathematical accuracy in slot game simulation and analysis.
Core Component Systems​
1. Generate Reel Strips - Mathematical Foundation Engine​
This sophisticated component serves as the mathematical foundation of the entire slot engine, responsible for creating balanced and mathematically sound reel configurations.

Node Architecture:
-
Generate Symbol Weights: Advanced probability distribution calculator- Input Ports:
Number of Symbols,Weight Formula,Do(trigger signal) - Output Ports:
Normalized Base Weights,Done(completion signal) - Dynamic Ports: 10 configurable custom weight inputs (
symbolWeight1throughsymbolWeight10) - Default Custom Weights: Precisely calculated values ranging from 0.9355069850316178 (Symbol 1) to 0.513417119032592 (Symbol 10)
- Mathematical Processing: Processes weight formulas with exponential decay functions
- Normalization Algorithm: Ensures all weights sum to 1.0 for proper probability distribution
- Custom Weight Override: Allows manual specification of individual symbol probabilities for fine-tuning
- Input Ports:
-
ISAAC Random Number Array Generator: Cryptographic randomness engine- Input Ports:
Size(array length),Nonce(seed value),Do(trigger signal) - Output Ports:
Generated Array(random number array),Done(completion signal) - Array Size: Configurable to match column size for reel generation
- Seed Management: Uses nonce input for deterministic sequence generation
- Cryptographic Security: ISAAC algorithm ensures unpredictable, high-quality randomness
- Performance Optimization: Batch generation reduces computational overhead
- Integration: Feeds
randomSeedsdirectly to Reel Strips Generator for balanced strip creation
- Input Ports:
-
Reel Strips Generator: Advanced strip creation algorithm- Input Ports:
Symbol Weights(probability array),Random Seeds(from ISAAC),Column Size,Do(trigger) - Output Ports:
Reel Strips(2D symbol array),Done(completion signal) - Strip Generation Logic: Combines normalized symbol weights with cryptographic random seeds
- Mathematical Validation: Ensures proper symbol distribution and prevents clustering anomalies
- Variable Configuration: Supports 1-10 columns with customizable strip lengths
- Quality Assurance: Validates generated strips against target RTP and volatility requirements
- Output Format: 2D array where each sub-array represents a complete reel strip sequence
- Input Ports:
-
Init Free Spins: Bonus feature initialization system- Input Ports:
Reel Strips(base strips),Free Spins Symbol,Blocked Reels,Do(trigger) - Output Ports:
Reel Strips(modified for bonus),Done(completion signal) - Blocked Reel Processing: Modifies specified reels (e.g., reels 0,4) to remain static during free spins
- Symbol Enhancement: Adjusts free spins symbol distribution for optimal bonus trigger rates
- Strip Modification: Creates specialized reel configurations for bonus round mechanics
- State Integration: Coordinates with Calculate Free Spins States for comprehensive bonus management
- Mathematical Balance: Maintains overall RTP while enhancing bonus round winning potential
- Input Ports:
-
If (Enable Free Spins?): Conditional logic controller- Routes processing flow based on free spins configuration
- Enables or bypasses free spins initialization as needed
- Maintains system performance when free spins are disabled
- Provides clean separation between base game and bonus features
Input/Output Architecture:
-
Critical Inputs:
Number of Symbols(1-15): Defines symbol set size for mathematical calculationsWeight Formula(String): Mathematical expression controlling probability distributionNonce(Integer): Cryptographic seed for deterministic generationColumn Size(1-10): Number of reels in the slot configurationEnable Free Spins?(Boolean): Activates bonus feature processingFree Spins Symbol(Integer): Special symbol ID for bonus triggersBlocked Reels(Array): Reel indices for sticky mechanics
-
Primary Outputs:
Symbol Weights(Array): Normalized probability weights for each symbolReel Strips(2D Array): Complete reel configurations for all columnsDone(Signal): Completion notification for downstream processing
Mathematical Validation Process:
- Formula parsing and validation for mathematical correctness
- Weight normalization to ensure proper probability distributions
- RTP calculation verification against target parameters
- Distribution analysis to prevent mathematical anomalies
- Quality assurance checks for regulatory compliance
2. Spin the Reels - Weighted Reel Execution Engine​
This critical component orchestrates the actual spinning mechanics, transforming reel strips and symbol weights into concrete symbol grids while managing free spins states and statistical tracking.

Node Architecture:
-
ISAAC Random Number Array Generator(Seeded): Cryptographic randomness for spin execution- Generates deterministic random seeds for weighted reel selection
- Uses configurable nonce for reproducible testing scenarios
- Ensures mathematical fairness through cryptographic security
- Provides batch random number generation for performance optimization
-
Weighted Reels: Core spinning mechanism- Input Ports:
Seeds(random array),Reel Strips(symbol sequences),Row Size,Symbol Weights - Output Ports:
Reels(symbol grid),Stop Position List(reel positions),Done(completion) - Weighted Selection Algorithm: Uses symbol weights to determine realistic stop positions on each reel
- Grid Generation: Creates visible symbol grid matching specified row size (typically 3x5)
- Stop Position Tracking: Records exact reel positions for analysis, debugging, and verification
- Random Seed Integration: Combines ISAAC-generated seeds with weighted selection for fair results
- Performance Optimization: Efficient processing for real-time spin execution and batch simulation
- Input Ports:
-
Calculate Free Spins States: Bonus round state management- Input Ports:
Engine Reels,Bet Amount,Blocked Reels,Free Spins Symbol,Capital,Total Bets,Current Free Spins,Total Free Spins Won - Output Ports:
Capital,Total Bets,Current Free Spins,Total Free Spins Won,Free Spins Symbol Count,Current Free Spins Won,Current Free Spins Lines,Done - State Tracking: Monitors all financial and bonus-related metrics in real-time
- Free Spins Counter: Decrements remaining free spins and tracks bonus progress
- Retrigger Detection: Analyzes symbol grid for additional free spins awards
- Financial Management: Updates capital and betting statistics during bonus rounds
- Comprehensive Reporting: Provides detailed bonus statistics for analysis and UI display
- Input Ports:
-
If (Enable Free Spin?): Conditional processing controller- Routes spin processing based on free spins activation status
- Optimizes performance by bypassing unused bonus logic when disabled
- Maintains clean separation between base game and bonus features
- Ensures consistent behavior across different game configurations
Input/Output Architecture:
-
Spin Configuration Inputs:
Column Size(1-10): Number of reels in the game gridRow Size(1-7): Visible symbols per reel for displayNonce(Integer): Unique seed for each spin operationReel Strips(2D Array): Pre-generated symbol sequences for each reelSymbol Weights(Array): Probability weights for balanced symbol selection
-
Financial and State Inputs:
Bet Amount(Float): Current wager amount for payout calculationsCapital(Float): Current player balance for validation and updatesTotal Bets(Float): Cumulative wagered amount for statistical trackingCurrent Free Spins(Integer): Active bonus round counterTotal Free Spins Won(Integer): Historical bonus awards tracking
-
Bonus Feature Inputs:
Enable Free Spins?(Boolean): Activates bonus round processing logicBlocked Reels(Array): Reel indices for sticky mechanics during bonusFree Spins Symbol(Integer): Special symbol ID for bonus triggers
-
Primary Outputs:
Reels(2D Array): Final symbol grid after spin executionStop Position List(Array): Detailed stop positions for each reelCapital(Float): Updated player balance after bet deductionTotal Bets(Float): Updated cumulative betting statisticsCurrent Free Spins(Integer): Updated bonus round counterDone(Signal): Completion notification for downstream processingUpdate(Signal): Triggers UI and statistical system updates
3. Check Spin Winnings - Dual-Mode Win Calculation System​
This sophisticated component represents the heart of the slot engine's win evaluation system, featuring intelligent switching between traditional payline mechanics and modern reel-ways calculations based on user configuration.

Advanced Node Architecture:
-
Get Paytable: Dynamic paytable management system- Input Ports:
Number of Symbols,Column Size,Min Consecutive Symbols,Payout Formula,Do(trigger) - Output Ports:
Paytable(complete payout structure),Done(completion signal) - Dynamic Custom Payouts: 10 configurable symbol payout inputs (
symbolPayout1throughsymbolPayout10) - Default Payout Values: Precisely calibrated from 3.0 (Symbol 1) to 9.75 (Symbol 10) with 0.75 increments
- Mathematical Consistency: Validates all payout combinations against specified formulas
- Real-time Calculation: Processes payout formulas with variable-based expressions
- Regulatory Compliance: Ensures payout structures meet gaming authority requirements
- Input Ports:
-
If (Enable Reel Ways?): Intelligent routing controller- Dynamically switches between payline and reel-ways evaluation systems
- Optimizes performance by activating only the required calculation pathway
- Maintains mathematical consistency across different win evaluation methodologies
- Ensures seamless transition between traditional and modern slot mechanics
Payline Calculation Path:
-
Check Wins: Traditional payline win detection engine- Input Ports:
Wild Symbol,Free Spins Symbol,Min Consecutive Symbols,Reels,Do(trigger) - Output Ports:
Winning Lines,Paylines,Done(completion signal) - Payline Analysis: Systematically evaluates all active paylines for winning combinations
- Wild Symbol Logic: Implements sophisticated substitution rules for wild symbols (default: Symbol 9)
- Consecutive Symbol Validation: Ensures minimum symbol requirements are met for valid wins
- Line Detail Generation: Creates comprehensive winning line data with positions and symbols
- Input Ports:
-
Calculate Winnings: Comprehensive payout calculation system- Input Ports:
Winning Lines,Paytable,Paylines,Bet Amount,Wild Symbol,Do(trigger) - Output Ports:
Spin Winnings(total payout),Winning Lines Details(detailed breakdown),Done - Payout Calculation: Processes each winning line against paytable for accurate payouts
- Bet Distribution: Applies bet-per-line calculations for proper win scaling
- Wild Integration: Handles wild symbol payouts and substitution multipliers
- Detail Generation: Creates comprehensive winning line analysis with positions and amounts
- Input Ports:
Reel Ways Calculation Path:
-
Reel Ways Check Wins: Modern consecutive symbol detection system- Input Ports:
Number of Symbols,Wild Symbol,Free Spins Symbol,Reels,Min Consecutive Symbols,Do - Output Ports:
Winning Lines,Done(completion signal) - Ways Analysis: Evaluates consecutive symbol matches from leftmost reel across all reels
- Minimum Consecutive Logic: Enforces configurable minimum symbol requirements (default: 3)
- Wild Substitution: Handles wild symbols in ways-to-win calculations with proper multipliers
- Path Calculation: Determines all possible winning paths through the symbol grid
- Input Ports:
-
Reel Ways Calculate Winnings: Advanced ways-to-win payout engine- Input Ports:
Winning Lines,Bet Amount,Wild Symbol,Paytable,Do(trigger) - Output Ports:
Spin Winnings(total ways payout),Winning Lines Details,Done - Ways Multiplication: Calculates total winnings by multiplying base payouts by number of ways
- Bet-per-Way Logic: Distributes total bet across all possible ways for accurate scaling
- Wild Handling: Processes wild symbols in ways calculations with proper multiplier effects
- Comprehensive Reporting: Provides detailed breakdown of ways contributions and payouts
- Input Ports:
Comprehensive Input Specifications:
-
Game Configuration:
Number of Symbols(1-15): Total symbol set size affecting calculation complexityColumn Size(3-10): Number of reels determining maximum possible combinationsMin Consecutive Symbols(2-7): Minimum matching symbols required for reel-ways winsEnable Reel Ways?(Boolean): Primary switch controlling calculation methodology
-
Mathematical Parameters:
Payout Formula(String): Mathematical expression defining win multipliersWild Symbol(Integer): Symbol ID for substitution logic in win calculationsFree Spins Symbol(Integer): Special symbol ID for bonus feature detectionBet Amount(Float): Current wager amount for accurate payout calculations
-
Spin Results:
Reels(2D Array): Complete symbol grid from spin execution for analysisPaylines(Array): Predefined line patterns for traditional payline evaluation
Detailed Output Specifications:
-
Primary Results:
Spin Winnings(Float): Total winnings calculated from all winning combinationsWinning Lines Details(Array): Comprehensive breakdown of each winning combinationDone(Signal): Completion notification triggering downstream processing
-
Winning Lines Details Structure:
- Line/Way identification numbers for tracking and verification
- Symbol sequences with position mapping for visual highlighting
- Individual payout amounts with multiplier breakdowns
- Wild substitution details and special symbol behaviors
4. Manage Simulation - High-Performance Batch Processing Engine​
This advanced component orchestrates automated batch simulation capabilities, enabling comprehensive mathematical validation through high-speed, repeated spin execution with sophisticated loop management and progress tracking.

Intelligent Control Architecture:
-
If (Enable Simulation Mode?): Primary simulation activation controller- Evaluates simulation mode status to determine processing pathway
- Optimizes system performance by bypassing simulation logic when disabled
- Provides clean separation between manual and automated operation modes
- Ensures consistent behavior across different operational configurations
-
Loop (Simulation Loop): Advanced batch processing engine- Implements sophisticated loop management with configurable iteration counts
- Provides real-time progress tracking and performance monitoring during execution
- Handles large-scale simulations efficiently with memory optimization and resource management
- Supports interruption and resumption capabilities for long-running batch operations
-
If (Simulation Enabled?): Secondary validation and routing controller- Provides additional validation layer for simulation state consistency
- Manages transition logic between simulation and manual operation modes
- Ensures proper cleanup and state management during mode transitions
- Handles edge cases and error conditions during batch processing operations
Comprehensive Input Management:
- Control Inputs:
Enable Simulation?(Boolean): Primary activation flag for batch processing modeNumber of Simulation(Integer, 1-1,000,000+): Total iterations for batch executionSpin(Signal): Individual spin trigger for manual operation modeNext Spin(Signal): Continuation signal for iterative batch processing
Advanced Output Coordination:
- Primary Outputs:
Spin(Signal, Repeated): Orchestrated spin execution signals for batch processing- Progress indicators and performance metrics for monitoring long-running simulations
- Completion notifications and statistical summaries for comprehensive analysis
Batch Processing Features:
- Performance Optimization: Efficient resource utilization for high-speed batch execution
- Progress Tracking: Real-time monitoring of simulation progress with estimated completion times
- Error Handling: Robust error recovery and continuation mechanisms for reliable operation
- Statistical Integration: Seamless integration with KPI tracking and data collection systems
5. Export Game Metrics - Advanced Data Collection and Export System​
This sophisticated component provides enterprise-grade data collection, aggregation, and export capabilities, enabling comprehensive analysis of simulation results through structured JSON export with complete metadata and statistical summaries.

Data Collection Architecture:
-
CollectionNew: Dynamic collection initialization system- Creates new data collection arrays with unique identifiers for session tracking
- Establishes collection metadata including timestamps, configuration snapshots, and version information
- Provides scalable collection management supporting multiple concurrent data streams
- Implements automatic collection lifecycle management with cleanup and optimization
-
CollectionInsert: Real-time data insertion engine- Handles high-frequency data insertion with optimized performance for large datasets
- Supports structured data insertion with validation and consistency checking
- Provides automatic data formatting and type conversion for consistent storage
- Implements batch insertion capabilities for improved performance during simulation runs
-
Collection2: Advanced data aggregation and management system- Maintains comprehensive data arrays with automatic indexing and search capabilities
- Provides real-time data retrieval and filtering for ongoing analysis and monitoring
- Implements data compression and optimization for memory-efficient large dataset handling
- Supports concurrent access and modification with thread-safe operations
Export Processing Pipeline:
-
Export to JSON file: Professional data export system- Generates comprehensive JSON exports with complete dataset and metadata inclusion
- Provides structured formatting with proper indentation and readability optimization
- Implements data validation and integrity checking before export completion
- Supports large file handling with streaming export for memory efficiency
-
CollectionClear: Data management and cleanup system- Provides selective or complete data clearing with confirmation and safety mechanisms
- Implements data archival options before clearing for historical preservation
- Supports partial clearing based on date ranges, criteria, or collection segments
- Ensures proper memory cleanup and resource deallocation after clearing operations
Comprehensive Input Management:
- Collection Control:
Insert(Signal): Triggers data insertion with current state snapshotObject ID(String): Unique identifier for tracking and organizing data entriesExport(Signal): Initiates complete dataset export with metadata inclusionMount(Signal): Initializes collection system and prepares data structuresClear(Signal): Removes collected data with optional archival and confirmation
Advanced Output Specifications:
- Process Completion Signals:
Insert Done(Signal): Confirms successful data insertion with validation completionExport Done(Signal): Indicates successful file generation with integrity verification
Data Export Features:
- Complete Dataset Export: All collected KPI arrays, statistical summaries, and time-series data
- Configuration Snapshots: Game settings, mathematical parameters, and operational configurations
- Metadata Inclusion: Timestamps, session information, version details, and system specifications
- Statistical Summaries: Automatically calculated means, medians, standard deviations, and trend analysis
- Reproducibility Data: Seeds, nonces, and configuration details for exact result reproduction
6. Start Page - Comprehensive User Interface and Integration Hub​
The Start Page represents the most complex component in the system, serving as the primary integration hub that coordinates all user interactions, component executions, state management, and real-time visualization.
Advanced State Management Architecture:
-
stateManager(Exported): Central KPI coordination system- 8 Input/Output Pairs: Comprehensive tracking of all critical game metrics
- Specific Aliases: Capital, Total Bets, Total Free Spins Won, Current Free Spins, Total Winnings, Total Winnings From Free Spins, Spin Count, Hits
- Bidirectional Data Flow: Real-time synchronization between processing components and display elements
- State Persistence: Maintains data integrity across all operations and provides reset functionality
- Update Coordination: Manages cascading updates throughout the entire system
-
arrayStateManager: Time-series statistical data management- 2 Input Channels: RTP and Hit Frequency data streams for real-time chart visualization
- Statistical Processing: Automatic aggregation, trend analysis, and data smoothing
- Chart Integration: Direct connection to Line Chart components for live visualization
- Export Coordination: Provides historical data arrays for comprehensive JSON export
Random Number Generation Network:
True Random Number Generator(Reel Strips Nonce): Cryptographic seed generation for reel strip creationTrue Random Number Generator(Spin Nonce): Unique seed generation for each individual spin operation- Deterministic Override: Manual nonce input capability for reproducible testing and validation scenarios
Component Integration Mapping:
Generate Reel Strips: Triggered by Generate Reel Strips button, uses TRNG nonce for deterministic strip generationSpin the Reels: Executed by Spin button, integrates with state management for real-time KPI updatesCheck Spin Winnings: Processes spin results and feeds winning data to statistical aggregation systemsExport Game Metrics: Collects comprehensive data from Array State Manager for detailed JSON exportManage Simulation: Coordinates batch processing with progress tracking and statistical convergence analysis
User Interface Element Coordination:
- Text Input Controls: Direct binding to component inputs with real-time validation and error handling
- Button Controls: Event-driven triggers for component execution with progress indication and state feedback
- Display Components: Real-time data binding from state managers with formatted number display and change indicators
- Chart Components: Dynamic data visualization with automatic scaling, trend analysis, and interactive features
- Value Viewers: Comprehensive result inspection with hierarchical data display and export capabilities
Advanced Visualization Integration:
- Line Chart (RTP): Real-time Return to Player percentage tracking with statistical smoothing and trend analysis
- Line Chart (Hit Frequency): Winning spin frequency monitoring with confidence intervals and comparative analysis
- Show Value Components: Individual KPI monitoring with formatted display and change tracking
- Dict Viewer: Comprehensive result inspection with hierarchical display and detailed breakdown capabilities
- State Manager Details: Complete state object visualization for debugging and analysis purposes