Every game in the Stake Engine Math SDK starts with aDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/StakeEngine/math-sdk/llms.txt
Use this file to discover all available pages before exploring further.
GameConfig class that inherits from Config. This is where you declare everything the engine needs to run simulations: board dimensions, symbol payouts, reelstrip files, special symbol behaviour, and bet mode definitions.
The GameConfig class
GameConfig must implement __init__ and explicitly set all required fields. The engine will raise a RuntimeError at startup if any required field is missing or if an invalid symbol is detected on a reelstrip.
game_config.py
Required fields
Unique identifier string for this game, used by the RGS and frontend.
Numeric identifier assigned by the provider registry.
Human-readable internal name used during development.
Maximum win multiplier allowed in a single round. The engine caps all wins at this value.
Win evaluation method. Must be one of
"lines", "ways", "cluster", or "scatter".
See Win Types for details on each method.Target return-to-player percentage (e.g.
0.97 for 97%). Used by the optimization algorithm.Number of reels on the board.
Array of row counts per reel. Length must equal
num_reels.Dictionary mapping
(kind, symbol) tuples to payout multipliers. See Paytable format below.Dictionary mapping attribute names to lists of symbol names. See Special symbols below.
Scatter-count-to-free-spin-count mapping per game type. See Scatter triggers.
List of
BetMode instances defining cost, RTP, and distribution criteria. See Bet Modes.Paytable format
The paytable maps(kind, symbol) tuples to float payout multipliers, where kind is the number of matching symbols that trigger the win.
game_config.py
pay_group together with convert_range_table():
game_config.py
Reels
Reelstrips are stored as CSV files and loaded intoself.reels as a dictionary keyed by a short identifier string. Use read_reels_csv() to load each file:
game_config.py
BR0, FR0, etc.) must match the keys referenced in each BetMode’s reel_weights distribution condition. See Bet Modes for how reel weights are assigned per simulation.
Special symbols
Special symbols are defined as a dictionary from attribute name to a list of symbol names:game_config.py
gamestate.py
True. To attach a meaningful value (such as a multiplier amount), override this in gamestate.special_symbol_functions.
A symbol is valid only if its name appears in either
self.paytable or self.special_symbols. If a reelstrip contains an unrecognised symbol name, a RuntimeError is raised when the configuration is loaded.Symbol validation
The engine checks all symbols in loaded reelstrips against bothpaytable and special_symbols at startup. Any symbol name that does not appear in either structure is rejected:
Scatter triggers and anticipation
Free spin entry from the base game and retriggers in the free game are configured per game type. The format is{num_scatters: num_free_spins}:
game_config.py
check_fs_condition() method reads this configuration to determine whether free spins should be triggered or retriggered after each spin.
Game type constants
Thebasegame_type and freegame_type constants default to "basegame" and "freegame" respectively. They are used throughout configuration and game state to index game-type-specific values:
game_config.py
gamestate.py
basegame_type. The engine transitions to freegame_type automatically when reset_fs_spin() is called at the start of run_freespin().
Related pages
Bet Modes & Distributions
Configure cost, RTP targets, and per-simulation win criteria.
Implementing GameState
Use your config in the run_spin() simulation loop.
Win Types
Choose between lines, ways, cluster, and scatter evaluation.
Config API reference
Full field listing for the base Config class.
