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

Received OnSerialization for view ID xxxx We have no such photon view.

$
0
0
I have a racing game where the master client is able to change the scene / track that players are racing on at any time. The players all join a room and then within that room the race manager can choose to load a new scene once racers get bored of the current loaded scene / track.

I'm using automaticallysyncscene = true and the master client loads the new scene by calling PhotonNetwork.LoadLevel

This works fine and you can see the master client switches first and then the clients follow automatically as expected.

After the new scene loads the master client can see all players but players in some cases can't see each other or the master client and I get the warnings about no such photon view existing. I can also see that the clone GOs for the players have not been instantiated.

My understanding was that using automaticallysyncscene and photonnetwork.loadlevel all this serialization stuff would be handled for me but clearly something is going very wrong. I've been searching for a solution but so far nothing found except stuff about turning off the message queue which I thought was automatic in the scenario I've described above?

Another symptom is if the player who can't see others then leaves and rejoins he may then see multiple instances of the same players as if the scene has been changed multiple times it seems to be stacking 'ghost' entities which then reappear as clones with view id's that just float about as there is no seralization for them.

What am I doing wrong to cause this?


hey,I can connect to cloud by tcp but can't by tcp,what's wrong?

$
0
0
I setup PhotonServerSettings,when i choose tcp at Protocol ,it shows timeout.
but when i change to tcp ,it can connect and do well.

Ball sync - ownership

$
0
0
I'm working on a 2d soccer game, and I got the character and ball sync working pretty well.
But I got a problem with the ball, mainly with shooting.

Now when shooting the ball I'm sending an Rpc, which works fine on the host, but results in visible delay on the remote client.
I'm not really sure how to get around this problem yet, my idea was to set the ownership of the ball to the player who is closer to the ball. The ball is currently a scene object.
Is this a feasible solution or are there other/better ways to get around this?

Thanks

Additive Scene Loading

$
0
0
We make use of additive scene loading in our game and are also making use of PhotonViews in the scene. The problem is that photon auto assigns ViewIDs to Scene views. If we load up two scenes additively both scenes will have a PhotonView that has a ViewID of 1 because of how Photon only checks the current scene for the PhotonViewIDs. Our use of additive scene loading is pretty core to our game loop that we use in every game we make. How should I deal with this issue?

Changing the Master Client Issues

$
0
0
Hey,
I am programming on this game right now:
https://www.reddit.com/r/Unity2D/comments/4lxh67/some_gameplay_of_my_hoverball_project_thoughts/

This is how Multiplayer looks at the moment:
https://www.reddit.com/r/Unity2D/comments/4m99xx/photon_networking_object_synchronization/

While trying to implement the multiplayer I have trouble to synchronize the Ball and Boards to let it look smoothly.
I want to change the master client dynamically, but when I call PhotonNetwork.SetMasterClient(...); i get the error message:
"Operation failed: OperationResponse 252: ReturnCode: -2 (CAS update failed: property='248' has value='2'). Parameters: {} Server: GameServer
UnityEngine.Debug:LogError(Object)"

Do you have any idea what is wrong with my code?
Or ideas how to make this kind of game feel good on multiplayer?

How does isMessageQueueRunning work? Does it pause the queue only for the local client?

$
0
0
I suppose i'm a bit confused on how the messageQueue actually works. I did manage to use it to get our game working correctly but it feels like its working half on luck because I don't understand this function well enough.

When pausing the queue are you pausing it on all clients or just on the local client?

Thank you in advance!

Top Down Shooter Rotation Problem

$
0
0
I'm Trying to make a Top Down Shooter Game and make the Player Rotate Towards the Mouse using this Code

if(CAM != null)
{
Ray ray = CAM.ScreenPointToRay(Input.mousePosition);
RaycastHit Hit;
if(Physics.Raycast(ray,out Hit,1000))
{
MouseTarget = Hit.point;
}
Vector3 direction = MouseTarget - transform.position;
direction.y = 0;
this.transform.LookAt(transform.position + direction,Vector3.up);
}


but the Problem is the both Players are rotating from one player Input

and Yes I Disabled the Player Script on the Player Prefab and Enable It when the Player Spawns

GameObject myPlayer = (GameObject)PhotonNetwork.Instantiate(player,spawns[Random.Range(0,spawns.Length)].transform.position,Quaternion.identity,0);
myPlayer.gameObject.GetComponent<Player>().enabled = true;


but It still doesn't work

can you please Help :)

Networking Peer

$
0
0
what does this Function

PhotonNetwork.networkingPeer
.OpRaiseEvent((byte)eventCode, (byte)interestGroup, (Hashtable)customEventContent, (bool)sendReliable)

Regarding web player development

$
0
0
After 2 years developing with unity, I finally have a confidence to learn making a browser multiplayer game. And just found out about Photon. What I want to achieve is, simply, a 2d pvp game with hack n slash mechanism.

But as I never done any multiplayer programming before, I'm going to start small (4-8 players in a room).
It's already my third day learning and I kinda get to know how Multiplayer works.
Sadly when I try to build web player, it won't connect to the server. Standalone and editor is working properly, though.
I read in unity answers, that you need crossdomain.xml, but I host the example project in my github repo (http://johanesnw.github.io/) and don't know if crossdomain is applicable here.

So here are some questions:
- can I host the webplayer in github for development? (more like how can I connect webplayer to photon server)
- is there any limit of players inside a single room? in the end (as in gdd) we need about 10v10 - 20v20 teamfight.
- can I use PUN to achieve this? or should I use photon server?

Thank you.

How to join room by matching room property in lobby ?

$
0
0
Hi to join room
I am doing such like this :
if(roomInfo.playerCount != roomInfo.maxPlayers && roomInfo.customProperties.ContainsValue("black"))
{
PhotonNetwork.JoinRoom(roomInfo.name);
}

How to match room property ? like : Red team player, blue team player Room Joining
Thanks in advance

Photon don't connect to local network but Mobile networks please help

$
0
0
hello every one

I am facing a weird problem

I am using PUN in my game

this is what happening

when I use mobile network connectivity like 3G or 4G its works fine
my game works good

problem starts when I connect to my local W LAN the game does not work

it just shows connecting to name server and nothing further
after sometime it shows error unable to connect to server

I have tested this using photon DEMOS and same result is there

for 3G and 4G it will work fine but as soon as I connect to my wifi it will not respond further and will not gt connect.

kindly help in resolving this issue
thanks

duplicate viewID issue on scene load

$
0
0
Hi,

Just started to use the PUN for my project. Everything looks great! Thanks.
Just 1 thing I can't understand currently. Here is editor runtime error:
PhotonView ID duplicate found: 1. New: View (0)1 on GameManager_Network (scene) old: View (0)1 on NetworkManager (scene). Maybe one wasn't destroyed on scene load?! Check for 'DontDestroyOnLoad'. Destroying old entry, adding new.

How I understand that is because of same ViewID (value = 1) on objects at 2 different scenes. My structure looks like that:
1 scene - containing NetworkManager object with PhotonView component viewID = 1
2 scene - containing GameManager_Networkobject with PhotonView component viewID = 1

I can change view ID in prefab instance in the scene, but if I click Apply, that resets to 1 again.

How can I avoid that?

Difference between "Unreliable on Change" and "Reliable Delta Compressed"

$
0
0
Hello, which is the main striking feature of "Unreliable on Change" and "Reliable Delta compressed"?
And also, can you please explain the sentences which is blue on screen (http://postimg.org/image/h2hfom4hn/).

Force game update

$
0
0
Hi, So far I have not found answer to this question :(

When I start connection I enter game version and all games with that version will connect together, however if I release multiple updates each with new game version that will divide my user base between multiple game copies because they don't update instantly.

Is there a way to check that if you don't have latest game version Photon will not connect at all, or PUN don't give that and I need to sort it on my own ?

Thanks

Operation failed:OperationResponse226: ReturnCode: 32758 (Game doesn't exists-error while Room Join

$
0
0
Hi I am getting below error while joining room :
I am getting
1.Room name 2. Also room is not full 3. Joining from same region i.e Asia. 4. Testing by making .app file in mac.


Operation failed: OperationResponse 226: ReturnCode: 32758 (Game does not exists). Parameters: {} Server: GameServer

Most likely the game became empty during the switch to GameServer.

UnityEngine.Debug:Log(Object)
NetworkingPeer:GameEnteredOnGameServer(OperationResponse) (at Assets/Photon Unity Networking/PhotonNetwork/NetworkingPeer.cs:926)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/PhotonNetwork/NetworkingPeer.cs:1380)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/PhotonNetwork/PhotonHandler.cs:125)

Please help. Thank you.

Weird issue: can't join to an existing room

$
0
0
I am using PUN v1.69 + Photon Cloud (JP region) and get a really weird issue as below:

I have 3 devices (A, B, C) that are being joined to a same room (TestRoom).
They are communicating to each others very well.
The issue comes with the connection lost.
======
Let A the one is loosing connection.
When A disconnected from PhotonServer, B & C are notified with OnPhotonPlayerDisconnected(). This is OK.

After that, A try to reconnect and join to the old room (TestRoom). At this time, A can not join to that room. It get a error code (32758) with message:"Game does not exist".

This is weird because B & C are still in that room and their communication is really good.
=======

I use an iPod 5, an iPhone 6+ and the unity editor to test this.

Do you guys have any suggestion for me on this case???
It took me too much of time :neutral:

Matchmaking Logic

$
0
0
Hi, i'm creating a ccg game but right now I need a little help about the matchmaking logic: I want to create a mm that is skill based and yes i've already read the documentation.

The problem is what to do when a player press the button "SEARCH FOR A MATCH". Assuming i've only one lobby for everyone:

I start searching in the room list then if I find a room with an ELO difference of 300 i join that room. If not i create a new room with a custom field with my ELO (to calculate the diff) but i want to search again in the room list after like 3 seconds increasing the Elo diff to 500, then again and again until i find a room or until someone joins mine.

Is this the right way to do it? Can i search and join a room if i'm already inside another?

Thanks in advance and sorry for my eng.

Default serialization frequency?

$
0
0
Is there a set frequency at which the PUN serialization code is called? Or is it called every update?

OnPhotonSerializeView() doesn't work correctly after reconnect (rejoin)

$
0
0
Hi Friends!
We working on unity3d.
The Game works fine.
All game logic calculates Master Client.
Any Client can be MasterClient, if masterClient was disconnected,
My problem apperars after reconnect to room!
The client, who was reconnected, on he's scene, units (mobs, creeps, soldiers) staying on position where they spawned at first time, it is doesn't matter when they spawned (before or after disconnect).
Then, someone spawn new units, they works fine, OnPhotonSerializeView() works correct.
I checked all params on units, all is ok ( in inspector debug mode too).
MasterClient's OnPhotonSerializeView() works,
but client's OnPhotonSerializeView() not calling.
And units, who stuck on wrong position, some time can resume normal activity. о.о
My code:
public class MobSerializationNetwork : Photon.MonoBehaviour {
void Start() {
m_MobScript = GetComponent<Mob>();
m_Transform = transform;
m_CorrectPlayerPos = m_Transform.position;
m_MobScript.photonView.ObservedComponents.Clear();
m_MobScript.photonView.ObservedComponents.Add(this);
m_MobScript.photonView.synchronization = ViewSynchronization.ReliableDeltaCompressed;
if (m_MobScript.photonView.RpcMonoBehaviours == null) {
RestartSerialization();
} else if (m_MobScript.photonView.RpcMonoBehaviours.Length == 0 ) {
RestartSerialization();
}
}
public void RestartSerialization() {
m_MobScript.photonView.RefreshRpcMonoBehaviourCache();
}
void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info) {
// Debug.Log("i'm working");
if (stream.isWriting) {
stream.SendNext((short)m_MobScript.lookDirection);
stream.SendNext((byte)m_MobScript.animState);
stream.SendNext((Vector2)m_Transform.position);
}
else {
m_MobScript.lookDirection = (short)stream.ReceiveNext();
m_MobScript.animState = (AnimState)((byte)stream.ReceiveNext());
m_CorrectPlayerPos = (Vector2)stream.ReceiveNext();
syncTime = 0f;
syncDelay = Time.time - lastSynchronizationTime;
lastSynchronizationTime = Time.time;
}
}
void Update() {
if (!PhotonNetwork.isMasterClient) {
syncTime += Time.deltaTime;
m_Transform.position = Vector3.Lerp(m_Transform.position, m_CorrectPlayerPos, syncTime / syncDelay);
}
}
}
Units spawns by PhotonNetwork.InstantiateSceneObject(...);
Anyone have some idea about this?
I checked all params on units, all is ok ( in inspector debug mode too).
4 days we can't resolve this problem:neutral:
And sorry for my bad English:blush:

Manipulate Scene Object by several clients simultaneously

$
0
0
Hi, All!
I have a problem when trying to manipulate scene object by several clients simultaneously.
Scene object connected via DistanceJoint2D to each client ( 2 or 3).

All works well on MasterClient, but on other clients everything is bad. Every player's RigidBody has exact settings. Player on MasterClient can't move object and other players, because they are too heavy for him, and it's ok. But other clients can move all the stuff easily, and this is wrong. Besides that visualization on secondary clients looks terrible.

Please explain me what I'm doing wrong, and how I can fix that.
Viewing all 8947 articles
Browse latest View live


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