Commit graph

90 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
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
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
c87997c774 fixes #147, fixes #136, is related to but doesnt entirely complete #144 2016-08-28 22:40:25 +02:00
Jeena
f35b9f5ba9 fixed flip for RubeDoll 2015-08-02 17:22:41 +02:00
logsol
0edde06d67 only adds lastMovedBy when there was no damage - fixes #99 2015-08-02 11:38:45 +02:00
Jeena
2e01a093fc first step of rotating limbs in RubeDoll 2015-06-28 16:26:52 -07:00
logsol
8e9ce62e19 merges from rubedoll 2015-06-22 00:22:00 +02:00
logsol
8e70eedbce added setting to switch off pointer lock filter 2015-05-11 11:10:30 +02:00
logsol
da7e0758bb changed box2d calculation config #158 2015-05-11 11:10:30 +02:00
logsol
ca1ca7635b implemented rubedoll level item (not after dying yet) 2015-05-11 11:10:30 +02:00
Logsol
6233588e63 cleared items of player fingerprints (lastMovedBy). fixes #92 2015-05-03 12:45:35 +02:00
Jeena
ed35071fff fixes enemy stat update 2015-04-19 18:13:53 +02:00
Jeena
a66a327386 fixes the sending and rendering of game stats 2015-04-19 17:31:41 +02:00
Jeena
cad112419d fixes initial level positioning 2015-04-19 16:06:23 +02:00
Jeena
aaa1db4468 hides default layers while loading level 2015-04-19 12:33:45 +02:00
Jeena
0592e2524d added gangsta level and tried to fix on new level 2015-04-12 18:08:11 +02:00
Jeena
aff23e8de0 better handling of dangerousnes, etc. fixes #107 2015-04-02 22:49:43 +02:00
Jeena
46f14c22c6 made fast objects bullets, fixes #126 2015-04-02 21:27:13 +02:00
Jeena
16826b174a fixed debug view and ragdoll start positioning 2015-03-16 01:50:41 +01:00
Jeena
c88afc8b4c fixes #112 finished recorder 2015-03-15 21:06:44 +01:00
Jeena
dfa71bc8e5 added ASSERT, fixed #103 2015-03-15 16:51:38 +01:00
Jeena
1408b6addd first version of recorder 2015-03-12 22:17:34 +01:00
logsol
bbd143eae0 decreased jumping height a bit, was still too high i think 2015-03-12 19:57:05 +01:00
logsol
d975792ebd added a couple of items 2015-03-12 19:55:26 +01:00
logsol
5f5fec5b10 added optimizer scripts and some code style improvements 2015-03-09 04:56:28 +01:00
logsol
6b472dc134 added max user and refactored coordinator/serveruser a bit fixes #105 2015-03-03 23:43:15 +01:00
Jeena
15a267f250 hidden debug printout of layers 2015-03-01 14:54:37 +01:00
logsol
20a974124e added new debug draw 2015-02-28 21:27:42 +01:00
logsol
60eae208a2 Added PointerLockManagement, Fixed layer positioning, added fps chart. fixes #120, fixes #121, fixes #123 2015-02-27 18:44:30 +01:00
Jeena
550d14fbef fixed #110 rewrite of tab-view and better fonts 2015-02-22 17:36:06 +01:00
Jeena
e404ad3598 fixes #78 revisited weight handycap 2015-02-15 01:38:16 +01:00
logsol
d24ab60756 added angular throwing 2014-12-25 00:33:00 +01:00
logsol
58b83f7297 updated pixi to v2 2014-12-21 23:16:35 +01:00
logsol
0a0b3e8849 added simple mode 2014-12-09 15:55:28 +01:00
Jeena
6d9d02615a added pointer locking and viewport moving 2014-12-06 20:20:49 +01:00
Jeena
4dd529e663 Merge branch 'layers' 2014-11-16 01:23:42 +01:00
Jeena
1bdc798540 first stab at background audio 2014-11-16 01:22:58 +01:00
Jeena
7c783d19e8 Refactored abstract method creation 2014-07-27 13:03:40 +02:00
logsol
a58beb58d1 added player arrow to me fixes #76 2014-07-18 17:34:17 +02:00
logsol
ac27da1e31 added zooming with +, - and 0 2014-07-07 23:32:11 +02:00
Jeena
6bc9b7e32b api getMaps for create channel 2014-07-03 20:28:18 +02:00
Jeena
9e6c42f221 removed game.html, fixes #85 2014-06-28 23:43:58 +02:00
logsol
ef98b9dd28 destroying doll body on kill, fixes #66 2014-06-07 15:48:03 +02:00
logsol
e7f4b6043d Implemented local positioning as master - included punkbuster instead of webrtc for now. #49 2014-05-29 18:29:17 +02:00
logsol
ebc3da12fa First successful attempt to implement rube ragdoll into the game. uncomment //type: rube at the bottom of ItemSettings.js to convert banana into invisible ragdoll (only visible in debug mode) - grabbing still pretty buggy. 2014-05-26 04:22:36 +02:00
logsol
c18384f502 begin Round Bug improvements, player renders doll. fixes #64 2014-05-24 17:39:19 +02:00
logsol
40e396fc23 implemented outgoing log filter 2014-03-31 05:01:05 +02:00
logsol
55256ada95 work in progress... worked on channel attributes and game goal. fixes #45 and references #48 2014-03-30 00:12:04 +01:00
logsol
039213cf50 missing commits from last commit 7eb3d0b8b0 2014-03-19 02:40:03 +01:00