This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2009-05-24 21:35:52

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Multiplayer In Scratch 1.4: A video demonstration

Hey guys, I made a video to show off my multiplayer pong game I made with the beta of scratch 1.4. The video is located @ http://www.scratch.mit.edu/ext/youtube/?v=5fzIiOnaYvA

I made this because I know people are looking forward to this feature probably more than any other feature in 1.4. While the new networking features are better than those in 1.3 its still pretty buggy.

Here are some errors I encountered:

If a variable is being updated too quickly, it is not sent to other computers
Sometimes, variables will not be sent to other computers, ever

This makes programming online multiplayer projects very difficult.

Last edited by archmage (2009-05-24 21:41:17)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#2 2009-05-24 21:46:58

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

Interesting. In multiplayer, can you just use the point towards block to point towards a certain sprite? Or do you need the formula of the point towards block?

Offline

 

#3 2009-05-24 21:50:14

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

All mesh does is share variables. The formulas you use don't make a difference.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#4 2009-05-24 21:50:38

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

Oh ok, never mind, I kinda understand it more now.

Offline

 

#5 2009-05-24 21:53:25

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

What kinds of games did you have in mind to make? Mesh is buggy, which is probably why it is a hidden experimental hidden feature. Mesh's variable sharing bugs will make multiplayer games much harder to create.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#6 2009-05-24 21:59:07

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

I was thinking of a shooter type thing. I'm trying to work the scripts.
Can I see how you did your Pong game?

Last edited by keroro645 (2009-05-24 22:00:02)

Offline

 

#7 2009-05-24 22:02:19

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

I will release the code when 1.4 is out


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#8 2009-05-24 22:05:01

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

Ok, I looked at an example project, and It had two versions of the project, so does that mean that if you want a two player game you have to have multiple versions of the project?.

Offline

 

#9 2009-05-24 22:10:34

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

keroro645 wrote:

Ok, I looked at an example project, and It had two versions of the project, so does that mean that if you want a two player game you have to have multiple versions of the project?.

No, you can combine them if you want but having 2 projects is much simpler.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#10 2009-05-24 22:11:57

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

Yay, I did it! I made a point and move around project. You can test on the same computer. And it works.

Offline

 

#11 2009-05-24 22:18:13

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

You can really only do anything with mesh if you have 2 computers.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#12 2009-05-24 22:22:29

mkolpnji
Scratcher
Registered: 2007-07-20
Posts: 100+

Re: Multiplayer In Scratch 1.4: A video demonstration

archmage wrote:

You can really only do anything with mesh if you have 2 computers.

...Thank god I have two computers  smile


http://i723.photobucket.com/albums/ww232/mkolpnji/signaturebanner.gif

Offline

 

#13 2009-05-24 22:26:21

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

Even if you can use mesh, it will only support slow moving games. It has a real problem with fast moving games. Here are some ideas of what is possible

pictionary
checkers
chatrooms
simple tag games
Highscore boards

Nothing that has too many variables that update too quickly.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#14 2009-05-24 22:34:12

Mike_W
Scratcher
Registered: 2009-02-05
Posts: 100+

Re: Multiplayer In Scratch 1.4: A video demonstration

Have you tried something like

ballx = ballx to see if it triggers updates better ( I have no idea how the mechanics work)

Offline

 

#15 2009-05-24 22:35:00

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

This is sweet. I see how complicated it can get.

Offline

 

#16 2009-05-24 22:36:14

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

Mike_W wrote:

Have you tried something like

ballx = ballx to see if it triggers updates better ( I have no idea how the mechanics work)

You have variables for everything.
Ballx is your x. If you have another player, you can create another ball variable.
Once you connect you can connect variables in sensors. And I have set something up

Offline

 

#17 2009-05-24 22:37:08

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

Well the problem is, that there is no send variables or broadcast commands. The 2 computers share all their variables and broadcasts. I think that what you are saying is that I should resend the variables if they are not in sync but this is not possible.

If anyone wants I can explain how the game was coded.

Last edited by archmage (2009-05-24 22:39:17)


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#18 2009-05-25 00:06:58

DawnLight
Scratcher
Registered: 2009-04-25
Posts: 500+

Re: Multiplayer In Scratch 1.4: A video demonstration

archmage wrote:

Even if you can use mesh, it will only support slow moving games. It has a real problem with fast moving games. Here are some ideas of what is possible

pictionary
checkers
chatrooms
simple tag games
Highscore boards

Nothing that has too many variables that update too quickly.

Nice Ideas Maybe I'll try one of them...

Offline

 

#19 2009-05-25 05:16:17

tcb
Scratcher
Registered: 2008-03-25
Posts: 100+

Re: Multiplayer In Scratch 1.4: A video demonstration

when importing a project in 1.3.1, the variables from the imported project do not mix with the variables from the original.
please can you ask them to fix this?

Thanks,tcb

PS:I really need this for my scratch OS to work. It's supposed to be able to import new apps so that there can be infinite programs.This won't work if the variables and broadcasts wont mingle


http://goo.gl/eCQLihttp://goo.gl/sK54shttp://goo.gl/jC0dehttp://goo.gl/yhGLQhttp://goo.gl/wqvsQ

Offline

 

#20 2009-05-25 05:18:59

tcb
Scratcher
Registered: 2008-03-25
Posts: 100+

Re: Multiplayer In Scratch 1.4: A video demonstration

tcb wrote:

when importing a project in 1.3.1, the variables from the imported project do not mix with the variables from the original.
please can you ask them to fix this?

Thanks,tcb

PS:I really need this for my scratch OS to work. It's supposed to be able to import new apps so that there can be infinite programs.This won't work if the variables and broadcasts wont mingle

however, scratch 1.2.1 works fine...I can't use that version because my OS uses lists and i cannot use jens's lists and files because I am already 3/4 done.Snd because without the extended memory of 1.3.1 scratch crashes...true story!


http://goo.gl/eCQLihttp://goo.gl/sK54shttp://goo.gl/jC0dehttp://goo.gl/yhGLQhttp://goo.gl/wqvsQ

Offline

 

#21 2009-05-25 11:23:48

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

archmage wrote:

Well the problem is, that there is no send variables or broadcast commands. The 2 computers share all their variables and broadcasts. I think that what you are saying is that I should resend the variables if they are not in sync but this is not possible.

If anyone wants I can explain how the game was coded.

Broadcasts are also shared, you just have to type them in on both computers. You can also use the ip 127.0.0.1 and experiment with two scratch sessions communicating - just as if you where using two computers... Could be useful for creating a multiplayer board game.

What if you just create two variables "ball direction" and "ball speed", and a sync of x and y positions say every second? it would require way less network variable updates, and so allow you to create "fast" games. Still experimenting with that though.


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#22 2009-05-25 12:19:34

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

Oh, I didn't know that you could connect to 127.0.0.1. That makes things much easier.


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#23 2009-05-25 12:26:30

BWOG
Scratcher
Registered: 2008-09-19
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

Extremly laggy but pretty cool
BTW what is 127.0.0.1?

Last edited by BWOG (2009-05-25 12:27:29)

Offline

 

#24 2009-05-25 12:27:13

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

I can't connect to that. What does it make easy?

Offline

 

#25 2009-05-25 14:17:10

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: Multiplayer In Scratch 1.4: A video demonstration

BWOG wrote:

Extremly laggy but pretty cool
BTW what is 127.0.0.1?

127.0.0.1 is a IP Address. But this is a "special" IP. When your on a computer and have a game and set 127.0.0.1 to the IP Address it sends all the info your sending from that computer to that same exact computer. So if you have 2 Scratch Sessions on the you have the first one broadcast lets say "Move forward" then on the other session it will receive "Move Forward" then do what's under it like move 10 steps forward.

Off Topic: Maybe I could make a game that can control another game. Like set the settings from 1 scratch session to another allowing you to control a game on another computer.. That would be cool...

Offline

 

Board footer