Skip navigation

Category Archives: video games

I already posted on this topic specifically related to Angry Birds, but I figured it’s worth putting a more general version of it up.

I’ve seen a few reasons why one might need to restore the saved states of a game on an Android device.  This could be necessary when moving to a new device, updating the OS on a device, or restoring after some sort of failure (I’ve seen Angry Birds data get corrupted as well as Temple Run).

In principle, Google provides a way for developers to store information with the user’s Google account so data gets restores just like calendar and contact data. This would be nice, but it depends on the developer actually updating their device to use this relatively new Android feature (and I have yet to encounter a non-google app that uses it).

The startup FTW is working on a similar solution only it is platform independent as well as device independent. Even better, unlike the Google solution, this one actually lets you see what data you have (along with other cool features). (And to be totally transparent, I’ve had some involvement with the FTW guys, so I’m not 100% objective here).  This is a really nice way to deal with game data, but it still has the same issue where if a developer doesn’t use it, you data is trapped on a device.

So, until more developers use one of those two solutions (hopefully FTW) for backing up game states on mobile devices, Android uses need to take matters into their own hands.

I’ve tested this on a Droid Incredible, Droid, Xoom, and Galaxy Nexus.  I’ve done it with Android 2.3 and 4.0.  There is no need for the device to be rooted although that make some things easier.

Apps on Android can save files to their own directory on the /data partition and possibly to a similar directory on the sdcard if present (/mnt/sdcard/).

The first thing you need is the Android SDK (you really just need the adb tool that comes with it).  It can be downloaded (along with instructions on how to make it work) from the Android development site.

Once you have that installed on your computer and can see your device when plugged in with the command:

john@yoshi ~ $ adb devices

(Note, all of this must be done from a command line of some kind.  My examples were done in an xterm on GNU/Linux, but any terminal, including the DOS command prompt on Windows should work with at most minor changes).

It is now necessary to put your device “USB Debug Mode”.  The option for that is either in the Applications part of the settings or the Developer Options.  This varies with different versions of Android.

You now need to figure out the directory where the game is storing the data.  This name will match the java package name of the application (which isn’t actually made readily available anywhere).

Open a shell on the device:

adb shell

This will connect you directly to the device. Then type the command:

ls /data/data/

This will show a list of directories. You need to figure out the directory for the app you are looking for. Usually it will be obvious, although if not, google can help.

The apps I know for sure are:

  • Angry Birds: com.rovio.angrybirds
  • Angry Birds Rio: com.rovio.angrybirdsrio
  • Angry Birds Space: com.rovio.angrybirdsseasons
  • Angry Birds Space (Free): com.rovio.angrybirdsspace.ads
  • Cut The Rope: com.zeptolab.ctr.paid
  • Temple Run: com.imangi.templerun

Now check the sdcard in the same way:

ls /mnt/sdcard/Android/data

for a similar directory. Of the games I listed above, only Temple Run stores data on the sdcard.

Once you have come up with a list of files, for each one you must execute the command:

adb pull /data/data/PATHTOFILE LOCAL_PATH_TO_FILE

If you need to restore, the command is:
adb push LOCAL_PATH_TO_FILE /data/data/PATHTOFILE.

Generally, you need to start up the game (and in the case of Angry Birds) play a level so it will create its directories and save files before you put you backup copy back.

The files I know about are:

Angry Birds

/data/data/com.rovio.angrybirds/settings.lua
/data/data/com.rovio.angrybirds/highscores.lua

(Only the directory changes for the different angry birds versions.)

Cut the Rope

 /data/data/com.zeptolab.ctr.paid/databases/achievements.db
 /data/data/com.zeptolab.ctr.paid/databases/webviewCache.db
 /data/data/com.zeptolab.ctr.paid/databases/webview.db
 /data/data/com.zeptolab.ctr.paid/databases/scores.db
 /data/data/com.zeptolab.ctr.paid/databases/webviewCache.db-journal
 /data/data/com.zeptolab.ctr.paid/shared_prefs/com.scoreloop.achievements.store_bd7eceaa-009d-4d58-beb8-1753e5412b54_data.xml
 /data/data/com.zeptolab.ctr.paid/shared_prefs/com.scoreloop.achievements.store_bd7eceaa-009d-4d58-beb8-1753e5412b54.xml
 /data/data/com.zeptolab.ctr.paid/shared_prefs/com.scoreloop.ui.login.xml
 /data/data/com.zeptolab.ctr.paid/shared_prefs/CtrAppPaid.xml

Temple Run

/data/data/com.imangi.templerun/shared_prefs/P31Prefs.xml
/data/data/com.imangi.templerun/shared_prefs/RTA.xml
 /data/data/com.imangi.templerun/shared_prefs/com.imangi.templerun.xml
 /mnt/sdcard/Android/data/com.imangi.templerun/files/recordmanager.dat
 /mnt/sdcard/Android/data/com.imangi.templerun/files/SpaceHolder.dat

For other games, you’ll have to figure out the files yourself, but the general idea will always be the same.

All of the above can just as easily be done for apps other than games, I just haven’t found the need for it myself.

I would love to write a program to automate this process on the Android device itself (and either save the files to the sdcard or mail them to the user).  Unfortunately, the security policy on Android prevents this.  Each application is assigned a user name and group when installed.  It is the only application (with the possible exception of some system processes I think although I haven’t experimented with that enough) that has permission to read or write to its own directories and files.  Another app by the same developer (with the same signing key) can get permission to them, but that really doesn’t help me.  So on devices that haven’t been rooted, it seems that this method where the computer is also used is necessary.

(Note: I realize this is very simple, but I wasn’t able to find it by searching and therefore had to figure it out myself. Hopefully by posting it somewhere, I can save someone else the time. And if not someone else, maybe I’ll save myself the trouble next time it comes up.)
Recently, after an update for Angry Birds Seasons on Beth’s Motorola Droid, the app refused to open. I know that if I were to just reinstall it, all progress would be lost. I looked around online and I see other people have had similar problems with the various Angry Birds versions on android phones. I filed a bug report with Rovio but never heard back.
A little while later, the SD card on my phone had some issues. This causes both Angry Birds and Angry Birds Rio to stop working on my Droid Incredible. I could just reinstall them, but that would also cause me to lose all my progress. Turns out it wasn’t too hard to solve both problems.
Angry Birds stores its save data and settings in files on the phone in:

/data/data/com.rovio.angrybirds
/data/data/com.rovio.angrybirdsseasons
/data/data/com.rovio.angrybirdsrio

If your phone is rooted, then you can just access these files directory from a terminal on the phone. Unfortunately, if your phone isn’t rooted, you don’t have access to these files (and rooting some phones requires wiping them which would defeat the whole purpose of this).
There is a way around this. If you download the Android SDK from google, you can access these files without root permission on the phone. Install the SDK following the instructions from google. When you connect your phone, make sure to turn USB debugging mode on (it can be found in Settings->Applications->Development).
Once you are connected, you can use the adb tool to copy the Angry Birds files off the phone for safe keeping. You should get both the file settings.lua and highscores.lua. Assuming you are doing this with bash on GNU/Linux (or a Mac)

john@yoshi ~ $ cd tmp/
john@yoshi tmp $ GAME=angrybirds
john@yoshi tmp $ mkdir $GAME
john@yoshi tmp $ adb pull /data/data/com.rovio.$GAME/files/settings.lua ~/tmp/$GAME/
john@yoshi tmp $ adb pull /data/data/com.rovio.$GAME/files/highscores.lua ~/tmp/$GAME/

(And the repeat with GAME=angrybirdsrio and GAME=angrybirdsseasons.)
After doing that on my phone, I reinstalled all three Angry Birds on my phone and then copied the files back with the command:

john@yoshi ~ $ GAME=angrybirds
john@yoshi ~ $ adb push ~/tmp/$GAME/settings.lua /data/data/com.rovio.$GAME/files/
john@yoshi ~ $ adb push ~/tmp/$GAME/highscores.lua /data/data/com.rovio.$GAME/files/

(Again, repeating for each game.)
For Beth’s phone, the pull command could not find the settings file for Seasons. It seems that the settings file was erased during the update. Just putting a blank file back was enough to fix it! All the settings were lost, but there aren’t many settings so that didn’t really matter since the level data was saved.
So, now I back up my Angry Birds data every once in a while. I haven’t had a chance to really examine the save files (.lua) but since I have copies, I’ll probably take a look at some point.

I just saw a post on Slashdot with a link to a Game Informer’s story about a possible Ghostbusters game. There was also more talk about it at a PC gaming site (which, not being a PC gamer really I never heard of).

This of course got me kind of excited. Not only is this talk of a Ghostbusters game, but Harold Ramis, Bill Murray and Dan Aykroyd are all supposed to be involved and it would be a sequel to Ghostbusters 2.

This all sounds great except for the fact that it is not the first time there has been rumors of a Ghostbuster game, sometimes even with screenshoots or movies. Or the rumors of a Ghostbuster 3 (all CGI at one point).

These rumors come up often enough that I should be immune to them. But for some reason I’m not and I get a little excited each time I read one. I think that must mean I’m a sucker or something.

I’ve been meaning to write this post for a while and never seem to get around to it so hear goes…

It’s not much of a secret that I like video games. I tend to think games are a big part of the reason I grew to like computers so much. Computers are a great tool for games, and like many other people before, I eventually became more interested in the tool than in the games that are made with the tool. It does mean that I’ve spent a lot of time thinking about video games.

Overall, my preference has always been console games (with a slight bias towards Nintendo). Sure I played Doom and Myst and a variety of not so great X-Wing or Tie Fighter games, but it always goes back to consoles for me.

The only current generation console I own is a Nintendo Wii. Even though I am a little disappointed with the Zelda game on it, I love the Wii. I think most of the playing I’ve done has been either Wii Sports of with games on the Virtual console. Between the wireless controllers and the virtual console games, I have decided that I completely hate dealing with game discs.

Now, on to my prediction…

I think that the Wii will be the final Nintendo console that relies primarily on physical media for its games. Whatever the next system is called (and I can’t even begin to imagine that), something like the virtual console will be the primary form of game distribution.

I would say the odds are very high (but a little less likely) that the X-Box 1080 (the only logical name for the successor to a system where the second version was called the 360) will work the same way. But not as well since it will be Microsoft in charge.

As for Sony, it is pretty safe to say they will not go that way for a long time. They’ve already gone too far down a different (and not so interesting or profitable) road to change course by the next console generation. Maybe for the PS5 (although by that point movies usually stop having numbers, so maybe the “Live Free, or Play Station”).

I couldn’t resist and finally bought Super Mario Bros. on the Virtual Console on the Wii. Sure I beat it years ago, but it is fun to play for a few minutes.

However, it got me thinking that I’m really not sure if I’ve seen every level. Usually I take the Warp Zone in level 1-2 and then again in 4-2. I guess I’ll have to try and get through all the levels to see, but you would think that after all these years I would know if I had seen all the levels in SMB.