Discuss Scratch

The_Blue_Snake
Scratcher
13 posts

Need help with cloud multiplayer engine!

Hey guys!

I had a (few) questions about cloud multiplayer engines, as I'm making a multiplayer game right now. I am mostly concerned about the time it takes to update cloud variables, and the problems that causes in-game. Now, I know there isn't really any way to speed up the cloud updates, I was just looking or ideas for workarounds for these problems. Here are my three questions: (If you can answer any one of these confidently, please do!)

The first is this:
When two people try to update a cloud variable at the same time, (For example, both try to join the same player slot), problems can arise if both think that they're in the same slot. I've heard that you can just put a 2 - 3 second wait in there, to see if your username is the one that took the slot. Does this really solve the problem completely? What if another player changes that “Request” variable while that other computer is waiting… (Remember, when you set a cloud variable, it appears that you set it instantly on your game, but takes a little bit of time to update on other people's screens)

The second:
If I'm making a shooter game, (multiplayer of course) should I have the bullets make the other player take damage based on their (and the player's) position on “Person one's” screen, (The one who shot the bullet) or “Person two's” screen. (The one who is being shot at).

And finally, the third:
Since you can only have 10 cloud variables in a project, how do those MMO projects work? (For example griffpatch's) Do you use some kind of code outside of scratch? (Replit, etc…) or is it all inside of scratch. You can't have two people trying to use the same cloud variable… right?

Thank you so much for helping,
(And Scratch on)
-The_Blue_Snake

Scratch battle simulator! https://scratch.mit.edu/projects/404130635/

I'm The_Blue_Snake, a game maker, reader, gamer, and 150% nerd. Proud of it, too.
Now that I think about it, 75% of my time playing computer games is scouting out bugs in my ow projects… Humph
bSpyder
Scratcher
100+ posts

Need help with cloud multiplayer engine!

Tip: you can update cloud variables every 0.1 seconds

1. Two people using the same cloud variable isn't recommended because the person with better wifi will override the other person
2. The player shooting
3. all inside of scratch

idk what im doing
MrNanners
Scratcher
100+ posts

Need help with cloud multiplayer engine!

I'm new to Cloud Variables too I am having trouble with mine as well I made a leader boards and in the Cloud Variables Data it says that other people are updating it but when I load up the game it doesn't show them on the board and the high score automatically reverts back to what it was when I saved the game. I thought maybe it was because I made the project in offline Turbowarp and the variable is secretly non-cloud but that wouldn't explain why it was showing it being updated in the Cloud Variable Data.

That's about it, see yah.
My best and most helpful projects:
Savable Games Engine | Plants Vs. Zombies | Competitive Clicker Game
As a kid, John Lennon, member of the most successful band in history, the Beatles, said, “When I grow up, I want to be happy.” The teachers around him said that he didn't understand the question, but young John said that {the teachers} didn't understand life.
bSpyder
Scratcher
100+ posts

Need help with cloud multiplayer engine!

MrNanners wrote:

I'm new to Cloud Variables too I am having trouble with mine as well I made a leader boards and in the Cloud Variables Data it says that other people are updating it but when I load up the game it doesn't show them on the board and the high score automatically reverts back to what it was when I saved the game. I thought maybe it was because I made the project in offline Turbowarp and the variable is secretly non-cloud but that wouldn't explain why it was showing it being updated in the Cloud Variable Data.
2 things.

1. please make your own topic
2. turbowarp has a different set of cloud variables than scratch

idk what im doing
forumsguy
New to Scratch
3 posts

Need help with cloud multiplayer engine!

The_Blue_Snake wrote:

Hey guys!

I had a (few) questions about cloud multiplayer engines, as I'm making a multiplayer game right now. I am mostly concerned about the time it takes to update cloud variables, and the problems that causes in-game. Now, I know there isn't really any way to speed up the cloud updates, I was just looking or ideas for workarounds for these problems. Here are my three questions: (If you can answer any one of these confidently, please do!)

The first is this:
When two people try to update a cloud variable at the same time, (For example, both try to join the same player slot), problems can arise if both think that they're in the same slot. I've heard that you can just put a 2 - 3 second wait in there, to see if your username is the one that took the slot. Does this really solve the problem completely? What if another player changes that “Request” variable while that other computer is waiting… (Remember, when you set a cloud variable, it appears that you set it instantly on your game, but takes a little bit of time to update on other people's screens)

The second:
If I'm making a shooter game, (multiplayer of course) should I have the bullets make the other player take damage based on their (and the player's) position on “Person one's” screen, (The one who shot the bullet) or “Person two's” screen. (The one who is being shot at).

And finally, the third:
Since you can only have 10 cloud variables in a project, how do those MMO projects work? (For example griffpatch's) Do you use some kind of code outside of scratch? (Replit, etc…) or is it all inside of scratch. You can't have two people trying to use the same cloud variable… right?

Thank you so much for helping,
(And Scratch on)
-The_Blue_Snake
Clcik Here to Make cloud lists

This is my signature!
This is Sam!

when green flag clicked
say [Scratch On!]
The_Blue_Snake
Scratcher
13 posts

Need help with cloud multiplayer engine!


bSpyder wrote:

Tip: you can update cloud variables every 0.1 seconds

1. Two people using the same cloud variable isn't recommended because the person with better wifi will override the other person
2. The player shooting
3. all inside of scratch

Thanks for the help! Scratch on!

Scratch battle simulator! https://scratch.mit.edu/projects/404130635/

I'm The_Blue_Snake, a game maker, reader, gamer, and 150% nerd. Proud of it, too.
Now that I think about it, 75% of my time playing computer games is scouting out bugs in my ow projects… Humph

Powered by DjangoBB