impact-crater / impact-crater-core

NodeJS authoritative server for the Impact.js game engine.
MIT License
42 stars 4 forks source link

Bandwidth Gains #7

Open dylan opened 10 years ago

dylan commented 10 years ago

There are gains to be made my introducing AOI filtering, switching from broadcast to multicast, and potentially switching protocols with socket.io so we aren't sending really fat packets all the time.

This is related to #1 and #2 but will involve it's own effort.

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

dylan commented 10 years ago

May also be a time to consider using something with a better track record on the networking side: https://github.com/faye/faye

cha55son commented 10 years ago

I have been googling around and I can't seem to find any definitive sources saying faye is better than socket.io.

That was a good link on bandwidth management. I will keep that in mind and will probably tweak the current implementation when I get the time. Along with shortening the event names and data, I would probably end up using the base128 encoding as it will be the least error-prone/easiest approach with decent payoff. What do you think?

dylan commented 10 years ago

It wasn't so much that one was better than another it was that socket.io has been known to leak under sustained loads.

Re encoding, if it's not too lossy, that sounds great.

On Dec 9, 2013, at 6:51 PM, Chason Choate notifications@github.com wrote:

I have been googling around and I can't seem to find any definitive sources saying faye is better than socket.io.

That was a good link on bandwidth management. I will keep that in mind and will probably tweak the current implementation when I get the time. Along with shortening the event names and data, I would probably end up using the base128 encoding as it will be the least error-prone/easiest approach with decent payoff. What do you think?

— Reply to this email directly or view it on GitHub.

cha55son commented 10 years ago

Faye seems easy enough so if I find sufficient evidence against socket.io regarding leaks/etc then it would make sense to switch.