This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-04-08 12:18:56

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

What file format will be Scratch 2.0 using?

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  smile

Offline

 

#2 2012-04-08 12:33:54

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

A new format. Binary is all that's disclosed. So don't get you're hopes up. (nothings really disclosed)


I support the Free Software Foundation. Protect our digital rights!

Offline

 

#3 2012-04-08 12:58:32

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

If 2.0 has to read 1.4, I'm guessing it will have the same format as always...

Offline

 

#4 2012-04-08 13:33:18

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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  roll
anyway, could u send me some files? you've got the pre-alpha, right?

Offline

 

#5 2012-04-08 13:54:12

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

It's a binary file with extension .sb2 in the prealpha.


Posts: 20000 - Show all posts

Offline

 

#6 2012-04-08 14:00:12

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

veggieman001 wrote:

It's a binary file with extension .sb2 in the prealpha.

Is it openable by 1.4?

Offline

 

#7 2012-04-08 14:09:43

Lightnin
Scratch Team
Registered: 2008-11-03
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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.  sad    If it was, we'd go back and write the support for it into Scratch 1.4!)


Help Scratchers make the leap to 2.0!
http://img818.imageshack.us/img818/6844/transitionteam.jpg

Offline

 

#8 2012-04-08 14:16:29

slayerrobe7
Scratcher
Registered: 2011-06-24
Posts: 500+

Re: What file format will be Scratch 2.0 using?

you could add an extention to 1.4 to read .sb2 files but unsupported blocks may be a problem


!!!When it comes to Scratch2.0 I am totally like freaking out!!!

Offline

 

#9 2012-04-08 15:44:07

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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.  sad    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  smile

I hope you're thinking about adding future compatibility in 2.0 though...

Offline

 

#10 2012-04-10 04:31:51

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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.  sad    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?  tongue

anyway, sounds better than the clutter in .sb  big_smile

Offline

 

#11 2012-04-10 04:54:57

scimonster
Community Moderator
Registered: 2010-06-13
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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

 

#12 2012-04-10 05:18:53

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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

 

#13 2012-04-10 18:56:47

SJRCS_011
Scratcher
Registered: 2011-02-07
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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


http://i.imgur.com/vQqtH.png
Learning to Program in a Nutshell:  "You're missing a closing parentheses" - LS97

Offline

 

#14 2012-05-09 10:31:34

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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:

{
    "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)


Posts: 20000 - Show all posts

Offline

 

#15 2012-05-09 10:47:04

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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

 

#16 2012-05-09 10:58:09

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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


Posts: 20000 - Show all posts

Offline

 

#17 2012-05-09 11:16:09

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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

 

#18 2012-05-09 11:18:49

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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)


Posts: 20000 - Show all posts

Offline

 

#19 2012-05-09 11:20:13

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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

 

#20 2012-05-09 11:24:59

veggieman001
Scratcher
Registered: 2010-02-20
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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)


Posts: 20000 - Show all posts

Offline

 

#21 2012-05-09 11:29:56

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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?

Here's PHP.Here's a .NET library.

Nice thank you!
What about Win32 API's for C++?

Offline

 

#22 2012-05-09 14:24:52

roijac
Scratcher
Registered: 2010-01-19
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

get python^^

Offline

 

#23 2012-05-09 16:09:05

bobbybee
Scratcher
Registered: 2009-10-18
Posts: 1000+

Re: What file format will be Scratch 2.0 using?

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  roll
anyway, could u send me some files? you've got the pre-alpha, right?

I wish.


I support the Free Software Foundation. Protect our digital rights!

Offline

 

Board footer