SuperMultiplayerShooter Template (heavily modded) WebGL not working in editor, but does on web build

Hey,

I'm having a persistent issue with Photon lately, when targetting the WebGL platform.

The issue is.. WebGL build works as supposed, however, whenever I try to run the game in the editor, it runs into issues. Mainly, the behavior is changed completely. Room is not filled with bots anymore, and game results in draw right after start.

I have looked into code, and there is no indication of why it should not work with WebGL target.

If I have target set to Windows, it works correctly in the editor, and build. If I target webgl, only build works as supposed.

I am not sure how this applies to editor in general, but it is confusing, given there are zero errors, or additional debug, or warnings.

It does not affect build in any way, just editor. It does not create any bots other than one, no matter the settings, which indicates the connector is not working correctly, because bots are created over the network (and not locally, really, the are created as a copy on the network, and then spawned.)


Any way to counter this?

Thanks, and.. cheers!

Comments

  • This is nothing typical for PUN, so the cause for this is likely in the project. You could try to build for Standalone instead of WebGL and figure out if that works well with the Editor.

    Also, run the Editor as first client in a room and join said room with Standalone or another Editor (you can copy the project and run another Editor with the copy).

  • Pretty much, yes. The project has quite some space tho.

    Now, the issue is, all platforms (Windows, Linux) works as expected, and they behave as expected in editor, only exception being editor not working with WebGL targets. Not sure what that means exactly.

  • I mean, yeah, I can build the WebGL every time to test things out, but that comes with a two minute build time, and.. sometimes that is more than I can afford. I am not sure what is causing this, because, in theory, the code is behaving as expected, only difference is lobby not being filled with bots whatsoever.

  • And by Editor I mean not client in editor directly, but functionality in editor alone. Normally, you tick in bots, they spawn, you fight.

    In this particular case, they don't spawn, or even attempt to, and that results into immediate draw/skip of game. Which, is confusing, at very least.

  • So, here is the thing, the behavior changes, depending on Photon settings, as follows:

    • Disabling fallback protocol allows me to do a game for one time per instance run.
    • Enabling fallback protocol messes up the match entirely, and results in immediate draw.
    • Even when game is run successfully, no additional bots spawn in (meaning it's 1v1, me and a bot.)


  • Tobias
    Tobias admin
    edited November 2022

    Protocol Fallback is applied, when the Name Server is not reachable with the default protocol.

    If the platform is WebGL, the fallback may be to TCP (which actually makes no sense, as TCP is not an option in the browser).

    Overall, the Fallback should not make a difference, if the initial protocol works. As said: WSS in case of WebGL platform being selected.

    It sounds like a timing issue. The connection may be slower of faster and maybe some script is running on Start() or Awake() and things go wrong, because with WebGL you are not in a room yet. That should log something.

    There should be some kind of warning or error logged to the console. To add to it, enable the SupportLogger. Please check the log or mail it: developer@photonengine.com

    Which Editor version do you run exactly and on which platform?