GithubHelp home page GithubHelp logo

p3anoman / web-guardians Goto Github PK

View Code? Open in Web Editor NEW

This project forked from croquet/croquet-for-web-guardians

0.0 0.0 0.0 20.43 MB

Croquet Guardians

Home Page: https://croquet.io/guardians/

License: Other

JavaScript 88.20% HTML 11.80%

web-guardians's Introduction

Croquet Guardians

Guardians is an open-source cooperative multiplayer game written by David A Smith using the Croquet Worldcore game engine.

It features massive numbers of AI bots, taking advantage of Croquet’s Synchronized Computation Architecture that uses only client-side code, and where additional bots do not incur additional network traffic or server load. From a Croquet programmer‘s point of view, there is no server. All the multiplayer code is contained in this repository and Worldcore's, yet you won't find networking or server code in either.

This is the Web version of Guardians, there is also a Unity port.

Hack it

  1. install dependencies

     npm i
    
  2. edit apiKey.js with your API key from croquet.io/keys.

  3. run it

     npm start
    

The Game

The game is implemented using Worldcore.

The Lobby

The Lobby is implemented using plain Croquet (not Worldcore).

The lobby is a separate Croquet session. It shows a list of ongoing games. When entering a game, it is loaded in an iframe inside the lobby.

The game will periodically send "croquet-lobby" window messages to its parent iframe, which the LobbyView will use to publish "in-app-session" events to its shared Lobby model. That game-session will be added to the Lobby's sessions Map by its name so other lobby users can see and join it. After a timeout the session will be removed from the map, unless another "in-app-session" event was received.

For a given game session, only one of its user will be "elected" to relay messages to the lobby (see LobbyRelayActor in src/Actors.js and LobbyRelayPawn in src/Pawns.js). All other users will leave the lobby session, and if one of them is elected, only that user will rejoin the lobby session. This ensures scaling for the lobby.

Questions

Please ask questions on our discord.

web-guardians's People

Contributors

croquetx avatar codefrau avatar jenfrolics avatar aranlunzer avatar bbupton 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.