Discuss Scratch
- Discussion Forums
- » Advanced Topics
- » I think I've finally got a handle on a workable multi-user mechanism...
- TheLogFather
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
Yeah, I'm certainly looking forward to seeing how cloud improves, of course.…which is probably why thisandagain is rewriting the Scratch website from scratch, so it can stand up to our kinds of abuse.Oh wow, I had totally forgotten about this! I was thinking of making a slither.io clone in Scratch, but got put off by the concept of handling cloud data. Maybe once he's done it'll get easier.
But on the other hand I am a little worried that it'll mean all the details I've discovered about how cloud behaves in different situation (so, e.g., how it can be used to detect fallback, etc.) will change, and I'll have to start all over again…

Still, hopefully it'll mean there's no need to jump through such hoops, so…

Almost certainly it is because your home network is using NAT/PAT and to an external server all those requests appear to be coming from the same IP… the remote server will have marked your IP as no longer accepting 531 traffic and therefore all your internal machines are kicked at the same time.Yes, indeed (wrote something similar in the github issue I submitted) – never did get around to testing it elsewhere outside a NAT, though…
Last edited by TheLogFather (April 17, 2016 20:07:56)
- gtoal
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
I've gone code-blind and hit a wall :-(
I had started merging sprites with the intention of eventually having all the multiuser support in one or two units that could be easily backpacked.
Something broke. I guess because of local vs global variables, but whatever it is I can't find it. The code goes down a rabbit hole, never returning from “internal: decode text string”. I thought perhaps the character encoding had not been initialised but I checked that and it is OK.
Could I ask a favour and have you look at https://scratch.mit.edu/projects/104865199/ and see if you can spot anything? I threw in a bunch of “think” statements to trace the code flow.
It's very frustrating because I do have an earlier version saved in a browser window but because it is “incognito” and logged in as Robotron2000, that appears to make it impossible to save the project to local disk. Not sure if that is a bug or a feature. You select “download to computer” and it silently returns control but no file is saved. I may try remixing the code from that window if someone can assure me that there's no chance that doing so will make scratch base the remix on the current version and not the older code cached in that browser window?
G. (short for “Grrrr”)
I had started merging sprites with the intention of eventually having all the multiuser support in one or two units that could be easily backpacked.
Something broke. I guess because of local vs global variables, but whatever it is I can't find it. The code goes down a rabbit hole, never returning from “internal: decode text string”. I thought perhaps the character encoding had not been initialised but I checked that and it is OK.
Could I ask a favour and have you look at https://scratch.mit.edu/projects/104865199/ and see if you can spot anything? I threw in a bunch of “think” statements to trace the code flow.
It's very frustrating because I do have an earlier version saved in a browser window but because it is “incognito” and logged in as Robotron2000, that appears to make it impossible to save the project to local disk. Not sure if that is a bug or a feature. You select “download to computer” and it silently returns control but no file is saved. I may try remixing the code from that window if someone can assure me that there's no chance that doing so will make scratch base the remix on the current version and not the older code cached in that browser window?
G. (short for “Grrrr”)
- TheLogFather
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
I've gone code-blind and hit a wall :-(You no longer have a sprite called “EncChars”. Those blue sensor blocks which use it are having a hard time understanding what you mean…
I had started merging sprites…
Something broke…

- gtoal
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
I've gone code-blind and hit a wall :-(You no longer have a sprite called “EncChars”. Those blue sensor blocks which use it are having a hard time understanding what you mean…
I had started merging sprites…
Something broke…
Good man. That's the sort of careless idiocy I was looking for! Thanks…
G
- gtoal
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
I've gone code-blind and hit a wall :-(You no longer have a sprite called “EncChars”. Those blue sensor blocks which use it are having a hard time understanding what you mean…
I had started merging sprites…
Something broke…
Good man. That's the sort of careless idiocy I was looking for! Thanks…
G
Wait a minute… is that a hacked block??? So I *need* to have those characters in another sprite. Which means I have to manually delete all those variables :-( This is going to be a long night…
- bobbybee
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
tosh? Manual JSON editing? Perl scripts?I've gone code-blind and hit a wall :-(You no longer have a sprite called “EncChars”. Those blue sensor blocks which use it are having a hard time understanding what you mean…
I had started merging sprites…
Something broke…
Good man. That's the sort of careless idiocy I was looking for! Thanks…
G
Wait a minute… is that a hacked block??? So I *need* to have those characters in another sprite. Which means I have to manually delete all those variables :-( This is going to be a long night…
- MegaApuTurkUltra
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
Perl scripts? Scripts?
- gtoal
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
tosh? Manual JSON editing? Perl scripts?I've gone code-blind and hit a wall :-(You no longer have a sprite called “EncChars”. Those blue sensor blocks which use it are having a hard time understanding what you mean…
I had started merging sprites…
Something broke…
Good man. That's the sort of careless idiocy I was looking for! Thanks…
G
Wait a minute… is that a hacked block??? So I *need* to have those characters in another sprite. Which means I have to manually delete all those variables :-( This is going to be a long night…
Not with hacked blocks involved :-(
I've deleted about 200 1-char variables so far. Just 240 2-char variables to go.
- bobbybee
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
Er… a few lines of JS should still be able to do thattosh? Manual JSON editing? Perl scripts?I've gone code-blind and hit a wall :-(You no longer have a sprite called “EncChars”. Those blue sensor blocks which use it are having a hard time understanding what you mean…
I had started merging sprites…
Something broke…
Good man. That's the sort of careless idiocy I was looking for! Thanks…
G
Wait a minute… is that a hacked block??? So I *need* to have those characters in another sprite. Which means I have to manually delete all those variables :-( This is going to be a long night…
Not with hacked blocks involved :-(
I've deleted about 200 1-char variables so far. Just 240 2-char variables to go.

- TheLogFather
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
Wait a minute… is that a hacked block??? So I *need* to have those characters in another sprite. Which means I have to manually delete all those variables :-( This is going to be a long night…Errr… ummm… I hate to say this at this point, but…
No, they don't need to be in another sprite. What makes you think they do…? All you needed to do was change the name of that sprite back to what those hacked sensor blocks expect.
Alternatively, if you do want to keep the name you gave it, you can change the name in those blocks (which you can't do directly, ‘cos it doesn’t list the name of the current sprite in the dropdown; but you can do it by copying it to a different sprite, setting the name to what you want while it's in there, then copying it back to the original sprite and duplicating it as many times as you need to replace the ones with the wrong name).
Sorry…
Good man. That's the sort of careless idiocy I was looking for! Thanks…The joys of Scratch never throwing any kind of error/warning back at ya no matter what you throw at it…
Last edited by TheLogFather (April 18, 2016 10:16:11)
- liam48D
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
You could create a clone that does the encoding handling so that the variables pane isn't cluttered with one/two char variables. Those variables would be dynamically created in the clone's local variables, and such not the parent's – that is, the sprite's – local variables.
Of course that'd have the limitation of not working if there were 300 (301?) clones already so.. scratch that
Of course that'd have the limitation of not working if there were 300 (301?) clones already so.. scratch that

- TheLogFather
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
You could create a clone that does the encoding handling so that the variables pane isn't cluttered with one/two char variables. Those variables would be dynamically created in the clone's local variables, and such not the parent's – that is, the sprite's – local variables.No, you can't, unfortunately. The blue sensor block will only get the value for the original sprite.

(If you could do that then I would've done it that way…)
Last edited by TheLogFather (April 18, 2016 10:45:11)
- liam48D
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
Oh, that's true..You could create a clone that does the encoding handling so that the variables pane isn't cluttered with one/two char variables. Those variables would be dynamically created in the clone's local variables, and such not the parent's – that is, the sprite's – local variables.No, you can't, unfortunately. The blue sensor block will only get the value for the original sprite.
(If you could do that then I would've done it that way…)

Somebody did say something about using local variables w/ sprites to do en/decoding, though. Not sure how that worked. I'm a bit too lazy to go through the entire thread where I'm sure they said that.
- TheLogFather
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
Somebody did say something about using local variables w/ sprites to do en/decoding, though. Not sure how that worked. I'm a bit too lazy to go through the entire thread where I'm sure they said that.You probably mean https://scratch.mit.edu/projects/103803380/ …?
That's using a somewhat different method – it doesn't need the blue “_ of _” sensor block. Instead it does it only by creation of one or two temporary vars, meaning it can all be done within a clone. (Unfortunately, it requires a loop to create the name of a 26-character-length var, so it's not going to be as efficient as the hacked “_ of _” sensor method.)
Last edited by TheLogFather (April 18, 2016 13:17:17)
- iamunknown2
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
The joys of Scratch never throwing any kind of error/warning back at ya no matter what you throw at it…Ah yes, the good old' philosophy of PHP…
- comp09
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
No, PHP is “go as far as you can and produce at least some result despite bad code while printing errors on the page”The joys of Scratch never throwing any kind of error/warning back at ya no matter what you throw at it…Ah yes, the good old' philosophy of PHP…
- NickyNouse
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
Yeah, you're thinking of JavaScriptNo, PHP is “go as far as you can and produce at least some result despite bad code while printing errors on the page”The joys of Scratch never throwing any kind of error/warning back at ya no matter what you throw at it…Ah yes, the good old' philosophy of PHP…
- CrazyFox101
-
Scratcher
1 post
I think I've finally got a handle on a workable multi-user mechanism...
I am working on an AMAZING slither.io with custom skins. In it u should be able to make ur own skin, choose ur starting mass, pick how many bots you want to play againts, and much much more! i will hope to release it in 2017
- joefarebrother
-
Scratcher
500+ posts
I think I've finally got a handle on a workable multi-user mechanism...
Interesting!
I didn’t know cloud variables supported hexidecimal, either
I didn’t know cloud variables supported hexidecimal, either
Last edited by joefarebrother (May 2, 2016 20:54:40)
- TheMonsterOfTheDeep
-
Scratcher
1000+ posts
I think I've finally got a handle on a workable multi-user mechanism...
The thing I find funny about all this is this is how I've *always* done cloud - with a turn-based system where each user takes a “turn” and saves their data - but I've never been able to get it to work because I'm bad at that kind of stuff. 
also it's really slow

also it's really slow
- Discussion Forums
- » Advanced Topics
-
» I think I've finally got a handle on a workable multi-user mechanism...












