[PROGRAMMING]True Local Saves independent of Game portals.

The place to make/discuss Kingdom Rush suggestions.

[PROGRAMMING]True Local Saves independent of Game portals.

by dimumurray » Mon Jan 30, 2012 12:22 am

KR has been getting a lot of flack lately over at Kongregate for lost saved games so I decided to look into options for solving this issue.

Traditionally devs rely on some cookie scheme to store saved games(SharedObjects for flash), sadly this scheme is prone to problems since the browser and other apps routinely delete cookies and other saved state. One work around is to have the game portal host saved games but not all hosts offer this service.

How about a true local save solution instead? As of version 10 and up flash allows users to load and save files locally to their machines by using the FileReference API. No more sandbox security issues to worry about; you only have to ensure that loads and saves are user-initiated via mouse clicks. I have done it myself and its fairly easily to take an object instance representing save state and write it to a ByteArray and then have FileReference::save() save it to the user's location of choice.

Of course the downside of this method is that the user has to manually initiate the save(i.e. press a button) but this method might help to alleviate some the gripes some players have with saving.
Last edited by dimumurray on Mon Jan 30, 2012 12:36 am, edited 1 time in total.
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: [PROGRAMMING]True Local Saves independent of Game portal

by Kitler » Mon Jan 30, 2012 12:36 am

isnt the other downside saveediting?
User
 
Posts: 59
Joined: Thu Jan 12, 2012 9:29 am

Re: [PROGRAMMING]True Local Saves independent of Game portal

by dimumurray » Mon Jan 30, 2012 12:42 am

Kitler wrote:isnt the other downside saveediting?

True. However writing to a byteArray will ensure that state data is not in human readable form, plus you can run a encryption and/or compression algorithm on the byteArray to mangle the info a bit more. Granted those measures won't stop a more ardent hacker, but it will suffice for the typical dude sniffing around in a save file.
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: [PROGRAMMING]True Local Saves independent of Game portal

by Vanzen » Mon Jan 30, 2012 6:15 pm

Thank you DD will look into it :)
User avatar
Ironhide Developer
 
Posts: 351
Joined: Tue Aug 09, 2011 7:53 pm

Re: [PROGRAMMING]True Local Saves independent of Game portal

by dimumurray » Mon Jan 30, 2012 7:01 pm

Kitler wrote:isnt the other downside saveediting?


Did some digging and it turns out that flash cookies are prone to the same problem, maybe even more so given that tools exist to edit them. It appears the hacker community is quite familiar with the file format for flash cookies. I suppose one can get around that by coming up with a custom format for saves instead, again via ByteArray.
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: [PROGRAMMING]True Local Saves independent of Game portal

by Giangreymon » Tue Jan 31, 2012 12:06 am

WTF!!! U guys are UBER GEEK :ugeek:
:mrgreen:
http://shadowscythe.minitroopers.com *pls visit and create an army in the link*
Image Image
Image
Image
*Eat without seasoning! if you do nuht follow mah order!* -daz hou evil cookie crumbles- >:D
User avatar
User
 
Posts: 501
Joined: Mon Jan 02, 2012 6:58 am
Location: Philippines

Re: [PROGRAMMING]True Local Saves independent of Game portal

by Epicazeroth » Tue Jan 31, 2012 2:06 am

I made a game and I don't know what language.
Image Image
So cute. And lonely :cry: Please visit him. And my other dragons while you're at it. Ok he's actually kinda creepy, but I promise the other one is cuter!
User avatar
User
 
Posts: 1600
Joined: Sat Sep 10, 2011 1:36 pm
Location: United States of America

Re: [PROGRAMMING]True Local Saves independent of Game portal

by suin » Tue Jan 31, 2012 11:50 am

the browser and other apps routinely delete cookies and other saved state.

yeah, that's the biggest problem with the local saves for some users. Maybe the devs could add some user-initiated saving feature as a supplement as well as the automatic one (this one actually saves a lot of trouble), or reprogramming the saving system.
User avatar
User
 
Posts: 548
Joined: Mon Jan 02, 2012 3:08 pm
Location: Utopia

Re: [PROGRAMMING]True Local Saves independent of Game portal

by Epicazeroth » Tue Jan 31, 2012 10:23 pm

Epicazeroth wrote:I made a game and I don't know what language.

Actually, it sucked, but it still was technically a game.
Image Image
So cute. And lonely :cry: Please visit him. And my other dragons while you're at it. Ok he's actually kinda creepy, but I promise the other one is cuter!
User avatar
User
 
Posts: 1600
Joined: Sat Sep 10, 2011 1:36 pm
Location: United States of America

Re: [PROGRAMMING]True Local Saves independent of Game portal

by kilele » Tue Jan 31, 2012 10:43 pm

dude you reply to your own posts? I'm really curious about your game, please share a download in the 'game talk' subforum
Last edited by kilele on Tue Jan 31, 2012 11:11 pm, edited 1 time in total.
KR1 Fanmade Challenges
At the end of the experiment, you will be baked and then there will be cake.
User avatar
User
 
Posts: 999
Joined: Sun Aug 14, 2011 5:58 pm

Re: [PROGRAMMING]True Local Saves independent of Game portal

by Epicazeroth » Tue Jan 31, 2012 10:51 pm

I have no idea how to download something, I made it at camp and it's half done and I forgot all the commands to complete it. If they're not called commands, that proves how little I know about programming. As I said, it was just a summer camp project. And I do not reply to my own posts, I forgot about editing until I posted.
Image Image
So cute. And lonely :cry: Please visit him. And my other dragons while you're at it. Ok he's actually kinda creepy, but I promise the other one is cuter!
User avatar
User
 
Posts: 1600
Joined: Sat Sep 10, 2011 1:36 pm
Location: United States of America

Re: [PROGRAMMING]True Local Saves independent of Game portal

by dimumurray » Wed Feb 01, 2012 3:54 am

Found some sample code over at wonderfl. It covers all the basic concepts to pull off true local saves:

http://wonderfl.net/c/mdgh/read
User avatar
User
 
Posts: 348
Joined: Wed Aug 31, 2011 6:11 pm

Re: [PROGRAMMING]True Local Saves independent of Game portal

by suin » Wed Feb 01, 2012 2:36 pm

Found some sample code over at wonderfl. It covers all the basic concepts to pull off true local saves:

I usually get the local ones to make backups by searching "slot" in my PC in case of any unexpected. BTW, I was wondering if there would be some tools or not to facilitate the process or at least add some "download" button to transfer the online saves to the local ones.
User avatar
User
 
Posts: 548
Joined: Mon Jan 02, 2012 3:08 pm
Location: Utopia


Who is online
Users browsing this forum: No registered users and 5 guests