playMaker

Author Topic: Photon 1.78 (WebGL support) Question  (Read 16294 times)

ermak

  • Junior Playmaker
  • **
  • Posts: 60
    • AL Games
Photon 1.78 (WebGL support) Question
« 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.
« Last Edit: November 20, 2016, 09:27:01 AM by ermak »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon 1.54 (WebGL support) Question
« Reply #1 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

ermak

  • Junior Playmaker
  • **
  • Posts: 60
    • AL Games
Re: Photon 1.54 (WebGL support) Question
« Reply #2 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.

ermak

  • Junior Playmaker
  • **
  • Posts: 60
    • AL Games
Re: Photon 1.54 (WebGL support) Question
« Reply #3 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

ermak

  • Junior Playmaker
  • **
  • Posts: 60
    • AL Games
Re: Photon 1.54 (WebGL support) Question
« Reply #4 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..

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon 1.54 (WebGL support) Question
« Reply #5 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

ermak

  • Junior Playmaker
  • **
  • Posts: 60
    • AL Games
Re: Photon 1.54 (WebGL support) Question
« Reply #6 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon 1.54 (WebGL support) Question
« Reply #7 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

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon 1.54 (WebGL support) Question
« Reply #8 on: June 16, 2015, 08:13:23 AM »
Hi,

 can you get the latest from the Ecosystem, let me know how ti works out for webgl.

 Bye,

 Jean
« Last Edit: June 16, 2015, 08:24:49 AM by jeanfabre »

ermak

  • Junior Playmaker
  • **
  • Posts: 60
    • AL Games
Re: Photon 1.54 (WebGL support) Question
« Reply #9 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.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Photon 1.54 (WebGL support) Question
« Reply #10 on: June 16, 2015, 02:41:25 PM »
Hi,

 ok, I'll investigate tomorow morning.

Bye,

 Jean

charming_fox

  • Junior Playmaker
  • **
  • Posts: 62
Re: Photon 1.54 (WebGL support) Question
« Reply #11 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

charming_fox

  • Junior Playmaker
  • **
  • Posts: 62
Re: Photon 1.54 (WebGL support) Question
« Reply #12 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?

charming_fox

  • Junior Playmaker
  • **
  • Posts: 62
Re: Photon 1.54 (WebGL support) Question
« Reply #13 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

charming_fox

  • Junior Playmaker
  • **
  • Posts: 62
Re: Photon 1.54 (WebGL support) Question
« Reply #14 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