Turnbase Overview

Key Concepts

Board

The board is the (virtual) physical space where game play happens. For a traditional board game, this would include not only the “board” (usually a physical printed cardboard piece) but any “space” involved in the game play, such as player hands or play areas on the table.

Tokens

Tokens are objects that can move around the board during game play. Examples of tokens in a traditional board game include meeples, dice, cards, coins, and so on.

Tokens can have multiple sides, each of which needs its own view config for specifying how it should look. A card is a particular type of token that has two sides.

Tokensets

A tokenset is a collection of tokens that are typically used together in a game. For example, a collectible card game may publish different “decks” over time that can be mixed together. Or, a board game may publish expansions that introduce new tokens but continue to use the tokens from the original base game.

Game Spec

The game spec defines the rules of the game as well as other configurations such as which board or tokensets are used.

Rule Enforcement

One aspect of the game spec is the ruleset. Rules are defined using a domain specific language LudL and enforced during the course of game play.

Instantiation

Token specs are defined using the tokenset editor. This specifies key properties of the token as well as how it should be rendered. During game play, tokens are instantiated according to the spec, but then its state and appearance may change according to the rules defined.

Mix & Match

A game may use several tokensets together, and a tokenset may be used in multiple games.

A game is associated with one board, but a board may be used in multiple games.

Turnbase Architecture Overview

_images/turnbase-architecture.png

Frontend vs Backend

  • All of the game logic happens serverside (in the backend)
  • The frontend is only responsible for presenting the game state through the UI and capturing user interactions
  • The backend and the frontend communicate through a messaging system

Turnbase Components

Game Engine

The game engine is the system that manages games during play. It has a frontend and a backend component, and a message protocol for how these two components interact with each other.

The game engine is responsible for:

  • keeping track of who the players are (which users map to which players)
  • keeping track of the game state
  • relaying the current game state to the frontend UI (via messages)
  • determining whether user actions are valid according to the game rules and executing the game logic to advance play

Game Spec Editor

The game spec editor is where creators can specify the rules of the game, as well as some additional attributes. More specifically, a creator will need to specify the following:

  • initial game state
    • what the game state should be at the start of the game
  • game rules
  • board
    • which board the game uses
  • tokenset(s)
    • which tokensets the game uses (can be multiple)
  • additional options
    • such as what info text shows up on the game lobby page

You can access the game spec editor for public and games you own by clicking on “details” under the game preview card.

_images/game-details.png

Board Editor

You can access the board editor by clicking on a board preview card for a board you own.

_images/my-boards.png _images/board-editor.png

Tokenset Editor

You can access the tokenset editor by clicking on a tokenset preview card for a tokenset you own.

_images/my-tokensets.png _images/tokenset-editor.png

You can also duplicate public tokensets to create your own fork.

Game State

See section on game state.

LudL Language

LudL stands for LudL Language. It is a domain-specific language (DSL) designed to codify game rules. See manual for more details.