Skip to content

Template Games

The SDK includes several template games that demonstrate different slot mechanics and serve as starting points for new game development. Each template implements a specific win calculation method and showcases common game features.

Available Templates

Core Win Types

Template Win Type Key Features
Cluster Cluster-pay Adjacent matching symbols, tumbles, grid multipliers
Lines Line-pay Traditional paylines, simple structure
Ways Ways-pay Left-to-right adjacent reels
Scatter Scatter-pay Pay anywhere on board

Advanced Features

Template Win Type Special Features
Expanding Wilds Line-pay Expanding wilds, super spin mode, prize collection

Template Structure

Each template follows the refactored architecture with a simplified file structure:

games/template_<type>/
  ├── run.py                    # Execution script
  ├── run_config.toml          # Runtime settings (symlink to dev.toml)
  ├── dev.toml                 # Development config (100 sims)
  ├── prod.toml                # Production config (1M sims)
  ├── game_config.py           # Game rules and configuration
  ├── game_state.py            # All game logic (100-400 lines)
  ├── game_optimization.py     # Optimization parameters
  ├── game_events.py           # Custom events (optional)
  └── reels/                   # Reel strip CSV files
      ├── base.csv
      ├── free.csv
      └── wincap.csv

Quick Start with Templates

  1. Copy a template that matches your desired win type:

    cp -r games/template_lines games/my_new_game
    

  2. Update configuration in game_config.py:

    self.game_id = "my_new_game"
    self.working_name = "My New Game"
    self.paytable = {...}  # Define your paytable
    

  3. Modify reel strips in reels/ directory (CSV files)

  4. Implement game logic in game_state.py:

  5. Add special symbol handlers
  6. Implement game-specific mechanics
  7. Complete run_spin() and run_free_spin() methods

  8. Run the game:

    make run GAME=my_new_game  # Uses dev.toml (100 sims, fast)
    

Template Documentation

Click on any template below to view detailed documentation including: - Game mechanics overview - Special features and behaviors - Custom functions and handlers - Configuration examples - Implementation details