5 ms·
What does it use for networking?
by borplk 9y ago
What does it use for networking?
- stuxnet79 9y agoVery curious about this as well. I was expecting this submission to be an endorsement for WebRTC.
- meritt 9y agoWebRTC really isn't suitable for multiplayer gaming due to it being entirely P2P. You need the server to operate as a single source of truth and enforce clients to play by the rules.
- TheCowboy 9y agoIs it entirely P2P? It seems like it has use cases for streaming audio and video, where low-latency is desired and dropped packets are acceptable.
- meritt 9y agoYep. The server provides signaling (who the peers are, what data is being requested/should be snet, etc) but you're absolutely correct: WebRTC primarily envisioned for high-bandwidth peer-to-peer suitable content such as video/audio/file-sharing. People have tried using it for gaming (e.g. server is the master peer) but it's tenuous and folks should just stick to WS.
- lxtx 9y agoIt is not entirely P2P, a server can act as a "peer" for all clients and handle the connections itself.
- deleted 9y ago[deleted]
- londons_explore 9y agoHaving both models works well... TCP from a master server to every client. and UDP low latency links from every client to every other client. The client code sends a sample of received UDP packets to the server over the TCP connection, who will then verify that all info contained in the packets is true and accurate and nobody was cheating. It's a nice model because you get the super low latency between clients, and at the same time within a few hundred milliseconds you can detect cheaters and kick/ban them. Obviously, you have to design your game to handle asynchronous lossy information from many different sources and nobody having a complete and whole view of the game until half a second later or so. Thats quite do-able though by timestamping every event and then running rollback-able or checkpointed synchronous simulation on all clients.
- alanning 9y agoKnow of any games that have implemented this method?
- gregmac 9y agoI'm not that familiar with WebRTC, but can the server not act as the only peer?
- fivesigma 9y agoJust plain ol' Websockets. But with a twist. I use 2 WS connections mirroring some packets on both, to deal with head-of-line blocking.
- johnhenry 9y agoInteresting. Could you talk more about this?
- fivesigma 9y agoWill do when this is over. Right now I'm trying to prevent servers from melting. HN traffic...
- Meegul 9y agoYou've done a great job! It's stayed very responsive for the time I've played. I haven't even noticed any dropped packets, so your method for dealing with them seems to be working very well despite the high load.