Search Unity

A Universal currency for all my games?

Discussion in 'Scripting' started by 8Eye, Nov 22, 2014.

  1. 8Eye

    8Eye

    Joined:
    Oct 11, 2014
    Posts:
    40
    I have an idea to implement a currency that can be used to buy/upgrade things across all my games but i have no idea where to start or whether it is possible. If anyone knows how to do this please reply!
     
  2. Rutenis

    Rutenis

    Joined:
    Aug 7, 2013
    Posts:
    297
    If you want to save the gold that you currently have, just use PlayerPrefs, This will save the gold and work after quiting the game.
     
  3. Stoven

    Stoven

    Joined:
    Jul 28, 2014
    Posts:
    171
    I think the concern is more or less how the data can be used across multiple games as opposed to handling the storage of currency within each game.

    Consider storing the data to an online player profile where each game allows the user to log in to this profile and perform transactions on the currency.

    I'm actually making attempts to learn how to do this myself, but for a slightly different purpose.
     
    Last edited: Nov 22, 2014
    Suddoha likes this.
  4. Suddoha

    Suddoha

    Joined:
    Nov 9, 2013
    Posts:
    2,824
    I agree with Stoven, you need some kind of online database/profiles to which the players have access with an account though all your games.

    A slightly different approach would be to have a manager in all your games that retreives data from a file which is shared among all your games. You could then allow the player to get your currency through each game and add it to the local file.
    But once someone finds out how to edit it, he will be god in all your games and might as well share that. :p
     
    Stoven likes this.
  5. 8Eye

    8Eye

    Joined:
    Oct 11, 2014
    Posts:
    40
    I am having a look at the Google Play api now and i found out you can save and load data to and from the cloud. Now i just need to see if there is a way to get information about the current users games library and if he has one of my games.

    It would be quite an awesome feature to have this and would be a great way to gain revenue from your games that you worked so hard on completing, that is why i am determined to get this working!

    Suddoha, you are right about the cheaters but, i think if you secure the data inside the cloud if you are using GPG then i don't think it will be easy for them to do any cheating. Maybe im wrong i don't know much about these kinds of things yet :(.
     
  6. Stoven

    Stoven

    Joined:
    Jul 28, 2014
    Posts:
    171
    Suddoha was referring to data sharing between applications on the same device without using the internet when he was talking about cheating.

    I don't know of how safe GPG is, but at the very least it has a reasonable layer of protection (user login/password).
     
  7. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    If you're talking about just an ingame currency for gameplay purposes, then just look into saving.

    If you're talking about a "premium" currency for Real Money Transactions then you need to start bringing an externally hosted database, and managing security. otherwise hackers will just give themselves (and everyone else) tons of free gold, and give you no real monies at all.