4 ms·
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.
by fivesigma 9y ago
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.
- 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.
- fivesigma 9y agoNothing too fancy. Just proper devops and a lot of testing. https://i.imgur.com/oSwGgFA.png https://i.imgur.com/oSwGgFA.png
- swanify 9y agoWhere are you hosting it? That looks quite custom to gaming
- fivesigma 9y agoIt better be! It's my homegrown panel that I use for all my projects.
- mcescalante 9y agoI would love to hear more about this dashboard in your write up. Would love to create something like this myself :)
- meebs 9y agoDo you have a blog or write ups about this process / your workflow / etc.? I feel as a novice I could learn a lot.
- comboy 9y agoThat is fancy. It is actually so beautiful I got emotional.
- fivesigma 9y agoTHE comboy of bitcoinity fame? I'm honored. I remember donating back in the day!
- comboy 9y agoHuh wow, thanks :) I need to make bitcoinity working as stable as airma.sh does. Congrats on the well earned success btw, clearly the game is here to stay. It would be sweet to be able to change fire from spacebar to something else. Spacebar tends to be big and loud.
- ngrilly 9y agoIs it an home made dashboard or do you use some standard tool?
- pvsukale3 9y agoGreat job with the Game. Would love to read an article about how you developed this game and handled initial traffic.
- Kiro 9y agoReally looking forward to a write-up!
- deleted 9y ago[deleted]
- z3t4 9y agoWould be nice to know what you use for hit detection and interpolation, it seems very smooth!
- Fifer82 9y agoAlso want to show appreciation for your work. I tried to create a game similar to this (I spent 6 months on it). Very basic Geometry. Circles. I got the concept working well locally, but I ran into problems on how to deal with the networking. I got things running in Node with SocketIO and so on but there could be 400 players, each made of upto 8 moving pieces, and each can fire several times a second. I spent a lot of time on a book, "Real time collision detection" and generally I have fond memories of the whole project and trying different partition and slicing up space. However, how to package and deal with this snapshot of world "over the network" or for example "how to smooth any lag relative to the client"... this middle region was largely undocumented or ill accessible to me. I will look forward to when/if you write any thoughts.
- fivesigma 9y agoI will definitely do a write-up but you're right. It's really hard to find info on any of that online. A lot of trial and error.
- alphaomegacode 9y agoFantastic game. Enjoyable, simple. Wish you all the best with it. Thank you for your outstanding work
- DiThi 9y ago(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.
- dested 9y agoDo both websocket connections send the same data, or do you split your data logically between two channels (movement data vs state data)
- DiThi 9y agoI interleave information that becomes redundant (like the position of players, I can handle losing every other packet for a while, interpolating/predicting missing info) but send important data in all channels (like when a rocket is fired, it's just one event that must be seen). Again, I'm not OP but I did similar things and explained what probably happens with this game.
- fivesigma 9y agoWhat 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.