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

Matchmaking Template

$
0
0
Hi,

does anyone know a good template for PUN to do matchmaking things that are done in almost every game? Steam Integration, Room List, Friends List etc.?

best way to check other player to disconnect?

$
0
0
in many pausing case, client can disconnect by him self, so there is no problem
but if client lost internet connection, he can't send anything to server and PhotonNetwork.CloseConnection( player ) function is not working to this client ( i tested this is only working for online player in room)
PUN cloud server will kick after 10 second automatically. but i want to kick him in 1~2 second

so i used this way
1. every player set their "ping" and "ping set time" in every second ( using player property, set PhotonNetwork.time )
2. every player check how long time passed after another player set their ping ( with "ping set time" )
3. if another player's "ping set time" is longer than 2~3 second than PhotonNetwork.time, then diable his gameobject (used disable because CloseConnection function not working for offline user )
4. in 3 step if he is a masterclient, change masterclient to other

but this way need to using many msg.
( there is 500 msg / s per room! )

so i want to know best way to check player timeout by other!

Instantiated objects in different scene

$
0
0
I am working on a room based multiplayer, and it works perfectly

But I want to add some kind of "Preparation" scene where you can see the other players information, and if you go into the room after the game started you can see the scores and info and then join the game

My problem is that if you join the room, all the data (including location Sync and Photon.Instantiate) is already syncing in the preparation scene.

Any best-practices on how to deal with that?

Thanks!

High ping.

$
0
0
Hi.
I'm connecting to PUN from PK on a 10mb connection with 46ms ping on speedtest.
Doing a ConnectToBestCloudServer connects me to EU where I get about 170ms with PhotonNetwork.GetPing() and 157ms with ping command on windows.
Is this normal? Since PhotonNetwork.GetPing() gives a RTT, should I divide it by 2 to show it to the users?
Thanks.

Photon doesn't connect to MasterServer

$
0
0
I'm currently working on a project in Unity that needs to support multiplayer, and to that end I've imported the free version of Photon. As far as I can tell, everything is set up properly--I've registered the project on the Photon Realtime dashboard, the PhotonServerSettings in Unity has the app ID, host set to Photon Cloud, US, and Auto-join Lobby is enabled. The network controller script is in the scene, and the player prefab has a script that identifies as a network entity. The problem is, whenever I run the program in Unity or as a standalone build, the connection times out while trying to connect to the master server. I get a log output from OnStatusChanged() that reads, "Timeout disconnect current State: ConnectingToMasterserver," and then another that reads "Disconnect current State: disconnecting." After that, the game switches to a PeerCreated session. I'd appreciate any help as to what the problem might be and how to fix it.

Is There any function to check Server Player Count?

$
0
0
i want to check server player count before connect to master server

is there any function or querry to check it?

Updated from 1.65 to 1.80 and broke rematch

$
0
0
Hello,

I just updated my golf game to PUN 1.80 and everything seemed fine. However, when the two players in the game offer a rematch, the new scene loads but OnConnectedtoMaster does not trigger. This connects the hole the players play. From the logs, Photon gets stuck at

OnStatusChanged: Connect current State: ConnectingToNameServer
OnStatusChanged: EncryptionEstablished current State: ConnectingToNameServer

this is the script to handle the rematch logic. It is working correctly as it loads the new scene.
https://www.hastebin.com/ocuqibamim.cpp

This is the script that is definitely active after scene reload but the public virtual void OnConnectedToMaster() does not work.
https://www.hastebin.com/yayetuwiju.cpp

Any and all suggestions would be greatly appreciated!

Matt

When a player disconnects does the ID move back or stay same?

$
0
0
Say there are 5 people in room. the 4th disconnects, does the 5th's ID become 4 or does it say 5 ?

Photon Instantiate buffered ?

$
0
0
Are Photon Instantiate calls buffered ? What we are seeing is Player 1 joins/creates a room. Player 2 joins the room. Player 1 can see Player 2 but Player 2 cannot. It loooks like Player1 gameobject is not being instantiated. We are not using Photon.LoadLevel could that be an issue ? If it is then is there are way to not use Photon's LoadLevel and have player's synced.

Thanks in advance.

Is SetCustomProperties on player only local, only Master or can any remote set your properties?

$
0
0
Can the master set anyone's properties?
And can you set it for the local player without having to RPC the master?

OnSerialize spend Message in room?

$
0
0
there is limitation of room message per second (500 m/s per room)

so i want to reduce it

there is 3 way to sync

1. OnSerialization call back( used by PhotonTransformView )
2. RPC
3. Player Property, Room Property


i know 2,3 is spend message in room,
but i wonder 1 is spend it or not

is it spend or not?

thank you

How to decrease latency?

$
0
0
I have photon multiplayer android game and it's server-side/master client rules because physics.,. and I have real problems with latency... :/ so: ping is 100-130ms and client sends input to server and server sends position updates back to client, does this mean 200 - 260ms latency? and it is lerped so even more? I set send rate to 21 for lower latency but it is still problem :( please help! :)

Problems with ipv6 (Unity 5.5.0f3, PUN 1.80)

$
0
0
I’m sending my app to review and a lot of times, was rejected. I followed the step=by-step instructions in Supporting IPv6 DNS64/NAT64 Networks and works in my mac mini. I tried a lot time send my app explaining this situation and i don’t know reproduced the problems related. My app is using Unity 5.5.0f3, PUN (v1.80) and the protocol used is UDP. Please i need a help, someone had this problem, You know if this version unity support ipv6?

Spawning projectiles and destroying them

$
0
0
So im spawning projectiles by sending the master a RPC to spawn one at my position, by PhotonNetwork.Instantiate.
I heard this is wrong due to many PhotonViews. I dont want to RPC the players to instatiate them client side as its easy to hack and im also relying on OnTriggerEnter (on the master client) to decide if a player collided with a missle.
Also if i use the RPC so everyone instantiates locally how would i delete them all at once?

Is photon a good choice for our game !

$
0
0
hello, we plane to create a multiplayer game for a special event, but maybe deploye later at a larger scale !
The game will be a RA quiz. The player first connect and he will be given to a team, eatch good answer upgrade the team scoring ! it will have 4 or 5 team maximum !
My biggest worry is the players size, it will have 500 participants !

So eatch team will have maybe 50 or more participants. how can i manage connections to the server side, i can't create juste on room with 500 gamers ! i must distributing with more rooms and eatch room must communicate internal score to a global one !

I'm not really a online dev, i usually develop offline game. I think photon will a better choice to futur upgrade !
I give you some slides that precise a little more the gameplay.

https://drive.google.com/file/d/0B7tPUWigHdTGN1FyYWhCZjhrX0U/view?usp=sharing

Thanks you



PUN Basics Tutorial - Error

$
0
0
Hi,

When I play the PUN Basics Tutorial in Unity and quit the game scene (to return to the launcher) I get the following error message:

MissingReferenceException: The object of type 'PlayerManager' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.

I haven't changed anything. I'm surprised to be finding errors in the tutorial provided. Can someone help explain how to fix this?

Cheers,

HK

Feature Request: send RPC to specific Component

$
0
0
Enjoying Photon a lot! I'm mostly using it to send RPCs to the "paired" GameObject on the other clients.

One thing I ran into this morning (and can't find a natural solution to) is the following. Imagine I have two copies of a behavior on a GameObject, like so:

WizardGameObject
- WizardBehavior
- CastFireBallBehavior
- CastHealBehavior (for expensive burst heals)
- CastHealBehavior (for cheap slow heals)

In other words, along with various behaviors, a wizard has two copies of CastHealBehavior with different params. When one of these sends an RPC like "StartHeal", the paired GameObject errors (correctly) that both instances of CastHealBehavior are receiving the RPC on the other side. This is leading to some hack code on my part for now (and errors in the log on each call).

I think that if I could send RPCs between behaviors, not just gameObjects, I'd use it even when I didn't have to. :wink: Then I could have a generic RPC like "fire" and all my behaviors could send/receive it without confusing each other.

[I'm imagining and implementation where the behavior id is sent under the covers along with photon's viewId. The receiver can use this to find the correct behavior.]

Thanks!

Keep empty rooms open on self hosting server?

$
0
0
Hi, I have just started using PUN for a FPS game I'm making and I want to achieve the game to be online with open rooms for players to join. I have read a lot that PUN does not support leaving empty rooms open because of clean up reasons, but what if the host is not Photon but my own server? Can I perhaps leave the rooms open if I host them myself? And if so, how can I achieve that?

Probably dumb question: How is a multiplayer game that trusts clients secure?

$
0
0
I'm coming back to my first multiplayer game development after 7 years, so pardon the history here, but I coming back to the world of multiplayer I'm lost and feel like I'm missing something.

The last multiplayer games I did were a Flash frontend with Smart Fox Server. Smart Fox was an authoritative server, I coded the game code in Java on the server side, and the clients were trusted only to send input and update displays. 7 years ago, if you released a multiplayer flash game without an authoritative server, one that trusted it's clients, the very second you became popular the cheatengine guys would have you game hacked and you're game was shot.

Now I'm making a Unity multiplayer game and all of the primary recommendations (UNET, or Photon PUN here, others) are based on trusted/master clients. I must be missing something, how does this ever work? Do hackers not care anymore, or is there some security layer I'm not understanding?

My inclination is to go right to Photon Server, since it's the authoritative server model I'm familiar with, but I also feel like I'm missing information since so many people are using client based solutions.

Thanks for any help!

How to fix the Masterclient (avoid that it switch automatically)

$
0
0
Hi,

I got a problem with my game. I have a lot of things that be handled by the masterclient. I run one copy of my game as a kind of deticated server. This copy has to be always the masterclient. At the moment the masterclient switches the game makes no sense any more and all other clients should get a message like "Host not responding". But actualy some other clients takes over the master and every thing messed up.
Is there a way to forbid other clients taking over the master?
Viewing all 8947 articles
Browse latest View live


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