New app - Photon Realtime vs Photon PUN
The whole answer can be found below.
Try Our
Documentation
Please check if you can find an answer in our extensive documentation on PUN.
Join Us
on Discord
Meet and talk to our staff and the entire Photon-Community via Discord.
Read More on
Stack Overflow
Find more information on Stack Overflow (for Circle members only).
New app - Photon Realtime vs Photon PUN
LeonidB
2022-02-08 13:30:25
Hello!
I just created a new app and there was a dropdown list to select a Photon type.
I can choose Photon Realtime or Photon PUN. However, according to https://doc.photonengine.com/en-us/realtime/current/troubleshooting/faq#what_is_the_difference_between_photon_realtime_and_pun_ , "Both products share the same backend, same server applications, same low-level stuff, same core concepts."
Could you clarify what is the point of being able to choose one of them for new apps if they are basically the same? It's pretty confusing, to be honest.
Thank you!
Comments
Kaiserludi
2022-02-08 19:26:22
Hi @LeonidB.
I don't see how this would be confusing and in fact we have introduced PUN appIDs exactly to AVOID confusion, because prior to this people got confused as to why they would have to use a Realtime appID when they were not using Realtime, but PUN.
Now it is really simple and straightforward: Just use the product type for the appID that matches the product that you are using with that appID:
If you use Photon Realtime on the client side, then select Photon Realtime for the appID product type, if you use PUN, then select PUN for the appID product type, if you use Chat, then select Chat, and so on.
That said, technically you could indeed use a Realtime appID for a PUN app and vice versa. Doing so makes sense when you develop PUN and Realtime clients for the same app, which need to interact with each other. If that isn't the case for your project, then just use the product type that matches your client.
Note, that some products actually technically require the correct appID product type to work correctly. i.e Chat clients will only work with Chat appIDs and Quantum clients will only work with Quantum appIDs.
Also note that you need to use a separate appID for each product if you use multiple products in the same app. So if your app uses PUN, Chat and Voice, then you need a PUN, a Chat and a Voice appID for it.
PS:
It's just PUN, not Photon PUN, as the 'P' in PUN already stands for Photon.
Kaiserludi 2022-02-08T19:26:22+00:00
Hi @LeonidB.
I don't see how this would be confusing and in fact we have introduced PUN appIDs exactly to AVOID confusion, because prior to this people got confused as to why they would have to use a Realtime appID when they were not using Realtime, but PUN.
Now it is really simple and straightforward: Just use the product type for the appID that matches the product that you are using with that appID:
If you use Photon Realtime on the client side, then select Photon Realtime for the appID product type, if you use PUN, then select PUN for the appID product type, if you use Chat, then select Chat, and so on.
That said, technically you could indeed use a Realtime appID for a PUN app and vice versa. Doing so makes sense when you develop PUN and Realtime clients for the same app, who need to interact with each other. If that isn't the case for your project, then just use the product type that matches your client.
Note, that some products actually technically require the correct appID product type to work correctly. i.e Chat clients will only work with Chat appIDs and Quantum clients will only work with Quantum appIDs.
Although note that you need to use a separate appID for each product if you use multiple products in the same app. So if your app uses PUN, Chat and Voice, then you need a PUN, a Chat and a Voice appID for it.
PS:
It's just PUN, not Photon PUN, as the 'P' in PUN already stands for Photon.
Thank you for the clarification!
Well, the confusion is my reaction as a user, it can be unexpected sometimes :)
So, Realtime can be used with Unity and other platforms, while PUN is only for Unity, right?
PS: I'm agree, its totally makes sense to use just "PUN", however there is Photon PUN in the list.
Kaiserludi
2022-02-08 20:09:29
"So, Realtime can be used with Unity and other platforms, while PUN is only for Unity, right?"
Yes, but at the point at which you create an appID, you should already know, which product you want to use and downloaded the client for it. Otherwise you have no place to enter the appID on the client side. So the question which one to use comes way before creating an appID.
In the end you can just create an appID for one product now and if you later decide to switch to another product, then just create another appID and use that one instead. It's fine to create multiple appIDs on 20CCU plans and it's also not a problem to have appIDs that you no longer use.
"however there is Photon PUN in the list."
Interesting. I will make the colleagues responsible for this aware of it. Thank you for pointing this out.
Kaiserludi
2022-02-09 19:49:06
Hi @LeonidB.
"So, Realtime can be used with Unity and other platforms, while PUN is only for Unity, right?"
One more thing:
What you can also do is use PUN on Unity and Realtime on other platforms and let them both use the same appID. They can then communicate with each other just fine as long as the PUN clients only use the Realtime subset of PUN when communicating with the Realtime clients. The PUN clients can then still use the PUN-only features to communicate with each other. This is possible, because PUN is a strict super-set of Realtime, that uses Realtime under the hood.
When doing so, be aware that PUN adds its own version to the game version to create the appVersion and you need to manually add the PUN version to the appVersion in the Realtime clients, as the appVersions must match for clients to be able to see each other. More info on this can be found in the docs.
Thanks for the extra clarification. I think now I understand.
It would be great to have some kind of comparison table of these two systems in the docs, with functions as rows and systems (PUN and Realtime) as columns.
Back to top