hello
first time writing here, i have a huge problem i literlly didnt eat or sleep much because i just test and try and test and try all day and night long, now im at a poing where i need profesional help
i made a mobile photon game, and my character moves and everything is ok when i joing the room and play in Windows mode, but as soon as i switch to android the control joystick and touchfield wont work, as you may see im new at photon, i only need this part to help me
i think the player cant access the joystick and touchfield or something, Joystick and touchfield are inside playerUi and i put playerUI in prefab folder and istantiate it together with the camera through a script
here also some photos
https://ibb.co/G7tz6vz
https://ibb.co/bd2MsZz
soo if plss someone can understand the issue pls write, i will even pay soo frustrated i am
↧
mobile controls dont work p
↧
"Invalid Cast" On Deserializing PhotonTransformView last Photon 2.14
I am getting the following error since updating to the last version 2.14
https://forum.unity.com/attachments/upload_2019-8-27_21-13-52-png.474512/
InvalidCastException: Specified cast is not valid
at PhotonTransformView.cs: 93
I tried debugging since it seems it is receiving some strange data from whoever is controlling the object in question, and debugging the stream.ReceiveNext(); that is supposed to set this.m_Direction, I saw a Vector4 instead of a vector3 which is what causes the invalid cast and freaks out about it. I am not sure why this is happening though.
I also changed my transformviews to the tranformviewclassic ones and I get the same error, this time it is localized to the rotation (OnPhotonSerializeView of the m_RotationControl), I get a cast invalid to a quaternion and if I debug it i see that is is because I am getting a Vector3 (0,0,0) from the stream instead of a quaternion. The photonviews are unreliable on change,and it happens only at the beginning of starting the change, in case that helps.
UPDATE: I just regressed to Photon 2.10 to test and it solved the issue ( I couldn't find the 2.12 package which was the one I was using before updating), so it must be something in the new version : /
LAST UPDATE: I found a rogue script that was doing transformView.m_SynchronizePosition = false; for one of the observed components for a couple of frames before reactivating it, this must be the source of all since it fixed the errors. I don't understand very well why it makes the stream of data fail but it is sensible that it could happen. I refactored it to fix it and now everything is good.
↧
↧
JoinRandomRoom() in specific lobby
How can I join random room in specific lobby? How to do this without expected parameters?
↧
Join room in specific lobby
I joining lobby with
TypedLobby lobby = new TypedLobby("*", LobbyType.Default);
PhotonNetwork.JoinLobby(lobby);
and then joining room with PhotonNetwork.JoinRoom(**);
But Photon does not join lobby, is there a way to join room in specific lobby or better way to join lobby?
↧
Gap Between Room.PlayerCount and ActorList.Length
Hi,
We've encountered a bug about a topic similar to one already asked ( https://forum.photonengine.com/discussion/11286/nuance-between-playerlist-length-amp-room-playercount ), but the answer didn't match our experience and we didn't find anything else related.
Brief recap: after a Room creation, we have a PlayerCount of 2 in a room containing only 1 player, and are desperately searching why (thus: what is exactly the origin of PlayerCount)
In details: server-side, whenever we receive a GamePlugin.OnCreateGame (inheritor of BaseVRIPlugin), our GamePlugin makes a AddPlayer call for the one who asked for its creation, with actorID 1.
This works seemingly well, but we noticed a strange gap:
- The player added to the room receives a CreateGame OperationResponse, with an ActorList containing only himself (Length 1), which is fine
- Other players' GameListUpdate event, containing the new room, have its PlayerCount already with a value of 2 (which appears wrong to us)
Our server-side logs don't show any duplicate events, or interference or anything like that.
We have this bug on all our rooms' creations, but it's especially damaging since one of our game mode is a "duel" one, with rooms of 2 players : when the 2nd player tries to join, it systematically receives a GameFull error (32765) because of this.
We are using PUN 2.13 (not the latest one, but we didn't see any changelog related to this issue on more recent versions) and Unity 2018.3.14
Thanks for reading, and thanks in advance for any help or hint!
↧
↧
Identify master client
Hey
Is there any way to identify master client in all other clients?
↧
OnOwnershipRequest is being called on all objects
I'll try to explain the problem. I have a prefab which contains a script and a photon view. This prefab is instantiated with PhotonNetwork.Instantiate, let's say, twice. I've checked and they both have different viewIDs. The problem comes when a player executes photonView.RequestOwnership() (this is inside the prefab's script). This objects receives the OnOwnershipRequest() callback, AND the other object (with different photonview id) too! Why?
↧
Cant find server on second device /(or build) after creating a server in the unity editor
Ran into this problem a while ago and just had to restart my project from scratch . I start my game and photon says connected. Then i build and run the standalone version of the game and search for servers but no matter what i do there is no servers on the server list. . I know that they are the same version of the game so it can't be (different versions of game being excluded form server list.) In the photon dashboard i can see that i have 2 ccu so i am defiantly connected but i just cant find the server I created in the editor. i am using PUN 1 and have messed with the photon server settings hosting options to try "photon cloud", and "best region" last time i had this issue i assumed my problem was in the photon server settings . Has anyone ran into this problem and know the workaround?
↧
NotSocket Error 10038 on MagicLeap
Hello,
I'm developing an application on the MagicLeap platform using Unity 2019.2.
In the application I often get a NotSocket error code 10038 at the first re-connection.
Given the circumstances of our app, we have the following sequence:
We first enter a lobby and then a named room. Here we interact with another user and generate a specific room name for these users. After this both clients leave the room, join the lobby again and from there join the room of the specific name. We receive the onjoinedroom() event.
However after this we receive an exception. Here's the stacktrace:
Any pointer to what could go wrong here?
Thanks in advance,
best regards,
Chris
11-26 11:23:50.553 2224 1 E Unity : Receive issue. State: Connected. Server: '92.38.154.45' ErrorCode: 10038 SocketErrorCode: NotSocket Message: The descriptor is not a socket System.Net.Sockets.SocketException (0x80004005): The descriptor is not a socket
11-26 11:23:50.553 2224 1 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, System.Int32 offset, System.Int32 size, System.Net.Sockets.SocketFlags socketFlags) [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at System.Net.Sockets.Socket.Receive (System.Byte[] buffer) [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at ExitGames.Client.Photon.SocketUdp.ReceiveLoop () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at System.Threading.ContextCallback.Invoke (System.Object state) [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at System.Threading.ThreadHelper.ThreadStart () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at System.Threading.ThreadStart.Invoke () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at UnityEngine.GridLayout.DoNothing () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : at UnityEngine.Playables.PlayableDirector.SendOnPlayableDirectorStop () [0x00000] in <00000000000000000000000000000000>:0
11-26 11:23:50.553 2224 1 E Unity : System.Diagnostics.StackTrace:init_frames(Int32, Boolean)
11-26 11:23:50.553 2224 1 E Unity : System.Diagnostics.StackTrace:.ctor(Int32, Boolean)
11-26 11:23:50.553 2224 1 E Unity : UnityEngine.StackTraceUtility:ExtractStackTrace()
11-26 11:23:50.553 2224 1 E Unity : UnityEngine.GridLayout:DoNothing()
11-26 11:23:50.553 2224 1 E Unity : UnityEngine.DebugLogHandler:Internal_Log(LogType, LogOption, String, Object)
11-26 11:23:50.553 2224 1 E Unity : UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
11-26 11:23:50.553 2224 1 E Unity : UnityEngine.Logger:Log(LogType, Object)
11-26 11:23:50.553 2224 1 E Unity : UnityEngine.Debug:LogError(Object)
11-26 11:23:50.553 2224 1 E Unity : Photon.Realtime.LoadBalancingClient:DebugReturn(DebugLevel, String)
11-26 11:23:50.553 2224 1 E Unity : ExitGames.Client.Photon.<>c__DisplayClass104_0:b__0()
11-26 11:23:50.553 2224 1 E Unity : ExitGames.Client.Photon.MyAction:Invoke()
11-26 11:23:50.553 2224 1 E Unity : ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
11-26 11:23:50.553 2224 1 E Unity : ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
11-26 11:23:50.553 2224 1 E Unity : Photon.Pun.PhotonHandler:Dispatch()
11-26 11:23:50.553 2224 1 E Unity : Photon.Pun.PhotonHandler:FixedUpdate()
11-26 11:23:50.553 2224 1 E Unity : UnityEngine.GridLayout:DoNothing()
11-26 11:23:50.553 2224 1 E Unity : UnityEngine.GridLayout:DoNothing()
↧
↧
Questions regarding PUN implementation approach
Hi,
I'm trying to implement multiplayer in my Unity project using Photon and I need some guidance.
I connect to the Photon server using the defined settings and join a lobby once connected.
PhotonNetwork.ConnectUsingSettings ();
public override void OnConnectedToMaster () {
PhotonNetwork.JoinLobby ();
}
Then, the user is given a choice to either create a public room or a private room.
Before creating a room, the code checks if there is any suitable room the user can join. If not, a new room is created.
//Public room creation
RoomOptions options = new RoomOptions { MaxPlayers = 2, IsVisible = true, PlayerTtl = -1 };
PhotonNetwork.CreateRoom (*SomeRoomName*, options, null);
//Private room creation
RoomOptions options = new RoomOptions { MaxPlayers = 2, IsVisible = false, PlayerTtl = -1 };
PhotonNetwork.JoinOrCreateRoom (*SomeRoomName*, options, null);
Once all players join the room, the game starts.
If a player disconnects midway, he can rejoin if the room is still active.
Once the user reconnects, the other player sends him the game state using a RPC.
Is there any better approach to achieve this?
I also have a few other questions:
1. Sometimes the cached room list returns a count of 0 even when a room is created. Why does this happen?
2. Is there any way I could save data on the Photon servers?
Thanks in advance!
↧
Traffic question
I am working on a system to synchronize the damage of weapons, they need a series of data.
Locally to launch the event I only need two, but this event collects a series of information that is necessary to execute another series of events, and this information is serialized to object type -> sent the rpc (with that information) -> deserialized the data and I run events with that information [so far so good]
These are the data that I currently send, and in a burst of 6 bullets the ping increases to 300 per player, imagine that we have 10 players in the room .... 300x10: |
[I can assume it is from the volume of data I send]
Float damage, IdGUN
String IdLocalPlayer, IdReceiverPlayer,
vector3, lookat hitpoint, direction
public part HitSite <- ENUM
bool: hit, impact
functions for serializate and deserializate
public static object Deserialize (object [] Info)
public static object [] Serializes (WeaponDamageStruct WDS)
This has a high consumption.
My questions:
I can abstract all this information to two variables, 1 type vector3 and another type string for the id of the player that sends. Would it be correct to make this decision? I would send the fire event and it would collect all the information necessary to execute the following functions
On the other hand, I do not use istanciated projectiles to generate the damage, what consumes more, create a projectile or send two variables of type vector3 and string?
Any suggestions to optimize this event that is repeated over and over again during the course of the game?
↧
How to download PUN Rock Paper Scissors demo
Hi,
I imported the PUN demos but there is no rock paper scissors. I need a turn-based demo, how to I get that demo?
↧
Where my GO did create ?
Hello, how can i PhotonNetwork.Instantiate/InstantiateSceneObject() as a child ?
I need to know where the object did create.
Thank you for help.
↧
↧
Syncing Vehicle with multiple passengers
Hi, I'm making a VR project with a moving vehicle that has multiple players/passengers inside of it. So players don't have their own vehicles, they just share this one vehicle. What is the best way to sync the position of the vehicle with the players, considering that the players are children of the vehicle and we can't have any sudden movements or sudden changes in speed for VR players not to get sick.
I have tried syncing the position of the vehicle at the start of the level and also syncing it's speed (OnSerialize) however that doesn't seem to be accurate enough as the vehicle is slightly off it's position on each client. However this method is comfortable for users as the vehicle moves at a smooth and expected rate.
When I tried syncing the position constantly, I found that the vehicle on the non-master clients was not smooth enough to make a comfortable experience, due to network traffic and lerping to the synced position it did not have a consistent speed. But of course the position was close enough to look the same on all clients.
↧
Helppp please, my memory is not cleaned

↧
Custom type Problem with serialization
My problem:
The information that there in the API is very confusing and I can not understand how to create a custom class, in my opinion I am doing well, without any writing error in code, but when I am going to serialize more than 1 data I get an error that apparently I can't solve in any way
My code:
My Log:
void Awake()
{
PhotonPeer.RegisterType(typeof(WeaponDamageStruct), (byte)'S', WeaponDamageStruct.SerializaME, WeaponDamageStruct.DeserializaME);
}
public void ShootIng(WeaponDamageStruct WDS)
{
photonView.RPC("Damage", RpcTarget.All, WeaponDamageStruct.SerializaME(WDS));
}
public static byte[]SerializaME(object wds)
{
var WDS = (WeaponDamageStruct)wds;
byte[] Info = new byte[]
{
byte.Parse(Convert.ToString( WDS.Damage))
,byte.Parse(Convert.ToString( WDS.Jugador))
,byte.Parse(Convert.ToString( WDS.IdGun))
,byte.Parse( Convert.ToString( WDS.LookAt.x))
,byte.Parse( Convert.ToString( WDS.LookAt.y))
,byte.Parse( Convert.ToString( WDS.LookAt.z))
,byte.Parse( Convert.ToString( WDS.HitPoint.x))
,byte.Parse( Convert.ToString( WDS.HitPoint.y))
,byte.Parse( Convert.ToString( WDS.HitPoint.z))
,byte.Parse( Convert.ToString( WDS.Receptor))
,byte.Parse( Convert.ToString( WDS.HitSite))
,byte.Parse( Convert.ToString( WDS.MatType))
};
return Info;
}
FormatException: Input string was not in a correct format.
System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) (at <7d97106330684add86d080ecf65bfe69>:0)
System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <7d97106330684add86d080ecf65bfe69>:0)
System.Byte.Parse (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) (at <7d97106330684add86d080ecf65bfe69>:0)
System.Byte.Parse (System.String s) (at <7d97106330684add86d080ecf65bfe69>:0)
↧
Can 2 player control the same object at the same time
Hi, I am creating a multiplayer games using VR. However, I did not sure on how to make 2 player work on the same object at the same time. For example, player can lift a table together in the scene.
Thank you.
↧
↧
4 bugs wont fix! (please notice it wont fix at all!)
i have 4 bugs wont fix at all, im trying to fix but it never fixes!!
please can someone tell me how to fix it or any solution please?!
the first bug, character animation script doesnt work, only idle animation works.
the second bug player damage, explosiveDamage and boneDamage doesnt work, only ApplyDamage works.
third bug, it also happens with character animation, weapon wont change and weapon sync wont work, i think because of character animation.
fourth bug, smooth movement is not working.
↧
Editor not connecting to player
So i have a Problem: My Editor is not matching up against build's. If I start 2 builded versions, it works fine. As I can see in my Console, The Editor is connecting to the Master without problems. But than, he sais, that there are no Players waiting on opponents and he creates a room, wich also seems to work. But then, when i start a build, and try to connect this, the Build version does not see the Created Room from the Editor and Creates a new one. If I now Restart the Editor, It cant see the room of the Build and creates a new one. If I start 2 Build everything works fine.
Does anyone have an Idea what I could do here?
Thanks a lot!
~BrainyXS
↧
Build created on remote build agent is not finding appId
Hello all!
Im using PUN and when creating a build locally i can connect as well as running in the editor. Both can connect to the same room and all this works.
However, I am building my project on a remote build agent. The build agent fetches the code from source control, and creates a build based out of this.
The build works, except that i can't connect to the Photon servers, with the following error being thrown:
"The appId this client sent is unknown on the server (Cloud). Check settings. If using the Cloud, check account."
I believe this is because the build did not include the appId which is configured in the PhotonServerSettings file.
Anyone has any idea why this might be?
I can see my appId sitting in the PhotonServerSettings file in Source Control, so it is available there, just not picked up on build.
Thanks in advance for any help!
↧