Forum C# MessagePack for Serialization

MessagePack for Serialization

Postby gonzogames » December 29th, 2012, 12:24 pm

Hi guys,

Have any of you tried MessagePack for serialization? We are hoping not to use JSON since it can become quite large, and MessagePack looks promising. See http://msgpack.org

Would it be a bad idea to use something similar (but supposedly smaller) than JSON to send data back and forth for a turn-based game?

Cheers!

:lol:
gonzogames
 
Posts: 4
Joined: December 11th, 2012, 8:37 am

Re: MessagePack for Serialization

Postby Benjaminsen » December 29th, 2012, 7:34 pm

What's the goal of wrapping the messages in yet one more format? The ability to have complex objects or something else?
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: MessagePack for Serialization

Postby gonzogames » December 30th, 2012, 6:20 am

For complex objects. Submitting structures like a jagged 2d array of points can be hairy. One of our developers was suggesting JSON to make things easier, but I imagine string parsing would be slow. I just came across MessagePack and was wondering if maybe it would be light enough.

Currently, what we do is to construct and destruct (?) a complex message by providing an integer for each item when the size of the item's data in an "array" varies.

I tried serializing an object in AS3, then deserializing it in C#, but got blocked due to non-whitelisted classes. I am not sure if C# can even recognize AMF-format serialized byte arrays. Is serializing to and from byte arrays a good alternative approach? What about MessagePack? Should we stick to what we are doing now?
gonzogames
 
Posts: 4
Joined: December 11th, 2012, 8:37 am


Return to C#



cron