Make a slot
A game is data. A mechanic is a module.
Most new games use a mechanic the engine already has: they are a folder of data and need no engine code. A new shape of play is a mechanic module, added to the engine once, and every later game on it is data again.
Path one
A game on an existing mechanic.
- game manifestThe game's code, its locales and the parts it is built on, each by its id: the mechanic, the math and the kit.
- skinSymbols, backgrounds and effects as atlases and compressed textures, audio sprites and fonts, gathered into a skin manifest.
- lookColours, layout and motion settings the field and the interface read.
- textsEvery label the player sees, per locale, including a name for each bet mode.
- math configurationThe settings the game's outcome calculator reads.
Checked on upload. A key the mechanic needs and the folder does not have is a refusal, with its name; the local preview runs the same check on each save.
Pinned. A release pins the folder, the math, the kit and the client version; a new engine version never changes a live game.
Previewed. The preview plays the folder on your machine with its math, in play money, and reloads on each save.
Path two
A new mechanic.
On the client
- the events the mechanic adds to a round
- the symbol roles it needs (wild, scatter, a collector) declared for the skin to fill
- an event-to-step map: what the field plays for each event, and for how long
- its overlays, such as paylines or cluster pops
- the illustration in the rules and the state a replay restores
On the server
- an event schema: the events, their fields, which fields are money
- a server module and an outcome calculator written to the game contract
// What a mechanic plugs into the core (abridged).
export interface IGameModule<TGameConfig, TEvent, TGameContext> {
readonly gameCode: string;
readonly messages: TLocalizedMessageCatalog;
parseGameConfig(gameConfig: unknown): TGameConfig;
mount(context: IGameMountContext<TGameConfig, TEvent>):
Promise<IShellGameRuntime<TEvent, TGameContext>>;
}
export interface IShellGameRuntime<TEvent, TGameContext> {
readonly handlers: TGameBookEventHandlers<TEvent>; // one per event type
prepareRound(book: IBook<TEvent>, gamePins: TGamePins, replay: boolean): Promise<void>;
restoreState(book: IBook<TEvent>, lastPresentedStep: number): void;
// ...
}The math
Pure code, the same everywhere.
Randomness, the clock and ids arrive as arguments, never from inside the math. That is what lets a round be replayed from its stored random tape and lets a development server force an outcome that is still a real one.
Certified math stays with the provider who certified it, frozen at the version that was certified. The engine consumes it as published and never changes a byte of it.
Your first slot, step by step.
The tutorial starts from an empty folder and ends with a round on the platform. It is not written yet; its page lists the steps.