2
\$\begingroup\$

I am very confused by the PUN implementation of the Photon networking engine. It looks like I don't have to write a separate server so I'm very curious how this works. I have done quite some KryoNet developing and fiddled around with LidGren, these libraries require you to create a server and client.

  • The client sends minimum data to the server.
  • The server verifies this data and runs the gameplay logic from it.
  • The server sends back minimum data so the client can update to the current server state.

Since PUN does not allow me to write my own server how does PUN work? I believe there is a server behind PUN but if it's the clients job of verifying the data this is a vulnerability.

So whats the deal with Photon? Can a competitive game make use of PUN?

\$\endgroup\$
  • 1
    \$\begingroup\$ Seems like it works with P2P connections. Like how many CoD titles are (notice how prone to cheating CoD titles are). So, I suppose you're right, it can be exploited but they do have a thing called Photon Server which gives you the ability to host an authoritative server to make up for that vulnerability. (let me know if you find anything on this). \$\endgroup\$ – John Hamilton Dec 26 '16 at 9:40
  • 1
    \$\begingroup\$ @JohnHamilton Yeah, I was actually fiddling around with Photon Server with a client and server both in C#. You have to install Photon and run the server with it using the binaries. I guess these binaries get uploaded and started on the Photon cloud. They even seem to have a Unity api for this but the link to the documentation does not work. I'm going to try to connect to my separate server from Unity using this API. Otherwise I'm going to try to use the regular client dll. \$\endgroup\$ – Madmenyo Dec 26 '16 at 10:00
  • 1
    \$\begingroup\$ @JohnHamilton Well, it does seem like PUN is not useful for a competitive game. It's an amazing framework to create something like Wordfeud or Hangman to play with your FB friends. But nothing that is even really competitive. I got Photon server working currently and it seems to have potential. But the price is kinda high if you compare it to something like KryoNet or Lidgren and pay to host it. I also dislike the development, on each change I need to build the server, put the binaries in a folder, restart photon and start the server again. Normally you would just run the server from your IDE. \$\endgroup\$ – Madmenyo Dec 27 '16 at 17:42
  • \$\begingroup\$ Seems like you got your answer ;) make it into an answer and pick it when you have the time :) \$\endgroup\$ – John Hamilton Dec 28 '16 at 7:12
  • 1
    \$\begingroup\$ Alright then, I'll turn it into an answer when I have some time for it ^_^ \$\endgroup\$ – John Hamilton Dec 28 '16 at 7:35
1
\$\begingroup\$

Alright, since this question seems like it was answered in the comments, let's turn that into an actual answer shall we?

Photon Unity 3D Networking (PUN) works by connecting people to each other instead of to a server for gameplay implementation. So, in short, it works with P2P networking. The most popular example I can think of is Call of Duty Modern Warfare series that uses this sort of (P2P) networking.

The biggest issue with this implementation is that the server is actually a player and should they cheat, it would be really hard to catch them (a reporting system would be necessary but since they have the server on their machine now, chances are, they could mask their username to something else).

The solution that Photon Engine offers is the Photon Server although this sort of P2P method could be used with other kinds of servers but it would take a bigger effort than using their own server implementation. Time versus money kind of deal.

Quote from the asker because these comments are also relevant to the answer itself:

You have to install Photon and run the server with it using the binaries. I guess these binaries get uploaded and started on the Photon cloud. They even seem to have a Unity api for this but the link to the documentation does not work.

Well, it does seem like PUN is not useful for a competitive game. It's an amazing framework to create something like Wordfeud or Hangman to play with your FB friends. But nothing that is even really competitive. I got Photon server working currently and it seems to have potential. But the price is kinda high if you compare it to something like KryoNet or Lidgren and pay to host it. I also dislike the development, on each change I need to build the server, put the binaries in a folder, restart photon and start the server again. Normally you would just run the server from your IDE.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.