Discuss Scratch

SeeGe24
Scratcher
100+ posts

ITopic: A Guide To Cloud Data

Stop saying bump!
scratchinghead
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

SeeGe24 wrote:

Stop saying bump!

Why I need to stop?

Last edited by kaj (Today 18:04:22)
scratchinghead
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

Bump

Last edited by kaj (Today 18:04:22)
s-swrichter
Scratcher
100+ posts

ITopic: A Guide To Cloud Data

nice guide!

“The world is a weird place.” – Sigton Take my survey to RATE me and my GAMES!


scratchinghead
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

Bump

Last edited by kaj (Today 18:04:22)
Evil_Leopard
Scratcher
100+ posts

ITopic: A Guide To Cloud Data

scratchinghead wrote:

I don't see any duplication to this, so yeah, I made this guide.


What is cloud data?

Cloud data is a feature in Scratch 2 that allows for data from a project to be saved and shared online. You can use cloud data to make surveys and other projects that store numbers over time.

Who can see the data stored in cloud data?

When you interact with a project using cloud data blocks, your information can be stored along with your username, and others can view it. Each project keeps a log of who interacted with it and any data they shared.

Why is cloud data currently limited to only numbers – with no strings or lists?

The current site is limited to numbers in variables as an initial step to work out any issues with their use on the site. Scratch Team plan to roll out cloud data features incrementally. If the infrastructure is working well, they plan to add other features (cloud lists, support for strings, etc.).

If I see someone post inappropriate content using cloud data, how do I report it?

Click the “Report this” button (under on the project player) to report inappropriate content in cloud data. The report form includes a link to a log of all cloud data in that project and who left it - you may want to take look at it before sending your report. Make sure that you mention “cloud data” when you type your reason in the report.

Can I make chat rooms with cloud data?

While it is technically possible to create chat rooms with cloud data, they are not currently allowed. The Scratch Team will reconsider this policy once they have a better sense of our capability for moderating and managing reports on cloud data.

How do I add a cloud variable when I'm making a project?

When you make a variable, you can check the box that says “Cloud variable.” Any data you store will be saved on the server and visible to others.

Who can change the information in a cloud variable?
Only your project can store data in its cloud variable. If people change or remix your code, it creates a different variable in their project with the same name.

I am logged in, but I still cannot use projects with cloud data. What is going on?

You need to have become a “Scratcher” on the website to have access to cloud data. You can become a Scratcher through actively participating on the website. Check out this guide to see how to become a scratcher. https://scratch.mit.edu/discuss/topic/34888/

Is it possible to make multiplayer games with cloud data?

Multiplayer games may be difficult to create, due to network speed and synchronization issues. However, some Scratchers are coming up with creative ways to use the cloud data for turn-by-turn and other games.

How long does it take for cloud data to reach another Scratcher?

It depends. If both Scratchers have a reasonably fast Internet connection (DSL/Cable), and there are no restrictive firewalls on the computers/network, updates should be transmitted in milliseconds. However, a lot of computers have firewall software running in them, and if the firewall software blocks outgoing connections to TCP port 531 and TCP port 843, the time-lag becomes one-second. Scratch Team are currently trying to figure out ways in which they can work around this limitation.

What's the maximum amount of cloud data? And what it contains?

Currently, cloud data has been stripped down to only (up to 10) cloud variables that can contain only integers. This means that cloud variables, unlike regular variables, cannot contain letters.

What's the character limit?

A character limit of 10,240 digits per variable has also been implemented, which translates to 300.7 KB of cloud data storage per project. The Scratch Team says they want to configure the server bit-by-bit to add new features incrementally.



~Thank you for reading, if there's anything I missed, just tell me~

good guide!!!!

Wonder is the beginning of wisdom. - Socrates
Helping new Scratchers and working on projects.

pen down
gamebeater187
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

scratchinghead wrote:


My 1000th post!
I haven't changed my logo since my 96th post on 2014. Now at 1000 posts, I changed my logo!
jromagnoli
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

I think this needs a bump.




ROAD TO 10,000 POSTS
████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 64%










If you can read this, my signature cubeupload has been eaten by an evil kumquat!
hehehe!Mytiptopsecrettopicidentifier!ahjdgggfhjadggahjsahasgdjfsdjfga

DadOfMrLog
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

I think the guide is missing some info, and is even a little misleading in places (though it's often due to the current status of cloud).

Here are some clarifications (added in red)…

Now, I don't know how much of it you'd want to include in the original (I've gone into probably too much detail in places), but I think some parts of it could be worth adding, in some form.


Why is cloud data currently limited to only numbers – with no strings or lists?

The current site is limited to numbers in variables as an initial step to work out any issues with their use on the site. Scratch Team plan to roll out cloud data features incrementally. If the infrastructure is working well, they plan to add other features (cloud lists, support for strings, etc.).

There's no technical reason that cloud data has only numerical values – it really doesn't need any changes to the cloud system for that – at the moment, the system is actually *preventing* non-numerical values, so it's just a case of removing that restriction.

The reason is really more to do with how easy it would then become to create chat clients. –See notes about question below for more about that…

Conversely, I think it's really, *really* difficult to see how to implement cloud lists in a way that would actually be practically useful. There's no way you would want the server to send out the whole of a list to everyone viewing the project each time someone adds/deletes/replaces/inserts just one item. But if you only send out a specific item at a time when it gets changed, the delay between one person changing it and others seeing that change would be potentially catastrophic for the syncing of cloud lists across players.
(Just think what happens if one player deletes item 3 of the list, but another tries to delete item 5 of the list before they see that item 3 was deleted – what is the cloud server going to do…? It would have to somehow know that item 5 for the second player has now become item 4 of its *own* view of the list because the first player deleted item 3 *without* the second player knowing about it – and the server really has no way to know when the second player actually ‘found out’ about the deletion of item 3, so cannot tell which item the second player means by “item 5”. The only way to be sure is to send the whole list at every change – but you really don't want to be doing that all the time… :/ )

I honestly can't imagine how cloud lists could be done such that it would be reliable and efficient, given the way the majority of Scratchers would be likely to script them. And I think that's why we've never seen cloud lists, and why we're not likely to see them any time soon.



Can I make chat rooms with cloud data?

While it is technically possible to create chat rooms with cloud data, they are not currently allowed. The Scratch Team will reconsider this policy once they have a better sense of our capability for moderating and managing reports on cloud data.

Yeah… Can you imagine what would very likely happen if many Scratchers started making chat clients…? Can you see the problems that would appear as people started talking to each other on a chatting system that was moderated only by young kids…?
–Sorry, that's more of my own comment about it, and not really meant to be adding any useful info. :)



Who can change the information in a cloud variable?
Only your project can store data in its cloud variable. If people change or remix your code, it creates a different variable in their project with the same name.

This seems like a slightly odd answer (i.e. not that clear exactly what is meant). The whole point of a cloud variable is that any Scratcher running the project can change the value in the cloud. The question is asking “who”, but the answer given is in terms of “what” can change it. And even then, it's not giving any info on what the restrictions are, i.e. when the project can and cannot change a cloudvar when run by others.

I'm guessing what it needs is to say that only the project creator is able to change the cloud variable manually while the project is in editor mode (otherwise any Scratcher would be able to change it to whatever they wanted just by editing the project), and that once someone else makes a change to your cloud project then it is no longer able to change any of its values in the cloud (unless they remix, in which case it's a different project with its own cloudvars).



Is it possible to make multiplayer games with cloud data?

Multiplayer games may be difficult to create, due to network speed and synchronization issues. However, some Scratchers are coming up with creative ways to use the cloud data for turn-by-turn and other games.

Wow, where do I start with this one…?!
I think the answer is a really good summary, but it's not actually very helpful, practically. –But then to make it actually helpful does require several paragraphs, unfortunately, so not sure what to do about that.

Well, here are my thoughts, and maybe someone can ‘crystallise’ it into something more succinct… :)


First of all, I guess it depends what is meant by “multiplayer game”. That is covered a bit with the answer above referring to “turn-by-turn” games.

But most Scratchers probably think of what I'd describe as (near-)real-time multiplayer – i.e. where each player sees the movements of the other players (almost) immediately.

Such games are (at least at the moment) a practical impossibility. The main reason is to do with the way a cloud-based project ‘polls’ the cloud server about once every 1.5s for the latest cloud values. That means it's not possible for a project to receive updates to positions more frequently that that! So any other players you're watching will only get updated very ‘jerkily’, about every second or so, which is clearly no good for a real-time game!

To work around this to create ‘smooth’ player updates, you really need to store a few seconds worth of player data in a stream, and have that stored in that player's cloud variable, along with some kind of ID ‘timestamp’ for each position in the stream. Then the other players have to keep track of where they are in the stream, and work their way through it at the appropriate speed.

The delay between one person setting a cloud variable, and others seeing it, is typically one to 1.5s. Since the player interpreting the stream must have a clear (at least) 1 second of positions to work through after getting a new cloud update (otherwise they will run out before they see the next update), that means the delay is bound to be at least 2 seconds between one player moving and another seeing it.

Of course, we're all hoping the current cloud situation will change… soon…



How long does it take for cloud data to reach another Scratcher?

It depends. If both Scratchers have a reasonably fast Internet connection (DSL/Cable), and there are no restrictive firewalls on the computers/network, updates should be transmitted in milliseconds. However, a lot of computers have firewall software running in them, and if the firewall software blocks outgoing connections to TCP port 531 and TCP port 843, the time-lag becomes one-second. Scratch Team are currently trying to figure out ways in which they can work around this limitation.

Since the fast port 531 connection is now disabled, and will never return in that form (a new system is under development, based around WebSockets, I believe), the part above which mentions about the old system might as well be dropped.

Until then, that leaves the current fallback polling method, with its delay of ~1.5s between polls of the server.

See previous answer for some practical issues that causes…



What's the maximum amount of cloud data? And what it contains?

Currently, cloud data has been stripped down to only (up to 10) cloud variables that can contain only integers. This means that cloud variables, unlike regular variables, cannot contain letters.

Cloud variables can contain any *string* which the cloud server considers could be numerical – i.e. NOT just integers! That includes things like…
Floating-point values: “-036837460987.984760938706870e-8357987295” (the part within quotes)
Certain strings which have numerical values: “Infinity”, “-Infinity”, “true”, “false”
Hexadecimal (with “0x” prefix): “0x0123456789abcdefABCDEF”
note that case doesn't matter, but is *remembered*!
A blank string, or even loads of spaces (it considers these to be effectively zero).
Also, leading and trailing spaces are allowed, so: “ 239872986798734968 ”

Note that the cloud server does NOT store an actual numerical value – what it stores is a *string*, so the string will not be ‘mangled’ in any way from what you set it to (i.e. leading zeros will remain, it will not turn blank/spaces into zero, it will not turn “false” into zero, etc.). But the *contents* of the string must be *considered* to be a numerical value in order for the cloud server to accept it and store.

(Also, yes, I know it's possible to circumvent the 10-cloudvar limit, but that's there for a reason, and I think it best not to draw attention to getting around it…)



What's the character limit?

A character limit of 10,240 digits per variable has also been implemented, which translates to 300.7 KB of cloud data storage per project. The Scratch Team says they want to configure the server bit-by-bit to add new features incrementally.

I guess the answer above is OK from a practical viewpoint. But the 10240 limit isn't really cloud-variable-specific, since it is applied through the “join” block. So it affects any variable if you try to set it to some expression which uses that block. (-Though it could well be that the limit was added specifically to avoid issues with having very long cloudvars?)
Again, probably best to avoid mention of the workaround for this – though I think it is relatively tedious to do, so it's not going to be something that's likely to cause widespread issues, I think…?



I think the guide is also missing some practical issues that are often faced when using cloud variables, so I'll put some of those into the following post when I have some time to write another essay…

Last edited by DadOfMrLog (March 20, 2017 20:07:11)



Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…


- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -

DadOfMrLog
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

PLEASE NOTE…

The new cloud system is now in place, and replaces the old “fallback” cloud system.

That means some of the things written below are out of date.

The most important thing that still holds about the new system is to ensure your project does not change cloudvars too many times per second. Otherwise the cloud server can disconnect you for a while due to ‘spamming’ the connection.

How many times per second is too many…? Well, I'm not sure exactly, but I try to keep cloudvar changes in my multiplayer test project down to only ten(-ish) changes per second, and that appears to works fine. My guess would be that making 30 changes per second is too many…




What Every Scratcher Should Know About Using Cloud Variables!


Yes, this is long – but it does also contain various scripting examples to help explain some of the points. And if you take some time to read through it then you will hopefully discover enough to understand some of the limitations of cloud variables, and how you can make them work well for you!

Contents

1. How often to set a cloud variable
Summary: don't do it too many times per second!

2. Some things to beware of when setting a cloud variable
Summary: it can go wrong! (You often need to catch it when it does.)

3. How often to check a cloud variable's value
Summary: it doesn't matter! (But see next section for some things to avoid.)

4. Some things to beware of when checking a cloud variable's value
Summary: watch out that its value could change while using it within a loop.

5. Encoding text into a cloud value as a long string of digits
Summary: see the numerous cloud encoder/decoder projects, and cloud list projects.

6. Comparing long strings of digits
Summary: it often does not work as you expect!


Maybe there will be more points, as I think of them…

_____________________________________________________________________



1. How often to set a cloud variable

With the current status of Scratch Cloud (fallback polling only), a project will pick up the values of cloud variables only once every 1.5 seconds (roughly). That means there is currently no point in setting cloud variable values any more often than about twice per second.

It's also worth remembering that every time you set the value of a cloud variable, the project sends the new value to the cloud server, and the cloud server then has to send that information to all those who are currently viewing the project. –If you set a cloud variable many times per second (Scratch typically runs loops at 30 passes per second), that means you are effectively ‘spamming’ the cloud server…

Even when the new cloud system becomes active (hopefully soon!), there will inevitably still be a delay between someone setting a cloud variable and others seeing that change. With the old, now disabled, fast port 531 system, the delay was rarely less than 0.2s, and I'd imagine the new one would be similar. That means there will be little point in setting a cloud variable more often than about five or six times per second.

So, practically speaking, you should NOT be doing this:
forever
do some things for this frame of the game... :: grey
set [☁ cloudvar v] to (whatever... :: grey) // Updates cloudvar many times per second, spamming cloud server
end
[If your project has scripts which do something like above (i.e. setting cloudvar(s) every time through the loop), then take a look at the cloud log, and notice how many entries it is putting in there for each and every second you're running the project – and then consider how much worse it will get as more users join the game…]

Instead, there should be a gap between setting the cloudvar, maybe like this:
set [next cloud time v] to (timer)
forever
do some things for this frame of the game... :: grey
if <(timer)>(next cloud time)> then
change [next cloud time v] by (0.5) // Will only update cloud 2x per sec
set [☁ cloudvar v] to (whatever... :: grey)
end
end

Also, you should NOT be constructing a cloud variable by joining digits onto it:

set [☁ cloudvar v] to [] //  starts off empty
set [pos v] to [0]
repeat (length of (data-to-encode))
change [pos v] by (1)
find a two-digit code for (letter (pos) of (data-to-encode)) :: custom block // for example
set [☁ cloudvar v] to (join (☁ cloudvar) (two-digit-code)) // Very bad!! -every change gets sent to cloud server :/
end

Instead, you just construct the string of digits elsewhere (e.g. another variable) and then, once that string of digits is complete, you should set the cloudvar to that in a *single* set block:

set [temp v] to [] // construct the encoding into this variable insead
set [pos v] to [0]
repeat (length of (data-to-encode))
change [pos v] by (1)
find a two-digit code for (letter (pos) of (data-to-encode)) :: custom block // for example
set [temp v] to (join (temp) (two-digit-code)) // not using cloudvar, so no longer spamming cloud server
end
set [☁ cloudvar v] to (temp) // only set cloudvar once at the end, after constructing the whole encoding

_____________________________________________________________________



2. Some things to beware of when setting a cloud variable

You might think that it's as simple as using the block "set cloudvar to whatever", and then the cloudvar will be set to whatever, and you wouldn't have to worry about it any more.

That is usually true. Unfortunately, though, it's fairly common for things to go a bit wrong, and you can then see the cloudvar reverting back to the previous value about a second after you've just set it!

There can be several reasons for this…
  • One common reason is due to using a browser which aggressively caches the response from the cloud server. Both Internet Explorer and Edge browsers have this problem – they will *always* reset the cloud value back to what it was when you first came to the project, and it makes them effectively unusable for any cloud-enabled project (whether editing or playing). You simply have to use a different browser (such as Firefox, or Chrome, etc.)

    BTW, it's possible to use this ‘quirk’ to detect someone using Internet Explorer or Edge: https://scratch.mit.edu/projects/151565105/
    In fact, it's possible that someone running your cloud project with these browsers can ruin its cloud values, as the above project explains. So it's not a bad idea to actually detect this and prevent them from using the project any further (at least from doing anything that changes cloudvars).
  • If you are using a sensible browser, however, then it's still possible for cloud variables to keep on reverting back to old values if the project's connection to the cloud server has timed out. This can happen if you don't use a project for an hour or so, e.g. because you're editing it. If the project does not change a cloudvar during that time, the cloud server eventually times out that project's connection, and will no longer allow any changes it sends to ‘reach’ the cloud itself. The cloudvar will simply revert back to its old value the next time the project ‘polls’ for the latest (true) cloud values (i.e. about a second later). To fix this you just need to reload the project to renew its cloud connection.
  • Also, if you have a cloud-enabled project opened in more than one place as the same user (e.g. in two different tabs, or in two browsers, or two computers) then the cloud server will only accept changes to cloudvars from the *most recently opened* project. Other open instances of the same project, using the same user, will only be allowed to read the cloudvar values. That means if you are editing the instance of the project that is not the latest one you opened, then a cloudvar will revert back to its previous value right after attempting to change it.
However, even when a project is still fully connected to cloud with a sensible browser, it's still possible for a cloudvar to sometimes revert back to an old value just after it has been changed by the project.

If you are setting the cloud variable fairly frequently (every second or so, or a few times per second), then it's no problem, since the next value will be sent before the cloudvar gets chance to revert.

But if it's only an occasional change then it's a really good idea to check that the new value has ‘stuck’. You can do this by checking for about 1.8s after setting its value, to see if the old value returns:
set cloudvar to (whatever :: grey) with current value (☁ cloudvar) //  when you want to set the cloudvar
define set cloudvar to (newVal) with current value (curVal)
repeat (4) // try four times
set [☁ cloudvar v] to (newVal) // try setting it to the desired value
set [end time v] to ((timer)+(1.8)) // check for 1.8 seconds after setting it
wait (0.3) secs // wait for a little bit
repeat until <not <(☁ cloudvar)=(newVal)>> // check if its value has changed to something else
if <(timer)>(end time)> then // all is fine - it has remained as 'newVal' for 1.8 seconds
stop [this script v] // can finish this script now
end
wait (0.1) secs
end
if <not <(☁ cloudvar)=(curVal)>> then // got a completely different value!
broadcast [got different cloud value v] // probably means someone else changed it
stop [this script v] // so get out
end
end
broadcast [failed to set cloudvar v] // may mean bad browser, or cloud connection timed out (see text above)

_____________________________________________________________________



3. How often to check a cloud variable's value

Unlike setting a cloud variable, it doesn't matter how often you use a cloud variable block to read the value of a cloud variable.

However, there are still some things to watch out for if you're reading from a cloud variable in a loop (e.g. extracting letters from it).

See the next section to find out about that…

_____________________________________________________________________



4. Some things to beware of when checking a cloud variable's value

Consider this loop, which you might be using to decode a chunk of data in a cloudvar:

set [decoded v] to [] //  start off with blank string
repeat (digit-pairs-to-decode) // or maybe repeat until it finds a specific two-digit code
set [2digits v] to (join (letter (pos) of (☁ cloudvar)) (letter ((pos)+(1)) of (☁ cloudvar))) // get 2 digits from cloudvar
set [decoded v] to (join (decoded) (letter (2digits) of (LETTERS))) // add letter to decoded
change [pos v] by (2)
end

That will most-likely work just fine most of the time. But just think for a moment what might happen if the cloud server sends a new value for the cloudvar, so it actually manages to change it while it's in the middle of that loop

Now, it's quite possible that Scratch is written in such a way that such a thing could never happen (if you put the above loop inside a non-refresh custom block). However, we have no access to the cloud parts of the Scratch source-code so we have no idea if it could happen – and since it's easy to rewrite the script to avoid this potential problem…

Instead, you should make sure that you're working on a copy of the cloudvar that you know cannot change until *you* want to check it again:

set [encoded v] to (☁ cloudvar) //  make a copy that we know cannot change during the loop
set [decoded v] to [] // start off with blank string
repeat (digit-pairs-to-decode)
set [2digits v] to (join (letter (pos) of (encoded)) (letter ((pos)+(1)) of (encoded))) // get 2 digits from 'encoded'
set [decoded v] to (join (decoded) (letter (2digits) of (LETTERS))) // add letter to decoded
change [pos v] by (2)
end

Probably the best way to do it is to have all the decoding happen in a custom block, and send the cloudvar as a parameter:

decode new cloud value (☁ cloudvar) //  send cloudvar into custom block as a parameter
define decode new cloud value (encoded)
do all the decoding in here, using (encoded) instead of (☁ cloudvar)... :: grey

_____________________________________________________________________



5. Encoding text into a cloud variable as a long string of digits

If you've read all the way through the sections so far then I think many of the scripts above have already given hints how you might do such encoding (and decoding).

If you still need more, I'd recommend that you type “encode cloud” into the Scratch search bar, and see all the projects that come up.

Also, searching for “cloud list” will give many projects that will encode a whole list into a cloud variable (and decode from a cloud variable back into the list).

_____________________________________________________________________



6. Comparing long strings of digits

One of the things you might want to do is to check if a cloud variable, containing a long string of digits, has changed from its previous value. And you might typically do it like this:
if <(☁ cloudvar)=(previous value)> then //  this test may NOT do what you expect!
maybe do something here when they are equal... :: grey
else
decode new cloud value (☁ cloudvar) :: custom block
end

But the above test for equality can go WRONG if the cloud variable contains more than about 16 digits!

The reason is that Scratch looks at what is in both sides of the equals block, and decides they are both numerical values (since they just contain lots of digits).

Scratch then turns them into numerical values, which are only accurate to about 16 digits. That means Scratch will say this is true:

<[1234567890123456789000] = [1234567890123456789111]> //  Scratch says this is true!

Even worse, if the long strings of digits both have about 310 digits or more, then Scratch will *always* say they are the same – even when the first digits are completely different, and even when the lengths of the strings of digits are completely different (say, one has 400 digits, the other has 500).

The reason is because once a number reaches 310 digits long, it ‘overflows’ what can be handled as a numerical value, and so Scratch just calls it “Infinity”. That means *anything* longer than about 310 digits is “Infinity”, so any two strings of digits longer than that will both be “Infinity”, and therefore equal!

OK, so how to work around that…? The answer is to ensure that Scratch *cannot* treat the things on each side of the equals block as being numerical values. And the way to do that is to join a letter to them:

if <(join [a](☁ cloudvar))=(join [a](previous value))> then //  ensures they are not compared numerically
maybe do something here when they are equal... :: grey
else
decode new cloud value (☁ cloudvar) :: custom block
end

_____________________________________________________________________

Last edited by DadOfMrLog (Oct. 14, 2017 10:14:13)



Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…


- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -

EncloCreations
Scratcher
500+ posts

ITopic: A Guide To Cloud Data

Basically, even thought the last movements of the opposing player will be ~1.5 seconds in the past, you would still get a mildly smooth game
EncloCreations
Scratcher
500+ posts

ITopic: A Guide To Cloud Data

Infact, if the movements of a player are very predictable (based on the game play style perspective), the opposing client can guess the predictable parts and get the rest of the data needed a few seconds later (Griffpatch's games work in a similar fashion)
DadOfMrLog
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

EncloCreations wrote:

Basically, even thought the last movements of the opposing player will be ~1.5 seconds in the past, you would still get a mildly smooth game
Not if you only see the cloudvar change every ~1.5 seconds – in that case the project can only see the position/data of other players at each ~1.5s interval.

That means you have to either place a stream of positions over that 1.5s into the cloudvar (probably twice as long, to be safe, which is what I do in my multiplayer base), or you have to design your game in such a way that it can figure out what all the intermediate movements might be (which sounds kinda similar to what you said in your post just above) – or a combination of some of both would probably be good.

Whichever & whatever, it requires careful thought and effort to do it well, and less experienced Scratchers are not going to be writing projects in that way (but rather more likely just changing their cloudvar(s) every pass through the loop, and expecting to see smooth movement at the other end, while also unknowingly spamming the cloud server…)



Alternate account: TheLogFather –– HowTos and useful custom blocks (see studio). Examples below…


- String manipulation - - - X to power of Y - - - Clone point to clone - Detect New Scratcher - Speed tests studio -

Daring_Sailor
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

Why does every bump say:
“Last edited by Kaj”?

scratchinghead
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

DadOfMrLog wrote:

Yes, this is long – but it does also contain various scripting examples to help explain some of the points. And …

O.o thank you DadOfMrLog (what a long post)
I will find some time to sum up your thoughts and maybe add it into the guide.

Last edited by scratchinghead (April 14, 2017 11:33:04)


Last edited by kaj (Today 18:04:22)
jromagnoli
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

Drunken_Sailor wrote:

Why does every bump say:
“Last edited by Kaj”?
Because that's part of his sig.




ROAD TO 10,000 POSTS
████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 64%










If you can read this, my signature cubeupload has been eaten by an evil kumquat!
hehehe!Mytiptopsecrettopicidentifier!ahjdgggfhjadggahjsahasgdjfsdjfga

Daring_Sailor
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

jromagnoli wrote:

Drunken_Sailor wrote:

Why does every bump say:
“Last edited by Kaj”?
Because that's part of his sig.
Oh ok.
BTW, what colour do you use for your sig?

jromagnoli
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

Drunken_Sailor wrote:

jromagnoli wrote:

Drunken_Sailor wrote:

Why does every bump say:
“Last edited by Kaj”?
Because that's part of his sig.
Oh ok.
BTW, what colour do you use for your sig?
probably #939393
last edited by kaj




ROAD TO 10,000 POSTS
████████████████████████████████████████████████████████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 64%










If you can read this, my signature cubeupload has been eaten by an evil kumquat!
hehehe!Mytiptopsecrettopicidentifier!ahjdgggfhjadggahjsahasgdjfsdjfga

Daring_Sailor
Scratcher
1000+ posts

ITopic: A Guide To Cloud Data

jromagnoli wrote:

Drunken_Sailor wrote:

jromagnoli wrote:

Drunken_Sailor wrote:

Why does every bump say:
“Last edited by Kaj”?
Because that's part of his sig.
Oh ok.
BTW, what colour do you use for your sig?
probably #939393
last edited by kaj
Thanks

hedgehog125
Scratcher
100+ posts

ITopic: A Guide To Cloud Data

Very useful info!

Hello I'm @hedgehog125 and @Hedgehog125_test!

You might want to look at these:
Frontier Pen Game Making For Beginners How's Itch?



Powered by DjangoBB