Updating Project - doesn't work...? -FIXED-

  • Hello, based on what I read here, I've created a layout with the following events and set it as the first layout:

    1) Browser | Is downloading update ----> Set text to "Please wait, updating... " & loadingprogress * 100

    2) Browser | On update ready -----> Set text to "Please, reload the page..."

    3) Browser | Is NOT downloading update -----> System | Go to Layout 2

    I am constantly changing and uploading the project to my ftp (this is part of the creation progress / getting feedback from my clients), but the whole update system doesn't work. After a change has been made and I upload the project to the ftp, the same version as before is running after I hit reload. If I wait a bit and hit reload again, the new version runs but none of the previous events is shown, the second layout runs instantly without displaying any loadingprogress messages....

    Am I doing something wrong here...?

    Thanks in advance for any help!

    -Fixed- Ashley's explanation:

    ...this event:

    > 3) Browser | Is NOT downloading update -----> System | Go to Layout 2

    >

    ...likely switches layout before the browser has found out there's an update, and then the "is downloading update" condition becomes true while on Layout 2, which I'm guessing you're ignoring.

    And here is a crude demo I made (right click and choose Save Link As) that updates correctly...

  • have you tried clearing the cache of the browser?

  • Hi TheDom , thanks for answering. What I am trying to achieve is a way to inform the user: when a newer version is uploaded, how much it has being updated and when to reload the page in order to see the changes.

    I thought that the whole purpose of the tutorial on the link above is to build an update system that takes away the hustle of clearing the cache from the user.

    In fact, I absolutely can't have the users digging into browser settings and searching for cache every time I make a change, this is a nightmare to give instructions on how to do in all browsers and I want the procedure to be as automated and streamlined as it can be...

    My question is why the system that I am showing on my post above doesn't work, what I am doing wrong...?

  • I know it's not a solution to your problem, but Ctrl-F5 is a quick way to clear your cache upon refresh until you get the updating working.

    As a web developer, I feel your pain with things not updating for users after a change.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • ryanrybot , I didn't knew that, thanks for the tip! Is this a standard function in all browsers?

    Up until know I didn't mind about this, because every project I did was for personal reasons and I was sending the published links only when it was 100% finished.

    But now, this is happening in a very iterative manner, I make some things, I upload, I get the feedback and so on... It's a nightmare not knowing if the version you are seeing is the one you are suppose to!

    Have you made an auto update system of some sort? How do you handle updates with your users..?

    Thanks again for the tips!

  • Yep, Ctrl-F5 works on every browser. ...or at least all the ones I've tried. <img src="{SMILIES_PATH}/icon_razz.gif" alt=":P" title="Razz">

    What I do when uploading a new build for testing might not be the most user-friendly way, but it works. I upload my game to a new link, usually by posting the game in a folder with the date as a name.

    For example, http://yoururl.com/randomgame/5-26-15/index.html, and then next time I upload I use a different date.

    Then I would update the link on the forums, or you could send the new link to the user. The problem is you can't save it as a bookmark, which would be the easiest for a client.

  • ryanrybot , I see. This is surely functional. I might just take this approach for now. It's just weird that the intended (?) update method doesn't work. I wish it did, or even that I am doing something stupidly wrong in my events...

    Anyway thanks for helping!

  • You can go into the index.html file and delete the <html manifest="offline.appcache"> tags.

    This will force the browser to re-load the game from scratch every play.

    This is only good however if your game isn't image heavy, as it will chew up a lot of bandwidth as the images are re-downloaded.

    Cheers,

    Tom

  • eli0s, I'm going to take a crack at it myself later this week. I'll let you know how I make out.

  • ive had this too, and did a quickfix by deleting link to appcache, i wonder now if changing the version in projectsetting may trigger a fresh download , but is actually pretty important Ashley too know best way

  • I haven't used this feature since we were having those caching issues during preview.

    If I recall, ashley disabled cache via preview(downloads a new version every time), I don't know if this applies, or if he has since re-instated it.

    And as far as live:

    [quote:1cthzouo]If you're online and you load the game, the browser loads from disk instantly as before. However, as the game is running, it checks for an update in the background. If you've uploaded a new version, the browser downloads it and saves it to disk. Then, next time you load the game (this includes refreshing the page), the browser loads the new version. Until then, the user keeps playing the old version.

    The user plays his cached version, at some point it picks up a new version and starts the download whilst user is playing old version. Then when finished, and browser is refreshed the new version is used.

    The browser object actions would / should trigger whilst user is playing old version.

  • how does it know there is a new version ? does it check all files date? I'm just saying ive had times where i just changed something small, could be just a sprite or something or change some event, and it keep loading the old one from the cache no matter what i did, only solution was to delete the appcache, but then you loose caching for returning visitors

  • I think different browsers may take a moment to realise there is an update. Since it loads everything from disk when coming back a second time, everything loads more or less instantly, while it checks the appcache file in the background to see if there is an update. So the game may start with "not downloading update" state, and then after a moment change to "downloading update" state. So this event:

    3) Browser | Is NOT downloading update -----> System | Go to Layout 2

    ...likely switches layout before the browser has found out there's an update, and then the "is downloading update" condition becomes true while on Layout 2, which I'm guessing you're ignoring.

    I'd just start the game on the menu, and if it detects an update, jump to the progress layout. You could make the jump less obvious by having a black screen fade in, a brief logo on startup, or something like that.

  • tomsstudio , thanks for this tip, however as you said, this won't be practical as the project goes on, and anyhow, changes might happen even after I finish the project and I want the users to know about the updated version.

    @TheDom , thank you for your interest and for volunteering, meanwhile Ashley provided a solid explanation, I'll try adopting his suggestion.

    @vtrix , I am glad I wasn't the only one baffled by this, thanks for notifing Ashley, now we have a solid suggestion!

    @DUTOIT , Ashley posted a reasonable explanation on why my events fail to trigger the update notification. Thank you for your input!

    @vtrix , I am not qualified to answer about how it does check for the update. I think it compares the appcache file and if there are changes the update happens on the background. Maybe your game doesn't look like it's being updating because it is big in size and by the time you give up reloading the page the files still haven't been downloaded/updated...?

    @Ashley , thank you for jumping in, your input is invaluable, I' ll try modifying the way my project begins to allow for the browser to catch up...!

    Thank you all for your help!

  • ryanrybot ,

    @tomsstudio ,

    @TheDom ,

    @vtrix ,

    @DUTOIT ,

    So, after thinking about what Ashley wrote, I made this test capx (right click and choose Save Link As) that proves him right

    It's very crude and ugly programming-wise but for the time being it does the job! Just check inside for the relative info!

    Thanks again for your time and effort!

    Elias

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