Slot Engine is in Beta - Stable, but may contain minor bugs
Slot EngineSlot Engine

Play Game

Play your game's front end against the LGS, force outcomes and replay books.


Overview

The Play Game module opens your game's front end inside the panel and connects it to the LGS that is attached to the panel. It creates a session, opens the front end in an iframe with the launch parameters of the session, and shows the balance and the last round next to the game. To see how the front end shows a specific book or win, force the outcome instead of spinning until it comes up, or replay the book without a session.

Requirements

  • An LGS attached to the panel. See Attach an LGS. Without an LGS, the tab shows the code that attaches one.
  • A simulation of every mode that you want to play. The LGS plays the books in __build__/publish_files.
  • Your front end running on its own port, for example a Vite dev server on http://localhost:3000.

The LGS serves plain HTTP. The official Engine client defaults to HTTPS, so create it with protocol: "http":

const client = RGSClient({ url: window.location.href, protocol: "http" })

Launch the game

  1. Open the Play Game tab of your game.
  2. Enter the URL of your front end, for example http://localhost:3000.
  3. Click Launch.

The panel creates a session with the settings from the bottom bar and opens the URL with the launchQuery of the session appended. The query sets rgs_url to the host of the panel, so the front end plays against the LGS on the panel's port.

While the game runs, Launch becomes Reload. Reload creates a new session, with a new wallet at the starting balance, and loads the game again. The link next to the button opens the same launch URL in a new browser tab.

Settings

The bar below the game holds the settings of the session. The panel saves the URL and the settings per game in the localStorage of your browser.

SettingDescription
CurrencyCurrency of the wallet. Lists the enabled currencies of the LGS.
LanguageLanguage of the session, passed to the front end as lang.
Starting balanceBalance of the new wallet, in major units: 100 is 100.00.
SocialSets social=true in the launch query and socialCasino in the jurisdiction flags.

Until you change them, the settings show the defaults of the LGS configuration: defaultCurrency, defaultLanguage and balance.starting.

If you change a setting while the game runs, the panel creates a new session with the new settings and reloads the game.

Force outcomes

The sidebar has two tabs, Force outcome and Replay. The fields of both tabs keep their values when you switch tabs.

The Force outcome tab makes the LGS play an outcome that you choose instead of a weighted draw.

FieldEffect
Book IDEvery play returns this book of the played mode, with its events and its payout.
Payout multiplierEvery play returns a book with this payout multiplier, or with the closest one in the lookup table.
  • If both fields have a value, the book ID wins.
  • Clear empties both fields and stops the force.
  • The status line below the fields shows the active force.

The force applies to every following play, in every mode, until you clear it. It does not change a round that is already open. The force also carries over to every new session, so a settings change or Reload keeps it.

Book IDs belong to one mode. If the lookup table of the mode that you play has no row for the forced book, the bet fails with ERR_VAL and the message unknown forced book. The LGS also plays books with a weight of 0, so you can force a book that a weighted draw never picks. For the rules that find the closest payout, see Forced outcomes.

Replay a book

Engine requires every game to support bet replay. In replay mode, the front end loads one book from the RGS and plays it without a session, so anyone with the link can watch the round. The Replay tab opens your front end in replay mode.

  1. Open the Replay tab of the sidebar.
  2. Select the Mode of the book.
  3. Enter the Book ID.
  4. Optional: change the Bet amount.
  5. Click Replay.
FieldDescription
ModeMode of the book. Lists the modes of the game. The first mode is the default.
Book IDID of the book in the lookup table of the mode. Replay stays disabled until you enter one.
Bet amountBase bet in major units: 1 is 1.00. The default is bets.default of the LGS configuration. Must follow the bet rules of the mode.

The panel requests the replay from POST /lgs/replays with the currency, the language and the social setting of the bottom bar. Then it opens the URL of your front end with the replay launch parameters appended:

http://localhost:3000/?replay=true&game=my-game&version=1&mode=bonus&event=812&rgs_url=localhost%3A7770&currency=USD&amount=1000000&lang=en&device=desktop&social=false&demo=false

The front end reads replay=true and fetches the book from GET /bet/replay/{game}/{version}/{mode}/{event}. The response holds the payout multiplier of the book, the cost multiplier of the mode and the events of the book.

No session exists in replay mode. The Session box names the book and the mode of the replay, and the force does not apply. If the request fails, for example because the lookup table of the mode has no row for the book, the error shows below the Replay button and the game stays as it was.

While a replay is open:

  • A change of the currency, the language or the social setting requests the same replay again with the new setting. A change of the starting balance does nothing.
  • Replay loads the book again, also when the fields did not change.
  • Launch leaves replay mode and starts a session.

Session

The Session box shows the current session and refreshes every 2 seconds:

  • The balance and the currency of the wallet.
  • The last round: its book ID, its payout multiplier and its payout.

The panel reads both from GET /lgs/sessions/:id.

Use of AI on this page: Some texts were improved with or written by AI.

On this page