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

2013/12/17

Multiplayer - Greenfoot

GreenHouse GreenHouse

2013/12/17

#

Hey multiplayer fans :D

because greenfoot.org isn't going to setup a multiplayer server, why don't we do? > A server that is able to do so, is available for less than 5$ per month. > A Multiplayer-Server for our usage can easily handle more than 100 active clients at the same time (from different scenarios, in different channels, or all together) > This would allow the games to exchange data in less than 40ms (this enables fluid and high frequent multiplayer games, for example racing games etc.) Do you think that this is a challenge to face? :)
bourne bourne

2013/12/17

#
Greenfoot devs said they won't?
GreenHouse GreenHouse

2013/12/17

#
Greenfoot devs didn't say the will; which means they won't :D
GreenHouse GreenHouse

2013/12/18

#
No one interested in doing something like this? :/
lordhershey lordhershey

2013/12/18

#
Who were you thinking of using to host the server?
mjrb4 mjrb4

2013/12/19

#
The reason there's no plans to implement this at the moment comes down to the same reason there's no 3D support in Greenfoot - it would be a huge step up in complication (all sorts of issues crop up with such multi-player games, indeed many of the big games often have synchronisation bugs because of these issues) and considering Greenfoot is aimed at making it easy for beginners to get started making cool games, this wouldn't really be directly in line with what Greenfoot aims to achieve. However, if you do choose to go ahead and setup a server and implement this, bear in mind that you still have a bunch of issues to get around - most obviously the fact that sandboxed applets can only communicate with the same server they're hosted on. Or in other words, if you set up such a server and provided an API, it would never work on the gallery, you'd always have to download the scenario first. So while this sounds cool in principle, in practice you forfeit the distribution platform (the gallery) as well as the novice appeal... It should also be noted that you can manipulate the user storage mechanism to provide such multiplayer activity if you want to - it won't be blisteringly fast at all, but will work with the gallery fine. With that in mind, perhaps an alternative project could be to develop a more user friendly API that provides real-time like method calls but uses the userdata mechanism underneath? Just an idea.
bourne bourne

2013/12/19

#
@mjrb4, what do you mean by manipulate the user storage mechanism? Do you mean using UserInfo like I did with my Battleship game, or making something new like the UserInfo class with same stuff underneath that just has a different API - which case wouldn't be different besides friendliness in terms of being aimed at multiplayer?
mjrb4 mjrb4

2013/12/19

#
...or making something new like the UserInfo class with same stuff underneath that just has a different API - which case wouldn't be different besides friendliness in terms of being aimed at multiplayer?
Yes, I meant that (different API, delegates to UserInfo underneath.) And aside for user friendliness in being aimed at multiplayer (if there is such a thing!) you're correct in that nothing would be different from a performance perspective, but the advantage is that it wouldn't require a separate server and would work on the gallery. I'm not touting it as the definitive answer to real-time multiplayer games, more of an interesting exercise rather than anything else.
I would be in support of using a game server, that'd be fun :D Are you going to make another mod for greenfoot to access the server, will it be another addition to GF3D, or will you have tutorials on how to use it? Also, would you support the server (Doubt it), will you have ads to help support it (on the server or somewhere else) or will we all pitch in if we wanted to? (trust issues arise obviously, but it is the internet)
GreenHouse GreenHouse

2013/12/19

#
@lordhershey: i hoped someone in here has a server, or at least something like a minecraft server; or maybe the greenfoot devs are interested in something like this and give it a chance on the greenfoot server... But at the ende, i will do this together with metropy.net. @mrjb4:
mrjb4 wrote...
...most obviously the fact that sandboxed applets can only communicate with the same server they're hosted on. Or in other words, if you set up such a server and provided an API, it would never work on the gallery, you'd always have to download the scenario first.
It think i am able to handle this ;) To what do we bet? :D
mrjb4 again wrote...
It should also be noted that you can manipulate the user storage mechanism to provide such multiplayer activity if you want to...
bourne's game is realy cool; a good demonstration of what userinfo is able too; but sadly this isn't fast enough to handle realtime multiplayer games... @FlyingRabidUnicornPig: According to what mrjb4 said, i use some 'unnormal' things to manage the applets restricitons. Most af the required resources i implemented in GF3D, thats why i will implement this in Greenfoot 3D; together with tutorials;.. this will be as easy as the following:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Open a new connetion to the Multiplayer Server
// passing no parameters will connect to the default GF Multiplayer Server
// this enables the possibility to connect to other / private servers
GreenfootMP gfmp = new GreenfootMP() {
 
    public onRecieve(String msg, String player) {
     
        // recieved message from player or server
    }
     
    public onConnect(List<String> players) {
     
        // sucessfully connected
    }
 
    public onError(String msg) {
     
        // something went wrong
        // or unable to connect
    }
     
    public onPlayerConnect(String player) {
     
        // other player connected
    }
     
    public onPlayerDisconnect(String player) {
     
        // other player disconnected
    }
}
 
// send message to all connected players
gfmp.sendMessage("Hello guys");
 
// if necessary
gfmp.disconnect();
kiarocks kiarocks

2013/12/19

#
I might write something to use UserInfo to multiplayer.
bourne bourne

2014/1/9

#
Check this out: http://www.greenfoot.org/scenarios/10597 Works for onsite user 2-player games (turn-based or similar style)
You need to login to post a reply.