4 ms·
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
by aerovistae 6y ago
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.
- gremlinsinc 6y agoCan you explain more on this ? 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).
- aerovistae 6y agoContext: 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. It just seems very daunting to me.
- halftheopposite 6y agoOn a lower level, I have been using Colyseus (https://github.com/colyseus/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 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 https://github.com/halftheopposite/tosios.
- aerovistae 6y agoOoh, 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.
- Folcon 6y agoI'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 =)... - [0]: https://www.ably.io https://www.ably.io - [1]: https://www.ably.io/documentation/realtime/presence https://www.ably.io/documentation/realtime/presence
- nicholasluimy 6y agowould redis on a server, with webrtc as an interface fit that requirement?
- deleted 6y ago[deleted]
- MikeLumos 6y agoI think this Godot Dedicated Multiplayer series might be interesting to you: https://www.youtube.com/playlist?list=PLZ-54sd-DMAKU8Neo5KsVmq8KtoDkfi4s https://www.youtube.com/playlist?list=PLZ-54sd-DMAKU8Neo5KsV... Godot also makes it very easy to export games to be run in the browser.
- EamonnMR 6y agoI 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)
- ringspun 6y agoHave you come across Nakama? https://heroiclabs.com/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.
- l33tman 6y agoI 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!
- AMerePotato 6y agoI had been working on this project https://github.com/Fluffy9/Zenbase 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 https://github.com/gundb/gaming, I think it would be possible