Velojet's Recent Forum Activity

  • AarongamerX

    Well, I guess you've tested it out now and found that your MasterAddress is correct and that the Workout demo plays as it should from your server. Well done!

    ... Also on my website it says my Apache server is port 80. Not sure if that matters.There are two servers involved here: your Apache HTTP server which necessarily runs through port 80, and the Photon Cloud server which uses port 9090. (I should add that to my demo posting - the Photon AppInfo template should've indicated that in a comment.)

  • AarongamerX

    You've missed the port number off the end of your Master Server Address: ':9090'.

  • ... You said to re-save removing the template part but what are we supposed to do with the file? ...

    AarongamerX

    Well, if you resave your edited cloud-app-info.js file, it'll end up the same folder on your HTTP server as the one where you've copied your Workout demo files (in my example, that folder is called photonclient.workout). You don't need to do anything more with it.

    Give me the URL of your copy of the Workout demo, so I can take a look.

  • AarongamerX

    See my post of 2 Apr 1:17 am, top of page 11 - it explains what files you need to upload to your HostGator account, to get my Workout demo working.

    When it comes to making your own game, it's the files produced by the C2 HTML5 exporter that you'll need to upload + your edited cloud-app-info.js file.

    Thanks for your positive feedback!

  • ... If you need some help for testing the plugin i'm now properly equiped :)Joskin   Thanks for your offer! I'm keen to have people using it to make a MP game for themselves - and to tell me what needs changing and adding.

    Taurian   Great to have you checking in here! I'd really like to know how far it goes towards meeting your expectations.

  • lemo

    Thanks! I'm sure it will be possible for RT HTML5 apps to support smooth pixel-by-pixel motion. And UDP will be part of the solution. Interestingly, the Photon Cloud supports UDP. The documentation says "You can even customize the way of exchanging information by specifying a protocol (UDP vs. TCP or reliable UDP vs. unreliable UDP) with simple parameters, depending on your needs", but AFAIK, the JavaScript SDK doesn't (yet) offer this customisation.

  • (NOTE: Before trying out the PhotonClient behavior as outlined here, you need to work through my demo as explained in my post of 2 Apr 1:17 am, top of page 11.)

    As promised, here?s my Construct 2 PhotonClient behavior that you can now try adding to your own sprites:

    https://dl.dropbox.com/u/54915877/photonclient.zip - install this in the usual way (sorry, I?ve not yet made it as an add-on).

    Here are the ACEs you can use ? you?ll find examples of the use of each in my Workout demo (whose capx can be downloaded from https://dl.dropbox.com/u/54915877/photon.workout.capx) :

    [Conditions/events]

    • On joined
    • On leaving
    • On web player/s to be created
    • On web player joined
    • On web player updated
    • On web player leaving
    • On collision with another player
    • On impacted by another player
    • On message
    • On game server ready (currently unreliable ? needing the Photon team to add a connect event handler)

    [Actions]

    • Initialise data of web player to create (i.e. data to be used by C2 in creating web players)
    • Set the web player's ID (this pairs the Photon-allocated photonID with the C2-allocated UID)

    [Expressions]

    • WebPlayerX (The current X co-ordinate of the picked web player)
    • WebPlayerY (The current Y co-ordinate of the picked web player)
    • WebPlayerUID (The picked web player's UID)
    • NumWebPlayersToMake (The number of web players to make)
    • WebPlayerPID (The picked web player's Photon ID)
    • Name (of either my player or the picked web player, as selected)

    I?ve liberally commented my Workout demo, and I hope that?ll be sufficient documentation of the use of each of the ACEs.

    The PhotonClient object also has these custom properties that can be set in the usual way, in (where else?) the Properties bar:

    • Auto-repeat: If enabled, the arrow keys (and sprite movements) repeat if held down. Otherwise, keys need to be tapped repeatedly to produce movement. This can make it easier to control positioning.
    • Tiled: If enabled, sprites move from tile to tile rather than pixel by pixel (see my comment below).
    • Tile size: Length (in pixels) of tile side (default is 32).
    • Random start: If enabled, my player starts in a randomly chosen vacant position (see my further comment below).

    ]] More about the ?Tiled? property: As with most multiplayer games, latency is a problem. It can result in jerky pixel-by-pixel movement. One simple way of dealing with it is to make big movements of sprites from tile to tile, rather than attempt smooth movements pixel by pixel. That?s why my Workout demo uses tile-by-tile movements.

    ]] More about the ?Random start? property: When enabled, a random initial position is chosen for your player and (most importantly) if there already happens to be a web player in that position, another position is chosen and checked, and so on, until a vacant position is found. Otherwise it?s up to you to choose the starting position, and to provide for the possibility of an initial collision.

    Some things to note:

    ]] You need to use the ?Export project? (as a HTML5 website) option ? ?Preview will give you an error (try it!).

    ]] Don?t run the export through the minifier ? there?re still some kinks to be ironed out before it?ll meet the exacting requirements of the Google Closure Compiler.

    ]] The player name input, the ?Join? and ?Leave? buttons, and the header (?= Construct 2 <-> Photon Cloud multiplayer =?) are created before the C2 runtime kicks in. They can be styled in the photon_client-inputs.css file in the photon.workout/css folder, and the header can be changed by editing the inputs_header.txt file in the photon.workout folder.

    ]] The Photon Cloud allows for multiple rooms in a game lobby. At this stage, I?ve not attempted to implement that feature and my PhotonClient behavior accesses a single room (called ?C2demo?).

  • Right after the master server address (the US one).

    SpacialPumpkin

    But in what file? It doesn't appear in your evantarctica.netau.net/photonclient.workout/cloud-app-info.js.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ... So yes, no need to implement save or load there.

    Thanks for your confirmation, Ashley (and for saving (!) me a bit more work :) )

  • Velojet

    Ok I put the ':9090' and it seems the header txt file is there. but its still not working :p

    SpacialPumpkin

    Where did you put the ':9090'?

  • I've got the same error as SpacialPumpkin, ...

    Joskin

    No, you haven't! It works perfectly. Congratulations! <img src="smileys/smiley20.gif" border="0" align="middle" />

  • Ashley

    I have a Photon Cloud multiplayer behavior on the go. Intuitively (which means I haven't thought through this in detail), I'd think it's not appropriate to implement save/load since the game state is not fully contained within any single client that might be wanting to do a save/load?

Velojet's avatar

Velojet

Member since 22 Nov, 2011

Twitter
Velojet has 1 followers

Trophy Case

  • 13-Year Club
  • x3
    Coach One of your tutorials has over 1,000 readers
  • x2
    Educator One of your tutorials has over 10,000 readers
  • Email Verified

Progress

16/44
How to earn trophies