TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Hathora – Multiplayer Game Development Made Easy

89 pointsby hpx7over 3 years ago
Hi HN, this is Harsh, I am the developer behind Hathora. I tried making a simple multiplayer game a few years ago and, as someone with software engineering experience but no gamedev experience, I found it to be very challenging. On top of the challenges of building a single player game, you now have to constantly battle the network and latency, find ways to prevent cheating, and figure out how to make a scalable backend architecture. With Hathora my goal was to encode best practices for online multiplayer game development into a framework so developers can simply focus on implementing their game logic.<p>Some technical pieces of Hathora I wanted to highlight:<p>- 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.<p>- 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&#x2F;technology you’d like and just use the Hathora client to communicate with the backend.<p>- 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: <a href="https:&#x2F;&#x2F;github.com&#x2F;hathora&#x2F;hathora&#x2F;tree&#x2F;develop&#x2F;examples&#x2F;chess" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hathora&#x2F;hathora&#x2F;tree&#x2F;develop&#x2F;examples&#x2F;che...</a>. I also made (a massively simplified version of) Among Us in under 200 lines of code: <a href="https:&#x2F;&#x2F;github.com&#x2F;hathora&#x2F;among-us-tutorial" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;hathora&#x2F;among-us-tutorial</a><p>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: <a href="https:&#x2F;&#x2F;docs.hathora.dev&#x2F;#&#x2F;roadmap" rel="nofollow">https:&#x2F;&#x2F;docs.hathora.dev&#x2F;#&#x2F;roadmap</a>. I’ll be around to answer questions, let me know what you think!

15 comments

hotenabout 3 years ago
When making the netcode for my web game, I highly valued TypeScript support so to get it by default, I defined the message types in TypeScript so they could be used directly[1]. I see that this framework defines its messages in .yml and converts it to types (stored in a folder kept out of source control).<p>I&#x27;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.<p>Anyway, very impressed with the binary format&#x2F;delta encoding feature! That&#x27;s been something that I know I _should_ do but am putting off until I see signs of sending raw JSON being problematic.<p>[1] <a href="https:&#x2F;&#x2F;github.com&#x2F;connorjclark&#x2F;gridia&#x2F;blob&#x2F;master&#x2F;src&#x2F;protocol&#x2F;protocol.d.ts" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;connorjclark&#x2F;gridia&#x2F;blob&#x2F;master&#x2F;src&#x2F;proto...</a>
评论 #30445722 未加载
jkchuover 3 years ago
I’ve gotten to know Harsh and we even built a game together with Hathora. We made a digital board game together in a week.<p>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.
评论 #30444935 未加载
rangunaabout 3 years ago
Wow just wow!<p>I&#x27;ve been building a game for some time now and I&#x27;ve been putting off building the server logic. I had some ideas, and looking at the code examples, it&#x27;s everything I wanted!<p>Really nice work here.<p>A few questions though:<p>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?<p>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?<p>3) This appears to be similar to some products offered by photonengine.com, how does it compare?
评论 #30456718 未加载
thebeardisredover 3 years ago
It sounds very much like your stated goals (&quot;...battle the network and latency, find ways to prevent cheating, and figure out how to make a scalable backend architecture&quot;) are very much in alignment with Agones (<a href="https:&#x2F;&#x2F;agones.dev" rel="nofollow">https:&#x2F;&#x2F;agones.dev</a>) and it&#x27;s sub-projects Quilkin (<a href="https:&#x2F;&#x2F;github.com&#x2F;googleforgames&#x2F;quilkin" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;googleforgames&#x2F;quilkin</a>), Open-Match (<a href="https:&#x2F;&#x2F;open-match.dev&#x2F;site&#x2F;" rel="nofollow">https:&#x2F;&#x2F;open-match.dev&#x2F;site&#x2F;</a>), and Open-Saves (<a href="https:&#x2F;&#x2F;github.com&#x2F;googleforgames&#x2F;open-saves" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;googleforgames&#x2F;open-saves</a>).<p>Had you explored these at all?
评论 #30446033 未加载
评论 #30444833 未加载
CGamesPlayover 3 years ago
Really like what I&#x27;m seeing here! I wish instead of a YML file I could provide a `.d.ts` file and you could understand that. That would be much more natural for me to code in.
评论 #30444073 未加载
matrixcubedabout 3 years ago
I’m really rather excited to see <i>communication protocol as code</i>, however what sort of latency does having “Hathora-in-the-middle” incur?<p>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.
评论 #30446567 未加载
hashamaliover 3 years ago
Looks interesting. We&#x27;ve evaluating multiplayer server frameworks at the moment and have decided on Nakama (<a href="https:&#x2F;&#x2F;github.com&#x2F;heroiclabs&#x2F;nakama" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;heroiclabs&#x2F;nakama</a>). Any thoughts on how Hathora compares? Particularly interested in the realtime multiplayer component, specifically around performance and scalability.
评论 #30444715 未加载
jokethrowawayover 3 years ago
Very interesting!<p>I think the scope is massive, multiplayer logic can differ quite a bit depending on what needs to happen.<p>I&#x27;ve been using this project lately and I can recommend stealing from them. <a href="https:&#x2F;&#x2F;github.com&#x2F;johanhelsing&#x2F;matchbox" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;johanhelsing&#x2F;matchbox</a><p>Even then, you&#x27;d cover only some very specific use-cases of multiplayer game-making.
评论 #30443873 未加载
nsrivover 3 years ago
I&#x27;m far removed from this area of making software but I have to say I absolutely love the name (&quot;Hammer&quot; in Hindi)!
评论 #30446400 未加载
tluyben2over 3 years ago
Well done! Maybe this will kick me to make a game I have been wanting to make for several years already.
评论 #30444285 未加载
terrycodyabout 3 years ago
Since most developers&#x2F;companies nowadays will choose an engine to start, I highly suggest you made this into a Unity&#x2F;Unreal&#x2F;Godot plugin&#x2F;addon, this should be popular.
评论 #30450808 未加载
dsiddharthover 3 years ago
This looks like a neat framework to build games quickly — congrats!<p>I wonder how reliable the data store is since it’s not using a traditional database. Mainly thinking about performance and consistency.
评论 #30443079 未加载
wsc981over 3 years ago
Seems interesting.<p>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&#x2F;LÖVR projects. I noticed Lua is not part of the roadmap.<p>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.<p>By the way, does Hathora support NAT hole punching?
评论 #30444531 未加载
continuationalover 3 years ago
I figure latency hiding the primary challenge in networked games. Does this framework help with that?
评论 #30444607 未加载
StopDarkPatternabout 3 years ago
Are they integrating with Easy Anti-Cheat?
评论 #30445738 未加载