Save game on mobile device?

Get help using Construct 2

Post » Sat Oct 13, 2012 5:53 pm

I spent last 2 hours searching for how can I save games in Construct 2.. but I wasnt succesfull. Only solutions I was able to find were using cache or internet connection etc.

Is there any way to save some basic info (hp, how many levels unlocked, ...) in app.folder? Im interested about creating mobile and PC exe games.. but without this being possible it can be hardly done.

Creating a mobile game without save progress is pointless.. and forcing customers to use internet to save? Lot of people in my country (and lot of countries in europe) dont even pay for mobile connection. And if they do its with 300mb fup or so...

Have someone made a android app using construct 2 and have it on market? How you solved this problem?

Thanks for help
B
1
Posts: 1
Reputation: 277

Post » Sun Oct 14, 2012 5:07 am

Active Server Pages (.asp) and Microsoft Access (.mdb) file.

Just like sending Ajax POST and GET requests to php and an sql database except the database (.mdb) is stored right in the application files. Then you just add the .asp coding to access the database and run queries like so:

<%
Set POwnn = Server.CreateObject("ADODB.Connection")
Set OSP = Server.CreateObject("ADODB.Recordset")

ConnectionString = "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=" & Server.MapPath("db\database.mdb")
POwnn.Open ConnectionString

sql = "SELECT * FROM users"
OSP.Open sql, POwnn, 3, 3%>
<%=OSP("username")%>

<%
OSP.Close
POwnn.Close
%>
B
22
S
9
G
3
Posts: 202
Reputation: 3,645

Post » Sun Oct 14, 2012 5:22 am

The tricks would be whether the mobile device can run asp and mdb files and finding a way to have the Ajax request point to the database within file structure of the app.
B
22
S
9
G
3
Posts: 202
Reputation: 3,645

Post » Sun Oct 14, 2012 5:33 am

ummm.I don't think expecting localhost ajax support is the best route if the device doesn't natively support a local webserver. Having a customer hack their ipod to install a webserver just to a save a game I think is a fairly large no.

I'm not sure, but have you the OP checked on dictionary plugin?
If your looking for native storage your likely going to be out of luck for some time. Local storage is usually not desired as a browser feature for security reasons. I don't think Google or Apple will go with file storage for either of their mobile browsers.
The other route is the cache method by way of the dictionary(as I understand the dictionary is the cache). If your game is packed to run as offline and set to home screen(IOS) then the cache should be fine. The cache isn't part of the safari cache and wont' be deleted if safari clears. cache is stored in it's own app folder. As for android.

I could of course be wrong on all of this information. So someone with more experience please speak up :
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sun Oct 14, 2012 7:41 am

There's always csv files as well.
B
22
S
9
G
3
Posts: 202
Reputation: 3,645

Post » Sun Oct 14, 2012 9:22 am

droptank21 raises a good point which I may have overlooked. Do you plan to run your project through the browser and home screen running or do you plan to use cacoonjs/phonegap that wraps your program into a native app.

If your going through browser then you only have access to dictionary plugin or some other form of cookies.

If you go through a native app wrapping program then you can have access to file writing. Which droptank21 suggestion of csv files will work well.
B
87
S
18
G
9
Posts: 2,455
Reputation: 14,834

Post » Sun Oct 14, 2012 1:17 pm

clay.io ?
B
40
S
11
G
4
Posts: 665
Reputation: 8,403

Post » Sun Oct 14, 2012 2:00 pm

WebStorage is the best way to save progress client-side. Have you tried it?
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Sun Oct 14, 2012 9:38 pm

WebStorage is deleted once cache is cleared, though, isn't it?
- Diji
B
23
S
4
G
4
Posts: 54
Reputation: 3,996


Return to How do I....?

Who is online

Users browsing this forum: Artpunk, Axiomaltd, MACPK, nicklowkcmagic, OddConfection and 22 guests