How dhanoliya-ji/krafton-game-project works
Latency Arena is a real-time multiplayer browser arena built to demonstrate latency-hiding netcode. A player supplies input in the browser; the client predicts movement and sends validated key states through WebSocket. The server assigns a room, queues input, advances an authoritative fixed-timestep world, and returns snapshots. The client reconciles its player, interpolates remote players, renders the result, and reports network metrics. The README also documents live network emulation, bots, matchmaking, and benchmark analysis; some wiring remains unsampled.
Components 18
Client Runtime
- Browser Game
client/src/main.js - Input Samper
client/src/game/input.js - WebSocket Connection
client/src/net/connection.js - Prediction Reconciliation
client/src/game/predictor.js - Entity Interpolation
client/src/game/interpolator.js - Canvas Renderer
client/src/game/renderer.js - HUD Controls
client/src/ui/hud.js
Server Runtime
- Server Gateway
server/src/index.js - Room Manager
server/src/rooms/room-manager.js - Game Room
server/src/rooms/room.js - Network Emulator
server/src/net/link.js
Shared Netcode
- Shared Simulation
shared/simulation.js - Wire Protocol
shared/protocol.js
Game Domain
- Authoritative World
server/src/game/world.js - AI Opponents
server/src/game/bot.js
Measurement
- Benchmark Harness
bench/run-experiments.js - Netcode Analysis
analysis/netcode_analysis.py
Other components
- Player
Connections 20
- Player → Browser Game: plays
- Browser Game → Input Samper: samples input
- Browser Game → Prediction Reconciliation: predicts movement
- Browser Game → WebSocket Connection: sends input
- Browser Game → Entity Interpolation: updates buffer
- Browser Game → Canvas Renderer: draws frame
- Browser Game → HUD Controls: updates HUD
- HUD Controls → WebSocket Connection: sets profile
- Server Gateway → Wire Protocol: decodes messages
- Server Gateway → Room Manager: acquires room
- Server Gateway → Game Room: joins room
- Server Gateway → Network Emulator: transmits input
- Room Manager → Game Room: creates rooms
- Game Room → Authoritative World: steps world
- Authoritative World → Shared Simulation: moves players
- Game Room → AI Opponents: manages bots
- WebSocket Connection → Network Emulator: crosses emulated link
- Network Emulator → WebSocket Connection: delivers snapshots
- Prediction Reconciliation → Shared Simulation: replays inputs
- Benchmark Harness → Netcode Analysis: produces datasets