Some of my friends are developing a game, and I help them by implementing a game backend server. The game is written in Flash, and I plan to develop a server in node.js, because (a) it will be a cool project to study node.js and (b) it is fast, which is important for games.
The server architecture is based on messages sent between the server and the client (such as the Minecraft server protocol). The format of the message, which I still represent bytes (packet type), two bytes (message length) and many bytes (message data, which are a mapping of key-value pairs). The problem is that I really don't want to develop my own serialization format (because, although I probably could, implementing this would be a pain compared to using an existing solution).
Unfortunately, I am having problems finding a good candidate for the serialization format of these messages.
- The Remoting format for ActionScript may work, but I don't like it.
- JSON has support in node.js (obviously) and in ActionScript, but it is also text-based, and I would prefer a binary to increase speed.
- MessagePack looked like a good candidate, but I cannot find an ActionScript implementation. (There is one called as3-msgpack in Google Code, but I get weird errors and cannot access it.)
- BSON has an ActionScript implementation, but support for node.js is in addition to their MongoDB library (and I plan to use Redis).
So, can anyone suggest any other serialization formats that I might have missed? Or should I just stick to one of them (or collapse on my own)?
source share