Photon Handler Dispatch Incoming Commands HIGH CPU USAGE
Options
I have a serious issue with photon. After running the profiler I can see that Dispatch Incoming Commands is at 90%+ and makes my game unplayable. Why is this happening? Please help me.
I can't play my game with anyone after somebody joins besides me I lag brutally.
I can't play my game with anyone after somebody joins besides me I lag brutally.
0
Comments
-
Hi @aidangig,
How many networked objects (e.g. PhotonViews) do you have in the scene? If you have too much objects, this might have a bad influence in terms of performance. Another thing is about the errors logged to the console. Is the CPU usage the same when fixing the issues. Logging errors to the console is somehow expensive in terms of performance.0 -
I have just the players connected as the photon views in the scene. Nothing else. That is why I am so confused.0
-
Do you have any other advice for me?Christian_Simon said:Hi @aidangig,
How many networked objects (e.g. PhotonViews) do you have in the scene? If you have too much objects, this might have a bad influence in terms of performance. Another thing is about the errors logged to the console. Is the CPU usage the same when fixing the issues. Logging errors to the console is somehow expensive in terms of performance.0 -
What about those errors logged to the console? Have you tried to get rid of them?0
-
Hey Everyone!
Thanks for the support. There is another issue that could be the reason why the Dispatch Incoming Commands is causing so much usage when another player joins.
The findobjectsoftype is called in a particular script. You can find the script in the link I shared. Please open the link and give me some insight.
Here is my question on the Unity answers - https://answers.unity.com/questions/1512637/unity-findobjectsoftype-ruining-my-performance.html
0 -
Never mind. I solved it. It was Photon Network code. I fixed it though in the end.0
-
I have the same problems, is there a solution?0 -
-
Out of my head, I don't know if you can work around this without PUN modification.
If so, it's on this page: "Optimization Tips"
https://doc.photonengine.com/en-us/pun/current/gameplay/optimization1 -
Did you have a look at the optimization page? Using PhotonNetwork.SendMonoMessageTargets should really help. It's also an option to create a MonoBheaviour subtype for the components that should get callbacks (versus all the scripts that should not). Then set PhotonNetwork.SendMonoMessageTargetType.
I think Playmaker support for PUN 2 is coming up.0