Category Archives: Dev

Wordfeud Tile Tracker

http://wordfeud.ardavey.com

 

It’s been up and running for a while now, and has had a coat of paint or 2 since the last post, so I thought I’d pimp my Wordfeud Tile Tracker again.

I’ve been promoting it on the Wordfeud League of Honour site semi-regularly, and mentioning it to my opponents – well, the chatty ones anyway ūüėČ There have been 18 unique user logins in the past 10 days, and a total of 5709 (and counting) total page views to date.

I’d like to encourage anyone reading this to spread word about the site – I made it for people to use.

For those of you who haven’t yet dived in, here’s a fresh set of screengrabs to show how far it’s come since the last post:

Login screen Game list Game view - in progress Game view - finished game 

Positive and negative feedback is welcome in the comment section of this post!

52 Comments

Filed under Dev, Wordfeud

Zookeeper Battle – Another reason to root an Android phone

It’s no secret that I have a keen interest in video games – from large-production epic console titles to casual smartphone games, and everything in between. ¬†There’s a recent growing trend in mobile games, where a game is advertised as “free” but requires some kind of in-game purchase in order to unlock or make significant progress. ¬†This is really starting to piss me off, but I’ve managed to get something positive from this frustration, as a result of working around the crippled functionality of just such a game.

I’m a shameless addict of so-called “match three” casual games – the most famous example of which is probably PopCap’s excellent “Bejeweled”. ¬†However, I am currently hooked on¬†the cute art style and naff music delivered by the Zoo Keeper¬†collections of games, across several platforms, so I was delighted when I discovered Zookeeper Battle¬†for Android (and iOS). ¬†Finally I could play challenge matches with random strangers on the internet, and it was free!

Well, after the first few games, it seemed that all was not as good as I had naively thought. ¬†Only the first few blocks of game credits are free, and then the game is crippled. The game credit indicator is a bar with 6 spaces which are initially full. You start out with a few “power bottles”, each of which will completely refill this bar. ¬†Each game empties one of the spaces on the bar and, upon depletion, the bar refills one slot every 6 minutes, but only up to a maximum of 2 slots.

Since I enjoy this game so much, I would happily pay a few pounds for an unlimited version, but a browse of the in-game store reveals no such option. ¬†One can buy a single “power bottle” (to refill all 6 slots) for $0.99, 6 bottles for $4.50, or 14 for $8.50 – respective rates of $0.165, $0.125 and $0.10 per game. ¬†Really, $0.10 is the cheapest option to play this game. ¬†I regularly come up against opponents who have played several thousand games – does this mean that they have stumped up in excess of $300 to the mobile game gods? ¬†I sincerely hope not!

Being a little devious, I decided to have a poke around the files which this game deploys on one’s Android device (and, without getting into too much detail, this kind of thing is exactly why I chose Android over iOS for my phone) and found a very interesting XML file containing all kinds of data for the game. ¬†With a bit of experimentation, I was able to determine that, while most of the data appears to have been written to the file following a download from the game server, some of the elements are read directly from file – including the “number of game credits” field.

Following a very brief spot of Perl scripting using the incredibly handy SL4A¬†package, I now have a solid workaround for this game- (and wallet-) crippling “feature”, which is as follows. ¬†Note – this does require root on your Android device. ¬†If you do not know what this means then please Google – this particular post is not intended as a “how to root an Android device” tutorial.

  • Play until you see the dreaded “give us more money to keep playing” screen, and then hit cancel and quit the application. ¬†It’s important that you *actually* quit, rather than just jumping to the Home screen:

2013-03-02 23.11.12

  • Using your file explorer/editor of choice (or a command shell), update the permissions on ‘/data/data/jp.kiteretsu.zookeeperbattle.google/zk.dat’ to make it world readable and writeable:

2013-03-02 23.11.56

 

  • Fire up SL4A and create a new Perl script as follows. ¬†I saved this as “zkpatch.pl” – note, you only need to create the script the first time:

use Android;

my $droid = Android->new();
my $datafile = '/data/data/jp.kiteretsu.zookeeperbattle.google/zk.dat';

unless ( open FILE, $datafile ) {
 $droid->dialogCreateAlert('Error',"Failed to read file: $!");
 $droid->dialogShow();
 exit 1;
}
my @content = <FILE>;
close FILE;

unless ( open WRITE, ">$datafile" ) {
 $droid->dialogCreateAlert('Error',"Failed to write file: $!");
 $droid->dialogShow();
 exit 1;
}

foreach my $line (@content) {
 $line =~ s!<zk_cp>.*?</zk_cp>!<zk_cp>6</zk_cp>!;
 print WRITE $line;
}
close WRITE;

$droid->dialogCreateAlert('Done',"$datafile has been patched");
$droid->dialogShow();

  • Now execute this from within the SL4A app. ¬†It will show an alert if there’s an error opening or updating the file, and a confirmation if it’s successful:

2013-03-02 23.12.17

2013-03-02 23.12.27

  • Reload the game and enjoy your full credit bar!

2013-03-02 23.12.46

 

There you have it – a nice workaround for a stupid game payment mechanic!

Ideally, I’d like to wrap this up in a standalone application for Android, rather than using the Perl script. ¬†Also there is word that future version of SL4A will allow performing operations as root – this would allow me to set the target file’s permissions from the script for a more elegant solution. ¬†Until then, I’d rather take 10 seconds to perform these steps than wait 6 minutes to play another game.

16 Comments

Filed under Android, Dev

Automated Tile Tracker Beta!

The first incarnation of my automated tile tracker is now available to try out. ¬†I’m looking for people to beta test it and identify any functional problems, and to make any suggestions for features. ¬†Both forms of feedback may be left in the comments section below.

www.ardavey.com/tiles/beta/

Update: Moved to wf.ardavey.com

Here is the kind of thing you should expect:

Login page List of games Game details - incomplete Game details - completed

21 Comments

Filed under Dev, Wordfeud

Automatic Wordfeud tile tracking

As previously mentioned I’ve been working on a Perl library for talking to the Wordfeud game servers.

After having issues logging in to my own account, I’ve discovered that passwords on older accounts seem to have a fixed string appended to them. ¬†I have no idea why – the new account which I created with my API does not share this requirement, so I can only assume it’s some kind of legacy mechanism to allow users to have no password set.

Anyway, now that I no longer see a ‘wrong_password’ response on my own account, work can continue. My first project is going to be a simple webapp which will allow the user to view the board layout, their own rack and the remaining tiles for any of their active games.

Here’s the output from the proof of concept script I knocked together which does just that – just need to wrap it in something prettier now (and which doesn’t just have a hardcoded game ID!)

board:
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| N |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| U | H |   |   |   |   |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|   | O | R |   | H | O | W |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| L |   | A | X | E |   | E | F |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| O | D | I | U | M | S |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| G | I | D |   |   | P | A | C | T |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|   | D | E |   | F | A |   |   | I |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|   |   | R |   |   | s | K | I | D |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   | A | T | E |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
|   |   |   |   |   |   |   |   |   |   |   |   |   |   |   |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
rack: [WRNITBG]
remaining: [?AAAAAABCDEEEEEEEEGHIIIIJLLLMNNNNOOOOPQRRRSSSSTTTTUUVVYYZ]

Comments Off on Automatic Wordfeud tile tracking

Filed under Dev, Wordfeud

Wordfeud development

I play a lot of Wordfeud on various devices (online Scrabble-like game – imagine Words With Friends didn’t look like it’s for children), and I’m finding a disappointing lack of game tools out there. I’m not talking about cheat apps – there are plenty of those.

I’m interested in collating statistics and tracking my current games in progress – including counting which tiles have been played, current scores, etc. All of those kind of things are not classed as cheat tools – they’re the kind of thing you can do with a pen and paper.

Over the last couple of days I’ve started writing a Perl library to allow communication with the Wordfeud game server, as a first step. Once I have essentially written an API which provides access to all of the game client’s functionality then I can start writing some useful tools.

Everyone needs a hobby!

Leave a Comment

Filed under Dev, Wordfeud