Skip to main content
Dev Log: Multiplayer Architecture
CodeEngineeringNetworking

Dev Log: Multiplayer Architecture

How we achieved zero-lag P2P gaming using deterministic seeds.

GI
Gal Itach
15 min read

The Problem: Lag in Card Games

In most online TCGs, when you draw a card, your device asks a remote server "What card did I get?". The server calculates, then sends the result back. If your internet connection is unstable, the game freezes.

For Covenant Cards, we wanted a "Play Anywhere" experience—planes, subways, bunkers. We needed a system that requires almost zero bandwidth and no constant server handshake.

The Solution: Deterministic Netcode

Instead of sending heavy asset data or card IDs back and forth, our multiplayer engine only exchanges Inputs and a Master Seed.

How it works:

  1. The Handshake: When Player A and Player B connect, they exchange a single large integer: The Seed.
  2. The Local Simulation: Both devices initialize their Random Number Generators (RNG) using that identical seed.
  3. The Prediction: Because the seed is identical, both devices already know what the next 100 cards drawn will be, without needing to ask the network.
  4. The Gameplay: When Player A draws a card, they simply send the signal "Draw". Player B's device executes the command locally, and because the RNG is synced, it produces the exact same card outcome instantly.

Results

  • Zero Latency: The game feels instant because the logic happens locally on your device.
  • Offline Tolerance: If the internet cuts out for 5 seconds, the game doesn't disconnect. It just queues the inputs and re-syncs instantly when the data packet gets through.
  • Security: To prevent cheating, we use a "Commit-Reveal" cryptographic scheme where players exchange hashes of their future moves before revealing the moves themselves.

This architecture allows Covenant Cards to support Peer-to-Peer play over Bluetooth in "Travel Mode," something practically no other major TCG currently offers.

Live System NoticeActive Development

Covenant Cards is a living, evolving simulation. While this archive strives for accuracy, the Architects (Developers) frequently deploy new patches, balance updates, and timeline extensions. Some card stats or mechanics mentioned above may vary in the latest build (v2.0+).