This site requires JavaScript, please enable it in your browser!
Greenfoot back
darkmist255
darkmist255 wrote ...

2012/2/8

Concepts behind multiplayer games

darkmist255 darkmist255

2012/2/8

#
Just out of curiosity (I might do something multiplayer in the future), what is the basic idea behind connecting two computers remotely so that they can "share variable data" if you will. Does it have to be done over direct IP (which is fine) or is there a way around it (thoughts: Highscore database saves player IP, you just search player username)? Also, is there a specific API that Java uses for this? If so, what would that be? Thanks for any assistance :D!
davmac davmac

2012/2/9

#
There was a brief discussion about it a while ago, which gives some advice: http://www.greenfoot.org/topics/find/25 ... but of course it's quite a broad topic. One thing to note is that multiplayer games won't work on the gallery (unless you could transfer data via the highscores database, but whether that's feasible really depends on the final API).
darkmist255 darkmist255

2012/2/9

#
Why is it that multiplayer games won't work on the gallery? Just how the server is set up?
Builderboy2005 Builderboy2005

2012/2/9

#
I believe it is because of applet permissions, although I am not sure
davmac davmac

2012/2/10

#
Builderboy2005 is correct, applet permissions only allow contacting the hosting server (greenfoot.org) which makes it impossible to connect to other players' machines.
sp33dy sp33dy

2012/2/10

#
Well, that's not strictly true. Hypothetically, if Greenfoot could afford the bandwidth and designed a small but generic REST or WSDL type interface. We could all create basic type of multiplayer games, using url connections. However, as I say, this would eat a lot of bandwidth up and require a fair bit of design..
sp33dy sp33dy

2012/2/10

#
...also, I believe. It's possible to use Flash to get round the security issues. Again, a flash object with such unrestrictiveness would have to be deployed on the same page as the java applet. The applet could then talk to the flash object (via javascript). It's all a little painful, but possible. The draw back here is that you are opening up exposures to people messing around.
sp33dy sp33dy

2012/2/10

#
So, thinking about this more. I created something for a technical problem a good few years ago. Basically, I remember we had an applet that used flash for some purposes (I can't state here). Basically, we discovered that Java Applets can talk to Javascript. Here's an example 'todo' article: Applet <-> Javascript comms I already knew you can make javascript talk with Flash. Again, here is a quick article found via google: Javascript <-> Flash These are both two way. So.. Why am I stating this??? There are then several Flash options for multiplayer type development. All of this is very beta though. Here is an up and coming option: Cirrus A developer would be required to set up a beta key to use. As you can see, this is all very technical, challenging and requires great skills in several technologies. However, it is all possible. The beauty of Cirrus it is a service; hence taking the strain. Please don't FLAME me. I'm just passing on some general information. Although it's probably far too much for this audience. However, you never know who is lurking around and want a pet project.
sp33dy sp33dy

2012/2/10

#
There is one other thought here (sorry, my brain is running at 100 mph). Sun introduced a basic http server set of classes into the latest JVM's. It would be possible to create a simple server using that; for which could be run and operated, but behind Greenfoot domain. Again, API's would have to be agreed for people to use. Network traffic would flow through the website load balancers/web servers. Hence, I can see this being too painful too; but would be a way to introduce it. I'm beginning to see a business opportunity here!
darkmist255 darkmist255

2012/2/10

#
I see, applets only let multiplayer happen if there's a middle man. I will see if the Greenfoot persistent storage opens up any windows with this, otherwise I might just make it so you download and run it. Still many options, we'll see what happens ;D.
You need to login to post a reply.