Company
Date Published
Author
Michael Carroll
Word count
2210
Language
English
Hacker News points
None

Summary

StackHack is a multiplayer WebGL game that exemplifies the integration of PubNub with the three.js library, reflecting the evolving landscape of browser-based 3D technologies. Originally inspired by a desire to combine mrdoob's three.js project "voxels" with PubNub, StackHack employs an authoritative server model using Node.js and Express, which helps maintain game integrity by authorizing player actions before they take effect. This contrasts with non-authoritative servers where actions are accepted without verification, leading to potential game manipulation. The server manages player connections via UUIDs and ensures communication through separate "from_server" and "from_client" channels, providing a structured approach to multiplayer interactions. The game features periodic server-initiated wipes to reset the environment, and client-side operations are contingent upon server acknowledgment, demonstrating a robust system designed to prevent unauthorized player actions.