Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Nucle.Cloud]Backend service solution (users, leaderboards, events, etc...)

Discussion in 'Assets and Asset Store' started by elseforty, Dec 5, 2022.

  1. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    289
    Hi,
    I've spent quite some time recently developing a backend service solution that perfectly fits my Unity 3D projects. The goal was to come out with a powerful solution that I can use in all of my Unity 3D projects while keeping it user friendly to the max. The whole point of building this is to save time .

    I've shown this solution to other devs in the community and they proposed to me the idea of developing this solution by adding more features and making it available to the public.

    so i've built this generic backend that can be used in any unity 3d project and put that into a server, on top of that i've created an API for the unity 3D applications to communicate with the server. There is the nucle cloud unity 3D library that can be used in case http client code is too complicated when sending API requests calls, this will help getting a lot of things done in a few lines of code.

    What you can do with nucle cloud,

    User authentication for:
    • Anonymous users.
    • Real users.

    For Real users,
    • Send custom emails for Email confirmation
    • Send custom emails for Password reset
    • Customized password pattern
    (emails will be sent from noreply@nucle.cloud)

    Localisation
    • Approximate user localisation is automatically collected

    User Variables:
    • Create user variables of any types (integers, floats, bools, strings, or text)
    • Perform read, write, delete

    Request Leaderboards which are just lists of variables,
    • Sort by High to low , Low to high , newest , oldest
    • Request global leaderboards
    • Request leaderboards by country
    • Apply pagination

    A/B Testing
    • Perform global A/B testing
    • Perform A/B testing by country

    Events
    • Measure anything in your Unity 3D games by Triggering events and view charts on the dashboard.
     
    Last edited: Dec 9, 2022
  2. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    289
    Hello,
    here is a video game that is using the nucle cloud service as backend service


    The service features used for this project are :
    • Data saving on the cloud for "user score" and "user unlocked levels".
    • User authentication (Anonymous users)
    • Global leaderborad
    • Leaderboard by country (the service will display the leaderboard of the current user country)

    Events collection such as
    - Know how many Parties has been played per day,
    - Know how many times each level has been played per day
    - Know how many times retry button has been clicked per day

     
  3. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    289
    Hi,
    i have added support for A/B testing by country, the range max value which represents variables country count is now reflected once the country value is changed


    the image bellow shows user variable range update globally


    the image bellow shows user variable range update by country, in this example United States
     
    Last edited: Dec 15, 2022
  4. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    289
    Hi,
    i have spent some time today improuving the update user variable form as well,
    in the search value field, you can provide userId, email or userName
    in the example bellow we try to change the variable score of a searched user

    In this example, search is performed by user email, no score found for this user

    In this example, Search is performed by userId, score found for this user is 20
     
  5. boris86

    boris86

    Joined:
    Dec 17, 2022
    Posts:
    5
    this looks interesting, i will try this out in my game
     
    elseforty likes this.
  6. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    289
    Hi,
    I have recently been focused on improving the visualization of events in my project. I have developed a new feature that will provide a clearer understanding of the insights gained from application events. For example, if we take the Frogger Frog project as an example, we can track events for each level to measure how many times it got played per day. These insights can give us an idea about the overall difficulty of the game. For instance, if a level is particularly difficult, it is likely to be replayed more frequently as players try to progress to the next level. Here is an early preview of the user interface for this new feature.

    what you can do with this user interface is adding/deleting charts, update start/end date, hide/unhide charts.
     
  7. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    289
    Here is what a single event chart looks like
    in this examle it shows how many times 'Level1' got played from 12/01/2022 to 12/21/2022

    Here is a demo video showcasing this new feature
     
  8. boris86

    boris86

    Joined:
    Dec 17, 2022
    Posts:
    5
    Hi,
    do you have any tutorials on how to make the local/global leaderboard to work,
    thanx
     
  9. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    289
    Hi boris,
    if you're using the nucle cloud library, use this to get the global leaderboard
    Code (CSharp):
    1.  
    2. var skip = 0;
    3. var take = 8;
    4. var _orderType = orderType.HighToLow;
    5. var  result = await  Variable.GetList(UserToken, scorePresetId,skip,take, _orderType);
    6. List<VariableModel> globalLeaderboard = result.list;
    7.  
    for local leaderboard, you first will need the country code,
    you can get it from the user login method (example: anonymous user login method used)
    Code (CSharp):
    1.  
    2.  var   projectId= "YOUR PROJECT ID FROM THE DASHBOARD";
    3.  var connectedUser= await Anonymous.Login(projectId, SystemInfo.deviceUniqueIdentifier);
    4.   var countryCode=  connectedUser.user.country_code;
    5.  
    Now the same method used to get global leaderboard with countryCode as param will return the local leaderboard
    Code (CSharp):
    1.  
    2. var skip = 0;
    3. var take = 8;
    4. var _orderType = orderType.HighToLow;
    5. var filter = countryCode;
    6. var  result = await  Variable.GetList(UserToken, scorePresetId,skip,take, _orderType, filter);
    7. List<VariableModel> localLeaderboard = result.list;
    8.  
    Let me know if this works for you
     
    Last edited: Dec 28, 2022
    boris86 likes this.
  10. boris86

    boris86

    Joined:
    Dec 17, 2022
    Posts:
    5
    any ideas on how to test this,
    my app is not live so basically i have no users from different countries to test it
    thanx
     
  11. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    289
    you can try a free VPN to change your location, then create test users from the dashboard
    under your project, go to users => create new user (green button on top left)
     
  12. boris86

    boris86

    Joined:
    Dec 17, 2022
    Posts:
    5
    Hi @elseforty
    i appreciate your support, it is working indeed, i can see the new test users added with the country set in the VPN instead of the country i currently live in , but i can't see the users on the leaderboard, any idea why ?
     
  13. elseforty

    elseforty

    Joined:
    Apr 3, 2018
    Posts:
    289
    by default new users will not appear on your leaderboard unless they have submited a value to that leaderboard.
    you can use the dashboard to submit a test value for the new users you created,

    under your project, go to your presets, find your leaderboard preset, under update column, go to the options menu and pick "Update by user", you will get the menu bellow, use the user email to look for the user, update the value like then submit
     
    boris86 likes this.
  14. boris86

    boris86

    Joined:
    Dec 17, 2022
    Posts:
    5
    this worked great,
    thank you