Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: ermak on June 10, 2015, 01:45:48 PM

Title: Photon 1.78 (WebGL support) Question
Post by: ermak on June 10, 2015, 01:45:48 PM
Unity 5.02
Playmaker 1.7.8.3
Photon 1.54 from: https://www.assetstore.unity3d.com/en/#!/content/1786
Photon 1.51 Actions from: https://hutonggames.fogbugz.com/default.asp?W928

Version 1.54 of Photon have "Fixed: WebGL support". This is very important, because all web browsers soon will stop "Unity plugin addon". Google Chrome is first.

In new project after import of "Photon 1.51 Actions" and Photon 1.54 I have this error:

Code: [Select]
Assets/PlayMaker PUN/Editor/PlayMakerPhotonWizard.cs(32,17): error CS0103: The name `dontCheckPunSetup' does not exist in the current context
Assets/PlayMaker PUN/Editor/PlayMakerPhotonWizard.cs(154,33): error CS0103: The name `dontCheckPunSetup' does not exist in the current context
Assets/PlayMaker PUN/Editor/PlayMakerPhotonWizard.cs(171,33): error CS0103: The name `dontCheckPunSetup' does not exist in the current context
Assets/PlayMaker PUN/Editor/PlayMakerPhotonWizard.cs(340,33): error CS0103: The name `Current' does not exist in the current context
Assets/PlayMaker PUN/Editor/PlayMakerPhotonWizard.cs(410,41): error CS0103: The name `Current' does not exist in the current context

Problem can be resolved by deleting: PlayMakerPhotonWizard.cs
But after this menu: PlayMaker -> Addons -> Photon Networking -> Setup wizard... is lost.

Of course this problem can be resolved again by manually editing this file for setup:
Assets/Photon Unity Networking/Resources/PhotonServerSettings.asset

So, my question is - Can anyone confirm 1.51 Actions working on Photon 1.54? And WebGL support is fine or not?

I will continue looking for issues and testing.
For now is just a "Playmaker Photon Wizard" problem.
Title: Re: Photon 1.54 (WebGL support) Question
Post by: jeanfabre on June 10, 2015, 02:39:41 PM
Hi,

Thanks for reporting, I'll make an update before the end of the week.

 Bye,

 Jean
Title: Re: Photon 1.54 (WebGL support) Question
Post by: ermak on June 11, 2015, 12:43:22 PM
Demo scene: DemoWorker.unity from PUNDemoWorker.unitypackage
here: https://hutonggames.fogbugz.com/default.asp?W928
working fine with Photon 1.54 and Photon Actions 1.51

But in my own project I have some troubles.

1. In Online/Offline mode, when hitting action "Photon View RPC Broadcast FSM Event", this error appearing:

Quote
Illegal view ID:0 method: rpc

This happens only on game objects that are not instantiated by Photon (with Photon Network Instantiate Action) and owner is "Scene".

Something like this topic:
http://hutonggames.com/playmakerforum/index.php?topic=8384.0
And quote:
Quote
Thanks Jean, I figured out the problem. It was related to calling photon actions on objects that were not spawned using Photon Instantiate

I check Known Issues here":
http://forum.unity3d.com/threads/photon-unity-networking.101734/#post-667622
Quote
When you use multiple scenes, the viewIDs of PhotonViews in those scenes will always start at 1. Edit the PunSceneSettingsFile in your project to enter a minimum ViewID per scene if needed.
And edit "Min View ID" to 10 in this file PunSceneSettingsFile.asset and problem with "Illegal view ID" dissapear. After this I removed this option from SettingsFile and still no problems with illegal view... very strange. And what exactly resolve this problem? PunSceneSettingsFile or something else...

Anyway, problem 2 is worse.

2. In Online mode, when Player 2 join game of Player 1 this error appearing in Player 1 console:

Quote
The observed monobehaviour of this PhotonView does not implement OnPhotonSerializeView()!

Player 2 don't have this error in his console, but he can't received information from Player 1 with "Photon View Observed Component" on some game objects that are spawned using "Photon Instantiate Action". But game objects with owner "Scene" working fine here. And again it's strange, but Player 1 and Player 2 characters are seeing each other and they spawned by photon instantiate.

Quote from:
http://answers.unity3d.com/questions/927100/photon-synchronization.html

Quote
The observed monobehaviour of this photonview does not implement OnPhotonSerializeView()!

This error means that you have a photonView somewhere that is observing a script, but that script has no OnSerializeView() method. Which makes observing that script a bit pointless, since no data gets sent or recieved in that case.

My observing FSM component is the right I am sure.

I don't know what went wrong with my project. In Photon 1.28.3 and Playmaker actions for 1.28.3 everything was fine.

I don't know if anyone can understand something from my long post, but I will continue looking for solution.
Title: Re: Photon 1.54 (WebGL support) Question
Post by: ermak on June 13, 2015, 11:45:23 AM
I resolved my problem 2...
I had to re-assign "observing FSM component",
maybe I was misled visually from "component icon image"...

But the new problem is - I can't compile WebGL build:

Quote
Assets/PlayMaker PUN/Scripts/PlayMakerPhotonProxy.cs(1004,61): error CS0246: The type or namespace name `ProceduralMaterial' could not be found. Are you missing a using directive or an assembly reference?

By the way Photon released version 1.55
Title: Re: Photon 1.54 (WebGL support) Question
Post by: ermak on June 15, 2015, 12:16:36 PM
ok, I commented these lines with errors:

Quote
Assets/PlayMaker PUN/Scripts/PlayMakerPhotonProxy.cs(1004,61): error CS0246: The type or namespace name `ProceduralMaterial' could not be found. Are you missing a using directive or an assembly reference?

Assets/PlayMaker PUN/Scripts/PlayMakerPhotonProxy.cs(1038,54): error CS0246: The type or namespace name `ProceduralMaterial' could not be found. Are you missing a using directive or an assembly reference?

Assets/PlayMaker PUN/Scripts/PlayMakerPhotonProxy.cs(1040,50): error CS0246: The type or namespace name `ProceduralMaterial' could not be found. Are you missing a using directive or an assembly reference?

Now I can export to WebGL.
But I am not sure for what exactly is needed "Procedural Material" maybe is important for something?

Also, my new problem is - My game can't load in browser (Firefox, Chrome, Opera)... progress bar filling 100% and nothing happens...

And some quotes from here:
http://www.rockpapershotgun.com/2015/04/17/google-chrome-browser-update-disables-unity-plugin/

Quote
I tried exporting to WebGL not long ago, one Unity Plugin build that would be like 3 or 5mb ends up being 100mb+ exported in WebGL. Not really great.
-------
Also, the performance is garbage. I thought that it was performing badly on my 3 year old Macbook Air when I built it but it wasn’t much better on my desktop. (it was a super simple project using 2D sprites so not exactly taxing)
-------
Ah yeah, need to chime in on this as well – the “export for WebGL” option in Unity is a bit shit. A bit shit as in we have two computers in the office that refuse to run anything made with Unity’s WebGL exporter. On any browser. Some computers simply don’t like WebGL.

Some projects also can’t run in WebGL because of performance issues on top of this. It’s Javascript – there’s a sharp limit on what you can expect.

Yes you can re-enable NPAPI but it may simply come down to just using Firefox or Safari if you want to check out a web-Unity game.

WebGL is probably the future, but currently, it’s pants. A lot of projects simply won’t work because they’re too ambitious, too hastily coded or just incompatible for some unknown reason.

Testing continues..
Title: Re: Photon 1.54 (WebGL support) Question
Post by: jeanfabre on June 16, 2015, 04:24:24 AM
Hi,

 1.55 will not make it. I have talked to the Photon Team, a new version will come out soon which will better to support than 1.55 so please wait a bit, thanks :) webgl support will be better as well apparently.

webgl is not ready for production, Unity is still treating this as a preview, and so unfortunatly, I don't think it will be reliable not performant until Unity makes few more releases.

 Bye,

 Jean
Title: Re: Photon 1.54 (WebGL support) Question
Post by: ermak on June 16, 2015, 06:02:59 AM
I don't know what to do when all browsers stop Unity plugin (Chrome already did this). At this moment I will stick to "Unity Web Player" as web platform for games. WebGL doesn't seems very reliable. Maybe is good for simple games, but for large projects... I am not sure.

Time will tell.

Please, update this topic and trello card, if you find fix for:
- PlayMakerPhotonWizard.cs
- PlayMakerPhotonProxy.cs (ProceduralMaterial error)

Of course, after new version of Photon (probably 1.56)

Thanks
Title: Re: Photon 1.54 (WebGL support) Question
Post by: jeanfabre on June 16, 2015, 06:51:07 AM
Hi,

 found a workaround for 1.55, will push this afternoon. Will include all the fixes mentioned.

 Unity will have to consolidate WebGL very very fast, because eventually, web plugins will become obsolete everywhere.

Bye,

Jean
Title: Re: Photon 1.54 (WebGL support) Question
Post by: jeanfabre on June 16, 2015, 08:13:23 AM
Hi,

 can you get the latest from the Ecosystem (https://hutonggames.fogbugz.com/default.asp?W1181), let me know how ti works out for webgl.

 Bye,

 Jean
Title: Re: Photon 1.54 (WebGL support) Question
Post by: ermak on June 16, 2015, 12:56:47 PM
Playmaker Photon Actions 1.55

- PhotonWizard working fine
- No other errors (like a ProceduralMaterial)

Yes, I can export WebGL empty scene with 1 plane and 1 cub inside and this loading in browser... but this is shame for testing.

Yes, "Playmaker DemoWorker scene" and "my project" can be exported in WebGL (250/500mb folder - this is insane), but they can't load in web browser. Firefox progress bar filling 100% and nothing happens. Google Chrome sometimes showing:

Quote
"The browser could not allocate enought memory for the WebGL content. If you are developer of this content, try allocating less memory to your WebGL build in the WebGL player settins."

I set "WebGL Memory Size" from 256 to 50/500/2000 and again nothing happens...

And one last note. After import of "Photon Actions 1.55" in "New project" I have this error:

Quote
Assets/Photon Unity Networking/Plugins/PhotonNetwork/SocketWebTcp.cs(24,17): error CS0246: The type or namespace name `WebSocket' could not be found. Are you missing a using directive or an assembly reference?

It's strange, maybe I am doing something wrong. This error showing only when platform is switched to "WebGL". In WebPlayer - no problems.

Also in "My current project" after import of "Photon Actions 1.55" this error above - not showing... interesting.
Title: Re: Photon 1.54 (WebGL support) Question
Post by: jeanfabre on June 16, 2015, 02:41:25 PM
Hi,

 ok, I'll investigate tomorow morning.

Bye,

 Jean
Title: Re: Photon 1.54 (WebGL support) Question
Post by: charming_fox on October 04, 2015, 10:14:45 AM
Hi guys,

I wondered if you'd managed to get anywhere with this, along with many others, I'm nervous about the impending doom facing any functional web version of Unity builds due to browsers dropping support. I know this is a Unity thing, but even if it's only half working I'm itching to see the product working with PUN via WebGL to give us all a bit of hope!

Cheers
Title: Re: Photon 1.54 (WebGL support) Question
Post by: charming_fox on October 13, 2015, 11:22:11 AM
Hi there, just tried creating a new project with PUN integrated, latest versions of Unity, Playmaker and PUN and everything works without the need to delete or modify anything... however, upgrading the existing unity project I get into a world of issues and after tinkering around have ended up with:

The type or namespace name `WebSocket' could not be found

.. when trying to build for WebGL.

Any thoughts?
Title: Re: Photon 1.54 (WebGL support) Question
Post by: charming_fox on October 13, 2015, 11:26:52 AM
Actually I have just also updated Photon Unity Networking Free (from the asset store) and now have a host of errors that look like:

Assets/Plugins/ChatApi/ChatChannel.cs(22,18): error CS0101: The namespace `ExitGames.Client.Photon.Chat' already contains a definition for `ChatChannel'

There's on error for each .cs file in the Assets/Plugins/ChatApi folder. Have tried upgrading and and reimporting Playmaker, PUN Free, Playmaker PUN 4 and Playmaker PUN5 (from the ecosystem) in every order imaginable and I can't get the project to play.

I do have backups but really want to see how it works in WebGL
Title: Re: Photon 1.54 (WebGL support) Question
Post by: charming_fox on October 13, 2015, 11:37:22 AM
https://dl.dropboxusercontent.com/u/33600486/webgltest/index.html

This is the demo scene I got working connected to photon.. it automatically creates a room, enters you into it and you can type a string to a photon room custom property, then fetch that property back... all working perfectly, however, as mentioned, upgrading an existing project just results in numerous errors
Title: Re: Photon 1.54 (WebGL support) Question
Post by: jeanfabre on October 14, 2015, 07:04:29 AM
Hi,

 yep, cause upgrading or loading packaging in U5 made in uç creates duplicates of files inside Unity project folder. it's a real pain, and unfortunatly, no solution is available other than cleaning up...

so, make sure that when you upgrade or import packages that you clean them up first, like removing folders entirely, to avoid duplication. import it to see where things get duplicated, delete offending folders and reimport.

!!ALWAYS BACKUP UP FIRST!!

Bye,

 Jean
Title: Re: Photon 1.54 (WebGL support) Question
Post by: charming_fox on October 14, 2015, 10:32:57 AM
Just going to give it a go now, might take a while and will report back the findings!
Title: Re: Photon 1.54 (WebGL support) Question
Post by: charming_fox on October 14, 2015, 10:50:37 AM
Sorry I'm getting nowhere with it, I've tried deleting the Playmaker, .netfabrejean, PlaymakerPUN, Plugins/ChatAPI and Photon Unity Networking folders then updating and reimporting them all multiple times and I always end up with: Assets/Plugins/ChatApi/ChatClient.cs(32,31): error CS0433: The imported type `ExitGames.Client.Photon.IPhotonPeerListener' is defined multiple times

Just so I'm sure, I require: Playmaker, Playmaker PUN and Photon Unity Networking as a bare minimum to export a PUN based build? Can you see any reason that this shouldn't work?
Title: Re: Photon 1.54 (WebGL support) Question
Post by: jeanfabre on October 14, 2015, 11:03:27 AM
Hi,

 I'll run some tests tomorow morning. Maybe the new version of PUN has introduced some depreacted features that needs cleaning.

 Have cleaned up your plugin folder as well? the plugin folder became a real mess with U5 with all assets putting stuff there in a very unorganized way... :) so check this as well.

 Bye,

 Jean
Title: Re: Photon 1.54 (WebGL support) Question
Post by: charming_fox on October 15, 2015, 04:18:58 AM
Hi Jean, I got a little further yesterday by taking out the obvious stuff then searching the folder for any files named 'photon', then deleting the suspicious ones before reimporting everything, I think it's PUN that's particularly messy, either way, the project didn't work properly even though all the errors had gone.

Specifically, the Playmaker PUN proxy wasn't detecting PUN states reliably and the game therefore wouldn't instantiate any prefabs or even show the correct menus. I've gone back to the previous backup with older versions for now.

Thanks for your help

A
Title: Re: Photon 1.54 (WebGL support) Question
Post by: jeanfabre on October 15, 2015, 07:59:04 AM
Hi,

 Doubled checked everything as well as packaging for the latest 1.62f version of PUN and everything si working fine. It's definitly the typical mess with duplicated files when importing package. Not much I can do unfortunatly. Things are going to get better with 5.3 it seems with a better unpacking process apparently.

 Bye,

 Jean
Title: Re: Photon 1.54 (WebGL support) Question
Post by: charming_fox on October 15, 2015, 08:28:10 AM
Thanks Jean, I'll try again with Unity 5.3
Title: Re: Photon 1.54 (WebGL support) Question
Post by: Bqlqzs on October 24, 2015, 04:01:25 AM
Hello
I also try to use webgl after the unity webplayer is useless..

I have my own photon multiplayer game, but it created when the playmaker contained the photon, so it is very old but working fine with other build targets.
(this not work with webgl.. but it is not updated yet.)

For the new test I use the latest
- Unity 5.2.2f1
- Latest playmaker from the assetstore
- pun actions from the ecosystem
- and demo worker for the test also from ecosystem

The webgl still not work for me too, I can make the webgl build but when I try to connect to the photon I got this errors:

Code: [Select]
Operation failed: OperationResponse 230: ReturnCode: 32756 (Cloud Public / Region none is not available.). Parameters: {} Server: NameServer
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1146)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.TPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:125)

Code: [Select]
Authentication failed: 'Cloud Public / Region none is not available.' Code: 32756
UnityEngine.Debug:LogError(Object)
NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1186)
ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
ExitGames.Client.Photon.TPeer:DispatchIncomingCommands()
ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:125)

Interesting, because I have the basic Pun+ from the assetstore and the contained photon demo worker (without playmaker) is working fine in the webgl. So now we need to wait?

This Pun+ photon pack is say, that webgl + photon need webgl pro, but if you have this photon pun+ pack you not need the webgl pro. Actually I use this.
https://www.assetstore.unity3d.com/en/#!/content/12080

I also wait for the solution, because cant find any info about the webgl + photon.
Title: Re: Photon 1.54 (WebGL support) Question
Post by: jeanfabre on November 10, 2015, 09:35:23 AM
Hi.

First of all, Photon servers experienced issues the last few days. I would try again, maybe it's nothing to do with you.

Quote
"Region none is not available."

else, you need to setup photon to use a specific region, other then "Best"

https://hutonggames.fogbugz.com/default.asp?W927


 Bye,

 Jean