Quantcast
Channel: Photon Unity Networking (PUN) — Photon Engine
Viewing all 8947 articles
Browse latest View live

Photon thousands of scene objects

$
0
0
Hello everyone, I've been making a game similar to "Slither.io" but don't know the best way to generate thousands of scene objects(Pickups, Collectibles, etc). I managed to generate them with the help of PhotonNetwork.InstantiateSceneObject(). But how to Enable/Disable/Change their position randomly in the gameplay and what is the best way of doing this ? Thanks and appreciate. Rohit Bhardwaj

Dynamic scene loading

$
0
0
Hey, is it possible to have multiplayer game which consists of multiple scenes, where player moves from one scene to another without any loading screens through a transition area in the middle. While walking accross the transition area the old area is removed from the memory and new one is loaded during a transition area? I can get this to work in single player, but can this be done in multiplayer using photon in unity?

CreateRoom failes after leaving room

$
0
0
Hello, The first time I connect to PUN 2 everything is okay. But then when I leave a room, and try to connect again, I get this error when creating a room: CreateRoom failed. Client is on MasterServer (must be Master Server for matchmaking)but not ready for operations (State: Joining) Wait for callback: OnJoinedLobby or OnConnectedToMaster. Of course I wait for OnConnectedToMaster. I am googling stuff for the past hour and you are my last hope I guess. Not only that, inside OnConnectedToMaster I double check that the user is Ready, and then I allow the user to create/join a game.
public override void OnConnectedToMaster()
        {
            if(PhotonNetwork.IsConnectedAndReady)
            {
                mainMenu.IsConnecting(false);
            }

            if (isConnecting)
            {
                PhotonNetwork.JoinRandomRoom();
            }
        }
And still, when the user taps on Create Game, I get the mentioned error. Any Ideas? Thank you for your time,

LeaveRoom() and PlayerTTL

$
0
0
if player call LeaveRoom then still room keep player information to rejoin for duration playerTTL set?

Disconnects when streaming video

$
0
0
Hello, we are using Photon to stream a 4K video from an Oculus Go to an Android Phone, the image itself is a heavily compressed Texture2D JPG. So this used to work fine until this month where our customer has reported frequent disconnects, and our application has become rather unusable because of this. I am now wondering if we are streaming too much data, and why it would only be a problem until recently. We would be happy to get a paid account if this helps. I've also been looking into photon bolt, and this example of streaming bytes is exactly what we are doing: https://doc.photonengine.com/en-us/bolt/current/in-depth/streaming-bytes Only we are using PUN, but it seemed to work fine up until now. The tutorial link above also states "Be careful with how much data you stream, as there is a limit to how much you can." So is there any indication on how much data we can stream? Would it be a lot of work to switch from PUN to Bolt?

SupportClass StopBackgroundCalls aborts thread causing ThreadAbortException

$
0
0
I currently get ThreadAbortExceptions and after some investigation it seems to be caused by an unhandled exception in:
public static bool StopBackgroundCalls(byte id)
    {
      if (SupportClass.threadList == null || (int) id > SupportClass.threadList.Count || SupportClass.threadList[(int) id] == null)
        return false;
      SupportClass.threadList[(int) id].Abort();
      return true;
    }
PUN v2.12 Any ideas on this please?

Player's Custom Properties in PUN 2

$
0
0
Hello, I'm trying to access another player's current health value to display on the local player's UI (as well as his own health). After doing some research, it seems like getting and setting players' custom properties would be the right solution for this issue. However, I can't find any documentation for custom properties in PUN 2. Is this still a thing in PUN 2? If not, what would be the best alternate solution? Thanks!

PUN 2, Remote clients position right after joining.

$
0
0
Photonview is set to send "Unreliable On Change" and I also check our byte array for changes before sending. (added code below) I'm using CullArea and CullHandler with almost no modifications. When a player joins a room with remote clients already available, and those remote clients prefab doesn't move or update it's values, the remote clients prefabs position remains in the Instantiated position. I think this happens because that remote client doesn't send anything with OnPhotonSerializeView after player entered. When the player moves or rotates or does anything to send a stream again, it fixes the issue. However I couldn't find a good way of fixing this. Do you think it may be caused by myself checking if byte array is the same in the OnPhotonSerializeView function? Should I make this check elsewhere? if (lastSent == null || byteArry.Length != lastSent.Length || !byteArry.SequenceEqual(lastSent)) { stream.SendNext(byteArry); lastSent = new byte[byteArry.Length]; System.Array.Copy(byteArry, lastSent, byteArry.Length); } Thank you. Mehmet

Questions about Quantum Video Tutorial 3-Data Assets

$
0
0
I have tried Video Tutorial 3 with Quantum-sdk_v1-2-3, but there is no Players field in Frame.RuntimeConfig. I used GetPlayerData () to try it, but it doesn't behave like the video. When I output some logs, I got the following result. 1) ### Starting quantum in local debug mode ### 2) Quantum Asset Database Loaded 3) MySystem.OnInit (Frame) 4) QuantumRunnerLocalDebug.OnGameStart (QuantumGame) Below is my source code.
    public unsafe class MySystem: SystemBase
    {
        public override void OnInit (Frame f)
        {
            for (int i = 0; i  DynamicBody.InitDynamic (Core.DynamicShape.CreateCircle (1), 1);
                c-> Fields.Player = i;
                c-> Fields.CharacterSpec = f.GetPlayerData (i) .CharacterSpec;
            }
        }
        
        :
        :
        :
    }
Assets were not set to f.GetPlayerData (i).CharacterSpec. How can I make it work like the tutorial video using Quantum-sdk_v1-2-3?

Several warnings after upgrade PUN2 from 2.12 to 2.13

$
0
0
Hello, I am new to PUN2, I am doing the basic tutorial. I received today an email with a PUN2 update to 2.13 versión. After Update the package and imported it, it shows the following warnings:
Failed to update assembly 'Assets/Photon/PhotonLibs/Metro/Photon3Unity3D.dll': Assembly reference folder does not exist: 'C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.6\'. UnityEditor.Scripting.APIUpdaterAssemblyHelper:DoesAssemblyRequireUpgrade(String) File 'RapidStrafe_Left' has rig import warnings. See Import Messages in Rig Import Tab for more details. File 'RapidStrafe_Right' has rig import warnings. See Import Messages in Rig Import Tab for more details. File 'JogBackward_NtrlFaceFwd' has rig import warnings. See Import Messages in Rig Import Tab for more details. File 'Jump_Land' has rig import warnings. See Import Messages in Rig Import Tab for more details. File 'Runs' has rig import warnings. See Import Messages in Rig Import Tab for more details. File 'IdlesWave' has rig import warnings. See Import Messages in Rig Import Tab for more details. File 'Jump' has rig import warnings. See Import Messages in Rig Import Tab for more details. File 'Idles' has rig import warnings. See Import Messages in Rig Import Tab for more details. File 'Jump_Start' has rig import warnings. See Import Messages in Rig Import Tab for more details.

Call A Method Before Local Player Disconnected

$
0
0
Hello everyone, I have a method which works pretty well when calling somewhere else or calling by ui buttons. I'm having this issue: I need to call this method just before when local player disconnected. If i use "OnPhotonPlayerDisconnected()" it doesn't work properly because it is calling from remote player, not locally. I also tested "OnLeftRoom()" method but it doesn't even calling. My method here:
    public void ReleaseSlot()
    {
        Slots[slotIndex] = true;
        Hashtable updateScore3 = new Hashtable();
        updateScore3.Add("teamslot" + slotIndex.ToString(), false);
        PhotonNetwork.room.SetCustomProperties(updateScore3, null, false);
        alreadyJoined = false;
    }

Create room and keep searching for rooms

$
0
0
We're implementing skill-based matchmaking using a PUN SQL Lobby. Quite similar to what https://doc.photonengine.com/en-us/realtime/current/lobby-and-matchmaking/matchmaking-and-lobby suggests, we're operating on an increasing skill window. The algorithm is supposed to work like this:
  1. maxDelta = 50
  2. join SQLLobby
  3. PhotonNetwork.GetCustomRoomList(lobby, $"rank BETWEEN {current-maxDelta} AND {current+maxDelta}");
  4. OnRoomListUpdate:
  5. If roomList.Count > 0: select best candidate and join it, done!
  6. else:
    1. create a room ourselves
    2. wait 3 seconds
    3. increase maxDelta by 50
    4. call GetCustomRoomList again until we either find a room, or until someone joins our room.
This requires us to be able to both open (and, preferrably, join) a room, but still keep querying for other rooms in parallel. It seems that PUN isn't designed to deal with this, however. We get: Operation GetGameList (217) not allowed on current server (GameServer) If we try to work around this by first completing the whole search range, and only then creating a room, this would greatly worsen the user experience, so we want to avoid it. While the documentation's last paragraph kind of states that photon matchmaking is not the right choice for "popular games", we decided to use it at the beginning at least to benefit from the tight integration with PUN multiplayer, to save time and get started quickly. Is there any way to circumvent this restriction? Maybe instantiating 2 LoadBalancingClients or something of the sort?

Photon App Creation: App Type> Realtime or PUN?

$
0
0
Hello, I use Playfab as backend, and in Playfab Photon integration tutorial it says create a Photon app, with a type of "Realtime". However every tutorial in Youtube says to create a "PUN" type of Photon app. What is the difference between "PUN" and "Realtime" app types? Which one to choose as a Photon app type: PUN or Realtime for Playfab integration?

Best practice with 100+ players in a room - RPCs on a manager vs. photonView

$
0
0
So I have a PUN game I'm working on that uses locally calculated navMesh agents as the representations of the players. All that needs to be sent is your new navMesh destination via RPC. In this way, we are able to have 100+ players in a room because you send only a single v3 when you find a new destination, and this can only possibly happen once every couple of seconds. The messages per second are about 20-25 with 100+ players. So, setting that technical part of the problem aside for a moment, we are talking internally about moving all communication to a single manager that sends and receives RPCs with IDs for the player meant to receive a navMesh destination, replacing the photonViews that are being used now. My experience with PUN so far has been that photonViews give a lot of functionality for "free" - instantiating your own player representation, destroying it when you disconnect, and in this case, guarantee that your RPC is headed to only your player representation and will not be competing against other traffic to arrive on the same object. So that kind of reveals my question. It's possible that all 100 players could send an RPC over this manager class at the same time, even though it's only once every second or so, it's possible they could line up and there would be 100 RPCs on the same network tick. Are there technical issues with this as far as the RPCs all piling up and some not getting processed?

My Unity Project wont connect to Master Servers

$
0
0
As title says, My Unity project is unable to connect to PUN master servers. This was working perfectly fine literally yesterday and now it wont connect. I dont think I have made any changes to the Networking part of my project so I have a feeling it might be something on photon's side. Anyone with any knowledge as to how to fix this will be greatly appreciated. If you need logs or debugs or something to understand my problem, ask away. Thanks

Syn 2 Player and not Control both at once

$
0
0
I am using the free invector third person controller. Can I use one computer to test 2 players connection? I followed to tutorial on photon...and I am able to instantiate my player(s) but I end up controlling both, or, in the one in the two launched instances. Like in unity editor, i can indirectly control the other player, while the one i started the game with in the editor stand still. Then in the external instance, I can control that.....My Scripts are the invector free thirdperson controller scripts...and the GameManager I got from the tutorial, I also made a playerManager...but the only code in it is for keeping track of the player instance...

How to reset room or remove room

$
0
0
when i try create room but photon return error code: 32766 Photon list room can't exist the name , I sent to created room How to I can't reset or delete, remove the room.

Help! My Project Will Not Connect to Master Server.

$
0
0
As title says, My Unity project is unable to connect to PUN master servers. This was working perfectly fine literally yesterday and now it wont connect. I dont think I have made any changes to the Networking part of my project so I have a feeling it might be something on photon's side. Anyone with any knowledge as to how to fix this will be greatly appreciated. If you need logs or debugs or something to understand my problem, ask away. Thanks

How to synchronize GameObjects in scene on change (not transform or rotate)?

$
0
0
Hey! I'm new to Unity and Photon and I am trying to make selected GameObjects in the scene glow when ever they are clicked on with the mouse. Currently I have the glow effect as a child-GameObject of the objects that I want to glow and when they are hit by Raycast the effect object is enabled and later disabled. This works for each individual player in the game but the glow doesn't synchronize between players. Any idea on how to implement this?

data-in-transit encrypted & supporting evidences in terms of application configuration /URL/document

$
0
0
Kindly let us know the data-in-transit encrypted & documents the example of the Cipher Suite are as below TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384. TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA These cipher suites support backward compatibility. TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 TLS_DHE_RSA_WITH_AES_256_CBC_SHA TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 TLS_DHE_RSA_WITH_AES_128_CBC_SHA TLS_RSA_WITH_AES_256_GCM_SHA384 TLS_RSA_WITH_AES_128_GCM_SHA256 TLS_RSA_WITH_AES_256_CBC_SHA256 TLS_RSA_WITH_AES_128_CBC_SHA256 TLS_RSA_WITH_AES_256_CBC_SHA TLS_RSA_WITH_AES_128_CBC_SHA
Viewing all 8947 articles
Browse latest View live