Lurker News

Comments (304) 119 threads

Earlier comments
bojo#
Apparently these are called "io games". I was visiting family last month and watched my nephew play these for hours.

Large list here: http://iogames.space

smnscu1 reply#
Staying #1 is incredibly exhilarating. My strategy was upgrading defense and staying out of big clusters while still shooting towards them.
airfoil#
Yes, that strategy works well. I've also found that "hitting the brakes and they'll fly right by" works really well in a knife fight.
borplk2 replies#
What does it use for networking?
stuxnet791 reply#
Very curious about this as well. I was expecting this submission to be an endorsement for WebRTC.
meritt4 replies#
WebRTC 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.
TheCowboy1 reply#
Is 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.

Continue this thread — 1 reply

lxtx#
It is not entirely P2P, a server can act as a "peer" for all clients and handle the connections itself.
londons_explore1 reply#
Having 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.

Continue this thread — 1 reply

gregmac#
I'm not that familiar with WebRTC, but can the server not act as the only peer?
fivesigma1 reply#
Just plain ol' Websockets. But with a twist.

I use 2 WS connections mirroring some packets on both, to deal with head-of-line blocking.

johnhenry3 replies#
Interesting. Could you talk more about this?
fivesigma18 replies#
Will do when this is over. Right now I'm trying to prevent servers from melting. HN traffic...

Continue this thread — 18 replies

DiThi2 replies#
(Not OP but I had the same idea)

When a packet is lost in a TCP stream, it must be retransmitted, and until the client receives it, all further packets are stuck in limbo (received by the client, but cannot be seen). For this reason, most games use UDP instead, and are designed so some packet loss is acceptable (if I received where you are at frame N, it no longer matters if I receive where you were at frame N-1).
Minecraft uses TCP, that's why in very populated servers occasionally you can see the whole world freeze for a second.
In the browser we have UDP with WebRTC data, the problem is that not all browsers support it, it may not work in some places and for now it's more difficult to work with.
An easy compromise is to use several TCP connections, so if one packet is lost, instead of having N packets stuck for a moment, you have 1/N where N is the number of connections. And if important packets are sent through all channels, the chance that they arrive too late is much lower.

Continue this thread — 2 replies

fivesigma#
What DiThi said (read his excellent post)

There's also another important detail. Due to delayed ACKs on Windows and battery-preserving TCP stacks on most mobile devices/laptops, some of your packets will be delayed. Even with TCP_NODELAY. Desktop OSX/Linux do not display this behavior.
The only solution I have found, and it's a rather crude one, is to blast the server every 50ms with a 1-byte packet. It is ugly but it works well.

Load more comments