Discuss Scratch
- PullJosh
- Scratcher
1000+ posts
The new cloud infustructure!
This is awesome! Websockets are a huge upgrade.
For anybody who is curious about why this is an improvement, and doesn't know much about websockets:
For anybody who is curious about why this is an improvement, and doesn't know much about websockets:
The Old System (HTTP requests):If you're making a website of your own and want to add websockets (so you can have fancy live features like this), socket.io is a good place to start. (If you aren't using node, there are other libraries available to help you out as well, although you'll have to do a bit of research yourself.)
The old cloud data system used HTTP requests, which are the same things used to request a webpage, or submit a form. HTTP requests are a one-way street. A Scratch user's computer (the “client”) would send a message to the Scratch server (such as “set this cloud variable to be 5” or “give me the data stored in each cloud variable”), and then the server would send a response back. With HTTP requests, the server can never be the first to send a message. To check if the cloud variables were updated, the user's computer would have to be constantly sending new requests to the server and looking for changes. This wasn't very efficient.
The New System (Websockets):
The new system uses something different: websockets. Websockets are different from HTTP requests in one really significant way: They're a two-way street. When you load up a scratch project with the new cloud system, a websocket connection is opened. Then, whenever your computer changes a cloud variable, it sends a message to the server using websockets. But your computer does not have to continually send HTTP requests polling for changes. Instead, the server can send a message of its own (rather than just responses). So when the server finds out that a cloud variable has changed, it sends a message to every computer running the project. All of them are notified of the change and updated accordingly. This makes for a much simpler, cleaner, and more efficient system.
- PullJosh
- Scratcher
1000+ posts
The new cloud infustructure!
On github:
Although I've done my fair share of complaining about the new Scratch interface, the program itself is actually talking a huge step in the right direction. With custom reporter blocks and now some cloud variable updates, I'm feeling good about the technical side of Scratch 3.0.
(The form-over-function design has still left me Scratching my head, though.)
This makes it sound like non-numeric cloud variables (i.e. including text in cloud vars) are coming our way. Obviously, the Scratch 3.0 release isn't planned until 2018, so there's still going to be a bit of a wait, but things are heading in the right direction. The goal is to get everyone moved over to this new websocket-based system in the short term and then we'll continue to evaluate and add new features on top of this new infrastructure after Scratch 3.0 is released.
Although I've done my fair share of complaining about the new Scratch interface, the program itself is actually talking a huge step in the right direction. With custom reporter blocks and now some cloud variable updates, I'm feeling good about the technical side of Scratch 3.0.
(The form-over-function design has still left me Scratching my head, though.)
- comp09
- Scratcher
1000+ posts
The new cloud infustructure!
Random suggestion: use Protocol Buffers to save CPU and bandwidth. There's a nice JavaScript library for it too: https://github.com/dcodeIO/protobuf.js
- IcyCoder
- Scratcher
1000+ posts
The new cloud infustructure!
Did anyone find any new bugs?
Because JS is the future (echos) future future futur futu fut fu f
- herohamp
- Scratcher
1000+ posts
The new cloud infustructure!
Not letting me store 10gb of data on it Did anyone find any new bugs?
- TheUltimatum
- Scratcher
1000+ posts
The new cloud infustructure!
I sad.Not letting me store 10gb of data on it Did anyone find any new bugs?
- IcyCoder
- Scratcher
1000+ posts
The new cloud infustructure!
Boo we need unlimited storage.I sad.Not letting me store 10gb of data on it Did anyone find any new bugs?
Because JS is the future (echos) future future futur futu fut fu f
- banbot2
- Scratcher
100+ posts
The new cloud infustructure!
https://scratch.mit.edu/projects/172591974/ for testing the new cloud.
- Mole_Gaming
- Scratcher
100+ posts
The new cloud infustructure!
aw heck I just made a testing one too lol https://scratch.mit.edu/projects/172706278/ https://scratch.mit.edu/projects/172706278/?newcloud
Edit: I guess mine doesn't need a separate server to set the cloud variables since all the testing is in-project but just takes a heck lot longer
Edit: I guess mine doesn't need a separate server to set the cloud variables since all the testing is in-project but just takes a heck lot longer
Last edited by Mole_Gaming (Aug. 30, 2017 22:12:14)
am can program above good
- IcyCoder
- Scratcher
1000+ posts
The new cloud infustructure!
https://scratch.mit.edu/projects/172706278/ https://scratch.mit.edu/projects/172706278/?newcloud404 aw heck I just made a testing one too lol
Edit: I guess mine doesn't need a separate server to set the cloud variables since all the testing is in-project but just takes a heck lot longer
Because JS is the future (echos) future future futur futu fut fu f
- Mole_Gaming
- Scratcher
100+ posts
The new cloud infustructure!
404
Whoops forgot to share it lol
am can program above good
- -Io-
- Scratcher
1000+ posts
The new cloud infustructure!
https://scratch.mit.edu/projects/172706278/ https://scratch.mit.edu/projects/172706278/?newcloudTheLogFather's doesn't need a server either, he just sets the vars differently on the old Cloud and the new Cloud aw heck I just made a testing one too lol
Edit: I guess mine doesn't need a separate server to set the cloud variables since all the testing is in-project but just takes a heck lot longer
Very clever
- Mole_Gaming
- Scratcher
100+ posts
The new cloud infustructure!
Oh I get it now, there's two different sets of variables for each infrastructure type. I thought it would just change the behavior
am can program above good
- applepie2
- Scratcher
48 posts
The new cloud infustructure!
OMG cloud data finally works with this!!! Before I would set the cloud variable, and it would change back to before I set it like a second later! This is awesome!
- IcyCoder
- Scratcher
1000+ posts
The new cloud infustructure!
Because JS is the future (echos) future future futur futu fut fu f