Frequently Asked Questions
- Which Photon Product Is The Right One For Me?
- What Is The Difference Between Photon Realtime And PUN?
- What Is The Difference Between LoadBalancing API And Photon Realtime?
- Photon Cloud
- Photon Voice
Which Photon Product Is The Right One For Me?
This is a difficult question to answer as it depends on the game you are making and the specifics of your project. However we can recommend the following:
- Watch this talk by our CTO and founder Chris Wegmann at Unite Europe 2017
- Read the comparison page: "pun vs. bolt"
- Read the comparison page: "photon cloud or photon server?"
Feel free to reach out to us if you still have questions.
What Is The Difference Between Photon Realtime And PUN?
Photon Realtime wraps up all generic features needed for the load balancing of Photon. It is a product as much as a defined workflow to use Name Server, Master Server and Game Servers. Photon Realtime (a.k.a. LoadBalancing) is the basis for many games using Photon.
While Photon Realtime is independent from Unity, PUN adds many comfortable features for Unity and makes Realtime (the lower level) even easier to use.
Both products share the same backend, same server applications, same low-level stuff, same core concepts. At first PUN was meant to be a better UNet (old Unity Networking): preserve a similar API with a more solid backend and rich features. Then it slowly diverged and became the number 1 solution for multiplayer on Unity.
While we do have a Photon Realtime Unity SDK, PUN has more high level out-of-the-box features like:
- Magic Unity callbacks
- Extra Unity components that serialize and sync. networked objects for you: most important one PhotonView
- Offline mode
Read more here.
However, while PUN supports webhooks and persisting room states, it is still not 100% able to restitute networked objects' state in the scene(s) when loading a saved game. Read more here.
What Is The Difference Between LoadBalancing API And Photon Realtime?
LoadBalancing API and Photon Realtime can be two different names for the same thing. The LoadBalancing API or the LoadBalancing Client API is the programming interface available in the client SDKs we provide for the Photon Realtime product.
Is Photon Cloud Down?
You can check Photon Cloud status here or follow @photon_status on twitter to get notified about status updates.
What Is The Default Photon Region?
Clients should be able to connect to Photon Cloud as long as at least one region is available.
So to guarantee this, a default value is configured or is used when the developer does not explicitly set one or choose "Best Region" option.
The default value could vary by client SDK.
In native SDKs, it is the value at index 0 of the region list returned by server in
On Unity and DotNet SDKs, the default region should be "EU".
Is It Possible To Disable Some Regions?
Yes. It works in the other way around by defining a list of allowed regions. Read more about the "dashboard regions filtering".
How To Save Conversations Into Files?
We will answer this question in two parts:
First, incoming voice streams:
Photon Voice streams are uniquely identified using the pair: PlayerId and VoiceId. So given this pair you can guess the origin of the remote voice stream: which player and which recorder. You can subscribe to three events for remote streams:
VoiceConnection.RemoteVoiceAdded(RemoteVoiceLink): a new remote voice stream is created (started transmission) with information received.
RemoteVoiceLink.FloatFrameDecoded(float): an audio frame is received from a specific remote voice stream.
RemoteVoiceLink.RemoteVoiceRemoved: a remote voice stream has ended and is destroyed (stopped transmission).
If you want to capture an entire incoming remote voice stream, you can:
- Create and open file for the stream in
- Write frame of audio data in
- Save and close the file in
Or you can open and close file and update
FloatFrameDecoded accordingly on user input.
Second, outgoing voice streams:
For outgoing audio stream, you can create a custom processor by extending
You can get the locally recorded audio frame in
A component attached to the same GameObject as the
Recorder is needed to intercept
PhotonVoiceCreated Unity message.
Inside that method, insert the custom processor in the local voice processing pipeline using
LocalVoice.AddPreProcessor (before transmission) or
LocalVoice.AddPostProcessor (after transmission).
See "WebRtcAudioDsp.cs" for an example.
How To Use A Custom Audio Source?
If you want the
Recorder to transmit audio produced by your own custom audio source:
First approach: data stream is driven by consumer
AudioClipWrapper is a sample of this approach.
It streams audio clip assigned to
Create a class reading your audio source and implementing
Factoryin editor (or in code).
Create an instance of your class somewhere during app initialization (before creation of
// MyAudioReaderSource is just an example, replace with your own class name and constructor recorder.InputFactory = () => new MyAudioReaderSource();
As long as client is connected to a voice room and
IAudioReader.Read(float buffer)method will be called on your custom audio source instance (e.g.
MyAudioReaderSource). Calls frequency and buffer size are adjusted to meet sampling rate returned by
IAudioReader.SamplingRateproperty of your custom audio source instance (e.g.
Second approach: data stream is driven by producer
ToneAudioPusher in "AudioUtil.cs" is a sample of this approach.
In this case it may be more convenient to implement
Photon.Voice.IAudioPusherinterface instead. e.g.
MyAudioPusherSource. You need to implement
IAudioPusher.SetCallbackmethod only which mainly stores given callback.
Factoryin editor (or in code).
Create an instance of your class somewhere during app initialization (before creation of PhotonVoiceRecorder):
// MyAudioPusherSource is just an example, replace with your own class name and constructor recorder.InputFactory = () => new MyAudioPusherSource();
During streaming, you simply call the callback set using
IAudioPusher.SetCallbackperiodically (e.g. from
MonoBehaviour.OnAudioFilterRead) with as many samples as you have. Photon Voice will do all buffering work for you.
Do You Have Special Offers For Students, Hobbyists Or Indies?
All our products have a free tier and a one-off entry-plan. We also usually take part in Unity's asset store sales and occasionally give vouchers to lucky ones.
Can I Combine More Than One 100 CCU Plan For A Single Photon Application?
No. The 100 CCU plans are not stackable and can be applied only once per AppId. If you purchase multiple PUN+ asset seats then you must redeem each 100 free CCU for a separate AppId. If you need more CCU for a single app, the next higher plan is the 500 CCU one. If you subscribe to a monthly or yearly plan, then you will still keep the 100 CCUs for 12 months on top of / in addition to the CCU from your monthly/yearly plan.