Overview
The following document shows
how to improve conversion from free to paid version of games, by
integrating OpenFeint in both the free and paid version of the app. It
discusses how to limit the free version to a subset of the full
leaderboards, achievements and challenges in the paid version. The same
technique can be used to enable specific social gaming features only
for users that have bought In-App Purchase packs.
Taking the Plunge : Registering your Game in
the Dev Dashboard
The OpenFeint development
dashboard is where you register your game and obtain a unique product
key and secret key to initialize the OpenFeint libraries. You should
only register one game with OpenFeint, even though you will have two
versions of it: one free and one paid. Using the same OF registration
for both the free and paid version of your game means that users will
be able to start playing the free version, earning achievements,
submitting high scores, while still having a clear migration path to
the paid version.
By using the same product
and secret keys from the dev dashboard in both versions, the paid-only
leaderboards and achievements will be listed in the free version, and
will help show there is added value in the paid version. Paid and free
version owners will be able to chat and engage in forums with each
other, where the paid version owners can help promote your game to
those using the free version. Free and paid version owners will also be
able to compare scores and achievements, highlighting the fact that
paid owners will have scores submitted to leaderboards and earned
achievements the free version owners can't have without upgrading.
Another benefit of using a
single registered OpenFeint game for both the free and paid version is
the in-dashboard promotion of games available with OpenFeint. By
filling the iPurchase info for their paid game in the dev dashboard,
both free players and paid players will be helping promote the game to
their friends through the developer dashboard and taking prospective
buyers to the paid version of the game in iTunes. The developer should
also create Featured banners and icons for the new in-dashboard
promotional tools in OpenFeint 2.4. These banners should target free
version players, enticing them to upgrade.
The Key is Careful Design
During design of your game,
you should carefully decide which features of your game are going to be
unique to the full paid version, and which features will be made
available in the free version.
For example, you could
release the paid version with 15 to 20 or more levels, and restrict
your free version to between 5 and 8 levels. Adjust this depending on
how many levels your paid game has. A puzzle game with a hundred levels
in the paid version could release a free version with 20 levels.
Splitting your levels like this means that when creating leaderboards
in the dev dashboard, those leaderboards that are only available in the
paid version should indicate so in their titles. If you are using
In-App Purchase in your game, you should also indicate which
leaderboards are only available to players that have bought your In-App
Purchase packs.
You should also think of how
you are going to distribute achievements throughout your game. The name
and description for the achievement should explicitly indicate if they
are available in the paid version only.
Careful naming of
leaderboards and achievements to indicate which are available only in
the paid version will help drive sales among free users. When
navigating the OpenFeint dashboard for your game, the paid-only
leaderboards and achievements will be listed in the free version, and
will help show there is added value in the paid version.
An example of how this is
handled is the game Gravity Sling by Riptide Games. The free game comes
with 19 levels, and has several In-App Purchase packs with 30 extra
levels each. The free version shows leaderboards and achievements for
each level in the In-App Purchase Packs in the OpenFeint Dashboard.
This shows players how much value there is in the In-App Purchase
packs, and is a great upsell incentive.
Coding Best Practices for
Easy Free to Paid Upgrades
After
you have designed your game and how you are going to divide levels,
leaderboards, achievements, etc. between your free and paid versions,
then comes the job of coding your game. Here are some practices for
organizing your code so that you can limit the free version to a subset
of all of your game's features.
Use Conditional Compilation
in Free to Paid Games
With conditional
compilation, you as developer set up portions of your code that only
run if a flag is passed to the compiler. If the flag is not set, that
segment of code will not be compiled into your game. You can use this
to limit game progression in the free version, by locking out levels,
leaderboards and achievements.
One way to set up
conditional compilation in your XCode project, is to create build
settings for each version of your app. Open your project in XCode, then
either right-click on the project icon (the blue icon at the top of the
"Groups and Files" pane) and select "Get Info" or click on the
"Project" menu and select the "Edit Project Settings" option.
This will open the Build
settings window. Select the "Configurations" tab. Every project in
XCode comes with "Debug", "Release" and "Distribution" configurations
set with some useful default values.
By selecting a configuration
name and clicking on the "Duplicate" button, you create a new
configuration that is a replica all the settings of the selected
configuration. For example, selecting the "Debug" configuration and
clicking on "Duplicate" creates a new configuration called "Debug
copy". This "Debug copy" has the same settings as configuration
"Debug". By creating a copy we can change the settings in the copy
without affecting the settings of the original.
Rename "Debug copy" to
"Debug Free". Duplicate the "Release" and "Distribution" configurations
and rename them, so that in the end you have "Release Free" and
"Distribution Free" configurations created.
Once you have created "Debug
Free", "Release Free" and "Distribution Free" configurations, click on
the "Build" tab and select "Debug Free" in the "Configuration:"
drop-down list. Type "preprocessor" in the search field next to the
"Configuration:" drop-down list, then look for "Preprocessor Macros" or
"GCC_PREPROCESSOR_DEFINITIONS" in the settings below.
Once you find this setting,
add "__IS_FREE_GAME__" to whatever other value you find for this
setting. That is, don't destroy any values that are set. Just add
"__IS_FREE_GAME__"at the end of the setting. In the example shown
above, the value "_DEBUG" was already set for this setting.
"__IS_FREE_GAME__" has been added at the end. Don't forget to set the
same "__IS_FREE_GAME__" value for this setting in the "Release Free"
and "Distribution Free" configurations.
Now that we have set the
"__IS_FREE_GAME__" preprocessor definition, we can detect it in our
game's code with #ifdef __IS_FREE_GAME__
The sample code below limits
submitting high scores in one leaderboard in the code for the paid
version only.
#ifdef
__IS_FREE_GAME__
//
do not submit a high score in leaderboard ID 12345 for free version
#else
[OFHighScoreService
setHighScore: score forLeaderboard: @"12345" onSuccess: OFDelegate()
onFailure: OFDelegate()];
#end
The sample code below limits
unlocking a specific achievement.
#ifdef
__IS_FREE_GAME__
//
do not unlock achievement ID 5678 for free version
#else
[OFAchievementService
unlockAchievement: @"5678" onSuccess: OFDelegate() onFailure:
OFDelegate()];
#end
Check In-App Purchase
Receipts in Free In-App Purchase Games
If you are using In-App
Purchase in your game, the code above is not what you should use. A
simple way to integrate In-App Purchase into your app, besides the
relevant In-App Purchase API calls, is to save a User Default in your
code for each In-App Purchase pack the user has bought. This way, you
can use simple code to check whether the user has bought an item, as
shown below.