Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Some qeneral questions about mobile, IAP and saving

Discussion in 'Getting Started' started by antiReady, Jul 27, 2016.

  1. antiReady

    antiReady

    Joined:
    Sep 18, 2013
    Posts:
    28
    Yeah... I have never worked on anything mobile related so I have a few basic questions I need to wrap my head around.

    Let's say I have a game where you can earn gold by playing the game. You could also use IAP to buy more gold with real Money if you don't want to grind it ingame.
    The implementation of IAP seems quite straight forward from what I can tell (plenty of examples and such) - but what about saving the users current gold amount? Is that simply saved in the playerprefs or any other local save method like you would do in any desktop game without IAP?
    If so, any IAP purchases are basically bound to the device you used to buy the item... Or does the play store/appstore provide some kind of way to identify users (and their bought items) by their store account? It's not even that dramatic when its "just" virtual currency but what if you have unlockables like hats in TF2 or additional characters and whatnot. Is it standard practice to just have it bound to the device you're using?

    I'm quite a noob when it comes to mobile games and cellphones to be honest.. I never really played mobile games and have never bought stuff in an app so I really have no idea how it's usually done in any other app.
    And if it's generally "ok" to have your gamestate bound to a device, I would rather not have to implement any user account system to identify accounts. Having people to register an account somewhere is always a hassle (and potential turnoff) and also extra work to maintain and to make sure such data is safe -_-

    Thanks in advance :)
     
  2. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    I don't recommend storing anything in PlayerPrefs you don't want the user to be able to modify.

    Unfortunately (and speaking only for iOS), I don't think there's a built-in way to save things like player currency or inventory or things like that. I'm pretty sure most games have their own system where the game contacts a secure server that keeps track of persistent details for specific players.

    GameKit provides you the player's unique id, so you can use that to reference their account. Make sure you read Apple's guidelines (or Google's if you're just doing Android) and be sure you're not violating the rules by saving information you're not supposed to.

    Can I ask... If you don't play mobile games, why do you want to make one?
     
  3. antiReady

    antiReady

    Joined:
    Sep 18, 2013
    Posts:
    28
    Ok, so I have to use some kind of cloud service like Google Play Games Service or something similar for Apple (I suppose google requires you to use a google account regardless of your operating system. Seems like a bad idea to use a google service on IOS).
    Looks like I have quite a bit of research to do

    I want to make a mobile game because its generally way easier. You can make a restively simple game for mobile devices whereas pretty much nobody would want to play such games on PC (due to their usually simple mechanics). After about a dozen or so unfinished unity prototypes over the years it would be refreshing to finally finish something :D
    Besides, its always fun to learn new stuff. :)

    Any tips or advice on what service to use would be appreciated
     
    Last edited: Jul 27, 2016
  4. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,510
    Okay, as long as you're doing it for fun. Your talk of IAP suggested you expected to make some money off your efforts, and that's a tough nut to crack, there.

    You don't have to use Google Play Games or Apple's Game Center, but they're tools available to you in order to provide commonly needed services including realtime or turn based multiplayer, matchmaking, achievements, and leaderboards. It's also nice to be able to make a call to the GameKit (Game Center API) to bring up the interface for doing these things instead of having to write and build it all out yourself.

    That being said, there are limitations imposed by using these services. I haven't done anything with Google's business yet, but I assume it's similar to GameKit where the data you pass around has to be in a certain format, can't be over a certain size, etc. Additionally, there are the privacy restrictions you must abide by. But it's all generally worth it in order to have access to the integrated services.

    There are also alternatives like Unity's multiplayer offering that provide some of these services. I imagine they're a bit easier to integrate into your Unity project, but they're also (I think) generally paid services.
     
  5. antiReady

    antiReady

    Joined:
    Sep 18, 2013
    Posts:
    28
    Nah, money is not my main motivation. Though, it wouldn't hurt to earn something with it either - at least to cover the yearly fee for the Apple account and one time fee for the Google account. A polished and visually appealing game shouldn't do too bad. At least that's what my common sense tells me when I compare my concept to the countless S***ty (or at least ugly) games available :D

    So anyways... I don't really want to write my own user management system or database for savegames, leaderboards and achievements. I guess I'll read up on gamekit and the likes when I get home tonight.
    Multiplayer is not really important in my case since there is an element of randomness to my game.

    This stuff could turn out even more complex than writing my gameplay mechanics haha
     
  6. JoeStrout

    JoeStrout

    Joined:
    Jan 14, 2011
    Posts:
    9,840
    That's the truth. My boys and I are wrapping up a game now that has rather simple mechanics, but we're pulling out all the stops on the metagame — coins, bonuses every 8 hours, cosmetic upgrades, rewarded video ads, network high scores, etc. All this takes much longer than the game itself. But, it's what players like... it keeps them coming back, and that's what makes for a successful mobile game.

    (Or so I've been told... check back with me in 6 months to see how it turned out!)