-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exchange protocol too verbose for real world use #10
Comments
Thanks for pointing out! |
I would use binary data like agar.io
|
@asdfuken : that sounds awesome but how does it affect your debugging capabilities? Do you have a way to revert back to normal characters when running in test mode? |
I have made a huge modification to messaging, but I would have to 2016-07-03 14:42 GMT-04:00 jgamedev [email protected]:
|
@asdfuken , thanks for sharing! |
@asdfuken , I like how you use ws, I think you have moved away from socket.io, if that's the case can you comment on that? Here's some more information I have been able to collect about binary protocols:
|
My protocol is based on that http://agar.gcommer.com/index.php?title=Protocol
And I init the server with
Those are ascii encoded |
I am thinking about some sort of compress function that transforms the original object to the most minimal possible and then only send the diff. Then on the other side a decompress function will convert it back to a usable object and it then applies the diff to the previously received state. |
@arjanfrans , binary has a extremely small footprint so you would not need to diff it, unless you need to reduce message frequency as opposed to payload size. |
1 similar comment
@arjanfrans , binary has a extremely small footprint so you would not need to diff it, unless you need to reduce message frequency as opposed to payload size. |
I tried something with sending the diffs only and converting those to binary. |
For production deployment it's paramount that data exchange between the client and the server is kept to a minimum.
Currently there seems to be zero optimization on this area. For reference here's an example of an exchange payload with only 1 user inside the game room:
Here's a few ways in which I believe this could be optimized:
Rounding-off time to a meaningful precision: this is the most obvious one. For instance: ' '
30.091000000001493
could be sent as30.091
or (maybe30.02
?) and specially the rounding off of positions could be a benefit in a scenario where there are +20 players in the same room.Client UIDs should not be included on frequent exchanges: UIDs should be only be included in meaningful, one-time-off events such as joining rooms, etc. After that a much shorter id can be used that can be mapped to the actual client UID whenever that is needed
Avoid sending 'state of the world' types of updates inside of frequent exchanges: instead only "diffs" should be send.
The text was updated successfully, but these errors were encountered: