Show HN: Hathora – Multiplayer Game Development Made Easy (docs.hathora.dev)
Some technical pieces of Hathora I wanted to highlight:
- Hathora includes a system I think of as “gRPC for games”. You define your API in Hathora’s declarative format and the framework spits out typesafe data models, clients, and server endpoint stubs across multiple programming languages (although currently only Typescript is implemented). Minimal packet sizes are achieved through a binary serialization format which includes a delta encoding feature, allowing the framework to efficiently synchronize state by sending data diffs.
- Hathora includes a Swagger-like Prototype UI generated from the API definition. This allows you to view the game state and call server methods all in realtime, letting you interact with your backend logic without writing a single line of frontend code. Once you are happy with the backend logic, you can create a fully custom frontend using any framework/technology you’d like and just use the Hathora client to communicate with the backend.
- By handling generic game functionality (state synchronization, messaging, persistence, etc) for you, Hathora lets you create multiplayer games with very few lines of code. For example, see chess which is implemented in under 200 lines of user code: https://github.com/hathora/hathora/tree/develop/examples/che.... I also made (a massively simplified version of) Among Us in under 200 lines of code: https://github.com/hathora/among-us-tutorial
I am looking for developers interested in making online multiplayer games to try out Hathora and give me feedback. Additionally, if the roadmap seems interesting to you I would gladly welcome contributions: https://docs.hathora.dev/#/roadmap. I’ll be around to answer questions, let me know what you think!
37 comments
[ 3.3 ms ] story [ 76.4 ms ] threadI wonder how reliable the data store is since it’s not using a traditional database. Mainly thinking about performance and consistency.
For production use cases I've been mounting a networked drive (AWS EFS) to provide shared storage across nodes. It should be pretty easy add additional storage adapters (like Postgres) as well.
I think the scope is massive, multiplayer logic can differ quite a bit depending on what needs to happen.
I've been using this project lately and I can recommend stealing from them. https://github.com/johanhelsing/matchbox
Even then, you'd cover only some very specific use-cases of multiplayer game-making.
Thanks for linking matchbox - I've been looking into https://github.com/geckosio/geckos.io as a way to integrate WebRTC into Hathora
The latency will be even further improved once I add UDP support, and I also plan to write a library to make client prediction easier with Hathora.
Would it be a lot of work to add a Lua interface? I think this tool could be very useful for indie devs working on LÖVE/LÖVR projects. I noticed Lua is not part of the roadmap.
I worked on a pong clone last year and it was quite a pain to get the networking reasonably right. It would have been nice if a tool like Hathora could have been used instead.
By the way, does Hathora support NAT hole punching?
Generating a Lua client should be very reasonable. If you'd be interested in contributing (or just want to follow along), feel free to jump on the discord!
I do work on my own hobby projects (games), but I might consider working on the Lua implementation. Will at the very least join the Discord.
I’m a dev that makes web games (gomobo.app) but I’ve always wanted to spend more time building the game logic and UI and less on the networking and infrastructure stuff. I think Hathora is a great way to make your next game idea wayyy faster.
That being said, there are a number of features that make Hathora performant and easy to scale for realtime multiplayer games -- you can read about some of them on the architecture page: https://docs.hathora.dev/#/architecture
I plan on adding benchmarks in the coming weeks to better quantify perf and scalability
Had you explored these at all?
To me, part of the value Hathora adds is from being an integrated and easy to use solution where you don't need to figure out how to put the parts together in order to develop your game.
I'm not sure which way is best, but it is very nice to have the feature support of `.d.ts` files when creating complex message types, as opposed to needing to learn a new thing. Clearly if this is going to be a cross-platform framework (not just web) then using TypeScript as the source-of-truth makes far less sense.
Anyway, very impressed with the binary format/delta encoding feature! That's been something that I know I _should_ do but am putting off until I see signs of sending raw JSON being problematic.
[1] https://github.com/connorjclark/gridia/blob/master/src/proto...
Thank you for the feedback!
I’m particularly interested in the proposed GDscript support (to the level that I want to contribute), but I would recommend separating “packet validation” from “everything else”, so that it could live inside a game-server without the necessary performance cost (however minimal) to an external actor.
I'm not sure I understand the "Hathora-in-the-middle" piece -- Hathora isn't quite a Backend-as-a-Service like Firebase if that's what you were thinking. Hop on the discord server if you're interested and I would be happy to chat in more detail.
I've been building a game for some time now and I've been putting off building the server logic. I had some ideas, and looking at the code examples, it's everything I wanted!
Really nice work here.
A few questions though:
1) It seems that server and frontend logic are tightly coupled into a single project. Is it possible to separate these two and simply have a channel for separately developed frontend application to listen to?
2) The deployment steps only say to start the index file with node, but from the architecture page, this project needs to setup load balancer, multiple instances of the server and a distributed file system. How does running the index file do all this?
3) This appears to be similar to some products offered by photonengine.com, how does it compare?
2) There is a managed cloud coordinator (load balancer) which Hathora apps connect to by default, so you don't need to do anything for that. For the distributed file system I've been using https://aws.amazon.com/efs/, and each cloud provider as their own version.
3) Aren't the photon products tied to Unity?
Would love to chat in more detail in Github or in the discord: https://discord.gg/6nVdeCBffR
Will definitely join the discord.