Commit graph

566 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
47faae81e5 Add standalone POC comparing WebRTC DataChannel vs Socket.IO
Self-contained test under poc-webrtc/ that does not touch the game.
Spins up an Express + WebSocket signaling + node-datachannel server
alongside a Socket.IO server, serves a simple browser client that
runs the same game-like traffic pattern (14Hz worldUpdates, input
events, ping/pong) over either transport based on a URL flag.

Captures per-session stats to a JSONL file and ships an analyze.js
that prints a per-(transport, phase) summary of RTT percentiles,
receive rate, and seq-gap counts so the TCP-vs-UDP-style comparison
becomes quantitative rather than eyeball.

Confirms node-datachannel installs and works on this platform and
that the dual-channel (reliable + unreliable) pattern is feasible
to maintain — both prerequisites for the real integration.
2026-05-11 00:38:01 +00:00
71e4b4e847 Replace cheat-detection teleport with server reconciliation
The old PUNKBUSTER check compared client-reported position to server
position and snapped the player back when latency made them diverge,
which felt like getting teleported under any real network conditions.

Replaces that with proper client-side prediction + reconciliation:
client tags each input with a sequence number and keeps an input
buffer; server tracks the last processed sequence and reports its
authoritative position via a per-user inputAck alongside each
worldUpdate. The client only corrects when the actual disagreement
exceeds what the unacked input time can explain — so steady-state
movement runs purely on local physics, and only genuine unexpected
events (collisions, being hit) trigger a smooth blend toward the
server state.

Includes adaptive threshold scaling so high-latency sessions don't
false-positive corrections during normal running.
2026-05-11 00:37:42 +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
Karl
1bb9539530 adds fixme comment about object.assign for merging 2016-10-28 17:46:39 +02:00
logsol
45ea2dfba3 Fixes some bugs from bulk renaming singleton object variables
Related to #128
2016-10-10 23:41:25 +02:00
logsol
91e0e7af3f Makes singleton variable name of QuerySelector lowercase
When we require a singleton, its instance name should be named
by lowercase, since it is not a class.

Fixes #128
2016-10-10 23:17:16 +02:00
logsol
5b3bfd4370 Makes singleton variable name of OptionsHelper lowercase
When we require a singleton, its instance name should be named
by lowercase, since it is not a class.

Relates to #128
2016-10-10 23:11:18 +02:00
logsol
05c4e4de81 Refactoring of Options. Renamed to OptionsHelper
Because that is what it is.
2016-10-10 23:10:43 +02:00
logsol
ce01c8888e Makes singleton variable name of PointerLockManager lowercase
When we require a singleton, its instance name should be named
by lowercase, since it is not a class.

Relates to #128
2016-10-10 22:42:22 +02:00
logsol
3cb2e39a18 Makes singleton variable name of NotificationCenter lowercase
When we require a singleton, its instance name should be named
by lowercase, since it is not a class.

Relates to #128
2016-10-10 22:11:55 +02:00
logsol
ffc55a204a Makes singleton object variable names of DomController first letter lowercase
When we require a singleton, its instance name should be named
by lowercase, since it is not a class.

Relates to #128
2016-10-10 21:50:03 +02:00
logsol
875a40185e Increases score limit back to a higher value
It had been reduced to 1 for testing.
2016-10-10 20:15:41 +02:00
logsol
8fc1fb5d4e Adds newly generated github API token to "unavailable game" page 2016-10-09 22:00:46 +02:00
logsol
b798e6acac Adds forward walking on shift
The state of the shift modifier is now distributed across the
network. Walking speeds and animation states are being updated
according to it.

Fixes #130
2016-10-09 19:56:06 +02:00
logsol
062402db58 Adds NotificationCenter exception when triggering unknown topic
If you forget to add a certain topic to the Nc, you will
now get an Exception with a meaningful message.
2016-10-09 19:27:10 +02:00
logsol
dba743cd7b Updates obsolete/broken way of clearing fingerprints
When a user leaves the channel, some items need to be cleared of
their fingerprints (lastTouchedBy). This feature was broken
because it used the this.gameObjects pool which was no longer in
use.

The channel GameController now triggers an event to which all
items are subscribed to and if it is triggered, all items with that
users fingerprints clear themselves off those.

Fixes #170
2016-10-09 12:46:07 +02:00
logsol
3a5af058ef Prevents adding damage after round has ended
Because it created double round endings, which led to crashes.
Also moved inBetweenRound state from PlayerController to GameController.
2016-10-01 19:12:52 +02:00
logsol
c068592915 Makes world in Engine private
And some refactoring.
2016-10-01 19:09:52 +02:00
logsol
8641a2dc0b On destroy unsubscribe missing GameObjects from render event
fixes #71
2016-10-01 16:51:43 +02:00
logsol
8b8093b771 Stops sending gameCommands between beginRound and clientReady
Listen for beginRound control command
to set client to be unready again
so it can load its new level without getting
any gameCommands like worldUpdate
2016-10-01 16:08:01 +02:00
logsol
016c48ec3b During first worldUpdate set doll positions after spawning players
Otherwise we get a warning.
2016-10-01 14:01:12 +02:00
logsol
a5f828a861 Adds NETWORK_LOG_FILTER setting to incoming network messages 2016-10-01 13:43:37 +02:00
logsol
fc7866f11e Hides playercontroller within player
In order to not provide deep exposure to PlayerController,
we refactored it so that it is not visible anymore outside Player.

Also we renamed isInBetweenGames to inBetweenRounds.

Moved creation of PlayerController from GameController(s) to
The channel Player and client Me.
2016-10-01 12:19:02 +02:00
logsol
8d8a55cc8c adds core analyzer script which generates the core/channel/client method overview of a class 2016-08-29 00:33:59 +02:00
logsol
c87997c774 fixes #147, fixes #136, is related to but doesnt entirely complete #144 2016-08-28 22:40:25 +02:00
logsol
502cf72a7e fixes #157 2016-08-28 13:24:27 +02:00
Jeena
f35b9f5ba9 fixed flip for RubeDoll 2015-08-02 17:22:41 +02:00
Jeena
0b8d885d48 Merge branch 'master' into subbodies 2015-08-02 16:06:57 +02:00
Jeena
a8adbcf140 fixes position state update and removes dev graphs for better fps 2015-08-02 16:06:32 +02:00
logsol
0edde06d67 only adds lastMovedBy when there was no damage - fixes #99 2015-08-02 11:38:45 +02:00
logsol
e370adf746 worldupdate subbody repositioning - #99 2015-06-29 01:29:57 +02:00
Jeena
2e01a093fc first step of rotating limbs in RubeDoll 2015-06-28 16:26:52 -07:00
logsol
db95465208 fixed a bug in gangsta level 2015-06-29 01:24:05 +02:00
logsol
7cd4cc702b should fix a bug happening on live deployment 2015-06-28 20:11:28 +02:00
logsol
eb29a00012 only adds lastMovedBy when there was no damage - fixes #108 2015-06-28 19:44:26 +02:00
logsol
b46c309dbe Merge branch 'master' of github.com:logsol/chuck.js 2015-06-28 19:11:46 +02:00
logsol
71db5a8a81 removes flashsocket - fixes #117 2015-06-28 19:11:37 +02:00
Karl
8f7be70407 adds video image 2015-06-28 17:06:52 +02:00
logsol
bcecddd5bd added current milestone url to not_available overview 2015-06-22 12:04:33 +02:00
logsol
318b09ca49 adds warning too many recordings. fixes #132 2015-06-22 11:58:13 +02:00
logsol
8e9ce62e19 merges from rubedoll 2015-06-22 00:22:00 +02:00
logsol
07dad646cf new system for synchronizing game objects. fixes #74 2015-06-22 00:14:17 +02:00
logsol
3ef3a6abf9 Merge branch 'ragdoll' of github.com:logsol/chuck.js into ragdoll 2015-05-11 11:12:21 +02:00
logsol
5b68f7e2b6 improving rube doll flipping behaviour and positioning 2015-05-11 11:10:30 +02:00
logsol
f1197b3045 added swapMeshes method to swap textures of 2 meshes 2015-05-11 11:10:30 +02:00
logsol
7115292384 added possibility to not debug-draw sensor shapes 2015-05-11 11:10:30 +02:00
logsol
cb23c1fb05 centered rubedoll head 2015-05-11 11:10:30 +02:00
logsol
8e70eedbce added setting to switch off pointer lock filter 2015-05-11 11:10:30 +02:00