Discuss Scratch
- Chiroyce
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
1. Without separator, no need for separator.What? How will you order the data if there is no separator?
Last edited by Chiroyce (April 22, 2023 09:34:21)
- i_eat_coffee
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
Actually, it will make decoding so much easier in scratch, since it parses every 2 characters-1. Without separator, no need for separator.What? How will you order the data if there is no separator?
010203 - 01, 02, 03 - abc
0100020003 - 01, 00, 02, 00, 03 - a b c
Last edited by i_eat_coffee (April 22, 2023 09:36:24)
- ScratchCatHELLO
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
What 256 characters?You've got to be joking. This is the Scratch homepage load stats“hello” encoded: 0805121215encoding doubles the length of input text and adding a separator takes up 2 extra characters as well
You have 128 decoded characters per cloud variable, multiplied by 10 variables is 1280 characters. There is a 0.1 second delay between each update, so the fastest to transfer 1280 characters is 10 * 0.1 => 1 second. Anywhere near the 530kB to be transferred would take more than 8 minutes. Not to mention that rendering isn't even being handled yet.
at lot of that is just the structure of the page (and maybe react), which can be hardcoded. all you need to transfer are the variable parts (comments, descriptions, titles, etc). still infeasible, but not as bad.
Last edited by ScratchCatHELLO (April 22, 2023 14:57:51)
- ajskateboarder
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
010203 - 01, 02, 03 - abcI guess this is a good start
0100020003 - 01, 00, 02, 00, 03 - a b c
- davidtheplatform
-
Scratcher
500+ posts
Re-making scratch-www in scratch
If you use all 10 variables, you can transfer ~10 kilobytes per second, and for me there is 2.5mb of images on the front page, so downloading would take about 4 minutes. Some of those images aren't necessary/can be stored in the project and if you compress them a lot you could get down to less than a minute to load the front page (although projects would take forever)What 256 characters?You've got to be joking. This is the Scratch homepage load stats“hello” encoded: 0805121215encoding doubles the length of input text and adding a separator takes up 2 extra characters as well
You have 128 decoded characters per cloud variable, multiplied by 10 variables is 1280 characters. There is a 0.1 second delay between each update, so the fastest to transfer 1280 characters is 10 * 0.1 => 1 second. Anywhere near the 530kB to be transferred would take more than 8 minutes. Not to mention that rendering isn't even being handled yet.
- DifferentDance8
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
you keep on talking about HOW you are going to do this, but not once have you touched on WHY.
- INSERT-USER_NAME
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
you keep on talking about HOW you are going to do this, but not once have you touched on WHY.It would be cool.
- unsullied123-rblx
-
Scratcher
100+ posts
Re-making scratch-www in scratch
You've got to be joking. This is the Scratch homepage load statsyou could just have the scratchconnect server take a snapshot of the page at 480x360, and turn every pixel into an hsl/csb value.
to avoid the need for delimiters you could just write it with a locked number length. (e.g. 8 becomes 008, 16 become 016, etc.) each color value never goes above 100, and negative numbers aren't used. because scratch cloud vars max out at 256 chars, you could transfer about 25 pixels per second. assuming we use 4 cloud vars, that's 100 pixels per second. in a 480x360 image there are 172800 pixels, and that would take 1728 transfers, you can define a cloud var once every 0.1 seconds (i think?), so that would take about 172.8 seconds. that's a major improvement, but still long. in addition, you would have to manage multiple requests at a time, so the loading time is multiplied by every current user. to combat this, you could render the page at a lower (but still readable) resolution, lets say 96x72. that's only 6912, so that would only take 69.12 (haha nice) transfers. despite the funniness, we would have to round it up to 70 in order for this to work. again due to the cloud variable cooldown, this would take about 7 seconds to complete. while in the grand scheme of things this is terrible loading speed (my grandma's 56k modem could load that faster), it's an astronomical improvement.
just a thought
tl;dr: just take a low res screenshot of the page, send it through cloud vars as scratch color data, and render it with pen
Last edited by unsullied123-rblx (April 23, 2023 06:15:26)
- DifferentDance8
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
But then how would you handle interactions?You've got to be joking. This is the Scratch homepage load statsyou could just have the ~snip~ it's an astronomical improvement.
just a thought
tl;dr: just take a low res screenshot of the page, send it through cloud vars as scratch color data, and render it with pen
- WojtekGame
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
good ideaBut then how would you handle interactions?You've got to be joking. This is the Scratch homepage load statsyou could just have the ~snip~ it's an astronomical improvement.
just a thought
tl;dr: just take a low res screenshot of the page, send it through cloud vars as scratch color data, and render it with pen
- i_eat_coffee
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
^^you keep on talking about HOW you are going to do this, but not once have you touched on WHY.It would be cool.
so also basically, we are not transferring the actual data, we are just transferring some picked counters. For images, there are going to be 10 colors, each digit representing a color, and massively scaled down.
interactions would be on a different cloud variable, and the external server would listen on that one
- unsullied123-rblx
-
Scratcher
100+ posts
Re-making scratch-www in scratch
But then how would you handle interactions?You've got to be joking. This is the Scratch homepage load statsyou could just have the ~snip~ it's an astronomical improvement.
just a thought
tl;dr: just take a low res screenshot of the page, send it through cloud vars as scratch color data, and render it with pen
you can assign each user an id, and when the stage is clicked send y+180 through one variable, x+240 through another, and the id through another. this would use seven variables if used with the previous system i thought of, so you would still have 3 to spare. the endpoint can just subtract the y var by 180 and the x var by 240 as this avoids the need for handling negative numbers. you could also use a change detector on the user's end to wait 0.1 seconds between rewrites, so the user doesn't interact with another session and vice versa.
and because this assigns different users ids you could set another variable to the id being loaded, with 2 more variables to spare.
again, just a thought
- ajskateboarder
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
How will profile pictures be done? How about GIFs?
Last edited by ajskateboarder (April 23, 2023 17:50:50)
- unsullied123-rblx
-
Scratcher
100+ posts
Re-making scratch-www in scratch
How will profile pictures be done? How about GIFs?you could just load the first frame of the gif
- WojtekGame
-
Scratcher
1000+ posts
Re-making scratch-www in scratch
How will profile pictures be done? How about GIFs?you could just load the first frame of the gif

yes big brain to load the first frame of GIF.
- unsullied123-rblx
-
Scratcher
100+ posts
Re-making scratch-www in scratch
bump
timmccool's profile picture loader does this and it still works fine
it's the best way to do it without reworking the entire systemHow will profile pictures be done? How about GIFs?you could just load the first frame of the gif
yes big brain to load the first frame of GIF.
timmccool's profile picture loader does this and it still works fine
Last edited by unsullied123-rblx (April 26, 2023 19:11:05)
