Dedicated Master Client vs Photon Server

Options
(Sorry for long looking post, It is actually really short in context)

Hello, I am new in network programming and concepts. However I have worked with PUN before, several times. I am familiar with PUN way of synchronizing things. RPC and Serialization etc.

I want to achieve a full-authoritative and future scalable server architecture that works in dedicated servers and manages room/lobby services for clients.
The server architecture that I am planing is, similar to the games like Rust/ARK/Hurtworld etc. However the game will consist 7v7 matches, (not 100ish like them, 15 max), but will also have mechanics that alters the world. (like building something to world or altering terrain by mining etc). Gameplay would resemble Rust in visuals, but the mechanics would differ. However server architecture should be very similar to those games. Meaning it won't be Peer to Peer.

To start: "I know" that I have to use Photon Server for these type of things. So I can code server side logic right? The authoritative architecture, the persistent world, user&world databases, server management all these should be done in the server side if I am not mistaken. However as i said in the beginning I have only worked with PUN before, and only client-server architecture I know is that: one trusted client (user) hosts the game and others joins to him.

Now. I can learn Photon Server and server side programming. (hell, even started learning it now. It is kinda similar how PUN does it's work. Operations and Events instead of RPC's etc.) However, to create a sustained server architecture, I have to learn and practice it in depth. Meaning: I need profound knowledge to create a commercial product server.

So for the initial prototyping phase of the game, I don't want to focus my workload to learning and creating the Photon Server. Instead I have come up with an idea.

What if I create Unity instances in dedicated servers, that creates(hosts) rooms with PUN (cloud). And other players around the world join to these hosted matches? Dedicated servers would simply be "non-player" master clients that hosts the games and let other players join to games. And also does server stuff by itself.

So, I would create a standalone "server-only" Unity project file, that can manage servers, manage databases, create and sustain persistent worlds. All the features that won't be in user clients, can be in the server(host/master) client's project. And I can manage all these in the dedicated server inself.

So to clarify: A "special" unity project that runs the game simulation, manage world, manage database, manage players, manage everything and run everything, will be the master client. Will host the game. And "client" unity projects will join to this game, and will "send" inputs for authoritative architecture. Server will "accept" these inputs, simulate it and send it back to clients.

To more clarify: Everything that Photon Server should be handling will be handled by PUN and Cloud relay servers, RPC's and Serialize funtions. So I wont hustle my workload with the server programming. Win-Win. Right?

I know, It is probably not the best solution out there. I haven't found any single document/topic about it. So It may be a really stupid idea to begin with.
But I wonder. If I start with this type of architecture, when I get pass the prototype phase, would it be easy to implement Photon Server to server side? Would it be easy and work efficient to follow this approach? Or should I stop whatever I am doing, and start learning Photon server?

Comments

  • Hi @BerkayD,

    running Unity instances on dedicated servers might work, but I think it's not a good idea and it would be more easy using Plugins for Photon Server when you already have experience in using PUN, which you want to use for your game. Additionally it isn't much learning, since most of the work is already done. What you want to add is more like 'standard' coding logic instead of special server coding logic.

    When using Plugins you have predefined hooks where you can insert your custom server code. In your case you are interested in the OnRaiseEvent hook where you can check and validate a custom event sent by a player.