chuck.js/package.json
Jeena 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

43 lines
990 B
JSON
Executable file

{
"name": "chuck.js",
"author": "logsol <fartman@gmx.de>",
"contributors": [
"Jeena Paradies <spam@jeenaparadies.net> (https://jeena.net)"
],
"description": "Multiplayer browser jump and run game",
"version": "0.1.0",
"homepage": "http://chuck-game.tumblr.com/",
"repository": {
"type": "git",
"url": "https://github.com/logsol/chuck.js"
},
"bugs": {
"url": "https://github.com/logsol/chuck.js/issues",
"email": "fartman@gmx.de"
},
"main": "server.js",
"dependencies": {
"chart.js": "^4.4.0",
"express": "^4.18.2",
"node-datachannel": "^0.10.0",
"requirejs": "^2.3.6",
"screenfull": "^6.0.2",
"socket.io": "^4.7.4"
},
"devDependencies": {
"nodemon": "^3.0.2",
"playwright": "^1.59.1"
},
"engines": {
"node": ">=16.0.0"
},
"config": {
"port": "1234"
},
"private": true,
"scripts": {
"start": "node server.js",
"dev": "nodemon server.js",
"prestart": "scripts/build.sh"
}
}