Skip to content

State Management and Multiplayer Networking for Turn-Based Games

License

Notifications You must be signed in to change notification settings

gitgittygit/boardgame.io

Repository files navigation

boardgame.io

npm version Build Status Coveralls Gitter

Full Documentation: link

The goal of this framework is to allow a game developer to translate the rules of a game into a series of simple functions that describe how the game state changes when a particular move is made, and the framework takes care of the rest. You get a fully multiplayer implementation without having to write any networking or storage layer code.

Features

  • State Management: Game state is managed seamlessly across clients, server and storage automatically.
  • Cross-platform Multiplayer: All clients (Web / Android / iOS) connected to the game are synced in real time.
  • AI Framework: Create bots that are highly customizable and debuggable.
  • Game Phases: with different game rules (including custom turn orders) per phase.
  • Secret State: Secret information (like the opponent's cards) can be hidden from the client.
  • Prototyping: Debugging interface to simulate moves even before you render the game.
  • Logs: Game logs with the ability to time travel (viewing the board at an earlier state).
  • UI Agnostic: Vanilla JS client with bindings for React / React Native.
  • Component Toolkit: Components for hex grids, cards, tokens.

The framework is modular and made up of pluggable adapters, so you can swap out any part of it with your own custom implementation. For example, you can connect it to any storage backend, or change the underlying websocket layer to a different implementation. Even though bindings are provided for React, you can use the vanilla JS client to connect it to any client-side framework (see the examples in this repository for how to use threejs).

Usage

Installation

$ npm install --save boardgame.io

Running examples in this repository

$ npm install
$ npm start

Changelog

See changelog.

Contributing

See the contributing guidelines. Also take a look at the roadmap to find things that you could contribute to.

License

MIT

About

State Management and Multiplayer Networking for Turn-Based Games

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 90.1%
  • Svelte 4.5%
  • JavaScript 3.3%
  • Python 1.6%
  • CSS 0.2%
  • HTML 0.2%
  • Other 0.1%