315 comments

[ 2.5 ms ] story [ 293 ms ] thread
A lot of friendly fire among the HN crowd. "Make go boom" appears to be our goal.
Maybe you were in a F-F-A game :D
The Brits seemed to be fairly good towards each other :-D
The game space is a little crowded i felt. Otherwise pretty cool game ! Do you plan to open source or do you know of a HTML5 game of similar complexity that is ? Would love to read the code.
On the map I played, everyone spawns in over Europe. However, there's a whole entire world and NA and Eastern China was typically pretty barren
Really enjoyed this even after playing a few minutes. Good graphics and nice controls.
this is fun! how did you make it? give us some details.
What did u use too make the game?
PIXI.js for the graphics. Serverside is mostly Node.js.
No websockets for persistent connections? How are you handling RTC?
Open up the Network tab and you'll see that it's using WebSockets.
Ah. Sounds cool. Would WebRTC serve better here?
The gameplay reminds me a bit of an old favorite of mine - Starport: Galactic Empires. I wonder of games of that nature could undergo a revival as browser games.
Nifty and addictive little game! Good job.
I can't seem to get my aircraft to move forward using a keyboard. Flying backwards is fine, but using the ^ key is a nogo. Controller works fin theough!

OS: Windows 10 (Build 16251) Browser: Firefox Developer Edition (58.0b10 64-bit)

Off topic, but did they really have 16,251 builds of windows.

Is that low, high or normal(expected)?

normal, modern dev with automated builds and git creates a build every time you commit (or every push), and you can commit for a missing comma so ... with 10 or more people working on it on a daily basis it can go up very fast
ah, yeah that makes sense - I was thinking of “releases” not so much “builds” and thats why it looked weird to me...
Same issue on both Firefox (57.0.2) and Chrome (62.0.3202.94) on Windows 10 (build 16299.64). At least for me forward doesn't seem to be completely ignored; while holding it down it will occasionally spurt forward a bit.
I had to refresh the page once or twice throughout my play time because of key issues.
blue tooth physical keyboard on ipad: caps lock kills controls.

please update to ignore case in controls.

also bug, BT KB kills any touch control on an ipad... plus it hangs on a certain direction and contrl dies very fast...

way too buggy to even play on an ipad with a BT KB

Safari on iOS is generally buggy. WebGL and WebAudio are very glitchy.

I don't have a BT KB so I didn't test that case. Will do!

I am using chrome on the ipad
Kind of reminds me of SubSpace. I think, it has been a very long time since I've played it.
Thought the same exact thing. Whatever happened to SubSpace?
It's still alive, to some extent. Priit Kasesalu (of Skyroads, Kazaa and Skype fame) wrote an alternative client back in 2001: Continuum. Some of the bigger servers (EG, TW) are still around. Many of the smaller ones like SFSS have long since perished.
Yes! Loved that game. You could mount each other and create the almighty LevTerr. I wonder if it's still alive
Yup, pretty much same mechanics.

The netcode in subspace was a bit better, probably due to needing to deal with 200ms+ pings that were common back in that era.

What does it use for networking?
Very curious about this as well. I was expecting this submission to be an endorsement for WebRTC.
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.
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.
Yep. 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.

It is not entirely P2P, a server can act as a "peer" for all clients and handle the connections itself.
(comment deleted)
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.

Know of any games that have implemented this method?
I'm not that familiar with WebRTC, but can the server not act as the only peer?
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.

Interesting. Could you talk more about this?
Will do when this is over. Right now I'm trying to prevent servers from melting. HN traffic...
You'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.
Nothing too fancy. Just proper devops and a lot of testing.

https://i.imgur.com/oSwGgFA.png

Where are you hosting it? That looks quite custom to gaming
It better be! It's my homegrown panel that I use for all my projects.
I would love to hear more about this dashboard in your write up. Would love to create something like this myself :)
Do you have a blog or write ups about this process / your workflow / etc.? I feel as a novice I could learn a lot.
That is fancy. It is actually so beautiful I got emotional.
THE comboy of bitcoinity fame? I'm honored.

I remember donating back in the day!

Huh 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.

Is it an home made dashboard or do you use some standard tool?
Great job with the Game. Would love to read an article about how you developed this game and handled initial traffic.
Really looking forward to a write-up!
(comment deleted)
Would be nice to know what you use for hit detection and interpolation, it seems very smooth!
Also 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.

I 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.

Do you have a blog? Been visiting this daily to see if there's a new update about the write up on networking trial errors. :)
Fantastic game. Enjoyable, simple. Wish you all the best with it. Thank you for your outstanding work
(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.

Do both websocket connections send the same data, or do you split your data logically between two channels (movement data vs state data)
I 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.

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.

So much productivity for today. :) Very nice game. Congrats.
I'm amazed by how well this works on mobile. I literally played this game for about half an hour on my phone in the HN app web view because it's just so much fun. I'm used to normal web pages that don't even really work on mobile and this game just worked seamlessly without any problems whatsoever. Great Job!
Meanwhile, I tried 3 different browsers and can't get past the "enter your name" screen on mobile. Apparently native inputs are too dated to use.
Worked fine on my aging Nexus 5X.
Aging?! Worked fine on my S4!
Works fine on the iPhone 6 running iOS 11
Admittedly mobile was a bit of an afterthought and I only tested it on 4 devices. What device are you using?
iOS 8.1.2 model A1532. I don't upgrade because it will slow down my phone.

Probably not worth supporting. :) Adding new features and figuring out ways to keep people playing might be much more worth your time.

It says, right on the mobile mode interstitial, that it "requires the latest mobile/tablet hardware." And yet, you seem surprised when it doesn't work on older hardware?
> Probably not worth supporting.

I was going to disagree because the same countries that really like web games are often the ones using older handsets, but Apple themselves say only 8% of handsets are on iOS < v10: https://developer.apple.com/support/app-store/

1 in 10 handsets isn't a market you want?
Even at it's peak apple only had 23% market share. 1 in 10 out of 23% is 2.3% and not everyone plays this game on a phone so the percentage is even lower in reality.
Not this game but in general.

Good point about market share though, hadn't considered that.

you're doing something wrong
Really fun game. Very smooth and addictive. Curious to know about tech stack
I think pixi.js and websocket + node backend.
This is great, it's going to be the next big hit, calling it now. Awesome work :).
Awesome game, played for almost ah hour already!
How long has this been released? Seems very polished. How long did it take you to build?
In the changelog (https://airma.sh/changelog) it says today (10th Dec 17) was the first release.
I'd implied the same from the general player skill level. It's nice to play against people who are just as bad as me for a change!
Very good on mobile, got in first place a couple of times. Should stop disclaiming about the mobile experience