We (the meow team) are making a text-based Scratch so people can edit .sb files without the laggy block interface. blob8108 already made an awesome python module (kurt) to edit .sb files, but this would be extremely useful to know what format 2.0 will be using, as we want to prepare ourselves
Offline
A new format. Binary is all that's disclosed. So don't get you're hopes up. (nothings really disclosed)
Offline
If 2.0 has to read 1.4, I'm guessing it will have the same format as always...
Offline
bobbybee wrote:
A new format. Binary is all that's disclosed. So don't get you're hopes up. (nothings really disclosed)
binary -.-
what's so bad about XML
anyway, could u send me some files? you've got the pre-alpha, right?
Offline
It's a binary file with extension .sb2 in the prealpha.
Offline
veggieman001 wrote:
It's a binary file with extension .sb2 in the prealpha.
Is it openable by 1.4?
Offline
Hmm... where'd the rumours that it's a binary come from?
It's basically just a zip file that contains a .json and the assets it needs (images, sounds, etc.). It'll be: .sb2
We won't be releasing a spec very soon though (we want to make sure we have it right, and dont have to make many changes, first). But I imagine we will release it when we release 2.0.
Sb2 files will not be openable by Scratch 1.4. (Because time travel is not currently possible. If it was, we'd go back and write the support for it into Scratch 1.4!)
Offline
you could add an extention to 1.4 to read .sb2 files but unsupported blocks may be a problem
Offline
Lightnin wrote:
Hmm... where'd the rumours that it's a binary come from?
It's basically just a zip file that contains a .json and the assets it needs (images, sounds, etc.). It'll be: .sb2
We won't be releasing a spec very soon though (we want to make sure we have it right, and dont have to make many changes, first). But I imagine we will release it when we release 2.0.
Sb2 files will not be openable by Scratch 1.4. (Because time travel is not currently possible. If it was, we'd go back and write the support for it into Scratch 1.4!)
Well, I guess innovation has a price. Even Microsoft didn't think about supporting future versions of Office when it released 2002
I hope you're thinking about adding future compatibility in 2.0 though...
Offline
Lightnin wrote:
Hmm... where'd the rumours that it's a binary come from?
It's basically just a zip file that contains a .json and the assets it needs (images, sounds, etc.). It'll be: .sb2
We won't be releasing a spec very soon though (we want to make sure we have it right, and dont have to make many changes, first). But I imagine we will release it when we release 2.0.
Sb2 files will not be openable by Scratch 1.4. (Because time travel is not currently possible. If it was, we'd go back and write the support for it into Scratch 1.4!)
well, zip files ARE binary, aren't they?
anyway, sounds better than the clutter in .sb
Offline
slayerrobe7 wrote:
you could add an extention to 1.4 to read .sb2 files but unsupported blocks may be a problem
Yeah, they should release 1.4.2 now, so anyone downloading it now and not using 2.0 when it comes out would still be able to open uploaded projects.
Offline
scimonster wrote:
slayerrobe7 wrote:
you could add an extention to 1.4 to read .sb2 files but unsupported blocks may be a problem
Yeah, they should release 1.4.2 now, so anyone downloading it now and not using 2.0 when it comes out would still be able to open uploaded projects.
That's a good point. They should release a "double-reader" version now that keeps support for 1.4 but saves it 2.0 -- just to minimise the damage! I guess that would take up too many resources though, and that's not something the Scratch Team have a lot of.
Offline
LS97 wrote:
scimonster wrote:
slayerrobe7 wrote:
you could add an extention to 1.4 to read .sb2 files but unsupported blocks may be a problem
Yeah, they should release 1.4.2 now, so anyone downloading it now and not using 2.0 when it comes out would still be able to open uploaded projects.
That's a good point. They should release a "double-reader" version now that keeps support for 1.4 but saves it 2.0 -- just to minimise the damage! I guess that would take up too many resources though, and that's not something the Scratch Team have a lot of.
Maybe converter would work, to convert sb to sb2 and vice versa
Offline
Ooh, just saw this. An HTML5 viewer would be fairly simple then.
By the way, here's the JSON file for my Gammy! project as saved by the prealpha:
{ "objName": "Stage", "variables": [{"name": "score", "value": "0"}, {"name": "time", "value": "60"}, {"name": "timinc", "value": "5"}, {"name": "muffin", "value": "0"}, {"name": "timloop", "value": "0"}, {"name": "gmae", "value": "on"}], "scripts": [[20, 20, [["whenGreenFlag"], ["hideVariable:", "score"], ["hideVariable:", "time"], ["setVar:to:", "time", "60"], ["showBackground:", "menu"]]], [20, 162, [["whenKeyPressed", "space"], ["showBackground:", "game"], ["showVariable:", "time"], ["broadcast:", "game"], ["doUntil", ["=", ["readVariable", "gmae"], "over"], [["wait:elapsed:from:", 1], ["changeVar:by:", "time", -1], ["doIf", ["=", ["readVariable", "time"], "0"], [["setVar:to:", "gmae", "over"]]]]], ["showBackground:", "o'er"], ["hideVariable:", "time"], ["showVariable:", "score"], ["stopAll"]]], [276, 37, [["whenGreenFlag"], ["doForever", [["doPlaySoundAndWait", "8bp077-01-nullsl"]]]]]], "sounds": [{ "soundName": "8bp077-01-nullsl", "soundID": 0, "md5": "9b5a4a906dc8a4c179d292d81bb5d69e.wav", "sampleCount": 4789176, "rate": 22050, "format": "adpcm" }], "costumes": [{ "costumeName": "menu", "baseLayerID": 0, "baseLayerMD5": "1e31e4c6a8d4f270dd5c5d2a8d66e71c.png", "rotationCenterX": 240, "rotationCenterY": 180 }, { "costumeName": "game", "baseLayerID": 4, "baseLayerMD5": "c392a60cfc02bdb8e61746a3a400d245.png", "rotationCenterX": 240, "rotationCenterY": 180 }, { "costumeName": "o'er", "baseLayerID": 5, "baseLayerMD5": "9df9d49b7c1c73e79a9342b846633bb8.png", "rotationCenterX": 240, "rotationCenterY": 180, "text": "your score", "textRect": [29, 84, 454, 177], "textColor": 4278190080, "fontName": "Complex", "fontSize": 60, "textLayerID": 6, "textLayerMD5": "f87dfebf985ee739ba1376cf50b5d359.png" }], "currentCostumeIndex": 0, "snapshotMD5": "1e31e4c6a8d4f270dd5c5d2a8d66e71c.png", "penLayerMD5": "279467d0d49e152706ed66539b577c00.png", "tempoBPM": 60, "children": [{ "objName": "muffin", "scripts": [[20, 20, [["whenGreenFlag"], ["setVar:to:", "timloop", "0"], ["setVar:to:", "timinc", "5"], ["setVar:to:", "score", "0"], ["setVar:to:", "gmae", "on"], ["setVar:to:", "muffin", "0"], ["hide"]]], [20, 203, [["whenIReceive", "game"], ["doUntil", ["=", ["readVariable", "gmae"], "over"], [["doIf", ["=", ["readVariable", "muffin"], "0"], [["setVar:to:", "muffin", "1"], ["gotoX:y:", ["randomFrom:to:", -220, 220], ["randomFrom:to:", -160, 160]], ["show"]]], ["doIf", ["touching:", "veggie"], [["hide"], ["setVar:to:", "muffin", "0"], ["changeVar:by:", "score", ["+", ["rounded", ["\/", ["readVariable", "time"], 6]], 5]]]]]], ["hide"]]]], "costumes": [{ "costumeName": "costume1", "baseLayerID": 2, "baseLayerMD5": "c0f45ddfa968860cbf9be9932261014b.png", "rotationCenterX": 19, "rotationCenterY": 17 }], "currentCostumeIndex": 0, "scratchX": 102, "scratchY": -141, "scale": 1, "direction": 90, "rotationStyle": "normal", "isDraggable": false, "indexInLibrary": 1, "visible": false }, { "objName": "veggie", "scripts": [[20, 20, [["whenGreenFlag"], ["hide"], ["gotoX:y:", -87, 3]]], [20, 118, [["whenIReceive", "game"], ["show"], ["doUntil", ["=", ["readVariable", "gmae"], "over"], [["doIf", ["keyPressed:", "up arrow"], [["changeYposBy:", ["rounded", ["\/", ["readVariable", "time"], 6]]]]], ["doIf", ["keyPressed:", "down arrow"], [["changeYposBy:", ["-", ["rounded", ["\/", ["readVariable", "time"], 6]], ["*", ["rounded", ["\/", ["readVariable", "time"], 6]], 2]]]]], ["doIf", ["keyPressed:", "left arrow"], [["heading:", -90], ["changeXposBy:", ["-", ["rounded", ["\/", ["readVariable", "time"], 6]], ["*", ["rounded", ["\/", ["readVariable", "time"], 6]], 2]]]]], ["doIf", ["keyPressed:", "right arrow"], [["heading:", 90], ["changeXposBy:", ["rounded", ["\/", ["readVariable", "time"], 6]]]]]]], ["hide"]]]], "costumes": [{ "costumeName": "costume1", "baseLayerID": 3, "baseLayerMD5": "10cb31a7e1975dcbb3f757109d1a6000.png", "rotationCenterX": 49, "rotationCenterY": 59 }], "currentCostumeIndex": 0, "scratchX": -87, "scratchY": 3, "scale": 1, "direction": 90, "rotationStyle": "leftRight", "isDraggable": false, "indexInLibrary": 0, "visible": false }], "info": { "language": "en", "platform": "Win32", "history": "2011-8-8 15:16:38\tsave\tgammy\t\t\r2011-8-8 15:26:59\tsave\tgammy\t\t\r2011-8-8 15:49:43\tsave\tgammy\t\t\r2011-8-8 16:02:43\tshare\tGammy!\tveggieman001\t\r2011-8-8 16:09:22\tshare\tGammy!\tveggieman001\t\r2011-8-8 16:14:46\tsave\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:15:28\tshare\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:16:12\tshare\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:17:21\tsave\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:47:44\tsave\tGammy!\tveggieman001\tveggieman001\r", "thumbnail": { }, "scratch-version": "1.4 of 30-Jun-09", "author": "veggieman001", "comment": "This is my brand new game! I originally tried making it in Stencyl, but it's too dang hard. In this game, you are veggie and you have to collect muffins before the time runs out. Have fun and post your score! Music by Nullsleep.", "os-version": "NT" } }
Last edited by veggieman001 (2012-05-09 10:31:49)
Offline
veggieman001 wrote:
Ooh, just saw this. An HTML5 viewer would be fairly simple then.
By the way, here's the JSON file for my Gammy! project as saved by the prealpha:Code:
info": { "language": "en", "platform": "Win32", "history": "2011-8-8 15:16:38\tsave\tgammy\t\t\r2011-8-8 15:26:59\tsave\tgammy\t\t\r2011-8-8 15:49:43\tsave\tgammy\t\t\r2011-8-8 16:02:43\tshare\tGammy!\tveggieman001\t\r2011-8-8 16:09:22\tshare\tGammy!\tveggieman001\t\r2011-8-8 16:14:46\tsave\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:15:28\tshare\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:16:12\tshare\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:17:21\tsave\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:47:44\tsave\tGammy!\tveggieman001\tveggieman001\r", "thumbnail": { }, "scratch-version": "1.4 of 30-Jun-09", "author": "veggieman001", "comment": "This is my brand new game! I originally tried making it in Stencyl, but it's too dang hard. In this game, you are veggie and you have to collect muffins before the time runs out. Have fun and post your score! Music by Nullsleep.", "os-version": "NT" } }
so they still include your OS in the file -.-
Offline
roijac wrote:
veggieman001 wrote:
Ooh, just saw this. An HTML5 viewer would be fairly simple then.
By the way, here's the JSON file for my Gammy! project as saved by the prealpha:Code:
info": { "language": "en", "platform": "Win32", "history": "2011-8-8 15:16:38\tsave\tgammy\t\t\r2011-8-8 15:26:59\tsave\tgammy\t\t\r2011-8-8 15:49:43\tsave\tgammy\t\t\r2011-8-8 16:02:43\tshare\tGammy!\tveggieman001\t\r2011-8-8 16:09:22\tshare\tGammy!\tveggieman001\t\r2011-8-8 16:14:46\tsave\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:15:28\tshare\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:16:12\tshare\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:17:21\tsave\tGammy!\tveggieman001\tveggieman001\r2011-8-8 16:47:44\tsave\tGammy!\tveggieman001\tveggieman001\r", "thumbnail": { }, "scratch-version": "1.4 of 30-Jun-09", "author": "veggieman001", "comment": "This is my brand new game! I originally tried making it in Stencyl, but it's too dang hard. In this game, you are veggie and you have to collect muffins before the time runs out. Have fun and post your score! Music by Nullsleep.", "os-version": "NT" } }so they still include your OS in the file -.-
It only includes that information if imported from a .sb
Offline
SJRCS_011 wrote:
LS97 wrote:
scimonster wrote:
Yeah, they should release 1.4.2 now, so anyone downloading it now and not using 2.0 when it comes out would still be able to open uploaded projects.That's a good point. They should release a "double-reader" version now that keeps support for 1.4 but saves it 2.0 -- just to minimise the damage! I guess that would take up too many resources though, and that's not something the Scratch Team have a lot of.
Maybe converter would work, to convert sb to sb2 and vice versa
Converting sb to sb2 works simply by opening sb in 2.0 and saving it. For the other way round, maybe they will allow an export feature to export it to the old format. Otherwise I don't think it will be easy to convert.
Offline
What's exciting about the new format is that it'd be super simple to create Scratch 2.0 viewers in other languages like HTML5/Javascript + PHP;; just unpack the zip, check the MD5s, and parse the JSON file.
Last edited by veggieman001 (2012-05-09 11:19:02)
Offline
veggieman001 wrote:
What's exciting about the new format is that it'd be super simple to create Scratch 2.0 viewers in other languages like HTML5/Javascript + PHP;; just unpack the zip, check the MD5s, and parse the JSON file.
On a related note, is it possible to unzip anything
a) using a Microsoft API in C++ or VB
b) in PHP?
Offline
LS97 wrote:
veggieman001 wrote:
What's exciting about the new format is that it'd be super simple to create Scratch 2.0 viewers in other languages like HTML5/Javascript + PHP;; just unpack the zip, check the MD5s, and parse the JSON file.
On a related note, is it possible to unzip anything
a) using a Microsoft API in C++ or VB
b) in PHP?
Here's PHP.Here's a .NET library.
Last edited by veggieman001 (2012-05-09 11:25:47)
Offline
veggieman001 wrote:
LS97 wrote:
veggieman001 wrote:
What's exciting about the new format is that it'd be super simple to create Scratch 2.0 viewers in other languages like HTML5/Javascript + PHP;; just unpack the zip, check the MD5s, and parse the JSON file.
On a related note, is it possible to unzip anything
a) using a Microsoft API in C++ or VB
b) in PHP?
Nice thank you!
What about Win32 API's for C++?
Offline
roijac wrote:
bobbybee wrote:
A new format. Binary is all that's disclosed. So don't get you're hopes up. (nothings really disclosed)
binary -.-
what's so bad about XML
anyway, could u send me some files? you've got the pre-alpha, right?
I wish.
Offline