Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I have made a simple game Map Editor and I want to save a array that contain map tile info to a file, as below:

var arr:Array = [.....2d tile info in it...];
var ba:ByteArray = new ByteArray();
ba.writeObject(arr);
ba.compress();
var file:File = new File();
file.save(ba);

I had successfully saved a compressed object to a file. Now the problem is my server side need to read this file and decompress the array out from the file, then convert it to a Python list. Is that possible?

share|improve this question
    
Why do you use ByteArray? Just save xml or json file. –  Fox in socks Oct 21 '12 at 17:51
    
I just want to let the config file more little, and easily ,fast for python to read the data out. –  Last Chance Oct 23 '12 at 1:56
add comment

closed as off topic by Ricket Oct 23 '12 at 13:20

Questions on Game Development Stack Exchange are expected to relate to game development within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer

up vote 0 down vote accepted

As usual almost any Is that possible? question is answered Yes. To do that, you need to know compression method used by ActionScript (most possibly is some of zlib methods). After that you need to somehow get serialization format of array, and read it back.

But zipped Json and XML can be not much larger than binary compressed.

Also this question has not much to do with game programming, so you can try it on StackOverflow.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.