Damn I saw the title and thought this would be a solution for easily making realtime multiplayer games, got so excited because it's really very difficult right now. But this is more like roblox or something, not a tool for setting up a realtime server to sync data across clients.
Devs out there: if you make something like firebase that lets you realtime sync in-memory server data (instead of db data like firebase) among clients in a cost-efficient way such that it's viable for multiplayer browser games and mobile apps, there are a lot of people who would pay for it. Me most of all. I would pay $100+/mo on a starter plan for it, even before I scaled.
You really have to have serious technical chops to do this well right now, and it's a big barrier to entry.
The 19yo who wrote Agar.io single-handedly is nothing short of a savant.
I got what I needed for implementing interpolation from one of these videos, definitely recommend them. Godot is great but it would rock if interpolation support was as deep as puppet/rset support (which, it turns out, works great at lan speeds but can fall apart in high latency situations)
I wrote a minecraft clone with full physics sim, and networked multiplayer synced state between all clients. I had to spend a LOT of time on the multiplayer physics state propagation, it requires perfect clock synchronization, both client and server side predictions, interpolations, extrapolations and render-interpolations to maintain smoothness with hundreds of physics objects tumbling and flying around after explosions etc. It's extremely complicated and it's not going to help just having some sort of cloud SDK replicating an in-game memory area unfortunately.
But if your goal is not networked physics, it's certainly a much more simple problem!
I had been working on this project https://github.com/Fluffy9/Zenbase. I've been trying to figure out what it's good for and making an Agar.io like game is one thing I've started on. Combined with the nts library here to synchronize the clocks of devices https://github.com/gundb/gaming, I think it would be possible
Have you come across Nakama? https://heroiclabs.com/nakama. It's available as a paid service, or free to self host. It integrates nicely with engines like Unity / Unreal, but is equally usable for a browser based game.
Are you wanting something like a cloud-based ... browser/cache basically a users localstorage/db/browser data would be synched in the same format in the cloud?
How are you imagining this? (Burned out dev, looking for a side project).
Context: I started building a synced browser game, having never done anything similar before, and realized that multiplayer game state isn't supposed to be stored in a database, the way firebase works. It's just kept in a server's active process memory, so there's no reads/writes to a DB involved. Otherwise realtime speed would be impossible. I never knew this before, having never worked on it or thought about it. But if you want such a setup, you basically have to write it yourself. And that's hard.
I just wish there was a SaaS (much like firebase) where you sign up and have an API that lets you define the data that your game-state involves (which may be a large schema), and then provides you with a suite of methods for letting clients create, find, and join group sessions ("games", "matches", however you want to call them) where the game-state is synced across all clients in that session until the game ends, with each client being able to modify the game-state within defined limitations (i.e. play the game.) I suppose the server would have to know under what conditions a game ended so that it could notify all players and end the session.
You will need things like client-side prediction, input queues, dead-reckoning, entity interpolation, lag compensation etc etc which means your net code will be need to be tailored for your game. Just outsourcing it like Firebase has done with regular web apps will be really hard without making a lot of assumptions about the client. Adding server authority adds another layer of complexity where you basically need to either run the same engine on the server or simulate the same processes.
With that said, I also want something like this and definitely think it's a problem worth pursuing. I know there's Photon for Unity but I don't know what it actually provides and it's obviously tied to a specific engine.
Yes! It is a complicated problem. And it just leaves me laying awake wondering how a 19yo solved it so effectively by himself. (agar.io's author) How could he possibly have such depth of skill and knowledge at such an age?
I know, I'm side tracking from productive conversation, sorry for that.
On a lower level, I have been using Colyseus (https://github.com/colyseus/colyseus) which is, in the words of the author: "[...] an Authoritative Multiplayer Framework for Node.js, with clients available for the Web, Unity3d, Defold, Haxe, and Cocos2d-X.". I have been using it on multiple projects as a state synchronisation library for my browser-based games. It takes cares of all the data synching aspecta among all players in a "room". The community is very active and you will get a lot of help to begin with and scale your creations.
Of course, a lot will have to be done by you for anything like client-side prediction, server reconciliation, lag compensation, entity interpolation, but knowing that the state manages itself is already a huge relief if you are unfamiliar with these concepts.
Another project which already includes many of these features is https://github.com/timetocode/nengi. It is more opinionated and well focused on fast-paced games.
On my side, I have been creating an open-source multiplayer game for the browser that includes client-side prediction, entity interpolation and server reconciliation https://github.com/halftheopposite/tosios.
Ooh, this looks very good. I might try colyseus. Thanks for the link. My game is only a card game so it's actually a very simple use case relative to many others. But it isn't turn based, so it's still realtime.
Your spec is a little all over the place; Different multiplayer games need different setups, or more specifically different parts have different requirements.
Matchmaking, lobbies, and rooms are one thing. (Database)
Running an instance of a game (joining, game state, sync points, state authority, game complete) Is another.
Live movement of players which dont affect game/rule state, (ie, jumping up and down doesnt score a point) but wants low latency is another.
For the middle part, i developed https://github.com/NewChromantics/PopNotPoker as an alternative to boardgame.io for easy room creation, sharing, and most importantly to me, exetremely easy game rules (all async js)
The "netcode" would be stuck on top (player movement, voice chat etc), using a bit of player meta for say webrtc session sync (or udp addresses etc etc)
This is an approach I used for 25 years on pc, console and now vr & web games; have "keyframes" where the server/authority dictates new game state to everyone, and everything else is client side predicted and throwaway
I've done this before myself for a pretty simple game and had to build the system alongside it. It's quite fiddly to get right.
I've been working on a new game on and off which is a bit less working with websockets directly and I looked at ably[0] to be that firebase like system, I've found it works reasonably well if you squint, though it's definitely not the same thing.
You can hack together a pretty nice implementation which gets you started using for example using presence[1] to store a minimal dataset associated with synced state. Then derive gamestate off that.
Which you can then expand on.
Though maybe you were wanting a more complete solution =)...
I'm in the same boat as you! Looking to build a real-time multiplayer application (think Figma), and I'm not so sure of what to go for: Mongo is fine I guess but I have a feeling it'll bite me at some point. I've looked into CouchDB, as well as Redis and SQLite.
If anyone has experience with building this kind of thing, I would gladly pay for some consulting.
From what you've written it sounds like it's a great implementation for solving this problem! But I'm only a so-so dev and I just can't do much without great documentation-- the tutorial section on this page just isn't enough for me to feel confident that I can wield this tool in a meaningful way.
Yeah, it's hard, even with documentation there is so much that can't be communicated efficiently.
I'm working on a client that I will try to make more accessible (just like particubes and roblox are trying to do), but no matter how you turn it you're going to need some basic programming skills:
Devs out there: if you make something like firebase that lets you realtime sync in-memory server data (instead of db data like firebase) among clients in a cost-efficient way such that it's viable for multiplayer browser games and mobile apps, there are a lot of people who would pay for it. Me most of all. I would pay $100+/mo on a starter plan for it, even before I scaled.
You really have to have serious technical chops to do this well right now, and it's a big barrier to entry.
The 19yo who wrote Agar.io single-handedly is nothing short of a savant.