Repository navigation
Multiplayer and Netcode
AMFI-Disable edited this page Oct 25, 2026
·
2 revisions
RenYing uses serverless WebRTC DataChannels directly between client browsers:
flowchart LR
P1["Player 1 Browser"] <===>|"WebRTC DataChannel (UDP)"| P2["Player 2 Browser"]
P1 -.->|"PeerJS Signaling"| STUN["Public STUN Servers"]
P2 -.->|"PeerJS Signaling"| STUN
- Zero Server Costs: Match data and input packets do not pass through game servers.
- NAT Traversal: Automatic handshake using standard public STUN servers.
To eliminate input lag across network latency:
- Both clients run the simulation locally at 60 FPS using identical random seeds.
- Inputs are exchanged frame-by-frame via UDP.
- When remote input arrives late, the engine snaps back to the diverged frame, replays historical actions deterministically, and resynchronizes the scene seamlessly without visual hitching.
- Continuous frame checksums (
tools/rollback-test.mjs) guarantee zero desync drift.
刃影 RenYing 1.0.1 · Play / 游玩 · Repository / 仓库 · Report a bug / 报告问题 · MIT License