Prerequisites
Before you begin, make sure you have the following installed:- Python 3.12 or later — required. Earlier versions are not supported.
- pip — included with Python 3.12+.
- Make — recommended for the one-command setup. Available by default on macOS and Linux; install via winget or Chocolatey on Windows.
- Rust/Cargo — only needed if you plan to run the optimization algorithm. See Installation for details.
1
Clone the repository
Clone the Math SDK to your local machine:
2
Run make setup
- Creates a Python virtual environment at
env/. - Upgrades
pipinside the environment. - Installs all dependencies listed in
requirements.txt(numpy, zstandard, pytest, boto3, xlsxwriter, and more). - Installs the
stakeenginepackage itself in editable mode (pip install -e .), so any changes you make to the source take effect immediately without reinstalling.
make run activates the virtual environment automatically, so you only need to activate manually when running scripts directly.3
Run the sample lines game
The SDK ships with several example games under This executes
games/. Run the 3-reel, 5-reel lines game:games/0_0_lines/run.py inside the virtual environment. With the default settings it simulates 10,000 base-game rounds and 10,000 bonus rounds across 10 CPU threads, then runs the optimization algorithm and generates a PAR sheet.You will see per-thread RTP output as each thread completes:4
Inspect the output
All output is written to Open The The three columns are simulation ID, selection weight, and payout multiplier. The weight starts at
library/ inside the game directory. The publish-ready files are in library/publish_files/.library/books/books_base.jsonl to inspect individual simulations. Each line is one simulation object. Here is simulation 58 from a 100-simulation uncompressed run:events array is exactly what the RGS returns in the play/ API response body when this simulation is selected. The frontend SDK consumes these events in order to drive the animation and UI.Open library/lookup_tables/lookUpTable_base.csv and find row 58:1 for every simulation; the optimization step adjusts these weights so the weighted-average payout matches your RTP target.Next steps
Installation
Full system requirements and manual setup instructions.
Game structure
Understand what each file in a game directory does.
Configuration guide
Configure paytables, reel strips, and bet modes for your own game.
Lines game example
A detailed walkthrough of the
0_0_lines sample game.