Which is better? Save & Load OR offline cache?

Discussion and feedback on Construct 2

Post » Fri Feb 07, 2014 5:02 am

I just wanted to know which is better way to implement offline games? Use System Save and Load feature OR use Offline cache? Technically I know the difference between them, but to the layman, what is the difference between them and in what case is one or the other is preferred?

thanks,
Ravindra
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Fri Feb 07, 2014 5:22 am

Offline Chache is used to store your game assets, logic, files, music and all of that.

The C2 System Save and Load feature job is to save data state. ie position of objects, variables and such. Save/Load state doesn't deal with assets.

Since neither overlaps the other domain (ie banana milk shake or steak dinner) neither can really be compared to use one over the other.

I think maybe you want to consider WebStorage instead of offline cache.

Now if that's what we are talking about. I'll give you my opinion. WebStorage. Using Load/Save is great for game states similar to Emulator save states. hwoever Savestates use a lot more storage space. WebStorage however requires only a little overhead and is likely only uses 1/100th the storage size.

I tried using Save/Load once. I cut out most of the level objects and just had a handful to save. Player mostly and the level progress.
The Load/save stored at about 300kb
Where as my custom used about 300bytes

To me. Use Load/Save for mobile devices. When the player leaves the app then Save the State. If the player comes back to the App load the state.... not that I think our Apps can no when they are being shut down
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Post » Fri Feb 07, 2014 6:04 am

Thanks @Jayderyu. Your response provides good clarity. I have not been able to get around with offline cache issue that I have been facing for quite some time...The issue is something like this -

There is a Menu page ( lets say menu.html) from which I have links to two of the C2 games ( simple click the URL to open the game).

Now lets say I come out of the first game back to Menu page and open the second game and play the second game and then go offline. Now in offline mode, if I again click on the first game, it would not open up from the cache...(I have implemented offline cache for both the games individually.)

Do you have any idea / solution to get around this? I was thinking if I Save and Load the game when clicked or going back to Menu page might help. But given your response, it doesn't store any assets...so probably Save/Load game might not work either...
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368

Post » Fri Feb 07, 2014 6:53 am

Well even with an offline cache C2 while it has an online connection will attempt to check for updates. Save/Load won't help your problem.

I wish I could offer more advice. But I'm not entirly sure how it's possible to play the game offline. As I understand due to security reasons the basic index.html file has to served from a webserver.

The only possible way for offline mode to actually play offline is for Home Apps on mobile devices. These can somehow run while not connected to the internet.

But for all desktop browsers C2 requires to be served from a webserver. The offline cache only allows for the game to start quicker on consequtive plays because the resources are downloaded.
B
92
S
18
G
9
Posts: 2,455
Reputation: 15,113

Post » Fri Feb 07, 2014 7:23 am

OK. To clarify my understanding, are you saying even when we enable offline cache for a C2 game, the index.html should be loaded from the webserver? I don't think so, because when I load a C2 game directly which is offline cached, then it plays even when the internet connection is off.

The issue I get is inside an App - when I have a menu page (I have custom built this menu page outside of C2) that has links to two C2 games which are individually appcached...In offline mode, when I exit out of second game to the Menu page and get into the first one that was previously loaded...I am not sure what is it that I need to enable to make this work...

anyway thanks for your help so far...
For game development / IT services contact - [email protected]

List of published iOS apps -
https://itunes.apple.com/us/artist/ravi ... d693234511
B
84
S
20
G
3
Posts: 337
Reputation: 7,368


Return to Construct 2 General

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest