I just need a quick pointer on how I can accomplish the following.
My game is free to play until a certain point. Then, I want the user to buy a level pack. But if possible, I also want to give away one-time-codes for discounts (even up to 100%).
The important thing here is that this levelpack should somehow magically extend the already existing game. Only if not possible I want to transfer a whole extended game again. But thats OK if there is no other solution.
The easiest way to extend my game would be simply by unlocking an otherwise invisible button that leads to another scene. But that would mean that the contents are already actually existent. But since the level packs wonât be finished by the time I release the game, I need another mechanism. A level includes several scenes, script updates, etc.
I donât wanna destroy the playerâs savegame when he downloads the extension.
So how can I do that? I know for example that Bloons TD5 does exactly this. But how? I never did anything with the Google Play Store.
If your game is not too big in size, just release the levels in a new update (Update the APK/OBB files). This is the simplest approach and unless your game is really big and complicated I would recommend this approach.
The alternative is to have your game load the âlevel packsâ externally - you would package your levels packs in to asset bundles, (âFreePackâ, âPremium Pack 1â, etc) - the game would download all packs available on the server - it would know to allow the user to load the FreePack levels by default, and would require a special IAP to unlock the other packs. This way, all you have to do is add an IAP to the store for âPack 1â, then upload the âPack 1â asset bundle file to your webserver. The next time the player restarts their game, the game will download the asset bundle and will show it in the game menu with a lock icon until the user purcahases the IAP.
Youâd have to write the code for the entire system above yourself. If you know what you are doing it isnât too complicated but probably still not worth it if your game is small.
So when the user downloads an update (letâs assume it contains the files for the new levels, but he didnât pay for them yet), his save will be preserved, right? I use the persistentDataPath on Android.
And what IAP library can I use to incorporate one-time discounts? Is there a de facto standard for IAP? Primary target Android, later iOS should be possible, too.
Yeah data is preserved between updates. You can use OpenIAB (Search github) to handle your IAPs on both ios and Android. You can ask OpenIAB for a list of the users (nonconsumable) purchases and check to see if theyâve made a purchase to unlock your level pack! If they have, then you can let them play. The purchase is bound to their iTunes/play account so even when the user uninstalls your app, the purchases will be restored by the system if they reinstall it. (âRestoring purchasesâ)
So OpenIAB seems like a good framework. But from my understanding it is not able to implement a discount system where a one-time-code will unlock a cheaper version of sth, is that right? I didnât find anything about discounts in connection with OpenIAB. Any pointer on that?
Maybe I need some intermediate currency that the user can buy. And the programmatically have him enter a one-time-code that will increase this currency? Is that a good approach?
Sure. You could even add a second IAP via GPlay or ItunesConnect to your game which is a clone of the level pack except 50% the price. Then just check if theyâve purchased either one before letting them play. Skyâs the limit here lol. Again depending on the size of your game it might be easier to do this instead of introduce an entire virtual currency system.
But no matter how I do it: how can I assure that a code is only used once (not per user, globally)?
Since I feel like I cannot configure anything serverside
There is nothing âbuilt inâ to either of the app stores (Play/iTunes). They do not offer one time codes. For a mobile game, it seems a little awkward to have to enter a code (How many games do that? I donât ever remember playing a game that does that). Do you need one time codes?
If you want one time codes, you will have to get knee deep in some PHP - write a server application that can verify a key code that has been sent to it. If the key is valid, it should consume it by deleting it from the database and respond to the request with a message that says that the key was valid. Upon receiving this success message, your app will now âallowâ the user to purchase the discounted copy of your app purchase.
If you donât want them to make a purchase and just want to give the item for free, you can âunlockâ the IAP for them for free but this unlock wont be associated with the Play/iTunes app store (because the user never actually made a purchase) so if the user uninstalls the app and reinstalls it, they wont be able to ârecoverâ their âpurchaseâ - a requirement on the iTunes store. (Though you are in a bit of a gray area with this voucher stuff)
SoâŚyeah⌠begs the question - is it really worth it?
My basic idea was to give supporters on kickstarter the possibility to download the future levelpacks for free. But for that, each one of them would need a one-time-code, otherwise they will just pass the key to their friends and nobody pays.
So what youâre saying is basically that discounts are not really possible except I would initially give more ingame coins than usual (but by which mechanism?)?