<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hathora</title>
    <description>The latest articles on DEV Community by Hathora (@hathora).</description>
    <link>https://dev.to/hathora</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F5504%2F55b8e55d-4f46-4e4d-9478-3438c8954a1c.png</url>
      <title>DEV Community: Hathora</title>
      <link>https://dev.to/hathora</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hathora"/>
    <language>en</language>
    <item>
      <title>Hathora: Multiplayer Made Easy</title>
      <dc:creator>Harsh Pandey</dc:creator>
      <pubDate>Tue, 19 Apr 2022 16:21:16 +0000</pubDate>
      <link>https://dev.to/hathora/hathora-multiplayer-made-easy-36cl</link>
      <guid>https://dev.to/hathora/hathora-multiplayer-made-easy-36cl</guid>
      <description>&lt;p&gt;More multiplayer games are being developed than ever before, but building &amp;amp; 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.&lt;/p&gt;

&lt;p&gt;If you are starting a new game from scratch, you are inundated by a multitude of choices:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;em&gt;How should I set up my project structure?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Should I use peer-to-peer or client-server architecture?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;TCP, UDP, WebSockets, or WebRTC for networking?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;How should I implement authentication?&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;How do I persist data?&lt;/em&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;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 &amp;amp; operating scalable systems, we have been working on a solution. Enter &lt;a href="https://hathora.dev/"&gt;Hathora&lt;/a&gt;: a framework for building multiplayer games.&lt;/p&gt;

&lt;p&gt;Hathora can be used for:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;🎲 Turn-based multiplayer games - Examples: Chess, Words with Friends, Codenames, etc&lt;/li&gt;
&lt;li&gt;🎮 Realtime multiplayer games - Examples: Among Us, Agar.io, Slither.io, etc&lt;/li&gt;
&lt;li&gt;💬 Realtime &amp;amp; social applications - Examples: chat apps, delivery tracking apps, etc&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;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.&lt;/p&gt;




&lt;h1&gt;
  
  
  Prototype in Minutes
&lt;/h1&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Autogenerate type-safe data model and clients
&lt;/h2&gt;

&lt;p&gt;All Hathora projects start by defining their API using Hathora's language agnostic declarative &lt;a href="https://docs.hathora.dev/#/hathora-yml"&gt;API format&lt;/a&gt;. From this definition, Hathora generates typesafe data models and clients for the language of your choice.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hathora frees you from the extensive boilerplate normally required for client/server applications.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--MralBkjN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wxks7t20pyatl7t25t7z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--MralBkjN--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wxks7t20pyatl7t25t7z.png" alt="Hathora codegen" width="880" height="457"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Write server logic in 20-100x fewer lines of code
&lt;/h2&gt;

&lt;p&gt;Write backend logic seamlessly in the language of your choice. Just read and update in memory state, no database queries or ORMs needed – &lt;em&gt;Hathora automatically manages &lt;a href="https://docs.hathora.dev/#/state?id=persistence"&gt;persistence&lt;/a&gt; behind the scenes&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--r298gGhu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ttqtgwf9r50tojk6tkfc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--r298gGhu--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ttqtgwf9r50tojk6tkfc.png" alt="Hathora backend logic" width="880" height="705"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Iterate faster with the Prototype UI
&lt;/h2&gt;

&lt;p&gt;Test your backend logic without writing any frontend code using the built in &lt;a href="https://docs.hathora.dev/#/type-driven-development?id=prototype-ui"&gt;Prototype UI&lt;/a&gt;. Create &amp;amp; join rooms, call server methods, and interact with live data all from within your browser.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Hathora enables play testing from the first minute.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--cYw-fgJl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8c75pcxfulnackd4tn6v.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--cYw-fgJl--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8c75pcxfulnackd4tn6v.gif" alt="Hathora Prototype UI" width="880" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Flexible, cross-platform client support
&lt;/h2&gt;

&lt;p&gt;Once the backend functionality has been verified, it’s easy to use the generated client to &lt;a href="https://docs.hathora.dev/#/client?id=fully-custom-frontend"&gt;build your UI&lt;/a&gt; in your platform and technologies of choice and share the game with the world.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;The Hathora client fully handles networking, and easily integrates into any frontend technology/platform of your choice.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mwO3QxcX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0vozwzyfmd6zbia52wt.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mwO3QxcX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v0vozwzyfmd6zbia52wt.gif" alt="Hathora custom UI" width="800" height="532"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Other features you get out of the box with Hathora:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Automatic &lt;a href="https://docs.hathora.dev/#/data-flow"&gt;state synchronization&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Optimized &lt;a href="https://docs.hathora.dev/#/networking"&gt;networking&lt;/a&gt; (binary protocol, delta encoding)&lt;/li&gt;
&lt;li&gt;Built in &lt;a href="https://docs.hathora.dev/#/auth"&gt;authentication&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Project structure generation &amp;amp; development server with hot reloading&lt;/li&gt;
&lt;/ul&gt;




&lt;h1&gt;
  
  
  Scale to Millions
&lt;/h1&gt;

&lt;p&gt;Once you've built &amp;amp; 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hathora Coordinator
&lt;/h2&gt;

&lt;p&gt;Central to the Hathora architecture is the managed Coordinator service, which sits between Hathora clients and Hathora backends.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--DtLfAkgw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aceffybqevznfbvjzq4z.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--DtLfAkgw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/aceffybqevznfbvjzq4z.png" alt="Hathora coordinator" width="880" height="1046"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;The coordinator plays several key roles in the architecture:&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Hathora Protocol
&lt;/h2&gt;

&lt;p&gt;The Hathora Protocol governs the communication between clients and servers. It is flexible, lightweight, platform &amp;amp; transport agnostic.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hathora Cloud
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

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

&lt;p&gt;Hathora Cloud is currently in private alpha, sign up using &lt;a href="https://docs.google.com/forms/d/e/1FAIpQLSeGhyNzKozcxNj4zgxi0w3mxup58752JBqCum63-HuHX7X30Q/viewform"&gt;this form&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;a href="https://docs.hathora.dev/#/"&gt;Get started with Hathora today.&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>javascript</category>
      <category>programming</category>
      <category>gamedev</category>
    </item>
  </channel>
</rss>
