Socket
Socket
Sign inDemoInstall

github.com/jkomoros/boardgame

Package Overview
Dependencies
59
Alerts
File Explorer

Install Socket

Detect and block malicious and high-risk dependencies

Install

    github.com/jkomoros/boardgame

Package boardgame is a framework that makes it possible to build boardgames with minimial fuss. This package contains the core boardgame logic engine. Other packages extend and build of of this base. package boardgame/base provides base implementations of the various types of objects your game logic must provide. boardgame/moves provides a collection of powerful move objects to base your own logic off of. boardgame/server is a package that, given a game definition, creates a powerful Progressive Web App, complete with automatically-generated animations. The boardgame/boardgame-util command is a powerful swiss army knife of functionality to help create game packages and run servers based on that automatically. The documentation in this package is primarily detail about how the various concepts wire together. For a high-level overview of how everything works and tour of the main concepts, see TUTORIAL.md. The primary entry point for use of this package is defining your own GameDelegate. The methods and documentation from there will point to other parts of this package.


Version published

Readme

Source

boardgame is a work-in-progress package that aspires to make it easy to define multi-player boardgames that can be easily hosted in a high-quality web app with minimal configuration.

You formally define the rules and logic of your boardgame in Go by defining a state object and a series of moves that can be made. You also define a simple Polymer-based web component that renders a given game state client-side.

boardgame is under active development as a hobby project and different components of it vary in their completeness and polish.

Getting started

A comprehensive getting started guide, including a walkthrough of all of the important concepts in a real-world example, is in the tutorial.

Demo

Demo showing automatic card and token animations

Design Goals

  • Don't Repeat Yourself Write your normative logic that defines your game in Go a single time.
  • Minimize Code Writing your game should feel like just transcribing the rules into a formal model, not like a challenging coding exercise.
  • Batteries Included Common operations, like "deal cards from the draw stack to each player's hand until each player has 3 cards" should require barely any logic to accomplish.
  • Minimize Boilerplate Structs with powerful defaults to anonymously embed in your structs, and easy-to-use code generation tools where required
  • Clean Layering If you don't like the default behavior, override just a small portion to make it do what you want
  • Flexible Powerful enough to model any real-world board or card game
  • Make Cheaters' Lives Hard Don't rely on security by obscurity to protect secret game state: sanitize properties before transmitting to the client
  • Identify Errors ASAP If you've configured something incorrectly, ideally it's found either by the type checker or at the moment the program boots up, not later when someone's playing a game. The library is designed to minimize interface{}, allowing you to rely on the type system as much as possible, and many common configuration errors will be detected and reported when you call NewGameManager.
  • Fast Minimal reliance on features like reflection at runtime
  • Minimize Javascript Most client-side views are 10's of lines of templates and databinding, sometimes without any javascript at all
  • Rich animations and UI Common operations like cards moving between stacks should make use of flexible, fast animations computed automatically
  • Robust tooling A swiss-army-knife utility called boardgame-util makes it easy to generate boilerplate code, generate starter projects, run development servers, make sure the database is structured well, and more.

Status

The library is currently relativley full-featured. Here are a few of the known gaps (and the issues that track their status):

  • Support of Multiple Browsers (Issue #394) Currently the web-app only fully works in Chrome, with support for animations in Safari, and with limited testing in other browsers
  • More Contorl over Animations (Issue #396) Currently moves that are applied one after another don't pause to allow animations to play
  • Examples with a board None of the example games in the main repo use a board, which means that tools aimed at board-based-games aren't fleshed out
  • Smooth Upgrading (Issue #184) If you change the shape of the state objects in your game, there's currently no way to handle older versions of the game stored in your database.

Many more small things are still rough or not implemented. Please file issues or comment on existing issues in the tracker for things you're missing!

FAQs

Last updated on 18 Feb 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc