Discuss Scratch

nXIII
Scratcher
1000+ posts

My ideas for fixing cloud variables

BoltBait
What do you think about having a leader board that can't be read from? Wouldn't that solve the security problem?
It might, but I'd still prefer cloud variables and a no-chatroom policy. Cloud variables let you make anything you want, but a leaderboard will only let you make leaderboard.
funelephant
Scratcher
100+ posts

My ideas for fixing cloud variables

nXIII
BoltBait
What do you think about having a leader board that can't be read from? Wouldn't that solve the security problem?
It might, but I'd still prefer cloud variables and a no-chatroom policy. Cloud variables let you make anything you want, but a leaderboard will only let you make leaderboard.
You obviously can't do whatever you want with only 8 characters, soo…
BoltBait
Scratcher
1000+ posts

My ideas for fixing cloud variables

nXIII
BoltBait
What do you think about having a leader board that can't be read from? Wouldn't that solve the security problem?
It might, but I'd still prefer cloud variables and a no-chatroom policy. Cloud variables let you make anything you want, but a leaderboard will only let you make leaderboard.

Well, my point is: it will be impossible to police all projects for chat rooms so let's come up with alternatives to cloud variables that are secure (from chat rooms), easy to use, and fun.

I understand that my suggestions are not flexible. Each solution I proposed is for a particular purpose.

If you want to make a type of project that can't be made with the solutions I've given, come up with a solution for it that would (1) prevent “chat board” abuse, (2) be well defined, and (3) easily solve your problem.

So… what type of project can't be made utilizing one or more of the three solutions I've proposed?

The only one I can think of is a MMORPG type project, which I think carries too much potential for abuse.
nXIII
Scratcher
1000+ posts

My ideas for fixing cloud variables

funelephant
You obviously can't do whatever you want with only 8 characters, soo
The eight character limit is for display only, and is a temporary restriction.

BoltBait
Well, my point is: it will be impossible to police all projects for chat rooms
You can make projects with the word “chat” in their name (and/or project notes) display the message “chat rooms are not allowed” when their owner attempts to share them, with a link to a description of the problems involved with chatrooms. I know you can just rename it, but that would discourage a lot of people. Whatever chat projects are left will be reported and removed.

So… what type of project can't be made utilizing one or more of the three solutions I've proposed?
Some examples:
  • Project-wide persistent data
  • View & play counters for parts of the project
  • Per-game (not per-user) persistent data
  • In-game shops with users' items
  • Generating project-unique identifiers
All of these are possible with cloud data; none are possible with your solutions.

PS: I read all of your posts; you don't need to put paragraphs in bold.

Last edited by nXIII (Jan. 6, 2013 15:17:43)

BoltBait
Scratcher
1000+ posts

My ideas for fixing cloud variables

nXIII
Some examples:
  • Project-wide persistent data
  • View & play counters for parts of the project
  • Per-game (not per-user) persistent data
  • In-game shops with users' items
  • Generating project-unique identifiers
All of these are possible with cloud data; none are possible with your solutions.

These are generalized functions, not project types. I'm wondering what types of project you'd like to make. In other words, WHY would you like “Project-wide persistent data”? And, how would this be implemented such that a chat project couldn't be made using it?

For example, here is a project that can't be done with the proposals I've given:

Poll type projects.

(ie. “What is your favorite color?”, where everyone votes and then a graph is shown with the results.)

And, before you ask… no, I don't have a solution for that one.
LS97
Scratcher
100+ posts

My ideas for fixing cloud variables

BoltBait
WHY would you like “Project-wide persistent data”? And, how would this be implemented such that a chat project couldn't be made using it?
They wouldn't be able to be implemented without cloud variables, that's the point.

Persistent data could be saving the level you're on in a game, or saving an image in a paint project, or saving tiles in a map maker.
BoltBait
Scratcher
1000+ posts

My ideas for fixing cloud variables

LS97
BoltBait
WHY would you like “Project-wide persistent data”? And, how would this be implemented such that a chat project couldn't be made using it?
They wouldn't be able to be implemented without cloud variables, that's the point.

Persistent data could be saving the level you're on in a game, or saving an image in a paint project, or saving tiles in a map maker.

All those functions could be accomplished with the second of my proposals, personal cloud variables.

nXIII
Scratcher
1000+ posts

My ideas for fixing cloud variables

LS97
Persistent data could be saving the level you're on in a game, or saving an image in a paint project, or saving tiles in a map maker.
That could all be done with user-persistent variables. I'm talking about logs, statistics, counters, and, as BoltBait mentioned, polls.
EDIT: Ah, BoltBait beat me to it.

BoltBait
These are generalized functions, not project types.
  • Project-wide persistent data (polls/ratings, user feedback, any kind of game)
  • View & play counters for parts of the project (any kind of project)
  • Per-game (not per-user) persistent data (match-based or room-based games)
  • In-game shops with users' items (…games with shops…)
  • Generating project-unique identifiers (any kind of drawing or editing project)

And, how would this be implemented such that a chat project couldn't be made using it?
It wouldn't. We would use cloud variables (with slight alterations and optimizations if necessary), and we wouldn't allow chat rooms as a policy.

Last edited by nXIII (Jan. 6, 2013 16:40:21)

BoltBait
Scratcher
1000+ posts

My ideas for fixing cloud variables

Besides being unsecure, I think the cloud variable system is quite wasteful. It transmits the entire list of cloud data constantly even if nothing's changed.

If performance is this bad when I've only had a handful of people play the game, what's it going to be like after I have 3, 4, or 5 THOUSAND* players play? That's going to be a lot of data transmitted each second. Will there be any cycles left for other functions?

I'm looking at my adventure game now. It looks like I'll need to save TONS of data to ensure that I can restore the game state on a future visit to the game. That's for each person! So, in order to restore a game state I will need to transmit the stored game states for every single player in order to find the right one for the person who wants to restore their position in the game. Think about that… every single saved game would need to be transmitted to every single user of the game simply because that's the way cloud variables work.

For a game like my adventure game that will mean 1,200 people saving about 1000** bytes–that's about a megabyte of data. Can a cloud list item hold that much data? How about my game Star Trek… that game has 15,000 positions. If I wanted to save the game state I'd need to save all 15,000 pieces of information plus all the equipment status bytes and timers for all 2,300 users–that's about 69 megabytes. THAT's a lot of data! So, for one person to restore their game, ALL saved data would have to be transmitted to them in order to find that unique player's information. This is why we need my second suggestion, personal cloud variables.

If you can't tell, I'm really concerned about cloud variable performance.

Now, I haven't even started thinking about real-time, multiple player games. But, let's take a look…

sdg1
If the SWF cannot connect to the TCP socket within 2 seconds, the fallback server is used (and the fallback server delay is 2 seconds for every update).

If there is a 2 second delay for updating the cloud list and that doesn't include transmission time of a HUGE amount of data (since all data for all real-time games will have to be transmitted to every single player)… its never going to work. It just isn't fast enough to keep up with a space ship flying around the screen or Mario jumping over an opponent.

Lightnin
Just as a side note - many of the performance issues affecting use of cloud variables now are likely to get fixed / optimized in the not too distant future.

I know they say they're working on optimizing performance. But, obviously, I'm still worried. I don't like the way cloud variable have been designed. And, I'm still not convinced that cloud variables alone are the solution to all of our needs.

*On the main site, my tower defense game has had over 4,000 unique views.
**That's a rough guess as the game has ~80 rooms, a few dozen objects, and a few unique game states.

Last edited by BoltBait (Jan. 7, 2013 13:16:51)

nXIII
Scratcher
1000+ posts

My ideas for fixing cloud variables

BoltBait
Besides being unsecure [sic], I think the cloud variable system is quite wasteful. It transmits the entire list of cloud data constantly even if nothing's changed.
No, it doesn't. Here's a log of me connecting to my leaderboard project and clicking a few times. There aren't any times on it, but notice that 1) things are only sent when they change and 2) only the changed value is sent.
project set 10012959
handshake
> {"method":"handshake","project_id":"10012959","user":"nXIII","token":"********-****-****-****-************"}
< {"method":"lset","project_id":"10012959","name":"? Leaderboard usernames","value":["nXIII","MathWizz","kyle-elyk","ke1235","","","","","","","Scimonster","","","laternenpfahl","","","Liquidmetal",""]}
< {"method":"lset","project_id":"10012959","name":"? Leaderboard scores","value":["421","169","171","2222","","","","","","","35","","","20","","","",""]}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"422"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"423"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"424"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"425"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"426"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"427"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"428"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"429"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"430"}

EDIT: Wow, my number decoder was messed up. Fixed.
EDIT2: Aw, no clouds.

Last edited by nXIII (Jan. 6, 2013 19:52:02)

BoltBait
Scratcher
1000+ posts

My ideas for fixing cloud variables

Well, that's interesting. When I'm running my Tower Defense game (which only updates cloud variables at the end of the game) my network is completely saturated at all times. I wonder what it is doing.
nXIII
Scratcher
1000+ posts

My ideas for fixing cloud variables

BoltBait
Well, that's interesting. When I'm running my Tower Defense game (which only updates cloud variables at the end of the game) my network is completely saturated at all times. I wonder what it is doing.
It may be using the fallback server, which does poll all of the data every second. Does your console say something starting with “Persistence Server error?”

Last edited by nXIII (Jan. 6, 2013 19:55:16)

BoltBait
Scratcher
1000+ posts

My ideas for fixing cloud variables

nXIII
BoltBait
Well, that's interesting. When I'm running my Tower Defense game (which only updates cloud variables at the end of the game) my network is completely saturated at all times. I wonder what it is doing.
It may be using the fallback server, which does poll all of the data every second. Does your console say something starting with “Persistence Server error?”
Nope.
Wes64
Scratcher
500+ posts

My ideas for fixing cloud variables

i agree with your suggestions, it seems like cloud data is much too broad, and should be narrowed down a bit. i think the “leaderboard” should just be a normal list-type object that you could treat as a normal list, instead of having a glorified output thing though. good thinking here.

ive only read the original post so forgive me if i'm being ignorant of something.
Firedrake969
Scratcher
1000+ posts

My ideas for fixing cloud variables

Definitely agree with personal cloud variables.
sdg1
Scratcher
100+ posts

My ideas for fixing cloud variables

nXIII
BoltBait
Besides being unsecure [sic], I think the cloud variable system is quite wasteful. It transmits the entire list of cloud data constantly even if nothing's changed.
No, it doesn't. Here's a log of me connecting to my leaderboard project and clicking a few times. There aren't any times on it, but notice that 1) things are only sent when they change and 2) only the changed value is sent.
project set 10012959
handshake
> {"method":"handshake","project_id":"10012959","user":"nXIII","token":"********-****-****-****-************"}
< {"method":"lset","project_id":"10012959","name":"? Leaderboard usernames","value":["nXIII","MathWizz","kyle-elyk","ke1235","","","","","","","Scimonster","","","laternenpfahl","","","Liquidmetal",""]}
< {"method":"lset","project_id":"10012959","name":"? Leaderboard scores","value":["421","169","171","2222","","","","","","","35","","","20","","","",""]}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"422"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"423"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"424"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"425"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"426"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"427"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"428"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"429"}
< {"method":"lreplace","user":"","token":"","project_id":"10012959","name":"? Leaderboard scores","index":"1","value":"430"}

EDIT: Wow, my number decoder was messed up. Fixed.
EDIT2: Aw, no clouds.

This is correct - the TCP server sends and receives operations (eg. append, delete, set) only, so the amount of data being sent should be reasonably manageable. However, on the other hand - we are looking at the access patterns, and trying to get a sense of how many users are ending up using the fallback system. If the percentage of users is high enough, we will certainly put more effort into it, and try to optimize it more.

Also, as a general response to this thread - remember that cloud data are _not_ designed to be appropriate and/or applicable for all sorts of projects. Scratch has its own limitations (eg: it is possible to do a 3d raytracer in Scratch, but it is difficult to program, as well as slow), and so is the case with cloud-data. If you have an incredibly large multiplayer game - it would start to lag, no matter how much optimization we put into the design.

The aim of cloud-data is to be as generalizable as possible, at the same time keeping things simple. The suggestions in this thread is about games - if we start making specialized infrastructure and blocks for each and every genre out there, things are going to become very complicated and confusing very soon :-).
BoltBait
Scratcher
1000+ posts

My ideas for fixing cloud variables

sdg1
Also, as a general response to this thread - remember that cloud data are _not_ designed to be appropriate and/or applicable for all sorts of projects. Scratch has its own limitations (eg: it is possible to do a 3d raytracer in Scratch, but it is difficult to program, as well as slow), and so is the case with cloud-data. If you have an incredibly large multiplayer game - it would start to lag, no matter how much optimization we put into the design.

I understand that. But, what I'm saying is that the design of cloud variables is poor for any type of project. If you want to design a simple 2 player game using cloud variables you will need to make a HUGE effort to make it work and it will not perform well enough to make a real-time, 2 player game. Read this for how much data is going to be transmitted back and forth.

Now, it is true that you will be able to make turn-based games. But, reading the regular forums and the suggestion site, that's not what Scratchers want. They want to make real-time games. Cloud variables is never going to work for that which is why I suggested my third suggestion–that is, similar to the way mesh works today.

sdg1
The aim of cloud-data is to be as generalizable as possible, at the same time keeping things simple. The suggestions in this thread is about games - if we start making specialized infrastructure and blocks for each and every genre out there, things are going to become very complicated and confusing very soon :-).

I think cloud variables are too generalized and difficult to police. That is why I suggested making 3 solutions instead of only 1.

EDIT: And, with this edit, I'm done defending my suggestions. Feel free to close this thread. Just let me know when this bug is fixed so that I can continue working on my projects.

Last edited by BoltBait (Jan. 8, 2013 15:20:51)

alanturing
Scratcher
4 posts

My ideas for fixing cloud variables

Can I add my support to BoltBait.

It seems that the development team now regret defining Cloud variables, as the ability to pass any data between two Scratch users - even just one bit at a time - could be misused with a workaround to develop a “chatroom” or “message board” - neither of which applications are wanted on Scratch because they give too much freedom to post offensive remarks.

The network traffic issue also seems to be a problem.

My proposal to solve the network traffic issue would be to make network traffic controllable within the Scratch program using two additional blocks: “save cloud variables to server” and “load cloud variables from server”.

My proposal to solve the chatroom workaround problem would be to make Scratch 2.0 cloud variables user specific - as in BoltBait's suggestion for ways to save game positions - a logged in user could then come back to a long game at the same position at a later date simply by running “load cloud variables from server”.

As I want to see Scratch 2.0 released in Beta and then publicly as the main version of Scratch, I would leave cloud variables at that point for version 2.0.

For version 2.1 you could then add BoltBait's first suggestion of a “high score table” visible from a separate button on the project page - displaying a “top ten” list of the players' Scratch names and high scores submitted by the game using a new block “submit high score” - to simplify matters for games where low scores are better, or scores are really times, it would be up to the programmer to convert the score variable into a value which did get bigger the better a player did in the game and submit that value for the high score table. Working this way would prevent data from one user being passed to another as the high score table is outside the game and the values cannot be seen inside the game (except for that particular player's score).

Unfortunately, I don't see any solution to the multi-player game which could not be misused as a chatroom.
BoltBait
Scratcher
1000+ posts

My ideas for fixing cloud variables

alanturing
Can I add my support to BoltBait.

My proposal to solve the network traffic issue would be to make network traffic controllable within the Scratch program using two additional blocks: “save cloud variables to server” and “load cloud variables from server”.

Thanks for the support.

I like giving control of when to update cloud variables to the Scratcher. As it is, it is not working well at all.
ImagineIt
Scratcher
1000+ posts

My ideas for fixing cloud variables

I love it all. But maybe if it was in a tab, you could have multiple leaderboards in that section?

Powered by DjangoBB