boardgame.io is an MIT-licensed engine for building turn-based games in JavaScript, aimed at developers who want state management, realtime multiplayer and matchmaking handled for them instead of writing their own networking and storage code.
What it is
boardgame.io lives in the JavaScript and TypeScript ecosystem and is installed from npm as the package boardgame.io. It is an engine for creating turn-based games: the developer writes simple functions that describe how the game state changes when a particular move is made, and the engine converts those functions into a playable game complete with online multiplayer features. The project is filed under Miscellaneous / Gaming in this registry, carries the topics boardgames, game-engine, javascript, multiplayer, react, react-native, tabletop and turn-based, and publishes its documentation and examples at boardgame.io.
The concrete problem it solves is the plumbing surrounding turn-based play. Rather than hand-writing a networking layer, a synchronisation scheme and a storage layer for every new game, the developer describes moves and rules, and boardgame.io manages state across clients, the server and storage, keeping it in sync in realtime and across platforms. It also replaces the ad-hoc scaffolding around a game's lifecycle: matchmaking, game creation, turn order and phase changes, and bot opponents are part of the engine rather than things each project reinvents. Where the built-in abstractions are not enough, a plugin system allows new ones to be created.
Key capabilities
- State management: game state is managed seamlessly across clients, server and storage.
- Multiplayer: game state is kept in sync in realtime and across platforms.
- AI: automatically generated bots that can play the game.
- Game phases: different game rules and turn orders per phase.
- Lobby: player matchmaking and game creation.
- Prototyping: an interface to simulate moves even before the game is rendered.
- View-layer agnostic: use the vanilla JS client or the bindings for React and React Native, with game logs that support time travel to view the board at an earlier state.
Who uses it and how
- Individual developers and small teams building turn-based board games and tabletop titles in JavaScript or TypeScript, installing
boardgame.io from npm.
- Projects whose interface is already React or React Native use those bindings, while others use the vanilla JS client, since the engine imposes no view layer.
- Teams that want online multiplayer and matchmaking without writing their own networking or storage code, while accepting that game state still spans clients, a server and storage.
- Designers prototyping rules can simulate moves before rendering anything, then use game logs with time travel to inspect an earlier board state.
- Contributors run the examples in the repository's
examples folder with npm install and npm start, or open the repository in the provided VS Code dev container.
Getting started
Install the package into a JavaScript project with npm install boardgame.io and follow the full documentation at boardgame.io/documentation. To run the bundled examples from the repository, run npm install followed by npm start.
How it compares
No comparable turn-based game engine, and no list of paid products it replaces, is named in the facts provided for this registry. On the evidence available, it therefore stands alone in the Miscellaneous / Gaming category here.
When to use it — and when not to
Choose it for turn-based games in JavaScript or TypeScript where multiplayer synchronisation, matchmaking and bot opponents would otherwise be built by hand. A self-hoster still operates the server and storage across which the engine distributes state, and the README does not enumerate database or other infrastructure requirements, so that operational surface has to be confirmed from the full documentation and changelog. It is not aimed at realtime or action games or at developers outside the JavaScript and TypeScript ecosystem, and the README itself is brief, deferring to external documentation while 67 open issues remain on the tracker.
project readme (upstream, from github) — read inline
Read the Documentation
boardgame.io is an engine for creating turn-based games using JavaScript.
Write simple functions that describe how the game state changes
when a particular move is made. This is automatically converted
into a playable game complete with online multiplayer
features, all without requiring you to write a single line of
networking or storage code.
Features
- State Management: Game state is managed seamlessly across clients, server and storage automatically.
- Multiplayer: Game state is kept in sync in realtime and across platforms.
- AI: Automatically generated bots that can play your game.
- Game Phases: with different game rules and turn orders per phase.
- Lobby: Player matchmaking and game creation.
- Prototyping: Interface to simulate moves even before you render the game.
- Extendable: Plugin system that allows creating new abstractions.
- View-layer Agnostic: Use the vanilla JS client or the bindings for React / React Native.
- Logs: Game logs with the ability to time travel (viewing the board at an earlier state).
Usage
Installation
npm install boardgame.io
Documentation
Read our Full Documentation to learn how to
use boardgame.io, and join the community on gitter
to ask your questions!
Running examples in this repository
npm install
npm start
The examples can be found in the examples folder.
Using VS Code?
This repository is ready to run in a dev container in VS Code. See the contributing guidelines for details.
Changelog
See changelog.
Get involved
We welcome contributions of all kinds!
Please take a moment to review our Code of Conduct.
🐛 Found a bug?
Let us know by creating an issue.
❓ Have a question?
Our Gitter channel and GitHub Discussions
are good places to start.
⚙️ Interested in fixing a bug or adding a feature?
Check out the contributing guidelines
and the project roadmap.
📖 Can we improve our documentation?
Pull requests even for small changes can be helpful. Each page in the
docs can be edited by clicking the “Edit on GitHub” link at the top right.
License
MIT