Client hosted server but using matchmaking ?

Options
Hello,

I am doing a fighting game but it is the first time I am doing a multiplayer game with Unity.
I am looking for the best multiplayer solution, for now I am hesitating between PUN and UNet.

Here is my question :
Since it is a fighting game and only 2 player will play at the same time (maybe some will watch) I want one of those player to host the server locally and the other(s) to connect to it.
I will need to be able to write my own request (no RPC) to be as efficient as possible with little overhead.
I still want to be able to use matchmaking and lobbies.
And finally, I want to be able to gather data on the players and the matches played. (Ranked, points, stats, etc)

Can photon help me do that ? I feel that most solutions out there really want to host everything and doesn't give me enough liberty to do what I want.

rXp

Answers

  • jeanfabre
    Options
    Hi,

    Hosting server on a client is not ideal indeed, which is maybe one you see every solution trying not to encourage this.

    uNet does that yes, so uNet is a turn key solution for what you want to do, you'll still need the matchmaking system, and that's fine, it will have to be hosted online.

    With Photon, you don't have the concept of Server on a client ( unless a player specifically install a server and starts broadcasting to others, but essentially that player will nonethelss need to launch the client app and connect to the that server that happens to be on the same machine).

    I am not sure why you think you need to host the server on one client? using photon cloud is totally ok in your scenario. Maybe you want to make "server" only decisions? that is then called "MasterClient" in Photon. One of the client is elected "Master" and can take decisions and act as if he was the server, with special permissions.

    Maybe you could give a use case of why you want to host the server locally, and then we can better see how Photon can help you achieve it.

    Bye,

    Jean