HTML 5 question

Discussion and feedback on Construct 2

Post » Thu Aug 16, 2012 11:29 pm

Hi everyone, my question is about HTML 5, is it possible to use an external pack file to minimize the constant download everytime the game is accessed on the browser?
For example, a card game made with HTML5, that has an option to download a pack of images for all the cards, so the game acess that pack and don't need to download it anymore.

If this is possible, does construct 2 has that option?

ThanksMetal_X2012-08-16 23:29:49
B
22
S
7
G
5
Posts: 90
Reputation: 3,430

Post » Thu Aug 16, 2012 11:42 pm

Construct 2 already caches the game's files so that the game only has to be downloaded once.
B
90
S
30
G
24
Posts: 3,189
Reputation: 32,400

Post » Fri Aug 17, 2012 1:07 am

You would have to go out of your way in order to NOT make the browser cache stuff.
In other words, yes, construct has that option and it comes activated by default.
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Fri Aug 17, 2012 2:03 am

If you mean like packages which you download only when the level needs it.. It's not available yet.
B
36
S
10
G
6
Posts: 948
Reputation: 11,101

Post » Fri Aug 17, 2012 2:44 am

Of course i know that the browser caches the game after loading, but caching isn't permanent and "expires" after some time, i play flash games very often and the longest time that it stayed cached was 2 days, so it's extremelly different to cache the game and to download a permanent pack of files and use it externally.

Another difference is that a pack of files you can zip it making it lower.
B
22
S
7
G
5
Posts: 90
Reputation: 3,430

Post » Fri Aug 17, 2012 2:46 am

Rory, that's not what i meant to say, but the option you mentioned is really nice and will be nice to see it on C2.
B
22
S
7
G
5
Posts: 90
Reputation: 3,430

Post » Fri Aug 17, 2012 3:27 am

you can dump whatever info you have onto localstorage.
I don't know if it accepts images or not, but you could make a plugin to shove images there.
Worst comes to worst, you can encode your images in base64 (there are already plugins that do this) and store the resulting encoding onto localstorage, and then load them back in.
I don't think it will ever expire, unless the users explicitly clears it.
B
35
S
8
G
8
Posts: 532
Reputation: 6,868

Post » Fri Aug 17, 2012 3:57 am

I don't see this working, how can i transform numbers into images?
I know that everything on the computer is only data, but how can i transform numbers on an image at runtime during a game? Oo

Edit: I said that because you can't put images on localstaroge.Metal_X2012-08-17 04:00:42
B
22
S
7
G
5
Posts: 90
Reputation: 3,430

Post » Fri Aug 17, 2012 5:19 am

You can put images in the local webstorage once the image is extracted to Base64 and you can then inject the Base64 code as image with the third-part behaviors Fimbul mentioned.

Anyway, I don't believe the downloaded/cached HTML5 files are flushed after two days.

As for the size of download, check image compression in C2 which is really of big help as well as the spritesheet features that also helps with the download size.

Once again, the game, the assets are only downloaded once. There is no "constant download everytime the game is accessed on the browser".
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 7,000
Reputation: 57,795

Post » Fri Aug 17, 2012 5:59 am

Thanks Kyatric, i will study that method, but do you recommend do something like that?

As i said, i play many flash games and they need to download again after some days.
For example i played a lot of Kingdoms CCG on Kongregate.com, i dowloaded it once and played, than next day i played it again and don't need to download it, but on the next next day the game was not on cash and i needed to download it again...

Let's suppose that on HTML5 the game is cashed forever, but even so if i update the game, adding new features(new cards for example), the whole game will need to be downloaded again, right?
B
22
S
7
G
5
Posts: 90
Reputation: 3,430

Next

Return to Construct 2 General

Who is online

Users browsing this forum: pablo7 and 6 guests