1 Could you enumerate the difference between PUN2 Free and PUN2+ please ?
"Photon Unity Networking 2 - PLUS Version - includes 100 concurrent user Photon Cloud plan for 60 months"
What does that mean ? and "concurrent" ?
2. If i start my game on PUN2 Free, can i change later for PUN2 + ? the change doesnt will destroy my code ? or its easy to migrate or for very advanced ?
Thank you.
↧
Difference PUN2 Free and PUN2+ ?
↧
Interest group does nothing ?
Hello,
I am a new user of photon PUN in the process of making a position based interest management system for a 2D game, I'm doing this in my code:
byte[] groupArray = InterestGroupManager.GetInterestGroupArray(transform.position);
PhotonNetwork.SetInterestGroups(new byte[0], groupArray);
PhotonNetwork.SetSendingEnabled(new byte[0], groupArray);
photonView.Group = InterestGroupManager.GetMyGroup(transform.position);
With InterestGroupManager being a class that associate cells on the map to a group Id.
But it doesn't work how I understand it would, I still receive both OnPhotonSerializeView and RPCs from object that are not in the same interest group.
Also, I don't understand the reason for photonView.Group, I tried looking at both the documentation and the culling demo for PUN 1 but I still don't understand.
What am I doing wrong? Can only event be use with interest groups ? Thanks for the help !
↧
↧
Lobby or not lobby ? That is the question..
Hello ,
i just read the doc about the lobbies ( https://doc.photonengine.com/en-us/pun/current/lobby-and-matchmaking/matchmaking-and-lobby#lobbies ) , and i dont understand if i would create a lobby manuelly or not and for which situation.
First question : How many rooms can have a lobby ?
Second Question : If a Client01 "CreateRoom" >>> that create a lobby too, and a Client02 "CreateRoom" that will create a lobby too or rejoin the first lobby ?
Third Question : If i want create a game of Smash Bros by exemple, then battle of 4players per room. With a typical menu for join a game battle, same style than plenty multiplayer videogames : list of games battle(rooms) with number of players in and number of players capacity room, and a possibility to Quick Match for join a random room not full and a Rejoin Game for join a room specificly and possibility to filter the Games List with options (map, game mode etc).
Then in this case : what i have to do with my lobby or lobbies interrogation ?
Thank you.
↧
Serializing and deserializing more complex structures
I have this Dungeon full of DungeonRooms. The Dungeon is randomly generated once at the beginning of a game. After it's generated, I want the master client to send the Dungeon data to the other players, but I'm having a hard time wrapping my head around the serialize/deserialize process.
A SerializedRoom in this case is used to save the DungeonRoom to a json file.
What does the workflow for this look like? I've read the serialization documentation and looked at examples but it's not clicking. Serializing and deserializing simple primitive types is one thing, but how do you handle things like strings and arrays using just the one byte array? I'm not at all new to programming but I haven't worked at this level before. Am I seriously overcomplicating things?


↧
Bandwith overage fee question
Hello. My cloud server reached 100% bandwith now are in overage in FREE plan. I want pay extra bandwith fee, but site hasn't option to add billing informations .
"All plans come with a free traffic amount of 3 GB per plan CCU. E.g. 20 plan CCU = 20 * 3 GB = 60 GB. Additional fees apply for each month and region the free amount is exceeded in."
How i can pay extra bandiwth GB?
Note: i am going to buy other plan in some days.
↧
↧
FindFriends returning that player is always online and in a room.
So the returned array showing that Player with id "1" is always online and in room (Which of course not so). And i cant get if the problem is on my side. ID is being set during the Auth. Or i cant use ID's like (1,2,3... etc)?
↧
Getting errors when trying to generate PhotonServerSettings
Hey
I have been trying to migrate to PUN2 but I have been experiencing issues trying to generate the new PhotonServerSettings. Basically I completely removed my PUN1 and installed PUN2 and when I go to the PUN setup and try setup my account with an app ID and .
Undo object may not be null.
UnityEditor.Undo:RecordObject(Object, String)
Photon.Pun.PhotonEditor:UiSetupApp() (at Assets/Imports/Photon/PhotonUnityNetworking/Code/Editor/PhotonEditor.cs:395)
Photon.Pun.PhotonEditor:OnGUI() (at Assets/Imports/Photon/PhotonUnityNetworking/Code/Editor/PhotonEditor.cs:310)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
NullReferenceException: Object reference not set to an instance of an object
Photon.Pun.PhotonEditor.UiSetupApp () (at Assets/Imports/Photon/PhotonUnityNetworking/Code/Editor/PhotonEditor.cs:396)
Photon.Pun.PhotonEditor.OnGUI () (at Assets/Imports/Photon/PhotonUnityNetworking/Code/Editor/PhotonEditor.cs:310)
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at :0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at :0)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:359)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:353)
UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:329)
UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:374)
UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:341)
UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:298)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e, UnityEngine.Matrix4x4 worldTransform, UnityEngine.Rect clippingRect) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:483)
UnityEngine.UIElements.IMGUIContainer.HandleIMGUIEvent (UnityEngine.Event e) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:466)
UnityEngine.UIElements.IMGUIContainer.HandleEvent (UnityEngine.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:447)
UnityEngine.UIElements.MouseCaptureDispatchingStrategy.DispatchEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/Events/MouseCaptureDispatchingStrategy.cs:93)
UnityEngine.UIElements.EventDispatcher.ProcessEvent (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:280)
UnityEngine.UIElements.EventDispatcher.Dispatch (UnityEngine.UIElements.EventBase evt, UnityEngine.UIElements.IPanel panel, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/EventDispatcher.cs:156)
UnityEngine.UIElements.BaseVisualElementPanel.SendEvent (UnityEngine.UIElements.EventBase e, UnityEngine.UIElements.DispatchMode dispatchMode) (at C:/buildslave/unity/build/Modules/UIElements/Panel.cs:190)
UnityEngine.UIElements.UIElementsUtility.DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel panel) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:255)
UnityEngine.UIElements.UIElementsUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/UIElements/UIElementsUtility.cs:78)
UnityEngine.GUIUtility.ProcessEvent (System.Int32 instanceID, System.IntPtr nativeEventPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
I was trying to debug the PUN wizard and found that we the PhotonNetwork.PhotonServerSettings is always null. I was wonder if anyone has experienced this ?
I'm currently using unity 2019.2.0f1 in windows 10
Thanks
↧
The room continues to exist with no players
When a room creator leaves and there are no other players left in the room, the OnRoomListUpdate() method still gets this room info with 0 players and there no other OnRoomListUpdate() calls after that, so the room with no players exists in the room list (on other clients in the lobby) forever.
How to make a room be destroyed when there are no players left in it?
↧
PhotonNetwork.CurrentRoom is null. You don't have to call LeaveRoom() when you're not in one. State:
Hi guys i have those 2 errors when try to create or join room with photon
PhotonNetwork.CurrentRoom is null. You don't have to call LeaveRoom() when you're not in one. State: ConnectedToMaster
Operation LeaveRoom (254) not allowed on current server (MasterServer)
https://ibb.co/FKTbG7n
↧
↧
Maximum Sever Duration
I have a project in the works that requires a low player count server to run continuously for around a week straight.
I can't find any documentation relating to the maximum duration of a PUN server, does anyone know if I will run into any problems with this use case?
↧
Concept of Photon Networking
Hello,
So I have been using Photon for a few months now (and new to game networking) and have been going quite slowly with building my game around it. Today, I may finally have understood how Photon works (or videogame networking?). Can someone please confirm with me if this is correct:
So we have one level, which each client has this same level, and everything is just mirrored between each player's level (movement etc)? There are always "dummy" objects that mirror the player that is not the client's player's level. And this is where RPCs are used to update stuff between other clients so they can mirror what is going on. If this is the concept then I have been looking at it all wrong. I originally thought the other clients player object actually "joins" the players level and is not a mirror image. I feel very dumb with this revelation.
Thanks,
jrDev
↧
Continuing game once internet is disconnected and connected back again
I have implemented photon's Pun Solution for multiplayer in my Unity3d game and it is working fine except when I intentionally turn off my phone's data for few seconds and then turn it back on, the Player game object with PhotonView that I instantiated over the network destroys. Now I want a functionality where I can reconnect my player once internet connection is restored.
I am aware that using
PhotonNetwork.ReconnectAndRejoin()
connects the client to server back to server and then using PhotonNetwork.JoinRoom(LobbyController.RoomName)
I can get connected back to the previous room. But the issue is how am I suppose to handle the player prefabs which were instantiated over the Photon network if I locally instantiate them then PhotonView has 0 as Id. Do I need to instantiate the Prefabs over the network again once internet connection is back? Please correct me if I misunderstood some functionality.
For checking internet I am using recursion, once internet is restored I reconnect and rejoin the room, I cached the room name.
public void CheckIfInternetIsBackOn()
{
if (Application.internetReachability == NetworkReachability.NotReachable)
Invoke("CheckIfInternetIsBackOn", 1);
else
{
print("Reconnecting and rejoining");
PhotonNetwork.ReconnectAndRejoin();
PhotonNetwork.JoinRoom(LobbyController.RoomName);
}
}
↧
Using Lobby as a 'Hub' room
Hello!
My question is if it's possible to have the Lobby act as a sort of Hub-like room. Where players can see each other in the world and interact while looking for a room to play the actual game.
I have read that a client cannot be connected to a Lobby and a Room at the same time so is there a solution for getting this to work?
↧
↧
[Feat Req] Proper Network Encryption (+SSL/TLS?)
We currently have our own system, but it would've been wayy easier and more legible if this was native:
Currently, Photon PUN *does* sort of have an encryption feature -- but it doesn't do much good if the encryption key is sent with the message ;p we actually tried Photon's encryption, at first, until we realized this when we had an attack maybe 6 months ago after analyzing the traffic.
If it was offered, I'd probably swap our system with the native PUN one just for code legibility. And thinking about future projects.
Or, more importantly, how come TLS/SSL does not seem to be enabled so encryption wouldn't be necessary? I'm sure there's a reasonable explanation, but I'm curious what the roadblocker is.
↧
Turn a disconected player into a bot
I'm using PhotonNetwork.InstantiateSceneObject() to create bot and when the master disconnect the bots goes to another master. But how to turn this player into a bot aswell?
↧
RPC - Null Reference Exception
I'm trying to make multiplayer game like Air Hockey and I can shoot the ball with master but I can't shoot the ball with client. I've tried the owner transfer but with this solution ball moves awkward and laggy. I'm just found out the RPC and I'm trying to implement it but It gives Null Reference.
Here is my script:
using System.Collections;
using System.Collections.Generic;
using Photon.Pun;
using UnityEngine;
[RequireComponent(typeof(PhotonView))]
public class ShootControl : MonoBehaviourPun
{
[SerializeField]
private Color effectColor = Color.white;
[SerializeField]
private string targetTag = "Ball";
[SerializeField]
private bool bindCollision = false;
[SerializeField]
private float power = 5f;
[SerializeField]
private float Multiplier { get; set; } = 1;
private Rigidbody2D target;
private PhotonView pv;
void Start()
{
pv = GetComponent();
}
[PunRPC]
public void Shoot(float pushForce)
{
//effectRenderer.color = effectColor;
//Invoke("ResetColor", 0.2f);
if (target != null)
{
target.AddForce(DirectionVector * pushForce * 200);
}
}
private void ResetColor()
{
//effectRenderer.color = Color.black;
}
private Vector2 DirectionVector
{
get
{
Vector3 direction = transform.position - target.gameObject.transform.position;
return -direction.normalized;
}
}
[PunRPC]
private void OnTriggerEnter2D(Collider2D collision)
{
if (!bindCollision && collision.gameObject.CompareTag(targetTag))
{
target = collision.gameObject.GetComponent();
target.GetComponent().RequestOwnership();
target.GetComponent().TransferOwnership(GetComponent().Owner);
}
}
[PunRPC]
private void OnTriggerStay2D(Collider2D collision)
{
if (!bindCollision && collision.gameObject.CompareTag(targetTag))
{
target = collision.gameObject.GetComponent();
}
}
[PunRPC]
private void OnTriggerExit2D(Collider2D collision)
{
if (!bindCollision && collision.gameObject.CompareTag(targetTag))
{
target = null;
}
}
[PunRPC]
private void OnCollisionEnter2D(Collision2D collision)
{
if (bindCollision && collision.gameObject.CompareTag(targetTag))
{
target = collision.gameObject.GetComponent();
}
}
[PunRPC]
private void OnCollisionStay2D(Collision2D collision)
{
if (bindCollision && collision.gameObject.CompareTag(targetTag))
{
target = collision.gameObject.GetComponent();
}
}
[PunRPC]
private void OnCollisionExit2D(Collision2D collision)
{
if (bindCollision && collision.gameObject.CompareTag(targetTag))
{
target = null;
}
}
void Update()
{
if (!pv.IsMine)
{
return;
}
if (Input.GetKeyDown(KeyCode.Space) && Shootable)
{
Vector3 pos = transform.position + transform.forward * 2f;
Vector3 angle = transform.eulerAngles;
pv.RPC("Shoot", RpcTarget.All);
}
}
private bool Shootable
{
get
{
return true;
}
}
}
↧
Can't click arrow (Unity issue, probably not Photon's fault)
Not a Photon issue, especially since it occurs in a Unity Beta version (2019.3.0b), but a Unity issue that the Photon team might be interested to know about (and maybe can lobby Unity to fix, if not already done):
One often cannot click the little arrows anymore as shown, but confusingly needs to click the word. Sometimes, the arrows still work though, correctly expanding the section in question.
This seems to have started happening in the new, flat & modern Unity UI, at least I can't remember it occurring in the past.

↧
↧
Playmaker Action GetPlayerProperties called twice?
Hello,
Throughout my tests I have been having small issues with learning PUN and Playmaker. The latest one isn't much an issue (or maybe it was/will be, and caused some of the headaches I had in the previous threads I created) but I am curious as to why it's happening.
Since I use Playmaker, this might be directed at @jeanfabre,
1. So I currently have Playmaker FSM setup that is on Game Manager object which handles player turns.
2. When the player turn updates, the GameManager then sends an RPC Event "Update Player Turn" to let each player Instance know in their FSMs that the turn has changed.
3. Now in the player FSMs I do a compare Turn Number to make sure it is the actual Player's turn (the Game Manager saves the Turn Number in Room properties) using GetPlayerProperties with the LocalPlayer enum to get the Player's Actor Number.
I was having other issues with Player Properties recently so I had a log that I put in the GetPlayerProperties action that looks like this:
Debug.Log(Time.timeSinceLevelLoad + " user=" + userId.Value + " player=" + _player.UserId + " " + actorNumber.Value + " " + _player.ActorNumber);
I put this extra log after the above to make sure I am not crazy:
Debug.Log("Don't Repeat");
With that setup, here is the weird part; I get the log on the Standalone build that looks like this:
3.952909 user= player="TheID" 2 2
Don't Repeat
3.952909 user="TheID" player="TheID" 0 2
Don't Repeat
The Standalone build is Player 2 since it Joins the created room. See pic of log using SRDebugger asset:
This does not happen in the Editor Play mode, it only logs once. If you notice though, the first log shows user= blank, and the actor number fsm variable as 2, but the second log shows user="TheID" and actor number fsm variable is 0. It looks like it is applying the value to each FSM variable at 2 different times, but if you notice I have the Time.timeSinceLevelLoad logging the same time for each. In the Editor play mode, this is not the case, I get the ID and actor number for Player 1 in the same log for the FSM variables. I have a pic of the FSM too:
The "Check If Current Player" state is where I have the GetPlayerProperties action. It is a puzzling issue and as I said, one that may have caused me issues in the passed when I couldn't retrieve the UserID with the GetPlayerProperties, and then only getting 0 for Actor number in another instance. Any insight into this may help to see if there is a Playmaker issue.
Thanks,
jrDev


↧
Photon destroys player when log level full?
Hi,
I'm making a multiplayer game with funny looking characters that have bubbles spawning off of their heads. To make them visile to all players I put a photon view on them and it creates a lot of logs apearently. Sometimes photon destroys a player game object with the error message: log level full. How do I fix this? I dont want no logs on those bubbles at all. What line specifically do I need to change and to what to make it stop interfering ?
↧
How do I control where my players go, when pulling them to one area?
Hi, my question is ind of hard to express in a single sentence.
I have a 'teleport zone' that lets plays jump to that area. While in that area they need to line up based on the order they jump to that zone.
This is fine when all the players are doing this themselves, but when I try to manually 'pull' all the players to one zone they all get shoved into the first spot. (This is done by an rpc via the server).
I've tried using the room properties to give them each a'default' number for their spot.
I've tried making the master client tell them where to stand.
Any advice?
↧