HN
Today

The unlikely story of Teardown Multiplayer

Teardown's developers detailed the 'unlikely story' of adding multiplayer to their highly destructible voxel game, a feature long deemed impossible due to physics synchronization challenges. They opted for a hybrid deterministic approach, combining fixed-point math for destruction with state synchronization for other elements, facing hurdles like script compatibility and late joins. The Hacker News crowd appreciated the deep technical dive into game networking and the ingenious solutions to complex problems, highlighting the engineering prowess required for such a feat.

92
Score
13
Comments
#2
Highest Rank
13h
on Front Page
First Seen
Mar 17, 7:00 AM
Last Seen
Mar 17, 7:00 PM
Rank Over Time
8224688101315192129

The Lowdown

The Teardown developers unveiled the arduous journey of implementing multiplayer into their physics-intensive voxel game, a feature long considered unrealistic due to the complexities of synchronizing a fully destructible world. This post details their technical decisions, challenges, and the eventual success of a feature once thought impossible.

  • Initial Challenges: Early internal experiments and community-led mods demonstrated the immense bandwidth requirements and synchronization difficulties of destructible environments, leading to the dismissal of full determinism.
  • Hybrid Determinism: The chosen approach combines deterministic destruction logic (using fixed-point integer math and command streams) with state synchronization for non-structural elements like object transforms and player positions.
  • Network Architecture: Critical scene-modifying commands are sent via a reliable stream, ensuring order and delivery, while transient state updates use an unreliable stream with eventual consistency and priority queues for bandwidth management.
  • Scripting & Modding: Multiplayer support required adapting the modding architecture, eventually settling on a single script model with shared state and remote calls to balance server/client logic.
  • UI & Terminals: In-game terminals, being interactive scene elements, were synchronized by streaming delta-compressed draw commands from the server to clients, similar to the X Window System.
  • The "Big Merge": A significant challenge was integrating the multiplayer branch back into the main game, which had diverged due to console porting and optimizations, involving months of effort and manual merges.
  • Backwards Compatibility: Maintaining compatibility with existing mods was a core requirement, leading to a modified API that preserved old script functionality in single-player and adapted it where possible for multiplayer.
  • Late Joins: Implementing "join in progress" was solved by recording and replaying a deterministic command stream for new clients, a method balancing data size and computational cost, albeit with buffer limits.
  • Debugging Innovations: The team attempted a single-process, single-window debugging solution for multiple clients, though complexities forced a return to separate processes.

The developers express immense pride in overcoming the "unfavorable circumstances" and the "unlikely" odds, acknowledging the project as a testament to hard work and a valuable learning experience for future engine designs, despite the implementation's "inelegant" nature. They encourage players to enjoy the multiplayer experience while reflecting on the extensive efforts involved.

The Gossip

Deterministic Delights and Floating Point Fiascos

Commenters lauded the technical achievement, especially making the chaotic Teardown simulation deterministic. Discussions delved into the nuances of floating-point determinism, with some noting its feasibility on identical hardware (x86) but extreme difficulty across different architectures (x86 vs ARM), requiring strict control over operations.

Merge Mischief and Join-in-Progress Ponderings

The decision to merge multiplayer into the existing game, rather than making it a separate title, was seen as a sign of integrity, albeit a Herculean task. The article's discussion on late joins sparked questions about the feasibility of alternative data transfer methods, with community members clarifying the practical limitations of streaming entire scene states versus command streams.

Streaming Simulations and Remote Renderings

One commenter proposed a radically different approach: hosting the game on a single machine and streaming individual camera views to players. While acknowledging the potential for perfect consistency, others quickly pointed out the immense bandwidth demands, latency issues, and the impracticality for most users to host such a setup at home.