Multiplayer Netcode


Role


Lead Networking Programmer on Kindred Fates, a peer-to-peer action combat RPG with 1v1 PvP. Full responsibility for netcode architecture, optimization, and gameplay programming to deliver responsive multiplayer combat over high-latency P2P connections.


Key Achievements


  • Reduced network bandwidth by 75% through custom bit-packing, quantization, and variable-length encoding optimizations
  • Eliminated input lag on connections up to 200ms ping using client prediction and adaptive animation timing
  • Achieved 100% input reliability with custom counter-based system handling unlimited packet loss
  • Delivered responsive P2P combat that feels competitive despite lacking dedicated servers

Technical Solutions


Latency Mitigation

  • Implemented client prediction for instant visual feedback on ability inputs, masking server round-trip delays
  • Developed ping-adaptive animation system that dynamically speeds up server-side anticipation frames by up to 100ms
  • Created seamless rollback for cancelled abilities when server authority conflicts with client prediction

Bandwidth Optimization

  • Engineered custom bit-packing system reducing quaternion rotations from 16 bytes to 4 bytes (75% reduction)
  • Implemented 4-bit input counters packed into 32-bit integers, sending 40 input types in just 5 network packets
  • Leveraged Unity Netcode's variable-length encoding and delta compression through strategic data design

Reliable Input Handling

  • Built custom input counter system supporting unlimited dropped packets without input loss
  • Designed separate press/release events for held inputs with automatic server-side state reconciliation
  • Implemented robust packet loss recovery handling connections with 30%+ packet loss rates

Impact


Transformed P2P action combat from unplayable on poor connections to competitive-feeling gameplay. The netcode optimizations enabled smooth 1v1 PvP even on connections exceeding 150ms ping, directly supporting the game's core multiplayer vision.