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.

Question Accessing global data

Discussion in 'Cloud Save' started by Ronso007, May 6, 2022.

  1. Ronso007

    Ronso007

    Joined:
    Apr 21, 2019
    Posts:
    4
    Hey everyone,

    I stumbled upon a problem while trying to think how to implement something into my game.

    I want to be able to create global data that can be accessed and modified from the cloud code enviroment( it's not linked to any specific player) and be securely protected from client side read/write.

    this is a must for me and I haven't seen any thing like this on here.
    And couldn't figure out if next month when releasing the new version there will be any mentions on that note.

    Thanks,
    Ron
     
  2. MariusUrbelis

    MariusUrbelis

    Unity Technologies

    Joined:
    Mar 15, 2015
    Posts:
    21
    Hi Ron,

    That is a great question. We are definitely aware of this potential opportunity and are planning to look into it. However, there is no clear timeline at the present moment.

    We are thinking about this in two parts:
    1. The ability to change things from Cloud Code that can't be directly changed from the client.
    2. The existence of data that is not tied directly to a player.
    It would be great to learn more about what it is you would do with this so we can make sure that it is considered when we build this.
     
    Ronso007 likes this.
  3. Ronso007

    Ronso007

    Joined:
    Apr 21, 2019
    Posts:
    4
    Hey Marius, Thank you for the fast reply!

    I want to do some kind of global data that represent average time to finish a level in my game. and give a player a score against the average time. (the faster the higher the score).

    The thing is,
    that I *really really* love the simplicity of everything else like economy, auth, remote config ect...
    but this one thing really force me to leave to something like firebase :< (the data will be there, that means that cloud code be as well, that means that auth will be as well and so on)

    :(
    Thanks,
    Ron
     
  4. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    You could use Remote Config to provide a server-side value for the current average time to finish a level. Customers would read but not write to this value https://unity.com/products/remote-config
     
    Ronso007 likes this.
  5. Ronso007

    Ronso007

    Joined:
    Apr 21, 2019
    Posts:
    4
    Hey Jeff,
    Correct me if I'm wrong

    1. I think remote config can accessed by the client to read. I don't want that possibility.
    2. Can I change the remote config number from cloud code for every player that finish the level (to change the average)
    3. I believe the purpose of remote config is a bit different. I really want a global data that I can be modified and accessed only from server side and I want to dynamically create this data because I will have a lot of levels.

    Thanks,
    Ron
     
  6. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    How do you plan to find the average time per level across all users? Granted I'm not entirely familiar with cloud save, I'm probably looking at this problem from standard client code, sorry about that. The client normally would need to know this value to compare their score to a global score. Your point is taken also how to automatically update the RC value, but it could be done via the RC REST API.
     
  7. Ronso007

    Ronso007

    Joined:
    Apr 21, 2019
    Posts:
    4
    Hey Jeff,

    Finding the average time is the easy part if I could have global data.

    Each time a player finish a level than I will call the cloud code And save his personal time, I will compare it to the avg time and then recalculate the new average ( I only need to have the average, and the number of players).

    What the player in the client side get is not the average, but a percentage of success in that level that I calculate with formula against the average(avg should be a secret)

    My questions that this discussion raises for me are:
    1. Can I securely access remote config from cloud save only And not from client?
    2. Can I dynamically create new remote config data from cloud code?
    3. Can I use the API you mentioned in cloud code?

    Thanks,
    Ron
     
    DavidZobrist likes this.
  8. JeffDUnity3D

    JeffDUnity3D

    Unity Technologies

    Joined:
    May 2, 2017
    Posts:
    14,446
    Interesting use case, we will look into this!
     
    DavidZobrist likes this.