Commit graph

20 commits

Author SHA1 Message Date
a0481ed867 Route gameCommand traffic through WebRTC unreliable DataChannel
Socket.IO (TCP) holds back later packets while it retransmits a lost
one, which stalls worldUpdate delivery on lossy long-distance links —
exactly the pattern game state suffers worst from. WebRTC DataChannels
in unreliable mode (ordered:false, maxRetransmits:0) drop late packets
instead of queueing them, which is what we want for high-frequency
state sync.

Adds a per-user WebRTCTransport on top of the existing Socket.IO
connection. Socket.IO stays in charge of bootstrap, signaling
(SDP/ICE exchange), and control messages — only gameCommand payloads
get routed onto the unreliable channel once it's open. If WebRTC
fails to negotiate, gameCommand transparently falls back to
Socket.IO, so the game keeps working unchanged.

A new StatsLogger writes per-session JSONL events (session_start,
webrtc_ready with negotiation time, per-second stats with transport,
RTT samples, recv/send rates, seq gaps) so we can compare real-world
runs (e.g. Germany server <-> Korea client) instead of guessing.
URL flag ?webrtc=0 forces fallback for A/B testing.

scripts/webrtc-browser-test.js spins up a headless Chromium against
a freshly-started server and asserts the unreliable channel opens
and gameCommand traffic actually rides it.
2026-05-11 00:38:18 +00:00
Karl Pannek
e6089687ed 2025 update! 2025-07-15 20:05:12 +02:00
1df7258b56 Upgrade socket.io to 2.x 2017-11-06 22:17:33 +01:00
Jeena
58d5a859fe added chart.js dependency 2015-03-01 10:30:56 +01:00
logsol
005913dae9 restructured scripts for building and some improvements 2014-12-21 23:16:35 +01:00
logsol
f29883d47f Added gzip support #82 2014-12-20 05:30:22 +01:00
logsol
6f288f00b5 Compile and minimize code #82 2014-12-20 04:31:37 +01:00
logsol
ac27da1e31 added zooming with +, - and 0 2014-07-07 23:32:11 +02:00
logsol
5ba9a47948 show an error when port is already in use - fixes #42 2014-02-24 10:39:25 +01:00
logsol
cade476d70 changed url to blog 2014-01-16 23:55:29 +01:00
Jeena
4afc39081d debug draw overlay, fullscreen 2014-01-16 16:09:17 +01:00
Jeena Paradies
e93dbf2f2a fixed requirejs version 2012-11-21 00:12:12 +01:00
logsol
03678eb773 changed minimum node.js version due to childprocess sockethandler bugfix in newer version 2012-07-28 17:08:43 +02:00
Jeena Paradies
b5b10ba0b9 removed node-fork, using native child_process now, the API is the same 2012-07-23 01:11:18 +02:00
logsol
815c63009f working towards usable new structure 2012-07-22 17:54:27 +02:00
logsol
36c0e34dc5 adapted bootstrapping 2012-07-22 01:34:18 +02:00
Jeena Paradies
413dd242ba added start app.js 2012-07-22 00:51:41 +02:00
Jeena Paradies
2c9658012f moved Box2D to Vendor 2012-07-12 22:40:27 +02:00
logsol
2e864f5293 Set up new module structure 2012-07-01 01:32:30 +02:00
Jeena Paradies
7343958214 added package.json 2012-06-17 15:16:17 +02:00