Gamasutra: The Art & Business of Making Gamesspacer
View All     RSS
October 23, 2014
arrowPress Releases
October 23, 2014
PR Newswire
View All
View All     Submit Event

If you enjoy reading this site, you might also want to check out these UBM Tech sites:

How I accidentally gave away my game for free
by Ben Reynolds on 08/09/14 02:12:00 am   Featured Blogs

The following blog post, unless otherwise noted, was written by a member of Gamasutra’s community.
The thoughts and opinions expressed are those of the writer and not Gamasutra or its parent company.


I was watching a friend play my iPhone game today. Naturally, it's always satisfying to watch someone play something you've made, so I was feeling pretty good about myself.

That is, until he found a trick to unlock all the in-app purchases in my game for free. 

To make it clear, this is a game I recently released on the App Store after over a year of development time. After spending that much time working on a game, one might think the disastrous bugs would have been squashed by now. Nope, not a chance.

Here's the scoop: My game (Got Light?) is free to download, but usually costs $1.99 to get past a paywall after Level 28; this lets you play all 73 levels. Like all developers with in-app purchases, I included a "Restore Purchases" button in the game to let you re-unlock what you already paid for. When I was developing the game, I had this button activate the testRestorePurchases method in my code, which grants the tester the full version of the game for free, rather than the restorePurchases method, which asks Apple whether they've paid. You can see where this is going. As fate would have it, I forgot to switch out the test code before I submitted the game. 

As a result, you can open my game, tap on Restore Purchases, and then BOOM, you just snatched a $1.99 game for free.

Got Light Full Game Unlock for Free Screenshot
Why am I writing about this? To share a lesson learned: stress-test your game. Especially with something as important as monetization. The problem was literally one line of code. The Restore Purchases button is fairly out-of-the-way in my app, so I didn't catch it when I was just playing the game out of habit.
It's also great if you have a lot of playtesters, especially the type of people who love to break things. Friends typically aren't great playtesters because they give you sugar-coated feedback, but if you have "that one friend who always tries to find loopholes in everything" you should definitely have him or her take a look at your game. They'll enjoy breaking it, and you'll enjoy not releasing a broken version of your game.
I've submitted an update to Apple that will fix the bug and prevent these downloads, but until the update is approved the loophole still exists.

This one's on me.

Related Jobs

Square Enix Co., Ltd.
Square Enix Co., Ltd. — Tokyo, Japan

Infinity Ward / Activision
Infinity Ward / Activision — Woodland Hills, California, United States

Senior Sound Designer - Infinity Ward
Treyarch / Activision
Treyarch / Activision — Santa Monica, California, United States

Multiplayer Level Designer - Treyarch
Nexon America, Inc.
Nexon America, Inc. — El Segundo, California, United States

Localization Coordinator


Matías Goldberg
profile image
Another lesson to learn is always put this kind of code behind a macro like "#ifndef MY_GAME_RELEASE_VERSION"
and use this same macro to add a watermark to the final game "i.e. #ifndef MY_GAME_RELEASE_VERSION printOnScreen( Alpha build INTERNAL ONLY ) #endif"

This way you won't forget as easily to flip the macro when you deploy the release version to the market.

Ben Reynolds
profile image
Great idea about the watermark! I've decided to use a macro in the future to keep this from happening, but I hadn't thought of adding a visible reminder.

William Pitts
profile image
That can happen when you are so focused in getting the game done and out. You should always have a checklist and double check everything yourself before final deployment (especially the fields which are supposed to provide funds for you as the developer). You would have had to get to that point first, of course...

John McMahon
profile image
I'd say have someone else aware of the project and code, but not tied to getting it released as soon as possible. Otherwise, you'd still run the risk of rushing through it.

Alan Barton
profile image
The next lesson to learn about making mistakes like this is ... DON'T TELL ANYONE! ... that is until AFTER its fixed!.

News is spreading of your mistake and the availabilty of your free game. Soon it'll be on app download sites. e.g.

At this point you should be using the double facepalm image, when one facepalm isn't enough.

Florian Putz
profile image
But this way the game gets attention it otherwise wouldn't have. Probably cheaper than any ad campaign... For the download sites: Pretty much any game gets there sooner or later.

Alan Barton
profile image
It would still get the attention, but waiting to tell anyone would damage limit the spread of the free version.

I have to say, I do feel sorry for him because its a big worry releasing a game because of the potential to make mistakes in the monatization side of a game.

Javier Degirolmo
profile image
Going by the last paragraph in this post, it sounds like he just gave up on it in the end :/

Ben Reynolds
profile image
Hi Alan, I decided to release the mistake earlier rather than later as an experiment to see whether the publicity would positively or negatively affect sales. This is a hobby project of mine rather than a main source of income, so I'm content to run experiments like this to satisfy my curiosity.

Alexander Jhin
profile image
Sorry this happened to you and thank you for sharing. I'm curious if the publicity from a limited time free game won't actually amp up downloads and, thus, future sales? If you see any interesting trends, would you mind posting a follow up blog post?

Ben Reynolds
profile image
Thanks - and yes, so far this has shown a temporary improvement in downloads, though I've yet to see if it will improve sales in the long-term. I'd be happy to follow up in the future after I've seen more results!

Shay Pierce
profile image
The #ifdef solution (or some other approach to conditional compilation) above is the best solution to this - make it impossible to forget, with "real" versions of the game getting built with the correct code.

Sometimes that's not easy or possible, though. In those cases, I maintain a "release checklist" for my game; every time I add something like this to the game, I go add something to that checklist like: "check that testRestorePurchases method is not still used".

When I prepare a release of the game, I go through that checklist. Then, I go through it again.

Whenever I'm afraid something might be forgotten before we go live, I add it to that list, and then I don't have to worry that I might forget to change it back. Obviously this is a common practice on large teams/projects... but it can be a lifesaver on one-person projects too. Even simple games have more moving parts than people realize, and you can't expect yourself to remember every detail.

But yeah, none of this is a replacement for a thorough QA process.

Ben Reynolds
profile image
Great, thanks for the tips! This is the first major game I've released, so I keep learning new things I need to focus my attention on. I'll definitely add this to my checklist for the next game I work on.

Joe Chang
profile image
Yeah I agree with Shay - a simple set of pre-release test cases will go a long way. It may seem boring but it is totally worth while. Btw stress testing usually relates to performance testing, e.g. testing an app to breaking point.

Ben Reynolds
profile image
Ah, maybe I didn't use the correct jargon - thanks for the comments!

Ennio De Nucci
profile image
Clever marketing idea dude.

I'm starting to feel a bit annoyed by the need to create "a story" around your games to get them noticed. Stories that most of the time have nothing to do with the game...

I'm not criticizing anyone, it's just a thought

Roberto Caldas
profile image

Ben Reynolds
profile image
I agree that it can be annoying how difficult it is to get a game noticed. In my case - as a new indie developer with no prior games - I'm looking for any opportunity to get my name out there. I'm willing to share any personal blunders and lessons-learned if it helps raise awareness of my existence as an indie dev. Any thoughts?

Eric Ruck
profile image
You don't release any applications that compile with warnings, of course. Right? Then along with your watermark you can do this in your Objective-C:

#warning Turn Off Tester Mode

I actually use something like this for my enterprise code because I often point to mock data when I'm developing, and promptly forget to point back to the dev server or prod server when I release a test build to the internal clients. The #warning has certainly cut down on that quite a bit.

Mike Reddy
profile image
And the 'rigorous' Apple testing didn't pick this up…