[All Platforms] Need help with start

Options
3HMonkey
edited March 2015 in Native
Hello guys, my name is Roman and I come from Germany and I am a game developer.

I took a look into Photon already and become interested. Well it is very hard to come into the Photon Server Engine for a new Photon beginner also with thee documentation.
Now there came up some questions for me.
Our team is using Unreal Engine 4 and we are using the build in network solution for our FPS game as well.To prevent writing a complete TCP/UDP Socket Server we decided to use Photon.

1. The main task is : We are going to setup a player lobby inside UE4. Inside the lobby should be all the connected players. Now there is a "host" button. What this integrated lobby should do , is only to list up all the hosts( people who clicked the host button). Has Photon functions like register players, "join a lobby" and "host a game" ? The only thing it needs to do is send the players with their ips to UE4. So Photon would have nothing to do with the player movement and and and. Just for the lobby. Is there a tutorial or a documentation for a beginner outside ?

2. I followed the Server tutorial on the home page. After clicking "Default" -> "start as application" the server stopps and the log files shows me error code 5. What does this mean ?

Thank you for your time guys

Comments

  • Kaiserludi
    Options
    Hi 3HMonkey.

    Yes, Photon does provide that functionality.
    You would go with Photons LoadBalancing application serverside (not with default!) and use the LoadBalancing-cpp API on the client side.

    With Photon LoadBalancing there are master servers and game servers.
    The master server hosts a lobby, which lists open game rooms, while the game servers host the actual game rooms.
    When you call connect(), the Client will connect to the master server and when you have not explicitly turned autoJoinLobby off through the according setter, then it will also automatically join the lobby.

    When you call opCreateRoom(), then the client will ask the master server for the address of a game server to host that room on and will then disconnect from the master and reconnect to that game server to create that room there. As long as that room is running (at least one player inside) and it's properties isOpen and isVisible are both set to true, it will be listed in the list of open rooms in the lobby.

    Inside that room on the game server clients would normally interchange the actual ingame data like movement updates with each other by using opRaiseEvent() to send it to the Photon game server. However you would just use that room to let the clients exchange their IPs and after that IP exchange has been done you might just let the clients leave that room again.

    I would recommend that you take a look into demo_loadBalancing inside one of our C++ Client SDKs for some example code.
  • hello Sir, and thank you for your quick reply. Your post is very informativ for me and I can understand how to do that now a bit more. But one of my problems is I don't know where to start... Would I need to edit the server files too or only client side ?
    Also I tried to start the demo load balancing which cannot be run in VS2013 :(
  • Kaiserludi
    Options
    Hi again.

    You don't need to touch anything serverside. Just start the server and there you go (you have to add exceptions for Photon in your firewall configuration, of course).
    3HMonkey wrote:
    Also I tried to start the demo load balancing which cannot be run in VS2013 :(
    What do you mean with "cannot be run"? We have tested it with VS2013 ourselves and it works flawlessly.
  • In fact of the Windows SDK Clientside it is the demo_loadbalancing for example. When I hit compile it comes up with:
    mismatch detected for '_MSC_VER': value '1600' doesn't match value '1800' in NetworkLogic.obj
    
    for example
  • Kaiserludi
    Options
    That looks, like you have opened the VS2010 project with VS 2013 and then ran autoupgrade on it.
    The Windows Client SDK contains project files for VS 2010, VS2012 and VS2013, with the later two containing the according Visual C++ compiler version in their files names (VC11 for VS2012 and VC12 for VS2013).

    Please use the VC12 version of the demo project file when you want to use VS2013, as each version of the project file will link against Photon libs that have been compiled with the according VC version.

    One has to always make sure that all libs are compiled with the same compiler version as the app, as otherwise they won't be compatible. Therefor the SDK ships with libs and project files for multiple VS generations.
  • I followed the Server tutorial on the home page. After clicking "Default" -> "start as application" the server stopps and the log files shows me error code 5. What does this mean ?

    Do you still have that issue? Can you please post the full Photon-Loadbalancing-... log file?
  • Ok that is working so far. I also tried out the .Net SDK. the server is now recognizing the connection of the clients but I am unable to set create a room for example, the same with the "Run testclient" inside server ... here is the masterserverlog, seems like a timeout and so on ?
    2015-03-11 13:17:35,420 [13] DEBUG Photon.LoadBalancing.MasterServer.MasterApplication [(null)] - Received init request from game client on leader node
    2015-03-11 13:17:35,710 [28] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - OnOperationRequest: pid=7, op=230
    2015-03-11 13:17:35,710 [24] DEBUG Photon.LoadBalancing.MasterServer.PlayerCache [(null)] - Player state changed: pid=Player_336, master=True, gid=
    2015-03-11 13:17:35,770 [22] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - OnOperationRequest: pid=7, op=229
    2015-03-11 13:17:35,770 [22] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - Joined lobby: , 0
    2015-03-11 13:17:45,522 [4] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - OnOperationRequest: pid=7, op=227
    2015-03-11 13:17:45,523 [4] DEBUG Photon.LoadBalancing.MasterServer.GameApplication [(null)] - Created game: gameId=Room_3, appId={Default}
    2015-03-11 13:17:45,523 [4] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameState [(null)] - Added peer: gameId=Room_3, userId=Player_336, joiningPeers=1
    2015-03-11 13:17:45,524 [24] DEBUG Photon.LoadBalancing.MasterServer.PlayerCache [(null)] - Player state changed: pid=Player_336, master=True, gid=Room_3
    2015-03-11 13:17:45,582 [18] DEBUG Photon.LoadBalancing.MasterServer.MasterClientPeer [(null)] - Disconnect: pid=7: reason=ClientDisconnect, detail=
    2015-03-11 13:17:45,583 [18] DEBUG Photon.LoadBalancing.MasterServer.GameApplication [(null)] - OnClientDisconnect: peerId=7, appId={Default}
    2015-03-11 13:17:53,034 [32] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameList [(null)] - Checked join timeouts: before=1, after=1
    2015-03-11 13:18:00,544 [23] DEBUG Photon.LoadBalancing.MasterServer.GameApplication [(null)] - Removed game: gameId=Room_3, appId={Default}
    2015-03-11 13:18:00,544 [23] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameList [(null)] - RemoveGameState:id=Room_3, peers=0, max=0, open=True, visible=True, peersJoining=0
    2015-03-11 13:18:00,545 [23] DEBUG Photon.LoadBalancing.MasterServer.Lobby.GameList [(null)] - Checked join timeouts: before=1, after=0
    2015-03-11 13:18:00,544 [4] DEBUG Photon.LoadBalancing.MasterServer.PlayerCache [(null)] - Player removed: pid=Player_336, master=False, gid=
    
    
    
  • Kaiserludi
    Options
    Please make sure, that the game server ips (you can set those through PhotonControl) point to an address that the clients are able to reach. Those may point to the localhost, but should point to the network address of that machine if not only clients that run on the same machine as the server, but also clients from other machines in the same local network should also be able to reach it
  • I did and that makes no difference. Here is a game server log for example, seems strange to me :
    2015-03-11 13:55:26,648 [1] INFO  Photon.LoadBalancing.GameServer.GameApplication [(null)] - OnStopRequested: serverid=38058f9f-eebb-4c63-b3d6-c16dc47808c0
    2015-03-11 13:55:26,652 [1] INFO  Photon.SocketServer.ApplicationBase [(null)] - Application is stopping: AppId=Game1
    2015-03-11 13:55:26,657 [12] INFO  Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - connection to master closed (id=2, reason=ManagedDisconnect, detail=), serverId=38058f9f-eebb-4c63-b3d6-c16dc47808c0
    2015-03-11 13:55:26,671 [1] INFO  Photon.LoadBalancing.GameServer.GameApplication [(null)] - TearDown: serverId=38058f9f-eebb-4c63-b3d6-c16dc47808c0
    2015-03-11 13:55:26,671 [1] INFO  Photon.SocketServer.ApplicationBase [(null)] - Application stop: AppId=Game1
    2015-03-11 13:56:36,536 [1] INFO  Photon.LoadBalancing.GameServer.GameApplication [(null)] - Setup: serverId=3af0ffb7-5da6-4646-bfb2-40e00eaf123b
    2015-03-11 13:56:36,935 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter Business Logic Queue
    2015-03-11 13:56:36,936 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter ENet Queue
    2015-03-11 13:56:36,936 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter bytes in/sec
    2015-03-11 13:56:36,936 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter bytes out/sec
    2015-03-11 13:56:36,937 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter ENet Threads Processing
    2015-03-11 13:56:36,937 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter ENet Threads Active
    2015-03-11 13:56:36,937 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter Time Spent In Server: In (ms)
    2015-03-11 13:56:36,937 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter Time Spent In Server: Out (ms)
    2015-03-11 13:56:36,938 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter TCP: Disconnected Peers +/sec
    2015-03-11 13:56:36,938 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter TCP: Disconnected Peers (C) +/sec
    2015-03-11 13:56:36,938 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter TCP: Peers
    2015-03-11 13:56:36,939 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter UDP: Disconnected Peers +/sec
    2015-03-11 13:56:36,939 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter UDP: Disconnected Peers (C) +/sec
    2015-03-11 13:56:36,939 [1] WARN  Photon.LoadBalancing.LoadShedding.WorkloadController [(null)] - Did not find counter UDP: Peers
    2015-03-11 13:56:36,952 [1] WARN  Photon.LoadBalancing.LoadShedding.FeedbackControlSystem [(null)] - Could not initialize Feedback Control System from configuration: Invalid configuration file D:\Users\Roman\Downloads\deploy\Workload.config. Using default settings... (Die Datei "D:\Users\Roman\Downloads\deploy\Workload.config" konnte nicht gefunden werden.)
    2015-03-11 13:56:36,968 [1] INFO  Photon.LoadBalancing.GameServer.GameApplication [(null)] - Connecting to master at 127.0.0.1:4520, serverId=3af0ffb7-5da6-4646-bfb2-40e00eaf123b
    2015-03-11 13:56:36,986 [1] INFO  Photon.SocketServer.ApplicationBase [(null)] - Application start: AppId=Game1; AppPath=D:\Users\Roman\Downloads\deploy\LoadBalancing\GameServer1, Type=Photon.LoadBalancing.GameServer.GameApplication 
    2015-03-11 13:56:37,001 [1] INFO  Photon.SocketServer.Diagnostics.CounterPublisher [(null)] - CounterPublisher started on: 255.255.255.255:40001
    2015-03-11 13:56:37,893 [13] INFO  Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - connection to master at 127.0.0.1:4520 established (id=2), serverId=3af0ffb7-5da6-4646-bfb2-40e00eaf123b
    2015-03-11 13:56:37,897 [14] INFO  Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - Registering game server with address 192.168.178.21, TCP 4531, UDP 5056, WebSocket 9091, ServerID 3af0ffb7-5da6-4646-bfb2-40e00eaf123b
    2015-03-11 13:56:38,004 [13] INFO  Photon.LoadBalancing.GameServer.OutgoingMasterServerPeer [(null)] - Successfully registered at master server: serverId=3af0ffb7-5da6-4646-bfb2-40e00eaf123b
    
    
  • The log files are looking fine. The game server registers at the master server, rooms are created on the master. The client than disconnects (which is also expected). So far, so good. Do they connect to the game server afterwards?

    Can you please describe what exactly your issue is?
  • I found the solution for the problem. I had to connect to the public IP and set the game servers to the public ip too. Dont know why it was not working on the local one... no matter now :)

    Ahm is it possible that the players can register and/or login to their accounts before they reach the lobby inside the loadbalancer ?
  • Kaiserludi
    Options
    Photon does not provide persistent user accounts or user name registration. You would have to use something else for that. Clients can use whatever username they choose, as long as it is unique.