Deploying the game

hi,

I have developed a prototype game using Unity and Pun2. The targeted output is WebGl format.
I have successfully tested using localhost:portnumber that Unity generates dynamically.

In the Photon Server Settings I selected:

1. "Protocol" as "Web Socket".
2. "Use Name Server" is checked on.
3. "Port" is "0"

I am planning to use Photon Server for the game.

How do I test it online so that I can test it over the internet with different online users?

Where should I host / deploy the game package?

Thanks for the help.

Regards
r

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @RPhoton,

    Thank you for choosing Photon!

    This question is not really about Photon but rather about how or where to host WebGL Unity games.
    Here are some answers from a Google search:
    Unity answers
    reddit
  • Thanks for the response. I have deployed the game on my server. However when I hit the URL, the game doesn't loads. Do I need to setup the photon server on my server for the game to work?
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited September 2020
    Hi @RPhoton,
    Do I need to setup the photon server on my server for the game to work?
    No, but your server need to reach Photon Cloud.
    See list of ports.
  • I shared the settings earlier. Here it is again. Is this not enough for the game to connect to the photon server?

    1. "Protocol" as "Web Socket".
    2. "Use Name Server" is checked on.
    3. "Port" is "0"
  • The documentation says with this settings Photon picks up the server and identifies the port to connect automatically. If not please let me know I am using websockets.
  • JohnTube
    JohnTube ✭✭✭✭✭

    Hi @RPhoton,

    Sorry for the confusion.
    Please ignore my previous comment.

    I need to understand what you want exactly:

    You want to be able to play a WebGL game from a browser.
    So this game needs to be hosted on some web server for the browser to load it.

    On the other hand, this game, do you want it to connect to Photon Cloud or to your self-hosted Photon Server?

    1. "Protocol" as "Web Socket".
    2. "Use Name Server" is checked on.
    3. "Port" is "0"

    This is fine if you want to connect to Photon Cloud.
    I think you need to use WebSocketSecure and not WebSocket but I'm not sure.

    If you want to connect to a self-hosted on premises server then you need to change settings accordingly and configure certificate also.

    In any case, check logs for errors, see browser console: in chrome it's F12.

  • Thanks. I am now able to make it work on my server. The problem was to do with https. Though I keep getting this message as wasm is not a defined mime type. Despite the game though works. All this time I kept thinking I missed something related to Photon.

    Thanks for the help @JohnTube.