Slot Engine is in Beta - Expect bugs!
Slot EngineSlot Engine

Quick Start

Getting started with Slot Engine


Introduction

Slot Engine is a family of TypeScript libraries for building, simulating and testing slot games.

Slot Engine Core

Library for configuring and simulating slot games. Produces output compatible with Stake Engine / Stake RGS.

Slot Engine LGS

Local gaming server. Test your game locally without uploading to Stake Engine and save time during development.

Further Reading

For a more in-depth introduction to Slot Engine and its features, check out "What is Slot Engine?".

Unsure which is right for you? "Slot Engine vs Stake Math SDK" provides an in-depth comparison to help you decide.

Installation & Setup

Get started creating your first game using the @slot-engine/core library.

Install package from npm

Set up your Node.js project and install @slot-engine/core. Using TypeScript instead of JavaScript is highly recommended.

Slot Engine requires Node >= 23.8.0 or >= 22.15.0 to make use of native Zstandard compression features.

npm i @slot-engine/core

Configure your game

This example provides a quick overview to get you started. For detailed configuration options, see the configuration guide.

index.ts
import {
  defineUserState,
  defineSymbols,
  defineGameModes,
  InferGameType,
  createSlotGame,
} from "@slot-engine/core"

export const userState = defineUserState({ /* ... */ })
export type UserStateType = typeof userState

export const symbols = defineSymbols({ /* ... */ })
export type SymbolsType = typeof symbols

export const gameModes = defineGameModes({ /* ... */ })
export type GameModesType = typeof gameModes

export type GameType = InferGameType<GameModesType, SymbolsType, UserStateType>

export const game = createSlotGame<GameType>({
  id: "my-game",
  name: "My Game",
  maxWinX: 5000,
  scatterToFreespins: {},
  gameModes,
  symbols,
  userState,
  hooks: {},
})

Simulate your game

index.ts
game.configureSimulation({
  simRunsAmount: {
    base: 100000,
    bonus: 100000,
  },
  concurrency: 16,
})

game.runTasks({
  doSimulation: true,
})

Upon running your code, this will generate JSONL and CSV files containing the results of your simulated spins.

Currently, the output format is designed for compatibility with Stake Engine. Future versions may support additional platforms as they emerge. Output customization is not available at this time.

Learn more about game simulations.

Important

Before configuring your game, familiarize yourself with the concepts and ideas of the Core library to understand important terminology and background information. If you've used the Stake Math SDK before, many concepts will be familiar.

Use of AI on this page: All texts were initially written by hand and many were later revised by AI for improved flow. All AI generated revisions were carefully reviewed and edited as needed.

On this page