Discuss Scratch

raspykoo
Scratcher
1000+ posts

How do you make a multiplayer game?

I'm working on a game that allows both singleplayer and multiplayer but I need help on creating multiplayer mode.

What I want
A range of 1-6 people on each server.
Extra rooms/backdrops where people can move around in.
Safechat (Optional)
More than one server.
Online multiplayer

What I don't want
Only two people for each server
Only one room.
One server.
Glitchy gameplay.
Local multiplayer


Please reply :)


Last edited by raspykoo (Nov. 28, 2015 00:57:22)

deck26
Scratcher
1000+ posts

How do you make a multiplayer game?

Your project can only currently have 10 cloud variables and as far as I'm concerned it makes sense for each player to have their own cloud variable unless the game doesn't require a quick response. I think you may be expecting too much.
georgeskey
Scratcher
100+ posts

How do you make a multiplayer game?

I keep thinking about doing a multiplayer game, but the main thing for me would be how to recognize when a player drops out.
deck26
Scratcher
1000+ posts

How do you make a multiplayer game?

georgeskey wrote:

I keep thinking about doing a multiplayer game, but the main thing for me would be how to recognize when a player drops out.
https://scratch.mit.edu/projects/77775784/ shows how one method works. It's my preferred method since it will detect any kind of stop/disconnect.
amerg2
Scratcher
8 posts

How do you make a multiplayer game?

feature this

https://scratch.mit.edu/projects/89150039/



Last edited by amerg2 (Nov. 27, 2015 21:57:26)

raspykoo
Scratcher
1000+ posts

How do you make a multiplayer game?

deck26 wrote:

Your project can only currently have 10 cloud variables and as far as I'm concerned it makes sense for each player to have their own cloud variable unless the game doesn't require a quick response. I think you may be expecting too much.

But what about programming with only a few cloud variables? I don't want a boring, lonely multiplayer world where you can only talk with 4 people. Look at all of the other multiplayer platforms on Scratch that have succeed creating online multiplayer. It's okay if it isn't all cloud variables, right? There isn't a bunch of helpful resources out there for creating online multiplayer either. Even the Scratch wiki's page on multiplayer isn't helpful to me at all.

And yes, I was expecting too much. If you want, I could limit the range to 1-6 players so it will fit under the cloud variable max.

Last edited by raspykoo (Nov. 28, 2015 00:16:52)

raspykoo
Scratcher
1000+ posts

How do you make a multiplayer game?

Also, I want a visual example of how it works to create a multiplayer game on the forum. I don't like looking inside online multiplayer games, such as Griffpatch's Scratcharia, because they have HUNDREDS of blocks that I can't understand how to put them in my game. So anybody can help me by just putting the programming in scratch blocks and explain it to me on the forum. That will help a lot!

Last edited by raspykoo (Nov. 28, 2015 00:11:22)

noobyx
Scratcher
7 posts

How do you make a multiplayer game?

I didn't read any post above, (except for the requirements) but here. Make it so if you press up and W, it moves up. So make a control scheme for the arrow keys and WASD keys. So one player controls the arrow keys, and another player uses the WASD keys. (Make sure the control scripts are on different sprites.) You can made custom controls for six people. I don't know how to do ONLINE, but that's for multi-player for one server.
If you don't know what I mean, see the inside of this test game I made.
https://scratch.mit.edu/projects/89357491/
NOTE:THIS IS WHAT I KNOW, IT'S NOT HOW TO MAKE ONLINE, IT'S JUST WHAT I KNOW.

Last edited by noobyx (Nov. 28, 2015 03:31:57)

raspykoo
Scratcher
1000+ posts

How do you make a multiplayer game?

noobyx wrote:

I didn't read any post above, (except for the requirements) but here. Make it so if you press up and W, it moves up. So make a control scheme for the arrow keys and WASD keys. So one player controls the arrow keys, and another player uses the WASD keys. (Make sure the control scripts are on different sprites.)

If you don't know what I mean, see the inside of this test game I made.
https://scratch.mit.edu/projects/89357491/
And how are we going to come up with 6 different key combinations to move 6 players in a game? I meant ONLINE multiplayer, not LOCAL multiplayer. You are talking about multiplayer on a keyboard with two people. I want multiplayer where several people can be online at once. I guess you didn't understand the requirements.

I guess I have to edit my post since you all can't understand what i'm trying to say.

Last edited by raspykoo (Nov. 28, 2015 00:53:56)

noobyx
Scratcher
7 posts

How do you make a multiplayer game?

I understood the requirements, I was just writing what I KNEW about it. By the way, I wrote “I don't know to do ONLINE,” So really, I was just writing
about what I knew. So you thought I didn't understand. Anyway, I'm gonna edit my post to make it say, “THIS IS WHAT I KNOW,” to stop the confusion.
I'll go and research this and post what I find.
raspykoo
Scratcher
1000+ posts

How do you make a multiplayer game?

bump
deck26
Scratcher
1000+ posts

How do you make a multiplayer game?

If you understand my demo I linked to above the coding is not difficult. Here's a simple version I did - https://scratch.mit.edu/projects/63501310/

You really need to understand the methods if you're going to do anything with online multiplayer.
raspykoo
Scratcher
1000+ posts

How do you make a multiplayer game?

deck26 wrote:

If you understand my demo I linked to above the coding is not difficult. Here's a simple version I did - https://scratch.mit.edu/projects/63501310/

You really need to understand the methods if you're going to do anything with online multiplayer.


I understand the methods. I've done research. I just need help. It's ok if you show me any scratch commands on here because that's what I want.
deck26
Scratcher
1000+ posts

How do you make a multiplayer game?

My last link is a working multiplayer project. If you understand it it's not hard to modify to add additional players. I'm afraid I'm not going to duplicate it in Scratchblocks here.
raspykoo
Scratcher
1000+ posts

How do you make a multiplayer game?

deck26 wrote:

My last link is a working multiplayer project. If you understand it it's not hard to modify to add additional players. I'm afraid I'm not going to duplicate it in Scratchblocks here.


I understand it. It's only an option for you to put Scratchblocks on the forum, though. But that works fine.

Last edited by raspykoo (Nov. 28, 2015 18:14:28)

raspykoo
Scratcher
1000+ posts

How do you make a multiplayer game?

However, the players are divided into boy/girl. I'm working on a game where you can pick your own animal to control in multiplayer. And that's when I need help.

I fully understand the concept, but the only thing I need to know is how am I going to pick any animals to control in multiplayer when a lot of tutorials just show a “Player 2 sprite” or a “Player 1 sprite” assigned to them when they join a game slot.

(I'm sorry for giving you a hard time)

Last edited by raspykoo (Nov. 28, 2015 18:15:01)

deck26
Scratcher
1000+ posts

How do you make a multiplayer game?

It doesn't matter that it's boy/girl though. Basically you want each user to control one sprite and have a cloud variable that they control. As long as you have that you can choose what costumes are available for the sprites for each user. If you don't want two players to have the same animal you need to add in code to restrict the choice if an animal is already in use but that shouldn't be difficult.
raspykoo
Scratcher
1000+ posts

How do you make a multiplayer game?

Ok. Thank you for helping me.
CuriousGamer
Scratcher
60 posts

How do you make a multiplayer game?

Here is a basic script for it

Put this script anywhere
when green flag clicked
forever

if <key [left arrow v] pressed?> then

change [CLOUD P1 x v] by (-1)
end
if <key [right arrow v] pressed?> then

change [CLOUD P1 x v] by (1)
end
if <key [a v] pressed?> then

change [CLOUD P2 x v] by (-1)
end
if <key [d v] pressed?> then

change [CLOUD P2 x v] by (1)
end

end

Then put this in the player 1 sprite
when green flag clicked
forever

set x to (CLOUD P1 x)
end

Put this in player 2 sprite
when green flag clicked
forever

set x to (CLOUD P2 x)
end

Last edited by CuriousGamer (Nov. 29, 2015 18:04:13)

deck26
Scratcher
1000+ posts

How do you make a multiplayer game?

CuriousGamer wrote:

Here is a basic script for it

Put this script anywhere
when green flag clicked
forever

if <key [left arrow v] pressed?> then

change [CLOUD P1 x v] by (-1)
end
if <key [right arrow v] pressed?> then

change [CLOUD P1 x v] by (1)
end
if <key [a v] pressed?> then

change [CLOUD P2 x v] by (-1)
end
if <key [d v] pressed?> then

change [CLOUD P2 x v] by (1)
end

end

Then put this in the player 1 sprite
when green flag clicked
forever

set x to (CLOUD P1 x)
end

Put this in player 2 sprite
when green flag clicked
forever

set x to (CLOUD P2 x)
end
Only useful once you've actually sorted out the mechanism of how player slots are managed. You only want to change P1's cloud data when you are controlling player 1 so it can't just be a green flag script with no additional logic.

Powered by DjangoBB