Code Monkey home page Code Monkey logo

web-marbles's Introduction

⚠️ ARCHIVED

This project is no longer active. We have no intent to work any further on it, at least in the foreseeable future.


Discord Dependencies Patreon

web-marbles

Cinematic shot of the level with some marbles rolling down

Aims to recreate Marble Racing from the ground up, as a fully web based game. The goal is to make it cost-effective, being able to run it on a relatively low-cost server leaving all rendering to the client. Inspired by the original Marble Racing Twitch game.

This project is very much a work in progress.

Project configuration

You can find how to set up the project here.

Concept

To keep server load to a minimum, all it does is handle basic game logic and the physics simulation. It runs the physics simulation locally and sends over the resulting data to all the clients. Only positions and rotations of the marbles have to be synced real-time, other data can be pre-loaded and generated based on RPCs.

Limitations

Since there is no simple UDP API / standard for the web yet, we are limited to TCP only. This means our packets will quickly clog the websocket if the client's internet is too slow or unstable. I've built around this by limiting the amount of packet requests that can be done, but it's not comparable to proper UDP.

Additionally, when there are many marbles to sync, this will significantly stress the network. This is a problem for both the server and the client as bandwidth is limited. This is likely to be the biggest issue with this implementation, so a lot of care will be put in optimizing and minimizing network impact.

Downloading assets can be costly when it comes to bandwidth, and should probably be done from a different server, ideally by a CDN. This reduces the impact on the real-time connections of the game server.

Since the client has to render their own scene, I won't be able to guarantee the same level of visual fidelity for every client.

Advantages

Since the client has to render their own scene, they can completely independently pick their own camera angles. Even so, a shared camera is still possbile through identical tracking algorithms.

Only the physics run on the server which are relatively resource efficient. My $5 DigitalOcean VPS handles it nicely up to at least 100 marbles. Slowdowns do happen with more marbles, but it keeps on going nonetheless.

web-marbles's People

Contributors

dependabot[bot] avatar merlijnvanderkamp-bc avatar qaomen avatar sanquinary avatar zemanzo 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.