How about a Unity3D game server for photon

Options
xman
edited February 2012 in Photon Server
We are evaluation the Photon for our network solution. As we want to setup a CS topology and we decide to use Unity3D for our client and service.
In another word, we will firstly implement a game server and client in Unity3D and all the game logic will run on server and then combine the game server with Photon. We are worry about the efficiency of game server if it is developed by Unity3D in c#. And we also wonder if the game server can be porting into c++ successfully. And if it is difficult to integrate the Unity3D game server with photon server.
I know some of the question is about unity , but i want to listen to your advise.

Comments

  • dreamora
    Options
    Unity won't go to C++ and there is no reason to go there as Photon does not support C++ on the server backend either.
    Also, there is nothing that prevents you using unity clients as dedicated server nodes, thats what the LoadBalancing instance (Photon Unity Network on asset store) and the Photon Cloud do too
  • dreamora wrote:
    Unity won't go to C++ and there is no reason to go there as Photon does not support C++ on the server backend either.
    Also, there is nothing that prevents you using unity clients as dedicated server nodes, thats what the LoadBalancing instance (Photon Unity Network on asset store) and the Photon Cloud do too
    I know that BeGone is base on p2p mode, it will face a lot problem on that topology. So we decide to put all game logic on server, so what if we already implement our host in Unity3D which can connect with client to play the game, how can we put the host in Photon as a server?
  • dreamora
    Options
    With photon there is no P2P model, Photon is always inbetween.

    Also I'm pretty sure you didn't understand the idea behind the Unity based server.
    The idea is that you have a dedicated client that runs in YOUR environment (on a server in the same cloud / cluster as the photon instance) and that you fire up and down as you see need for it. These dedicated server nodes (hosting Photon Rooms) then would be listed as open rooms to join.
    The user with the 'real client' can not create new rooms, it can only join existing ones which are created on your backend.

    Unsure if Begone does that or something else, so I can't comment on that. But thats basically what we did on Reign of Steel too, just without Photon as it was not an option back then.

    You can't put a unity client into photon just to mention that. Unity is a standalone technology running in own applications, ALWAYS.
  • Tobias
    Options
    Using a special Unity build of your game for server-side logic is absolutely possible. We helped do that for a MMO-style game, using Photon in-between as "communication layer with extras". Not all actions will affect the world you simulate, so in that case, the Unity "server" and Photon can cooperate to do the work.
    The goal in that case was to get 1000 players into a single Unity "server" instance and even though that needs some tuning, it's possible, depending on the complexity of your game.

    Porting from C# to C++ is not possible without a lot of extra effort. I would suggest also, that you establish the workflows you want to use early on, instead of developing all with Unity as server and then switching to something else. Either approach has different bottlenecks - you don't want to solve both.
  • dreamora wrote:
    With photon there is no P2P model, Photon is always inbetween.

    Also I'm pretty sure you didn't understand the idea behind the Unity based server.
    The idea is that you have a dedicated client that runs in YOUR environment (on a server in the same cloud / cluster as the photon instance) and that you fire up and down as you see need for it. These dedicated server nodes (hosting Photon Rooms) then would be listed as open rooms to join.
    The user with the 'real client' can not create new rooms, it can only join existing ones which are created on your backend.

    Unsure if Begone does that or something else, so I can't comment on that. But thats basically what we did on Reign of Steel too, just without Photon as it was not an option back then.

    You can't put a unity client into photon just to mention that. Unity is a standalone technology running in own applications, ALWAYS.

    ok, i totally understand what you say, So have you ever met the efficiency problem when the dedicated server nodes is developed by Unity in c# or you unload the calculation to client side in your game? is it easy way to remove the rendering or other feature that not necessary in server from Unity3D and optimize it?
  • dreamora
    Options
    With unity pro its a matter of adding -batchmode to the command line call for your dedicated server and neither visuals nor audio will exist any longer.
    If you additionally ensure that the 'server client' has no animation (as they are of no use and cost a lot of performance), you have an extremely efficient beast normally (if you overdo physics it will hit ya but thats a thing that would hold for every technology you use, so no unity specific thing)