Realtime Games for the Web with WebRTC and Hasura GraphQL Subscriptions
The text describes the creation of a real-time game for web using WebRTC and Hasura GraphQL subscriptions. The game was designed to be played on a large screen with players scanning a code to initiate a game request, while an admin could accept or reject these requests. To manage interactions between player, admin, and stage, subscriptions were used. However, subscription latency wasn't fast enough for actual gameplay mechanics, so WebRTC was employed for ultra-low-latency web connections. The text also explains the technical aspects of WebRTC, including offer/answer interchange in Session Description Protocol (SDP) and Interactive Connectivity Establishment (ICE). Hasura subscriptions were used to send offers and answers between devices. Lastly, gameplay data was stored in Hasura for accessing high-scores and player lists.
Company
Hasura
Date published
March 10, 2022
Author(s)
Jesse Martin
Word count
1009
Language
English
Hacker News points
None found.