DEV Community

Cover image for Hathora: Multiplayer Made Easy
Harsh Pandey for Hathora

Posted on

Hathora: Multiplayer Made Easy

More multiplayer games are being developed than ever before, but building & launching a successful online multiplayer game remains one of the most notoriously difficult endeavors in the software world. The biggest challenges developers face are (1) choosing and correctly implementing the technologies to enable multiplayer, and (2) ending up with an architecture that you can operate and scale.

If you are starting a new game from scratch, you are inundated by a multitude of choices:

  • How should I set up my project structure?
  • Should I use peer-to-peer or client-server architecture?
  • TCP, UDP, WebSockets, or WebRTC for networking?
  • How should I implement authentication?
  • How do I persist data?

For the amount of demand for multiplayer games, the development process should not be as hard as it is today. Armed with a passion for multiplayer games and extensive experience building & operating scalable systems, we have been working on a solution. Enter Hathora: a framework for building multiplayer games.

Hathora can be used for:

  1. ๐ŸŽฒ Turn-based multiplayer games - Examples: Chess, Words with Friends, Codenames, etc
  2. ๐ŸŽฎ Realtime multiplayer games - Examples: Among Us, Agar.io, Slither.io, etc
  3. ๐Ÿ’ฌ Realtime & social applications - Examples: chat apps, delivery tracking apps, etc

We've built Hathora to provide the most streamlined development experience when starting a multiplayer game from scratch. The framework provides the right abstractions such that a game can be prototyped in minutes and scaled to millions of users.


Prototype in Minutes

Hathora's philosophy is to minimize the burden on the developer by allowing them to focus only on functionality specific to their game, while the framework serves as the engine to power the remaining machinery. We are pushing the limits of game development to drastically reduce the time it takes to ship a game.

Autogenerate type-safe data model and clients

All Hathora projects start by defining their API using Hathora's language agnostic declarative API format. From this definition, Hathora generates typesafe data models and clients for the language of your choice.

Hathora frees you from the extensive boilerplate normally required for client/server applications.

Hathora codegen

Write server logic in 20-100x fewer lines of code

Write backend logic seamlessly in the language of your choice. Just read and update in memory state, no database queries or ORMs needed โ€“ Hathora automatically manages persistence behind the scenes.

Hathora backend logic

Iterate faster with the Prototype UI

Test your backend logic without writing any frontend code using the built in Prototype UI. Create & join rooms, call server methods, and interact with live data all from within your browser.

Hathora enables play testing from the first minute.

Hathora Prototype UI

Flexible, cross-platform client support

Once the backend functionality has been verified, itโ€™s easy to use the generated client to build your UI in your platform and technologies of choice and share the game with the world.

The Hathora client fully handles networking, and easily integrates into any frontend technology/platform of your choice.

Hathora custom UI

Other features you get out of the box with Hathora:


Scale to Millions

Once you've built & released your game, you don't want to spend the next 6 months battling scaling issues and reworking the architecture to meet your user demand. Hathora includes several key components that make it so you can be production-ready from day 1.

Hathora Coordinator

Central to the Hathora architecture is the managed Coordinator service, which sits between Hathora clients and Hathora backends.

Hathora coordinator

The coordinator plays several key roles in the architecture:

  1. It ensures consistent routing so that clients playing the same game get routed to the same backend instance.
  2. It load balances games between backend instances to ensure an even distribution of traffic.
  3. It reduces latency by dynamically assigning games to instances based on the geographic distribution of the connecting users.
  4. It handles backend failover by automatically migrating the games from the failed instance to a new instance, all of which is transparent to clients.

Hathora Protocol

The Hathora Protocol governs the communication between clients and servers. It is flexible, lightweight, platform & transport agnostic.

At the core of the protocol lies a highly optimized serialization format. All data is binary encoded and servers send only delta updates to clients after the initial snapshot. The encoding/decoding code is generated from the API definition and is incredibly efficient so as to minimize latency while sending and receiving messages.

Hathora Cloud

Although it will always remain possible to self host your backend instances, for those who do not wish to manage their own infrastructure we have built Hathora Cloud.

Hathora Cloud is a platform for running Hathora applications at scale. It has features like autoscaling, multi-region deployments, monitoring & analytics, and migration management. Hathora Cloud makes it simple to deploy your game servers globally and scale to millions of users.

Hathora Cloud is currently in private alpha, sign up using this form.


Get started with Hathora today.

Top comments (0)