仅支持 JavaScript 生态,非 JS 项目需另选方案;联机与存储能力依赖其内置服务端,需自行部署托管
boardgame.io
boardgameioMIT活跃维护用 TypeScript 编写的回合制游戏状态管理与多人联机引擎,帮你省去自己实现回合流转、状态同步和网络对战的麻烦,专注写游戏规则本身。
State Management and Multiplayer Networking for Turn-Based Games
用 JavaScript 写回合制游戏的引擎,自动处理状态同步与在线联机
用 TypeScript 编写的回合制游戏状态管理与多人联机引擎,帮你省去自己实现回合流转、状态同步和网络对战的麻烦,专注写游戏规则本身。
核心能力
- 用纯函数描述走子后的状态变化
- 自动同步客户端、服务端与存储的游戏状态
- 实时多人联机,跨平台保持状态一致
- 自动生成可对战的 AI 机器人
- 支持阶段规则、大厅匹配与可回放日志
容易踩的坑
暂无 release 数据(可能没有发版,或尚未同步)。
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
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.