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

Discussion and feedback on Construct 2

Post » Wed May 27, 2015 7:12 am

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:
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.
You think you can do these things, but you can't, Nemo!
Just keep reading.
Just keep learning.
B
65
S
16
G
9
Posts: 1,429
Reputation: 12,718

Post » Wed May 27, 2015 7:30 am

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
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Wed May 27, 2015 9:37 am

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:

eli0s wrote: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.
Scirra Founder
B
399
S
236
G
89
Posts: 24,542
Reputation: 195,428

Post » Wed May 27, 2015 4:08 pm

@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! :)
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Wed May 27, 2015 6:56 pm

@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! :D

Elias
composer - multimedia artist
www.eli0s.com/en/
B
69
S
27
G
6
Posts: 1,146
Reputation: 10,379

Post » Wed May 27, 2015 8:13 pm

Thanks for sharing the capx!
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,283

Post » Wed May 27, 2015 11:03 pm

Thanx @eli0s gonna check that out
ImageImage
B
70
S
21
G
7
Posts: 827
Reputation: 10,052

Post » Fri Jul 17, 2015 9:01 am

I have been playing around with this issue since I uploaded my game prototype to the website (as it's intended to be played from desktop computers, was previously testing exports with NW.js only).

There seem to be two main issues to me, which are partly Construct 2 design problems:

1) The loadingprogress system variable is designed to contain values meaning different things, which is not ideal (would be better to have two separate variables, one showing the progress for game updates and another for layout load)

2) The Browser.On Update Ready signal only triggers when an update upload is complete (game running from cache and downloading new version). This is an issue when a person starts the game for the first time (game not running from cache). The Browser.Is Downloading Update will be True (allowing me to then use a timer to show update progression using loadingprogress), but the On Update Ready signal never fires to allow the game to move onto the first layout (player just sees "Loading game 100% complete")

So, to recap, there are three situations:

1) Player starting game for the first time in a browser
2) Player running the game again (uses cache) and an update is available
3) Player running the game again and no update available

Situations 2 & 3 are managed as follows and work fine:

...
Browser.Is Downloading Update -> System Set FlagGameUpdate = True
Else Goto FirstLayout

System Every 2 seconds
System FlagGameUpdate = True -> TxtIntroUpdate Set Text to "Loading game update... " & round(loadingprogress*100) " %"

->Browser.On Update Ready -> System Set FlagGameUpdate to FALSE
Browser.Reload


Problem is situation 1, as with the On Update Ready not being triggered, I haven't found how to automatically reload the page. Any ideas?
B
10
S
3
Posts: 87
Reputation: 957

Previous

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 11 guests