[Plugin] Photon Cloud

2 favourites
From the Asset Store
[C2] [C3] support C3 build service | support Banner ads, Interstitial ads, Rewared video ads.
  • kingpirux

    Please answer my questions when you have time.

  • Hey, I have a small question considering preventing/working around delays and hitting bullets etc.

    Currently, my project works as following:

    1. Player 1 shoots on his game version, sending P2 an event with the shoot command.
    2. Player 2 then receives that shoot command and makes Player 1 also shoot on his version.

    The problem currently is, that due to delay or ping issues, it often happens that you hit your enemy on your screen, but it won't hit the enemy on his version.

    Is there any workaround for that that won't break the game-flow too much?

  • hello, this add-on does not provide voice, what should i do so that players can speak during the game?

  • kingpirux

    Please answer my questions when you have time.

    sorry! here is the problem with Worker Mode:

    c8ce3219-71ad-4ae8-b42f-959fa5f72425:176 Uncaught (in promise) TypeError: Cannot read property 'ConnectionProtocol' of undefined

    at new PhotonInstance (c8ce3219-71ad-4ae8-b42f-959fa5f72425:176)

    at Function.New (e5eb945f-1c7f-4398-9091-d672666944d6:9)

    at Instance._CreateSdkInstance (6279c038-61da-4306-8ee6-d813cdb0c977:7)

    at ObjectClass._CreateSingleGlobalInstance (8936e39f-eee4-45f8-9da1-5150836a30c1:12)

    at new ObjectClass (8936e39f-eee4-45f8-9da1-5150836a30c1:7)

    at Function.New (e5eb945f-1c7f-4398-9091-d672666944d6:9)

    at Function.Create (8936e39f-eee4-45f8-9da1-5150836a30c1:7)

    at C3Runtime._LoadDataJson (3d39071a-5453-4fd6-96fc-ef0fea533d9d:28)

    at C3Runtime.Init (3d39071a-5453-4fd6-96fc-ef0fea533d9d:21)

    at async InitRuntime (7b4b556f-2b7b-427f-abe2-4cea28dcc3ae:4)

    this may or may not trigger when the worker mode is used in chrome, for some reason i dont get, firefox doesnt have this problem. But, this is a big problem for android exports.

  • 13spongg13

    The problem currently is, that due to delay or ping issues, it often happens that you hit your enemy on your screen, but it won't hit the enemy on his version.

    Don't run hit detection logic twice. Instead, notify other client if the target is hit.

  • PabloDev

    hello, this add-on does not provide voice, what should i do so that players can speak during the game?

    Hi,

    Have you searched for voice add-on or asked in a relevant forum thread?

    Photon provides voice support but only for Unity (C#).

  • kingpirux

    > I found out that the plugin in Construct3 works as charm but it is incompatible with the worker. If you deactivate worker it goes fine.

    What do you do exactly? What's in your logs? Can you provide a repro project, preferably modified demo from Photon plugin package.

    Hello ThePhotons, Luca from Rising Pixel here, the error in the console is

    Uncaught (in promise) TypeError: Cannot read property 'ConnectionProtocol' of undefined

    at new PhotonInstance (1bf167ca-039d-4121-8cc2-b030b1eb8a55:176)

    at Function.New (jsutil.js:9)

    at Instance._CreateSdkInstance (instance.js:7)

    at ObjectClass._CreateSingleGlobalInstance (objectClass.js:12)

    at new ObjectClass (objectClass.js:7)

    at Function.New (jsutil.js:9)

    at Function.Create (objectClass.js:7)

    at C3Runtime._LoadDataJson (runtime.js:28)

    at C3Runtime.Init (runtime.js:21)

    at async InitRuntime (2094b93e-dfc2-40ac-8f0d-d26af86f456f:4)

    I've created an empty (but working) demo from Photon demo to show the issue.

    github.com/tatosgames/testphoton

    It can be workarounded disabling web workers in construct 3 but this will affect the performance in the whole game.

    The issues are that in the instance.js you create all Photon stuff in the constructor when the base Photon couldn't be already initialized. May I suggest adding an new explicit init action in action.js where load balancer and Photon instance can be created?

  • Hi tatogame

    Please try to replace "external-script" with "inline-script" in plugin.js at the root of photon.c3addon archive. I don't know why but this works for me.

  • Hi ThePhotons,

    (and thank you for this great add-on!)

    Please try to replace "external-script" with "inline-script" in plugin.js at the root of photon.c3addon archive. I don't know why but this works for me.

    1. Should this replacement be made before installing the Photon plugin with Construct's add-on manager?
    2. Do you mean there's no explanation as to why Photon isn't compatible with web workers out of the box?
    3. No fix ongoing by Photon's dev team?
  • Hi smart_fr

    1. Yes, update the plugin archive and reimport it.

    2. Regard is as a bug.

    3. We will update the plugin in our downloads soon.

    Please let us know if the fix works for you.

  • Hi ThePhotons,

    Thank you for your answer.

    I would say it is almost working:

    Now, my app effectively launches with the global setting "Use workers: Yes", unlike before making this change.

    BUT I have somewhere Text (native Construct plugin) fields which have to be tapped in order to enter room name (so it is required to test network features) and unfortunately, the "On tap gesture" action doesn't work: nothing happens when a Text field is tapped. Strange, no?

    However, when back to "Use workers: No", the network features work properly with the modified Photon plugin... Hence I believe the Text insensitiveness to tap problem has nothing at all to do with workers. It may be caused by this "inline-script" mode in plugin.js.

    Does it make sense?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Sorry I botched my conclusion. I should have written:

    However, when back to "Use workers: No", the Text fields react to "On tap" events, and network features work properly with the modified Photon plugin... Hence I believe the Text insensitiveness to tap is caused by a combination of workers and the "inline-script" mode set in plugin.js.

    As a recap:

    Using the original Photon plugin with "external-script" in plugin.js,

    - Setting "Use workers: No" => App works but without workers

    - Setting "Use workers: Yes" => App doesn't launch (black window)

    Using the modified Photon plugin with "inline-script" in plugin.js,

    - Setting "Use workers: Yes" => App launches but Text fields don't react to "On tap" events

    - Setting "Use workers: No" => App works but without workers

    Does it make sense?

  • Hi smart_fr,

    Why you think text field's wrong behaviour is related to Photon plugin?

    Does the text field work if you remove the plugin?

  • Hi ThePhotons,

    You are right, my issue had to do with Javascript integration in Workers mode rather than with the Photon plugin.

    So the workaround you provided seems to be a solution to use the Photon plugin in Workers mode.

    Waiting for the updated plugin now, which won't require the workaround.

    Thank you!

  • Why is Photon plugin not working with the new updates of construct 3? it is working fine in r225 but not with later updates.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)