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

In which of the systems is it advisable to save stats data?

Discussion in 'Game Foundation' started by fredrod01, Sep 8, 2020.

  1. fredrod01

    fredrod01

    Joined:
    Jun 22, 2018
    Posts:
    3
    In which of the systems is it advisable to save data such as: last level reached, total games played, total enemies destroyed, etc.?
    This data could be in a system like the currency system easily updateable from the code, but it is not currency.
    I can't find a stats system, I'm using Game Foundation version 0.6.0 preview 2.
     
  2. fredrod01

    fredrod01

    Joined:
    Jun 22, 2018
    Posts:
    3
    Hi @mingz-unity:
    In the "Game Foundation 0.6.0 is Released" thread, i think in a similar way to @lorddesu, without over thinking about concepts like the Game Foundation designers do, what I need as a Game Foundation user and game developer is to be able to save modifiable values from the code that are relevant in my game particular and persist, even if they are not currency or inventory items.

    For example, in the achievement system I want the player to receive a reward for destroying 1000, 10000, 25000 and 50,000 enemies, I have to save the value of enemies destroyed somewhere and that it persists.

    The same happens if I want to save the value of the last level played by the player to be used by the level selection system, it must be able to be saved from the code and persist.

    I think you call it global stats.

    It does not make much sense to use Game Foundation for some data and another solution for the other data.

    By the way, Game Foundation is amazing.
     
    erika_d likes this.
  3. mingz-unity

    mingz-unity

    Unity Technologies

    Joined:
    Oct 12, 2017
    Posts:
    62
    Hi @fredrod01 - In earlier versions of Game Foundation, we introduced stats as a concept for items that works locally. As we transition to be full-stake (i.e. supporting backend and cloud services), we need to re-implement a new stats system for the use cases you described.

    In the meanwhile, based on the use cases you described, Currency is actually the best system to implement these, as surprising as it may sound. If you can bypass the 'perception' of what currency system sounds to you, the underlying implementation of that system would allow you to support stats data persistence really well, both locally and remotely.

    To differentiate the 'stats' type of concept from the true Currency however, you can consider using the Tag feature we provided, for example by labeling currencies as 'PremiumCurrency', 'SoftCurrency', and 'Stats'.

    This will allow you to sync stats with backend (using the CC adapter which we provide an out-of-box reference implementation).

    Hope this helps, and let us know if you have other questions or feedbacks. We'll update you once we are closer to provide the new stats system.
     
    saskenergy, erika_d and fredrod01 like this.