Code Monkey home page Code Monkey logo

wildwestonline's Introduction

WildWestOnline

Prototyping a game engine for the Bang! card game

Trading card games: a form of competitive activity played according to rules. it is turn based, cards have properties and have rules. Currently, there is no good way to prototype trading card games and then be able to test the workings and the implications of rules in these games.

DSL: Domain Specific Languages are computer languages designed for a specific domain. Since DSLs result in programs that are smaller and easier to understand, they allow even non-programmers to read, write and understand the language.

Key Features

  • Game DSL
  • Serializable game object
  • Composable rules
  • Support classic Bang! and extensions
  • Replay
  • Hot reload
  • Multiplayer online

MetaModel

  • Game: Global metaclass which contains all elements in a game.
  • Player: Players who are participating in a game.
  • Rule: Rules define the constraints of a game. Rules are either game-wide, or specific to one card.
  • Card: Cards that are used in a game. Cards can have multiple properties, define additional rules, have actions that can be played and have side effects that happen when they are being played.
  • Action: Any action changing the game state. It can be performed by a player or by the system.
  • Effect: Action applied when playing a card. An Effect may be resolved as a sequence of actions
  • Queue: Commands queue
  • Option: a choice that have to be taken by player when resolving sequence

Event solving

  • The engine is event driven
  • The process of resolving an event is similar to a depth-first search using a graph
  • Some effects may be blocked waiting user input. Then options are displayed through state

Architecture

Redux architecture is meant to protect changes in an application’s state. It forces you to define clearly what state should be set when a specific action is dispatched.

  • There is a single global state kept in store.
  • State is immutable.
  • New state can be set only by dispatching an action to store.
  • New state can be calculated only by reducer which is a pure function.
  • Store notifies subscribers by broadcasting a new state.
  • It is best to separate each responsibility into different middleware. You can then easily enable or disable some features.

Store projection

The app should have a single real Store, holding a single source-of-truth. However, we can "derive" this store to small subsets, called store projections, that will handle a smaller part of the state for each screen. So we can map back-and-forth to the original store types.

Overview of app modules

Sequence diagram

Online gameplay uses shared database

wildwestonline's People

Contributors

stephtelolahy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.