28 December 2011

Monkeying with the Pirates

So one of my main concerns with this latest update of Bakers Game is the cost. The marginal cost of a solution is practically zero - and so is its utility. This forces the cost per solution downward.

There are other considerations involved beyond a pure profit from Bakers Game, of course. As a technological demonstration it will be a nice feather in my cap. It will tie a lot of disparate programming elements together to make a nice personal challenge. I can use it as a geek shibboleth at parties. However the costs have to be kept down.

The main problem with costs will be piracy. Bakers Game has already been hacked and is available on various and sundry Chinese hacker sites. Some of them charge 99 cents up-front for the cracked version (sigh). If any idiot can download a cracked version and dump a boatload of solver requests against my EC2 instances my utilization spikes and my wallet empties. Securing the requests with encryption is pointless - it would restrict me to US and Canada sales only (stupid export restrictions), and the Chinese would simply drop some coin to acquire the key. I would see one sale and then a million solver requests.

So if the set { app , phone , user } cannot be trusted, there are only two things left to trust. I can trust myself and the servers I setup.

The user will purchase solution credits via Apple's In-App purchase. The app sends the receipt over to my servers - and my servers can establish their own channel to Apple to verify that the receipt is valid. If the receipt is valid the user is credited - and the credit amount is stored on my servers. Sure, the user gets a copy - but the official record is on machines under my control. The app then receives a randomly generated token from my servers for each purchase, and this token must be sent for any request.

What this means is that some enterprising hacker group will purchase solver credits and embed the resulting token into their cracked version. Anyone who downloads their cracked app, though, plays in the same sandbox as EVERY OTHER pirate. My problems are solved - I'm selling solution credits rather than unlimited access. The more pirates the faster the credits are expended for ALL of them. But it's also fair if one of the pirates opts to go legit - the purchase of credits generates a new token sent only to that phone!

More posts on the architecture will follow, but meanwhile ... keep coding!

18 December 2011

The monkey breaks the silence

So it's been quite awhile since the last post. Let's remedy that!

It's time to update the Bakers Game application. There were around 1,000 folks who downloaded version 1.0, which was absolutely fantastic for it being my first app. This has increased to around 4,000 for version 2.0 - with around a 65% conversion ration (updates from version 1.0). Interestingly, there are still some updates trickling in even today!

Upping the game brought bug fixes, more game boards, a cheat mode, and card animation. So it looks a lot like the other card apps out there no, except, of course, my app is still free and ad-less! And there are still very few solitaire games available that guarantee a winnable board. I find this strange, as it is not all that difficult to build such boards. I spent about $20 on Amazon EC2 - surely Big Company Inc can swing that!

So version 3.0 has to bring an even bigger change to the table ...

*** SHOWING YOU HOW TO WIN! ***


Let's be honest - there's more power in my 2nd generation iPod Touch than ever there was on a Commodore 64, but still nowhere near enough. Heck - there isn't even power on my 2.8 Core2 Duo except that I traded memory for speed - an option not available on a simple iPod, and not available even on the new iPad. However, there is an "always-on" Internet connection - and Amazon AWS services cheaply available.

The present planned architecture is going to use Amazon's Elastic Beanstalk to run the front-end processor, reserved EC2 instances for processing, SQS to move requests from the front-end to the processors, SNS so that the components can tell each other of jobs & solutions, and S3 as a backing store. The app will simply submit a request to the front-end, obtain an estimated callback time, and check back periodically.

Expensive? Hardly - the entire thing should weigh in at less than $100 per month.

Profitable? Hardly! All prices eventually get pushed down to just over their marginal costs, and the marginal cost of solving a board is INSANELY low. That said, I haven't run a market analysis so anything is possible.

DDOS attacks? Amazon should take care of that for me. It's doubtful anybody's going to start up their own EC2 instances to assault mine.

Piracy? Heh heh heh - bring it on! This one I've got solved - to the detriment of anyone using a hacked Bakers Game. I'll post more on this one because I think it's an excellent Akido throw to be executed in software.

Time to start coding ...

21 April 2011

Why would pirates steal a free app?

The refresh of Bakers Game Solitaire was released Monday evening.  By the very next day, Chinese hackers tore into the code, hacked it, and posted it on their site.  No - I'm not linking to it.  It's easy enough to find, if you want to pay the hackers $1 for my app.

The pirates' web site is, at least, amusing:

• "You may only download this app for evaluation purposes" - because you certainly wouldn't want to evaluate the free and legal version
• They prominently display my name - free ads for me
• They provide a convenient link to my app on the Chinese iTunes App Store - more free ads!
• And, apparently, it's not only English where they have spelling problems - h4x0rs sux!

My app download numbers are up, too.  Part of this may simply be the refresh and some chatter, but I think I also have to credit the pirates.  I don't read and write Mandarin, so their conversion of my English into Chinese is most welcome.  The pirates are building a buzz around my app that I would ordinarily have to pay decent coin for.  Hey, this app is worth stealing!  Even though it's free with zero distribution costs - it's still worth stealing!  The hackers are even paying for disk and bandwidth!  Whoo-hoo!

Now I'll freely admit I placed no anti-hacking / anti-piracy code in my app.  So cracking Bakers Game is a task easily done by the greenest of code monkeys.  But consider this - the time they wasted on my app is time they didn't spend cracking any other app.  Without any anti-hacking code, there's nothing there for the hackers to learn from.  It was nothing but a giant time suck.

At the end of the day I have more downloads, an amusing blog post, and I've delayed the pirates' hacking of other apps and content.  God I love winning!

Keep coding!

15 April 2011

The Waiting is the Hardest Part

It was 11:00 PM on 8 April that the refreshed Bakers Game went to Apple for review.

It is still awaiting that review.

Fortunately I've managed to keep busy.  I've identified a couple of ideas for new projects and selected one. I've pulled down the data necessary for it.  I've got some code written, and the code has spawned newer ideas.  One mega-project has now suddenly morphed into two mega-projects.

And still I find myself refreshing the "Waiting for Review" page.

It's not like this is my first rodeo.  I had one app take two weeks from submission to publication.  I've witnessed apps from other developers taking months.  One week is nothing.  It's a feeble drop in the bucket, especially when you see hundreds of apps going live every day on the App Store.  You just know your ticket number probably resembles this year's deficit figure.

BRB ... nope, still "Waiting for Review".

I've a ton of work to be done on my advertising campaign for Bakers Game.  I've got copy to write, I've got reviews to solicit, I've got to select my targets, and I've got to finalize my budget.  If Apple suddenly approved my app today I would be woefully unprepared.  It's not a bad thing they've taken this long; I've been very bad about getting my stuff together!

There just aren't enough hours in the day to get everything done.

But there sure would be more if I wasn't "Waiting For Review".

08 April 2011

Monkeying about with Amazon EC2

There are a lot of new boards required for the Bakers Game refresh. And I do mean A LOT. We're jumping from about 5,500 easy boards to 12,000. And we're more than tripling the number of standard boards - and it's the standard boards which take FOREVER to compute.

So I needed processor power - gobs of it.

And thus Amazon steps in. Amazon rents out processors by the hour, and for cheap! For 17 cents an hour I can run two solvers on Amazon's hardware, so although their hardware isn't as fast as mine, they have much more of it. And solving winnable boards is practically Parallel Programming 101 ...

I've been running the solvers now on Amazon's hardware for about 72 hours. And in that time I've managed to generate more than enough easy boards and am nearly complete with the standard boards. And for just a little over $22 - which includes my experimentations, too.

With any luck I'll be able to wrap everything up and post for Apple's review team this weekend! Follow me on Twitter (@lgehrig1) and you'll see exactly when.

Keep coding!

06 April 2011

The Bakers Game Refresh

It is time to update you with a few of the changes you're going to see in the refresh of Bakers Game:

1. Game state will be saved
If you exit the game the current state will be saved. I hadn't quite figured out the NSKeyedArchive bit on the first go, but it turns out that it's really quite simple. You'll be able to keep playing your game even if interrupted by a phone call. By far, this was the #1 most requested change.

2. Vastly improved UI
It was impossible to tell which card you'd hit in version 1.0. This wasn't a major flaw, but all the other card games highlighted or "glowed" the card that had been hit (or the stack that had been hit). I went a different route; having no initial success on the "glowy" graphic front, I threw in some placeholder animation that simply expanded and contracted the card's graphics. And this looked WAY cooler than any glowy-based graphic, especially when an entire stack is selected! You'll be pleasantly surprised at the end result.

I've also animated the card transitions so you can watch them flow from the tableau to foundation, etc. It's much better than the current "freeze-tag" interface.

3. Now a Universal app - play on the iPad in native resolution
I wasn't thrilled with the way the game looked in the iPhone emulation mode so I've rebuilt the app to support both the iPad and iPhone. It will even support orientation changes for the iPad.

4. More guaranteed winnable boards!
The game will still be free, but there will be 2,500 standard boards available, and 8,000 easy boards - all of which can be won.

5. Did I mention more boards?
For a mere tier 1 price (that's 99 cents for North America) you can expand the number of winnable boards to 5,000 standard and 12,000 easy. Plus, with your purchase, comes ...

6. Cheat mode - never lose again!
Only available with the boards package purchase - draw a big "C" on the screen with your finger and a card will be moved from the tableau to the foundation. Unlike most other Solitaire games, I don't track the cheats. It's a computer game - if it's not fun then people won't play. If you back yourself into a corner it's entirely your choice of retracing your steps or moving a wall, right? It's Solitaire! Who's going to care?

7. That other cheat thing - yeah, that's disabled
The move counts will not stray into negative territory. Sorry. THAT was a bug.


The new application should be heading to the Apple reviewers sometime next week; the code is done but I'm still constructing the winnable boards. I will be using the Amazon EC2 services cloud computing resources to blow through the rest of the searches - for less than $20/hr I can purchase resources equal to my home computer running for a day. I'll definitely be blogging my adventures there!

Keep coding!

25 March 2011

Faster than 200 monkeys per hour

"Sprouts - A Game of Maths!" was released very late Wednesday night; it is my third app to be released on the App Store.

Following my marketing monkey mantra, I hit Facebook, Twitter, forums, etc. and finish that night's work a little past midnight.

Thursday morning I login to check my app sales.  Sprouts opened at 16 - for historical comparison Bakers Game had opened at 20.  Bakers Game does it's average - only 3 sales, but it makes those sales consistently and every day.  Since Sprouts has opened exactly to Bakers Game's levels, I make my notes in my spreadsheet and go back to work.

Friday morning I'm working on one of my hopefully more lucrative apps.  It's going to be universal, so much of the day is spent trying to shoehorn my awesome iPad layouts into a 320x480 shoebox.  With some success, some annoyance, and some cursing.  But anyway, I don't check the sales until the night.

Thursday sales, for Sprouts, were 242.

242.

This calls for a check of the App Store!  And there I learn I've broken the Top 200 on Puzzle Games.

242 sales, 196th ranked.

This I had not expected.  It is amazing.  It's a measure that I'm on the right track, that I can trust my instincts, and that I should keep going with this experiment.  It also means I've got to get more apps out there!

So, many many thanks everyone who's downloaded any of my apps!  The future will not disappoint!

23 March 2011

Your Kung-Fu is weak, Young Monkey!

So the ghost of programmers past has paid me a visit.

I am replicating an analysis piece that I had written back in high school.  I have some of the original outputs generated but none of the original code.  And as we'd be talking Pascal on the Commodore 64 vs Objective C on the iOS platforms, I could care less about original code.

There is, however, a trick on the analysis.  I distinctly remember completely glossing over the problem when I was a teenager - it was a complicated problem, it didn't lend itself to a quick answer, it was going to be icky code ... WHINE WHINE WHINE.  I threw something in to approximate the correct answer and moved on.  As the output was really only for myself and an immediate circle of friends I thought this was an acceptable answer.

Unfortunately, when code monkeys take shortcuts, real people end up becoming monkeys.

The whole point to a computer program running calculations is ensuring the end user doesn't have to.  The computer SHOULD BE the monkey - it can run the numbers much faster, and to a greater precision, than any other primate.  Worse, when the calculations might take a human tens of minutes, the human will "guess-timate" and apply emotion in place of logic.

How many computer programs can you think of where it's clear that the programmer decided to get a latte instead of spending some extra time to finish the job properly?

How many times have you done calculation tasks FOR the computer instead of ON the computer?

Want a banana?

So ... it took around 2 to 3 hours to write that tricky piece of code last night.  About half that time was spent staring out the window trying to wrap my head around the next part of the problem.  I think the end result is pretty cool - it appears as effortless and graceful as a samurai's kata and will be about as difficult as one to replicate.

Truly, some excellent kung-fu.  Take that, young-code-monkey-me!

22 March 2011

Marketing Monkey

There sure are a lot of alliterations that can be done with the letter M.

It was high time to begin focusing on the marketing side of the independent coding experience.  My third app has gone into App Store "limbo" and is awaiting review.  I've asked for licensing information for my next hopeful.  And I've passed 600 downloads on "Bakers Game" - which is quite amazing since I've done no marketing yet!  So ... market, monkey, market!

LinkedIn ... Facebook ... and Blogging - oh my!

There are two projects currently sitting in my hopper: an update to Bakers Game and a new project for BattleTech.

Bakers Game really needs a refresh.  I still find myself playing it immensely on my iPod, which is good - if it becomes boring for me it certainly will be boring for everyone else.  Unfortunately, it looks like monkey poo on the iPad.  The user interface needs some cleanup, such as responding to touch & move events and perhaps animating the card moves (now that I've learned how to do it!).  An update should also include more winnable boards.  And I've also decided that the winnable boards should be solvable in realtime on the hardware - this way a button can be given to "hint" the user to the next move.  So I'm thinking a few thousand more winnable boards, and for $0.99 a few MORE thousand winnable boards & a brain.

There's a refresh to the BattleTech rules being published in a few days.  So I've certainly missed the initial boat on releasing an app here.  On the other hand, there's no reason to despair.  While monkeys don't float, they can wait for the next ferry.  I completed a nice proof-of-concept last night and sent away this morning to inquire about licensing.  Nothing to do now but wait.

Keep coding!