agar.io-clone icon indicating copy to clipboard operation
agar.io-clone copied to clipboard

Replace Socket.IO with a lighter-weight alternative

Open jniles opened this issue 10 years ago • 9 comments

This has been mentioned before, but I'd like to get a public poll. Socket.IO is a bit overkill for the current project scope. My vote is for the ws. In particular, look at the comparisons between frameworks here and here.

Has anyone had experience with other frameworks more suitable to agar.io-clone? Can we decide on a new alternative to put together some migration code?

jniles avatar Jun 06 '15 14:06 jniles

It needs to be done, no question about it. This is probably the most pressing issue preventing a game like this from scaling (with implementation of quadtrees or similar partitioning of players and entities being a close second).

I found some good info on the subject here:

http://buildnewgames.com/optimizing-websockets-bandwidth/

JoeMattie avatar Jun 06 '15 14:06 JoeMattie

I agree that WS is a better option. It solves many of the laggy issues!

c-hew avatar Jun 09 '15 02:06 c-hew

how about sock.js? I am planning on change to sock.js on my fork

keon avatar Jun 14 '15 15:06 keon

@keonkim , did you give sock.js a try? My concern is that sockjs doesn't use raw websockets and if we are going to the trouble of re-writing, we should be the lightest and best possible.

jniles avatar Jul 02 '15 00:07 jniles

The Agar.io server implementation Ogar is using ws. Would that work well enough?

keithagroves avatar Jul 02 '15 15:07 keithagroves

I think so. ws is great.

igorantun avatar Jul 02 '15 18:07 igorantun

@jniles I haven't touched on it yet, I also think going for ws is better choice though.

keon avatar Jul 02 '15 18:07 keon

Sweet. I propose that refactoring efforts focus on making sure we have testable components and test cases for those components, then we can swap out bits and see how it goes. It seems the consensus is for ws, so when the time comes we'll use that library.

jniles avatar Jul 02 '15 21:07 jniles

I seem to have gotten a socket.io -> einaros/ws transition on one of my branches, still needs a lot of testing though.

On a side note, every website that uses the current tagline would be wrong if we were to switch off socket.io.

abalabahaha avatar Jul 28 '15 23:07 abalabahaha