What application should I choose ?

edited July 2013 in Native
Hi,

I am creating an online game which, in terms of network part, is very close to something like Counter strike or Team Fortress.
I want to create multiple servers, being able to list them, to know for each how many clients are connected, how many slots are available, add some specific datas, etc. : it's a classical online PC game, but I would like to let the player the choice to create their own servers (no cloud).

For now I am very confused and I don't really understant what I should use : I am working with LitePeer and have installed the Photon Socket Server, but now I am lost. I don't know if I should use the LiteLobby or the LoadBalancing application. Is it a good idea to install the service ? Do I need to create the server part by myself ?

Sorry for all these questions, but could someone help me on that ?

Thanks by advance
Chris

Comments

  • Hi Chris.

    Lite and LiteLobby are single server only.

    LoadBalancing provides all that LiteLobby provides, but adds multi server support. You would however have to switch from LitePeer to LoadBalancing::Client on the client side to use the server side LoadBalancing application.

    "create multiple servers, being able to list them, to know for each how many clients are connected, how many slots are available"
    With our LoadBalancing application you just boot additional game server instances and let the rest be handled by Photon: When you tell a client to create a room, it will ask the master server on which game server it should create it and the master will decide depending on the current load of the different game servers (determined by current amount of players, used/unused bandwidth, used/unused cpu power, etc.). When your app asks the client lib to join a room, it will ask the master, where this room is, and then join that game server. That is all done automatically under the hood and you don't have to deal with that kind of stuff yourself, like you would have to with LiteLobby.
    However that does also imply, that its not possible to list the available game servers and let a player decide on his own, which he wants to join. You would therefor have to run multiple master servers and let the player choose between them. Normally you should only be concerned about which room the player wants to join, while it shouldn't really matter, on which game server that room runs, but there is one scenario, where multiple master servers between which the app can choose make sense: If your run those masters (and the game servers that belong to them) on different continents, then you can improve the latency: US palyers can connect to us servers, eu players to eu servers, asian players to asian servers and so on.
    I don't see any reason why your app or the players should care about how many more players a certain game server could handle (aka available slots). You should think of that as an implementation detail of the LoadBalancing app.

    "I would like to let the player the choice to create their own servers"
    For that you would have to use the redistributable package of the Photon server, which you are allowed to deliver to the players of your game. That package isn't available yet, but its only a matter of days as its nearly ready for release. It should get available this or next week.
    You could then let your players choose between connecting to a master server that's run by you or to specify the address of the server, that is run by one of the players.

    Those server that are hosted by players, would still run LoadBalancing for API compatibility. It's not a problem at all to run the LoadBalancing with just the master and a single game server instance that runs on the same computer as the master does.


    About running the server as an application vs installing it as a service: the main difference is, that as a service it will automatically get restarted at reboot of the OS, so a service should be preferred, when the game goes live. For development you could also run it as an app and restart it manually whenever rebooting. The disadvantage of running it as a service is that you have to deinstall the service, before switching to another version of the Photon Server as otherwise even the Photon Control of the new SDK would still start and stop the service of the old one, which can be confusing.
  • Hi Kaiserludi and thank you for your quick answer,

    "I don't see any reason why your app or the players should care about how many more players a certain game server could handle"
    The idea in my game is to have maps with a limited number of players. I'am not creating a MMO, at least for now. The maps will be created to handle sometimes 16, sometimes 64, sometimes 512 players. There will be a limit because of the game map itself. That's why I would like this information to be known by erevyone : a game room can just be full and inaccessible. Do you understand ? Maybe it's a misunderstanding : I am talking about game room, not game server. For a game server, you are right, no one cares about these informations.

    About the differences between LoadBalancing and LiteLobby : are these 2 applications very different ? If I start using LiteLobby and then need to move to LoadBalancing, is it something possible and easy ?

    I have just a few programming questions now. I have created a game using LiteLobby and I can connect several computers to the computer hosting the Photon Windows Service. It works and I can send informations from a computer to another. My problem is : in a game, I will need a computer to be a "game master" which means that this computer will decide / validate some game elements to avoid cheating by letting the clients deciding everything by themselves (which map to load, hits by a player against another, items spawning, player join / quit / ban, etc.). Is there a way for now to define such a "room master" or do I have to define that by myself using the get / set properties ?

    Thanks a lot for your help !
    Chris
  • The LoadBalancing API provides a builtin max players property for each room. You can set it at room creation and also change it later. Changes get automatically synchronized between players inside the room, the gameserver and the lobby on the master.
    Other builtin properties of rooms in LoadBalancing that could be useful are the current player count, the visibility flag (is the room listed in the lobby and used for random matchmaking) and the open/closed status (closed rooms can't get joined, even when the current players are below the allowed max players for that room, so you would set the room to closed when a match starts and no players should be able to enter in the middle of a running match).

    You can also set custom properties for a room or a player. I guess that you are talking about "add some specific datas" to rooms not about adding them to the servers,correct?

    Custom properties are also a feature of LiteLobby, but the mentioned builtin properties are not available with LiteLobby so that you would have to implement logic for that yourself in that case.

    Yes, there are quite a few differences between the APIs of LB and LL. Porting you game from one app to the other of course is possible, but depending on how much network logic your game has it can be quite a bit of work. I would recommend to switch to LB now and not to wait with it until you have already put a lot more work into working with LiteLobby.

    About the "game master": LB has a masterClient-functionality, which chooses a client as game master. However it simply always chooses the client that has been inside the room for the longest time and you can't directly tell it to use a certain client.
    If you want to specify a certain client as game master yourself, then you could set a custom room property holding the playernumber of the game master.

    Regarding authority and cheat prevention it may however be preferable if you implement your anti cheat logic on the server side, by providing a custom application, that inherits from an existing Photon application like LB or LL and adds custom logic for game specific operations. In this custom logic you would then implement simulate the gamelogic an check the data from the clients against that simulation: If client A claims that it has hit client B, then he server can check the positions of both clients inside the serverside representation of the game and see if the hit is correct.
    Basically you would just run the same gamelogic on the server that also runs on the clients, but instead of rendering the current frame you would use that data data as authority for validation (not only against cheating, but also against different results due to latency). Just keep in mind that logic that runs fine when calculated just for 1 player on a client may get really expensive when calculated for hundreds to thousands of players on a gameserver, so you have to performance test and may simplify gamelogic calculations for the serverside checks.
    The advantage should be obvious:
    That way also the game master can't cheat.

    PS:
    For that you would have to use the redistributable package of the Photon server, which you are allowed to deliver to the players of your game. That package isn't available yet, but its only a matter of days as its nearly ready for release. It should get available this or next week.
    I have been wrong about that. Indeed the redist package just went live yesterday!
  • Thank you very much for your very precise answer : I think that I have everything I need to go forward.

    Best regards
    Chris
Sign In or Register to comment.