Git Product home page Git Product logo

cerveau's Introduction

Cerveau

The Node.js implementation of a multi-game server intended for games with AIs within the Cadre framework.

{Cadre}

All inspiration taken from MST's SIG-GAME framework, and most of the terminology is assuming some familiarity with it as this is a spiritual successor to it.

Features

  • Multi-Game Multi-Framework
    • One server instance can host multiple games at the same time, and the games can be completely different games.
    • e.g. One server could host Chess, Checkers, Go, etc all at the same time and clients can choose which games to play.
  • A simple Node.js app: Simple to write, fast to run, and very easy to develop in.
  • Easy generation of new games using the Creer codegen
    • Most of the game code is easy to replace using generatedObjName.js files to ease Creer codegene re-runs.
  • Games can be turn based or real time, with turn based code abstracted into an inheritable class.
    • More game prototypes can be added easily as new classes for re-use
  • Non-restrictive game structures.
    • Games state can be structured in any way.
    • Cycles can be created and synched easily between the server and its clients.
  • All logic is server side (here), with states updating for clients after anything changes.
    • Optional support for client side logic
  • Web interface
    • Gamelog viewer with visualizer
    • Automatic general game documentation generation
  • A simple Class system that supports multiple inheritance
  • Truely multi-threaded. As opposed to using Node's internal thread pool, each game session is spun off to a seperate process to run until the game is complete.
  • Networking via TCP
    • Communication via json strings with support for cycles within game references
    • Only deltas in states are send over the network
  • Automatic gamelog generation as a json structure of deltas
  • Extra fields present for Arena and Data Mining purposes
  • Optional authentication with seperate web server for "offical" game matches

How to Run

Make sure Node.js v4.0 is installed then:

npm install
node ./main.js

That's it, your server is running! Now start up two Cadre clients such as the Python or JavaScript clients and connect them to the new server. Or visit the server in your webbrowser to view gamelogs and game documentation.

By default games can be played on port 3000, and the website starts on the game port + 80, so 3080 by default.

How to add games

You could manually code everything, but to more easily sync the game to clients (espcially non-dynamically types ones) use Creer to generate some base code given the basic game structure.

Then fill in the functions for the functions to you make in your game objects. Everything else should be handled by the base classes in both this server and the clients.

Debugging

Use node-inspector, as it's awesome.

The main thread, which runs the website and game Lobby can be debugged as any normal NodeJS app, but game Sessions are run on true seperate threads rather than the Lobby and must be debugged on a different port. By default that port will be: mainThreadPort + gameSession. So if the main thread can be debugged on port 5858 (the default node-inspector port), and you want to debug game session 1, it can be debugged on port 5859.

cerveau's People

Contributors

jacobfischer avatar

Watchers

James Cloos 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.