40 comments

[ 5.8 ms ] story [ 92.1 ms ] thread
Before reloading I could not really see smth. Input for "input name" wasnt highlighted. So I could not understand what should I do.
Seems interesting, but apparently the layout is hardcoded to use WASD, which doesn't go well with AZERTY keyboards.
Is this struggling under the load?
I just deployed it to my free heroku account to see if I could get it up and running, the lag is immense haha :D
Are there any controls besides arrow keys and spacebar? I start out tumbling and can't seem to stop.
If you don't have better ideas for improving your packet size at least push your JSON through msgpack. Using strings as keys (properties) is ultra bad for your bandwidth too. In general JSON is only suitable for turn based games.
Protobuf would be an excellent serialization. It's compact, binary, and efficient. There's a ton of library support in nearly every language imaginable.
I am not 100% sure, but I think I read somewhere (at least 2 years ago), that browsers are actually faster using JSON than Protobuf (a bit counter-intuitive).

Nevertheless, bandwidth-wise it could make sense anyway, but I think it makes sense to consult some benchmarks in this case.

For my games[1] I use a custom binary protocol which is not that difficult to pull off. Actually building a buffer with JavaScript's DataView[2] and ArrayBuffers produces very compact results since you're free to optimize the packets for each specific game - for example a single uInt8 can store 8 different flags for a game character - things like dead/alive, up/down, right/left, walking/running, etc.

[1] https://redka.games [2] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

If you don't have better ideas for improving your packet size at least push your JSON through msgpack.

I'm about to change over to msgpack for my own multiplayer real time browser game. I'd use protobuf, but the extra code generation step would get in the way of my plans to turn my MMO into an MMO-game-as-lambdas PaaS project.

Right now, I'm using my own protocol which uses something somewhat like base-85 for encoding, except it's base-92. It's a binary packing format, but packs directly into base-92 encoding. This packed base-92 is encapsulated into JSON, which minimizes the use of keys. This might all sound horrible, but I'm able to achieve what Flatpack achieves: no copies are needed to extract the data. That, and the remaining slight JSON overhead makes it easier to debug network traffic.

(comment deleted)
I would suggest tank controls to reduce server CPU (with event based protocol) and make the game a bit more playable, try my controls: http://aeonalpha.com
What is the server written in?
what are the controls?

I haven't found any explanation and I've only managed to spin the ship on itself.

W - forward, S - slow down, A - roll left, D - roll right, Q - yaw left, E - yaw right, MouseY - up and down, SPACE - shoot, ENTER - chat
Left click mouse down to shoot would be more intuitive! It was fun playing the game though!
BRB, growing a third arm ;)
Nice work! I would suggest adding a controls screen that fades out. Took me a while to realize I had to combine aiming with the mouse and WASD keys for movement to get everything going.
This is really cool.

One suggestion. Allow the mouse to control the spaceship movement in both x and y directions. It’s intuitive to try to point the mouse to the place you want your ship to go, however the mouse only controls the Y axis.

Right. Or use W and S for pitch up/down and ignore the mouse. Shift or Z or something for forward movement.
I think this is cool just from the "sharing code" perspective; yes, it needs some more work, but that's the way games are. I can't give any suggestions there, since I haven't touched game code in decades (well out of date for today's MP stuff). But I like what I see so far from this demo!
Pretty cool and actually, something I always wanted. Reminds me of the good old Netwars days:

https://www.youtube.com/watch?v=eMp1RrCy4w4

There are just a few things Netwars had that I am missing here:

1. Sound (is it just me?) 2. The controls are kinda weird. If I remember correctly Netwars used Ctrl and Shift to throttle. Mouse (or Joystick) for turning (upper part of the side of the screen to roll), Space to fire the gun and Return to fire missiles. 3. A radar for orientation.

But for a prototype awesome already :-D

The netcode seems to be working great for me. Controls are not what I expect based on the space-shooters I've played, but I eventually got the hang of them. Ship to ship collisions would be nice.
Fun game. Good work.
oh man, I made a 2D one back in the day with node.jd and socket.io, to test a physics engine I was writing, but never really finished it to release it. looking at your project now, I wish I did finished mine. really cool job. keep it up
Needs a radar/minimap or something, I pretty quickly found myself lost in space with no idea where other players were, or how to get back to the starting point to find new players.
So the game just crashed? Could only move forward after that.