0

So I have been coding a game using Libgdx, and THE very simple and powerful kryonet(SERVER-CLIENT) for multiplayer section . So far I could properly do the multiplayer over LAN and it works great!. I'm Starting to do the Online part of multiplayer section, in which two players will have a match randomly(the opponent would be randomly chosen). OK I have these questions that I think Is so simple and sadly I couldn't find any proper Answers:

  1. I have a web application running on my server that could be like:

    Public class myClass {
    .
    .
    .
    public main(){
    Server server = new Server;
    networkRegisterer.register(server);
    server.bind(port.UDP,port.TCP);
    server.start;
    server.addListener(new ServerListener);
    
    .
    .
    .
    }
    

So my question starts with that: Suppose that I have 500 players playing online(250 matches playing know) I know that I'm not being specific but how do I manage this? should I create one ServerListener per Match(for 2 players)?should I create separate servers for each match? should I have just one server forwarded to one port and somehow manage the matches being played? should I use several ports(and then several servers) in order to control the traffic?

and another important question is that how am I supposed to check the Server performance for issues like data transfer Speed ?? (I mean before publishing the app obviously I cannot test my Server performance since I don't have 500 clients!!!!) . is there any way that I can run a simulation with a lot of clients without having actual clients?

Sorry if my questions look naive, I have done a lot of java experiences but not any Server-Client programming.

Mh_Bash
  • 36
  • 4
  • You don't need multiple servers or listeners. You just need one server and a single listener. Your server will hold all the matches with some id and every time client sends some message, it adds the game id to the message or something of that sort. The server can then locate the game via id and process messages. Performance shouldn't be an issue with 500 clients if you use some threading and the game is turn based. Realtime games get more complicated. (By server I mean your game server with all business logic and games which holds Kryo server in it) – Sneh Dec 09 '16 at 09:51
  • Thanks. my game is kind of not turn based. I its like CounterStrike in which players communicate with each other in every frame of rendering loop(so I used UDP NIO). 500 client is an example. I mean that I could have 10000 thousands. I have done the multiplayer over LAN (WiFi) and its good but I Kinda feel that a server like mine communicating with a lot of users would have some performance issues. what is your Idea about simulating a test? – Mh_Bash Dec 09 '16 at 10:18
  • Its too early to think about that. Once you are able to handle 10 players at least and game works as expected then think about traffic. :) – Sneh Dec 09 '16 at 10:31
  • Many thanks. any books or articles about this issue? never found what I want on net :) – Mh_Bash Dec 09 '16 at 10:47
  • There are no particular books for this. For me I just learnt by looking in a Pokemon MMO. You can google Pokemonium source code. Then by experience you start learning more. – Sneh Dec 09 '16 at 11:36

0 Answers0