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

Avoiding unwanted CCUs

$
0
0
Hello,

our team is about to release a build to some testers and friends to get feedback, stress test etc. One thing I realized is that if somebody owns a copy of an old build, they could potentially use up CCUs by playing the old version. In a worst case scenario, someone could distribute said build and cost us money in monthly biils.

Is there any way to prevent said situation from happening? Perhaps by blacklisting game versions, or changing appids just before launch?

This won't be an issue after we release to steam, but if unsolved it prevents us from releasing public test builds in fear of people redistributing en mass and costing us money in the future.

Any solutions or advice are much appreicated.

Thanks,

-Carson

The best way about the network in this game

$
0
0
Hello,

I will try to be very concrete and any help is welcome.
I'm trying to make a similar game of this one :
image

As you can see, the synchronization is very important. My fantasy is that every frame must be the same on each client.

My issue is with the synchronization, following the help on the forum, the movement is very nice synced.
But when I try to instantiate a collider behind player it's not good synced.
( Aswell, when someone have a bad connexion, he is just stuck, and I dont want this. )

I would like to know if I can make this following system =>
the photon server make all the photon player moving forward and the server instantiate the wall behing them.
I'm wondering that because if is that possible I think that all movement & instantiation should be sync.

Can someone tell me if with that system above the synchronization should works nice and if it's the most approriate way ?
Or if there is another way that I can use to send data over Photon ?

Simulating Photon connection failure.

$
0
0
Hi,

Does anyone have tips on how to simulate a photon connection failure? I'm unable to simply pull the ethernet cable, since there are other connections that the application requires to function normally. I'd like to test these two cases:

- Failure to establish initial connection
- Failure of an already established connection

Thank you!

S

Need for RLE compression?

$
0
0
In my game, players sometimes send a pretty large bytes array to each other. Is it useful to RLE-compressed them out? Or will it be redundant due to the fact that the Photon has some kind of its compression mechanism?

Scene objects and network culling

$
0
0
Hi,
in my game players can fight with mobs. Mobs are scene objects that sync positions via PhotonTransformView

I want to use Photon Network Culling script. It works fine with players (I added NetworkCullingHandler on them).
But what should I do with scene objects so culling works correctly with them? (after master changes other player starts to control them).

Thank you

Phantom Room

$
0
0
We have some kind of issue. I set the EU region for my game and after this region's Master Server was down existing rooms were active. My game is online so I need exactly two rooms for my game and no more. Am I right that existing rooms don't close after Master Server stop because every room is a separate server? Seems like we had a phantom room with phantom players who even doesn't know they are in a room to which nobody can connect anymore. I couldn't find that phantom room after Master Server was working again but I 100% sure there was a room because there was one of the developers of our game. They were in a room when nobody could connect to Master Server. Are those players use CCU when they are in a phantom room and is there a way I can close that room if Master Server is down? Thank you.

Switching from Unity Networking to Photon Networking

$
0
0
Hello all. Recently I got project with complain that game is crashing if one of the players decides to quit from the game or if one of the players gets lost internet connection. When I opened project I understood that it made with Unity Networking and there is an asset "Unity Networking Lobby" has been used. So it's a little bit hard for me because game logic uses some components which comes with Lobby Asset. I have done only with Login/Register/Photon Connection/Menu/Awaiting Lobby Panel/ Join Room/ Small count down lobby timer. Further game logic is hard for me to convert because I have never worked with Unity Networking Before and my Photon knowleage is also not perfect. So it will be great if there is anyone who can help me with my project. I can post all codes here or pm. Thanks in advance.

Transform a child object and send it through the server & IK

$
0
0
Good Afternoon. i am now in a multiplayer game project, and i am with a issue. I need to make a child send it's rotation to the server, but that is not working with Photon Transform View, not even with my own script made for this propourse. I have another issue with animation IK, it does not set rotation of bones to the server. How can i do that?
Thanks in advance.

PUN Custom Authentication - Steam?

$
0
0
Hi,

I noticed in the code for LoadBalancingPeer.cs, that there are three CustomAuthenticationTypes : None, Custom, Facebook, and Steam. I was suprised about steam, as I had not seen that documented in the authentication docs.

Is this steam authentication implemented and ready to use? If so, is usage documented anywhere?

Thank you

S

SteamID verification possible with Photon Cloud?

$
0
0
Given you can verify a Steam product purchase with Steam ID, is there anyways to prevent crack version of the game from connecting to Photon Cloud?

Is it possible to stream audio?

$
0
0
Hi all,

I'm working on a multiplayer music-based game that will allow the master client to load their own sound files. Because of this, I can't tell the other clients to start playing these audio clips, so I was wondering if it would be possible to stream the audio from the master client to all other clients? It is also important that all clients hear the same audio, which is why I thought the streaming approach would be the best.

Thanks!

Matchmaking according to the selected category

$
0
0
I am making a game like QuizUp ( a quiz based game ), in which users can play with other online users. I have successfully implemented the creating and joining room using the documentation available.

The problem is that I have multiple categories for quizes like General Knowlege, Games, Sports, History etc. I want to make it work such that when a user selects any of the available categories then a room is created and if any other user from other part of world selects the same category, only then a match between the two is started.

For example, I selected sports category and created a room. Another player say "x" from some other region also selected sports category and only then we can play against each other.

Currently what I have achieved is that even if two users select different categories, still they are connected to a same room and match is started between the two which is obviously not what I am trying to implement.

What I did is to create separate rooms with the name of selected category.
		PhotonNetwork.CreateRoom(categorySelected, new RoomOptions() { MaxPlayers = 2, PlayerTtl = 20000 }, null);
I have searched on google for hours and found some helpful documents but no clear answer was available. I am a newbie in photon so I might be missing something very obvious.

For reference, below is the code I am using to create and join rooms:
using System;
using Photon;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

using ExitGames.Client.Photon;

public class photon_connectscript : PunBehaviour {



    public GameObject connectbutton, loadingbar;
    public Text statetext;

	public InputField InputField;
    public string UserId;

	string categoryselectedKey = "Multiplayer_Category";
	const string NickNamePlayerPrefsKey = "NickName";


	private string categorySelected;

    private const string MainSceneName = "multiplayer_startscene";


	void Start()
	{
        loadingbar.SetActive(false);
		statetext.text = "";
		categorySelected = PlayerPrefs.GetString (categoryselectedKey, "");

		if (PlayerPrefs.HasKey (NickNamePlayerPrefsKey)) {
			InputField.text = PlayerPrefs.GetString (NickNamePlayerPrefsKey);
		} else
			InputField.text = "";
		}

	void Update(){

		if (Input.GetKey (KeyCode.Escape))
			SceneManager.LoadScene ("multiplayer_category_select");
	}


    public void ApplyUserIdAndConnect()
    {
        loadingbar.SetActive(true);
    	statetext.text = "Connecting to Game Servers ...";
    	connectbutton.SetActive(false);
     
        string nickName = "Player";
        if (this.InputField != null && !string.IsNullOrEmpty(this.InputField.text))
        {
            nickName = this.InputField.text;
			PlayerPrefs.SetString(NickNamePlayerPrefsKey,nickName);
        }
        
    
      if (PhotonNetwork.AuthValues == null)
        {
            PhotonNetwork.AuthValues = new AuthenticationValues();
        }
		PhotonNetwork.AuthValues.UserId = nickName;

		Debug.Log("Nickname: " + nickName + " userID: " + this.UserId,this);
		

        PhotonNetwork.playerName = nickName;
        PhotonNetwork.ConnectUsingSettings("0.5");
        
        // this way we can force timeouts by pausing the client (in editor)
        PhotonHandler.StopFallbackSendAckThread();
    }

    public override void OnJoinedLobby()
    {
        OnConnectedToMaster(); // this way, it does not matter if we join a lobby or not
    }

    public override void OnConnectedToMaster()
    {
        // after connect 
        this.UserId = PhotonNetwork.player.UserId;
        PhotonNetwork.JoinRandomRoom();
        }

   

    public override void OnPhotonRandomJoinFailed(object[] codeAndMsg)
    {
		Debug.Log("OnPhotonRandomJoinFailed");

		//Specify room details here.

		// ------------------ IMPORTANT: The room name is string categorySelected so that players get 
		//----------------------matched into respective categories

		PhotonNetwork.CreateRoom(categorySelected, new RoomOptions() { MaxPlayers = 2, PlayerTtl = 20000 }, null);

    }

    public override void OnJoinedRoom()
    {
    	Debug.Log("Joined room: " + PhotonNetwork.room.Name);

		// ------------------ IMPORTANT: The scene names for each category should be named as "multiplayer_mcq_general" or 
		// ------------------- "multiplayer_tf_games" etc.

		SceneManager.LoadScene(categorySelected);

    }

    public override void OnPhotonJoinRoomFailed(object[] codeAndMsg)
    {
		Debug.Log("OnPhotonJoinRoomFailed");
      
    }

    public override void OnConnectionFail(DisconnectCause cause)
    {
        statetext.text = "Cannot connect. Please check internet connection";
        connectbutton.SetActive(true);
    }
	
	public override void OnPhotonPlayerActivityChanged(PhotonPlayer otherPlayer)
	{
		Debug.Log("OnPhotonPlayerActivityChanged() for "+otherPlayer.NickName+" IsInactive: "+otherPlayer.IsInactive);
	}

}

Any kind of help Will be highly appreciated.

Thanks

"Operation response 226 return code 32758" and "not enough buffer space is available" problem

$
0
0
Hello. I am currently working on a sandbox game.
Basically player can create,change color, transform and delete game object(like minecraft) in a multiplayer room.
(i put photon view in each block)
The workflow is this :
1. When player joined the room
2.if the player is master and currently the only person in the room, thus the player will download the room data from the server, using transform, material and gameobject name info. manually obtain viewID, then manually creating the gameobject in the scene
3. if the player is not master and currently not the only person in the room, im sending an info to room properties using
newProperties.Add ("masterscenedata", "NOTYETUPLOADING");
PhotonNetwork.room.SetCustomProperties (newProperties);
The master receive an info that somebody is joining the game, then start saving their current scene and uploading to the server
public override void OnPhotonPlayerActivityChanged(PhotonPlayer otherPlayer) {
if (!otherPlayer.IsInactive) {
			if (PhotonNetwork.player.IsMasterClient) {
				if (editorManager.loadingSaveData == false) {
					StartCoroutine (MasterUploadScene ());
				}
			}

		} 
}
once the master finish uploading the scene data, the master sending an info that the data is on the server and ready to download, by changing the room properties
public void SendingDataToClient()
	{
		ExitGames.Client.Photon.Hashtable newProperties = new ExitGames.Client.Photon.Hashtable ();
		newProperties.Add ("dropdown.value", PhotonNetwork.room.CustomProperties ["dropdown.value"]);
		newProperties.Add ("loadingTrue", true);
		newProperties.Add("masterscenedata", "DONE");
		PhotonNetwork.room.SetCustomProperties (newProperties);
	}
when the new joined member receive the "DONE" sign, it start to download the room data from the server that master just uploaded.


The problem I am currently facing is to sync the data between players are:
1. The master keep getting disconnected into "Peer Created" state (not always) when somebody else joined the room
Cannot send to: 159.8.0.202. Not enough buffer space is available
connection fail becauseDisconnectByClientTimeout
2. When the master just joined the room, it's still "ON PROGRESS" creating the game object (maybe hundreds or thousands), then somebody else joined the room, the master started to upload the scene data eventhough it's still not finished, then the client only got the "ON PROGRESS" scene data.
3. I put the connection manager in the different scene, and use "Don't destroy on load" when it's loading into "Main Scene", after player disconnected and I tried to rejoin, I keep on getting warning
Operation failed: OperationResponse 226: ReturnCode: 32748 (User does not exist in this game). Parameters: {} Server: GameServer

I have been working on this for a while, but I didn't find any helpful clue about this.
What do you think would be the best way to do this type of application?

Thanks a lot.

How can i get other players gameobject from photonviewID?

$
0
0
hello!

I am developing a 2 D running Game!
now i am working on the camera.

if i finished the game, my camera should follow other players!
so i made a array of photonplayers who is not finished and then get a gameobject.transform of one of player's array
, and finally make camera follow to that transform.

but i know how to get photonplayers list. but i can't figure out how to get access to get a transform of that player...

please help me!:(

a player goes into the room which is invisible!

$
0
0
hello!
I am working 2d running game!

I made the connecting to room only using JoinRandomRoom. when game is stated, room max players is changed and visible is changed to 'invisible' to prevent other players come in middle of the game.

I thought it works well, but here is the problem...

In the middle of the game, if one players disconnected and came back to lobby and go to room, JoinRandomRoom function makes a player go into the started room which is the players was in and the game is already middle of the game.

i don't want to interrupt by players in the game which is started. I mean i hope room to close when started.
What should i do in this situation?
the room properties or player properties affects to find a random room? or just photon network remember the info of the room the players was in.

In this situation, if player disconnected middle of the game, then he cannot go to any other room do any other game until the game (he was in) is finished because JoinRandomRoom send the player to that room again.

Please help me~ TT


Synchronize Kinect Animation

$
0
0
Hi! I've been playing around with the PUN Basics Tutorial in order to test it as a replacement for Unity Networking in my project.

The first thing I would like to ask is this: is it possible to synchronize a skeleton which animation is given by a kinect v2 (excluding the option of adding a Photon Transform View to every bone of the skeleton)?
The Photon Animator View does that well for Skeletons with an animator component attached, by synchronizing it's properties, but with kinect I will not have an animator nor properties.

Thanks

Network player cannot join the room

$
0
0
I am developing a network game app using Unity 2017.3.0f3 & Photon PUN. My PhotonServerSettings are Best Region(Hosting), Eveything(Enabled Regions) & Udp.
My phone is Galaxy Note FE (SM-N935L) and the Android version is 7.0. And my app set the Minimum API Level to 4.1.

I can play the game with Galaxy S6 Edge (Android version 7.0). It goes perfectly fine.
However, an user with Galaxy J7 (Android version 6.0.1) phone cannot find the room that I made. The user seems to make new room. I tried it many times, but it keeps making new room, even though a room exists.
I wonder why this happens. Did I miss something or any hardware/software limitations?
Any advice will be so appreciated. Thanks.

PUN is experiencing issues on the lastest beta (2018.1b)

$
0
0
The new Beta has been out for like uhmmm a month... I have been waiting for PUN to come to the newer versions, betas. Still nothing... I would like to not to see this message (or similar ones):

Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs(431,63): error CS0104: `Hashtable' is an ambiguous reference between `System.Collections.Hashtable' and `ExitGames.Client.Photon.Hashtable'

If i try to fix one... Trust me here comes another error...

Unet Lobby, Photon Lobby.

PUN Error In Latest Unity Beta (2017.1.0b3) - Hashtable ambiguous reference

$
0
0
PUN has been working fine for me until I upgraded to the latest beta version of Unity.

Now I get lots of errors similar to the following:
Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs(431,63): error CS0104: `Hashtable' is an ambiguous reference between `System.Collections.Hashtable' and `ExitGames.Client.Photon.Hashtable'

I know I can workaround this by modifying the Photon scripts to specify either to use System.Collections.Hashtable and ExitGames.Client.Photon.Hashtable, but just wanted to pass this information along regarding this problem with the latest unity beta.
Viewing all 8947 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>