Q:

What's the most recommended transmission format using websockets for a MMORPG?

(note: I'm not asking for the supported formats in the RFC, but the format I should develop to send/receive the messages, say, in the Application layer).
(note 2: Please help me retagging this post to reference internet, communication, client-server messages).
I am developing a game. Right now it is just a concept of a multiplayer game, tile-mapped, with role-playing characters.
The big problem here? It will be online-massive. My concerns are about lag and transmission. The front-end will be pure ActionScript3. The connection will be done with websockets.
Certain actions will be really quick like: walk, grab (item) and perhaps hit (attack) or execute another type of quick action (e.g. use a small, quick, item).
Considering that websockets are not plain sockets, and this is my first online game, my question is about the protocol to use.
Right now, I marshall the messages in the following format (this is just an example, since I did not develop the actual commands yet):
client ---> {'code': 'walk', 'kwargs': {'direction': 'left'}} ---> server
server ---> {'code': 'walk.ok', 'kwargs': {}} ---> client

As you can see, it is JSON format, sent via websockets. The processing backend is Tornado with Python 2.7. I developed a library to marshal and unmarshal these messages.
Assuming that, as an expected peak (with so much luck), I will have 1000 players mostly walking... will I have performance issues with this protocol I defined? Actually, I'm asking about
I want to avoid lag as much as possible, considering websocket transmission.
What format is more adecquate and performant for MMORPG games client-server communication for these really-quick actions? Actually I never developed one of these games and I'm concerned about the performance.

A:

With all respect: Don't worry about it... yet.
By all means, keep in mind that eventually, to run at scale with as few servers as possible, you may need to use a binary format.
You will probably benefit from omitting duplicate data; there's no need for sending "Still moving at velocity 1.0, no change there!" hundreds of times a second.
You will certainly need to resolve issues relating to timing of nodes with different ping times, lost and found connections, sanity-synchs from time to time, and many other things.
Switching from JSON to binary, if and when the time comes, will involve swapping out one well-defined part of your code. (Or possibly keeping both, and checking if the first character of a message is '{' to decide which flavor.)
In the early stages, having text-based easy-to-read messages will be more valuable. It will ease your debugging, and you can use ready-made solutions to get on with it. Done!
Because... You have hundreds of hours of more interesting problems to solve before worrying about 1000 low-bandwidth players.
(On the other hand, if you're not actually writing a game, and just want to learn about data compression for networking, that would change your priorities.)

