Search Unity

[RELEASED] CloudOnce | Unified Game Services API

Discussion in 'Assets and Asset Store' started by Trollpants, May 6, 2015.

  1. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    cloudonce_large.png
    CloudOnce
    Unified Game Services API
    Getting Started | API Docs

    Download
    GitHub | Asset Store

    Why code thrice when you can CloudOnce?
    Enhance your Unity mobile games on three platforms in no time with achievements, leaderboards and cloud saving.


    CloudOnce is the Unity plugin that lets you spend more time developing your mobile game and less time quarreling with the native systems. Create achievements, leaderboards and cloud saving for three different platforms using only a few lines of code. Get CloudOnce on the Asset Store to release your game today with the professional functionality your players want!

    Unified API
    Platforms.png
    CloudOnce works for the Apple Game Center, Google Play Game Services and Amazon GameCircle using the same few lines of code. Our Getting Started guides and extensive API documentation will get you through the implementation in a flash. Make your Unity game even easier to export to different platforms and submit your game today instead of a month or two from now!

    User-friendly editor
    Coding is fun, but takes time and focus. Handle all your achievements, leaderboards and cloud saving settings using CloudOnce's user-friendly, Unity integrated editor. Don’t let time constraints or a lack of know-how stop your game from using the native systems everyone else is using!


    Detailed getting started guide with code samples
    You can check it out here: http://trollpants.github.io/CloudOnce/gettingStarted.html
     
    Last edited: Jun 1, 2016
  2. Zaddo67

    Zaddo67

    Joined:
    Aug 14, 2012
    Posts:
    489
    Can I use Google Play from a PC build?
     
  3. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Thanks for your interest Zaddo! Google Play will only work on mobile devices (phones and tablets). CloudOnce specifically is set up to take advantage of the game services that are native to each of the three mobile platforms we support. Although you can technically use Google Play and GameCircle on iOS, we believe most developers and players prefer the systems native to their platform of choice. So on Amazon devices GameCircle is used, Game Center is used on iOS, and Google Play Games is used on Android mobile devices.

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  4. djfrail

    djfrail

    Joined:
    Jan 16, 2014
    Posts:
    124
    Any chance of CloudOnce working in Unity 4.6.x? I'm very interested in using CloudPrefs, but very not interested in converting my current nearly finished game over to Unity 5.
     
  5. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Hi djfrail! There shouldn't be any problems using the package in a Unity 4.6 project. We simply published it as a Unity 5 asset because of a few benefits we get on the store. You'll need to install Unity 5 in a separate location first and import the package into an empty project with Unity 5, then move the files to your 4.6 project. We'll be happy to assist you if you should encounter any problems doing so :)

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  6. djfrail

    djfrail

    Joined:
    Jan 16, 2014
    Posts:
    124
    I like what I'm reading!
     
    Trollpants likes this.
  7. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    We submitted an update last week that should be through the approval process within a day or two. Here is the changelog:

    v1.0.2
    • Improved editor visuals when using dark theme
    v1.0.1
    • Fixed bug where new local data would not get uploaded to the cloud
    • Improved Google Play Sign In/Out Quick Start script
     
  8. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.0.2 is now live on the store! :D
     
  9. djfrail

    djfrail

    Joined:
    Jan 16, 2014
    Posts:
    124
    Hi - I bought CloudOnce and am trying to get it work in Unity 4.6. I imported CloudOnce into an empty Unity5 and exported a custom package of everything that CloudOnce imported, then imported that custom package into my game project in Unity 4.6. I get 6 copies of this error in the console after importing:

    Assets/Extensions/Trollpants/CloudOnce/Internal/Editor/Utils/BuildUtils.cs(131,86): error CS0117: `UnityEditor.BuildTargetGroup' does not contain a definition for `iOS'

    Maybe it has to do with a folder name conflict with Unibill (which I'm also using in my game) ? Both Unibill and CloudOnce have a folder named "iOS" under assets/Plugins...
     
  10. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Hi again djfrail! Thank you so much for your purchase :D We will try to reproduce your error and get back to you as soon as possible. The iOS folder under Plugins is a Unity folder with some specific properties, that must be used by native iOS plug-ins, so that should not be the problem. You can read more about that here: http://wiki.unity3d.com/index.php/Special_Folder_Names_in_your_Assets_Folder

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  11. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    We have a workaround for you djfrail. This error is caused by a change Unity made to their BuildTargetGroup class in Unity 5. Open BuildUtils.cs and replace "BuildTargetGroup.iOS" with "BuildTargetGroup.iPhone" on line 131 and 231. This will fix the errors you have reported. Should you need any more assistance, please don't hesitate to contact us!

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  12. djfrail

    djfrail

    Joined:
    Jan 16, 2014
    Posts:
    124
    That worked - no more compile errors! Thanks!
     
  13. djfrail

    djfrail

    Joined:
    Jan 16, 2014
    Posts:
    124
    Another problem - I got this build error when trying to build for Amazon (only have Amazon GameCircle achievements in CloudBuild menu):

    Error building Player: CommandInvokationFailure: Failed to re-package resources. See the Console for details.
    C:\Android\adt-bundle-windows-x86_64-20140702\sdk\build-tools\21.1.0\aapt.exe package --auto-add-overlay -v -f -m -J gen -M AndroidManifest.xml -S "res" -I "C:/Android/adt-bundle-windows-x86_64-20140702/sdk/platforms/android-21\android.jar" -F bin/resources.ap_ --extra-packages

    stderr[
    ERROR: No argument supplied for '--extra-packages' option
    Android Asset Packaging Tool
     
    Last edited: May 22, 2015
  14. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    We have not encountered that error before, and can't seem to reproduce it. We suspect that this problem might not be with CloudOnce itself, but perhaps a compatibility issue or a problem with your Android SDK. If you intend to release your game on Google Play as well, it would be helpful to see if you can successfully build your project to that platform, or if this problem affects both Android platforms. Remember to run the "Google Application ID" setup located in the CloudOnce editor and that the "Android build platform" is set correctly before building to Google Play. It is by the way important to save the configuration after switching Android build platform, as the AndroidManifest needs to be updated by the editor. Please get back to us after trying this.

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  15. djfrail

    djfrail

    Joined:
    Jan 16, 2014
    Posts:
    124
    Did what you said and it compiled for Google Play no problems.
     
  16. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.1.0 has now been submitted to the asset store. Special thanks to djfrail for assisting us in identifying a couple of bugs!

    Release Notes
    -------------
    Version 1.1.0
    - Updated GPGS plugin from v0.9.15 to v0.9.20
    - Fixed bug when building Amazon build before running Google App ID setup
    - Added missing Amazon GameCircle resource files
    - More stable Amazon GameCircle login, achievement and WhisperSync handling
    - Exposed Load method in storage wrappers
     
    Last edited: May 27, 2015
  17. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.1.1 is now on-line on the asset store! :D

    Release Notes
    -------------
    Version 1.1.1
    - Improved WhisperSync implementation
     
  18. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.2.0 is now on-line on the asset store!

    Release Notes
    -------------
    Version 1.2.0
    - AutoLoad system
    - OnNewCloudValues now only gets called when there are new/changed cloud values
    - iCloud wrapper now checks if signed in before accessing cloud data
    - Fixed editor debug warning from CloudIDs
    - Fixed saving CloudPrefs when in editor
     
    Last edited: Jun 23, 2015
  19. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.2.1 is now on-line on the asset store!

    Release Notes
    -------------
    Version 1.2.1
    - Fixed problem with building project before saving CloudOnce configuration
    - Fixed GameCircle support when targeting APIs below 11
     
    Last edited: Jun 23, 2015
  20. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.2.2 is now on-line on the asset store!

    Release Notes
    -------------
    Version 1.2.2
    - Improved iCloud implementation, no longer dependent on Game Center sign in
    - Added Quick Start Scripts to Component menu
    - Fixed support for Mono2x scripting backend on iOS
     
    Last edited: Jun 30, 2015
  21. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.3.0 is now on-line on the asset store!

    Release Notes
    -------------
    Version 1.3.0
    - Added OnSaveComplete and OnLoadComplete events
    - Added optional parameter to Initialize for disabling Cloud Save
     
    Last edited: Jun 30, 2015
  22. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.3.1 is now on-line on the asset store!

    Release Notes
    -------------
    Version 1.3.1
    - Updated GPGS plugin from v0.9.20 to v0.9.21
     
    Last edited: Jul 9, 2015
  23. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.3.2 is now on-line on the asset store!

    Release Notes
    -------------
    Version 1.3.2
    - Improved implementation of Cloud Save deactivation
    - Improved handling of Guest User on Google Play
    - Improvements to several Quick Start scripts
     
    Last edited: Jul 11, 2015
  24. joihelgi

    joihelgi

    Joined:
    Jan 21, 2014
    Posts:
    19
    How is CloudSave (CloudCurrencyInt & CloudInt) saved regarding to security? i'm thinking about so the user cannot change their score or currency
     
  25. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    The data is obscured, but not encrypted, so it is possible to alter the data, but pretty difficult. I believe the device would have to be rooted and the user would need to have a lot of experience in doing that type of thing.

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  26. joihelgi

    joihelgi

    Joined:
    Jan 21, 2014
    Posts:
    19
    @Trollpants Sold ! :) Thanks for quick answer!
    But if I may ask, how is it obscured?
     
  27. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    @joihelgi I sent you an email via the contact form on your website :)

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  28. joihelgi

    joihelgi

    Joined:
    Jan 21, 2014
    Posts:
    19
    @Trollpants I have a few questions about implementation,

    1. In you docs you talk about how CloudCurrencyInt & CloudCurrencyFloat are designed so that all additions and subtractions made to a currency are stored in as two sums for each device the user has connected to the game, but I can only see that for SyncableCurrency not CloudCurrency-Int/Float, should I use SyncableCurrency instead of CloudCurrency-Int/Float ?
    2. Am I responsible for calling Cloud.Provider.Storage.Save(); ? if so, then where / when do you recommend to save?
    3. How costly is the currentcy type (SyncableCurrency or CloudCurrency-Int/Float) vs the regular type (e.g. CloudInt)? The thing is, some of my achievements are total of something (e.g. how many items player has collected over all), it doesn't need to be completely accurate but it would be nice if it was. I use 2 currencies and have about 5 objects I need to keep total of for achievements.
     
  29. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    @joihelgi
    1. SyncableCurrency is an internal class used by both CloudCurrencyInt and CloudCurrencyFloat. So you should use one of the latter.
    2. Yes, it's recommended to call it after important events in your game; Whenever it is important not to lose some new information. Examples would include after the player dies, after the player picks up a collectible, when the options screen is closed, and so on.
    3. The currency types are not that much more costly. But for the example "how many items player has collected over all" I would think that a CloudInt with the PersistantType set to Highest would be the best choice. Because the number of items collected could presumably never go don't. Even if the player somehow loses an item, it was still collected in the first place. Below is a couple of examples that hopefully makes it more clear.
    Example 1
    Achievement: Have 100 000 gold in your bank.
    Here it would be natural to use a CloudCurrencyInt for the amount the player has stored in the bank. The player will have the option both to put gold into the bank and to take it out. And only when the player has a total of 100 000 gold does the achievement unlock.

    Example 2
    Achievement: Win 50 matches.
    Here you would use a CloudInt set to Highest. Because even if the player loses a match, that doesn't take away from the wins.

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  30. joihelgi

    joihelgi

    Joined:
    Jan 21, 2014
    Posts:
    19
    @Trollpants Thanks for the answer :)

    I think i'm misunderstanding how CloudCurrencyInt works, because I cannot see how you would adjust the balance without accessing the value directly.

    In the SyncableCurrency class you have a Adjust method, TotalEarned and Value properties. Where the TotalEarned is "the total sum of additions made to the currency, ignoring subtractions", the Value is "The current currency balance. All the additions minus the subtractions." and the Adjust method "Adds to or subtracts from the currency amount.", but in the CloudCurrencyInt I can only see a regular Value property where you change the whole balance directly, witch is not as practical as the methods and properties in the SyncableCurrency class.

    Do you maybe have some kind of a example project or just an example where I can see how you use CloudCurrencyInt or CloudCurrencyFloat ?
     
  31. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    @joihelgi CloudCurrencyInt and CloudCurrencyFloat are both actually behind the scenes stored as a SyncableCurrency. But the system is made so the developer doesn't have to worry about the details of how the currency actually works, and can treat for example a CloudCurrencyInt just like one would a regular int. The system handles all value changes across multiple devices and makes sure that the player never loses any of their collected currency. If you dig into CloudCurrencyFloat and the DataManager class, I'm sure you'll see what I'm talking about. BTW if you attempt to use SyncableCurrency directly the save and load system will not work correctly. Only the classes in the Trollpants.CloudOnce.CloudPrefs namespace can be used.

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  32. joihelgi

    joihelgi

    Joined:
    Jan 21, 2014
    Posts:
    19
    @Trollpants

    Ahhh I see what you are talking about. ;)

    One problem I have about CloudCurrencyInt is that it seems like it doesn't update the currency status correctly, if I make operation like:

    CloudCurrencyInt gold = new CloudCurrencyInt("gold", 0);
    gold.Value += 100;
    gold.Value -= 50;
    gold.Value += 25;​

    the total additions should be 125 and total subtractions -50, but if I call DataManager.GetTotalCurrenyEarned("gold"); I get 75 and if I look into the JSON saved in playerPrefs I see additions = 75 and no subtractions.

    I only get the correct additions and subtractions if I always save after changing the CloudCurrencyInt value directly or use DataManager.AdjustCurrencyBy("gold", amount), is it not recomended to use the DataManager directly ?

    Also it would be awesome to have method like Adjust and Properties like TotalEarned and Value (like in the SyncableCurrency class) in the CloudCurrencyInt, and that the value in CloudCurrencyInt could not be negative.

    Sorry for the troubles and thank you so much for your help! :)
     
  33. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    @joihelgi DataManager is also an internal class that is not designed to be used directly. The specific addition amount and subtraction amount was never designed to be used for more than conflict resolution between devices. The GetTotalCurrenyEarned method is a remnant from about 9 months ago, from before the asset was converted to public use. Frankly it should have been removed in it's current state.

    However, I see your point in that it would be great to extend more functionality into the CloudCurrencyInt/Float classes. These will be fairly significant changes so I'll need some time to implement them. I'll work on them during the next week and send you an updated package as soon as it's done. :)

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  34. joihelgi

    joihelgi

    Joined:
    Jan 21, 2014
    Posts:
    19
    @Trollpants Thats great! I look forward to next update :)
     
  35. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.4.0 is now on-line on the asset store!

    Release Notes
    -------------
    Version 1.4.0
    - Added DES encryption to both local and cloud data
    - Reworked CloudCurrency types to support checking total additions and subtractions
    - Added option to allow for currencies to be negative
    - Added more overload constructors to all CloudPrefs, no longer necessary to supply value
    - Improved handling of allowed characters in the ID fields of the editor
    - Removed broken "initial value" feature from CloudCurrency types
    - Optimized data serialization
     
    Last edited: Jul 21, 2015
  36. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    We are currently working on a major overhaul of the achievement and leaderboard systems, and early results are looking great! This should make the achievement and leaderboard systems way more intuitive. We are hoping to be done with the update by the end of the week :)

    We've found a couple of small issues that was introduced in v1.4.0 that are now fixed, but should you have any trouble before we can get the next update out, be sure to send us a message and we'll help sort everything out!

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  37. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    The progress on update 1.5.0 is going really well! :) Unfortunately we have discovered some serious issues with v1.4.0 specific to iOS. We will be fixing these issues in the v1.5.0 update, but if you need a working version for iOS in the next couple of days, be sure to contact us on support at trollpants dot com and we'll send you the previous version (please include your invoice number).

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  38. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.5.0 is now on-line on the asset store!

    Release Notes
    -------------
    Version 1.5.0
    - Rebuilt Achievements and Leaderboards systems to be more intuitive, and require less code.
    The Getting Started guides will be updated to reflect the changes.
    - Added DeleteCloudPref method to Cloud class
    - Added overload constructor to CloudUInt
    - Improved allowed characters validation in editor
    - Prepared files for Unity 4.2 compatibility
    - Fixed bugs in Currency CloudPrefs
    - Fixed Reset methods
    - Removed DES encryption due to performance and compatibility issues,
    will replace with hash + salt system in a later update
     
    Last edited: Aug 11, 2015
  39. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Version 1.5.1 is now on-line on the asset store!

    Release Notes
    -------------
    Version 1.5.1
    - Added more debug logs to initialization to help with troubleshooting
    - Renamed some events to make their function clearer
    - Improved "Show Overlay" Quick Start scripts
    - Improved API documentation
    - Improved WhisperSync integration
    - Improved Initialize methods
    - Improved handling of deserialization failure
    - Improved handling of unstable Google Play authentication
     
    Last edited: Aug 25, 2015
  40. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    CloudOnce is currently on sale! Grab it while you can :) http://u3d.as/fE5

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  41. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Planned features in the next update include:
    • Option to declare Cloud variables in the editor for easy implementation
    • Support for Unity 4.3 and up
    The update after that will most likely focus on adding full Playmaker support! :)

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  42. kurodp

    kurodp

    Joined:
    Aug 13, 2015
    Posts:
    6
    i'm a beginner, i already bought the plugin and tried to initialize CloudOnce by copying the code on this page's example code: http://trollpants.com/cloudonce/initialSetup.html
    but it seems like OnInitializeComplete method is not working since the statement is red.
    moreover, i tried applying Cloud.Provider.Initialize(); function, it built on Android, but then it crashed.
    how am i supposed to fix this? what's the difference between Cloud.Provider.Initialize and Trollpants.CloudOnce.Quickstart.InitialiazeCloudOnce? how to initialize CloudOnce properly? thank you very much :)
     
    Last edited: Aug 13, 2015
  43. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Hi @kurodp, thank you for your purchase! Yeah we see now that some of the changes that were made in v1.5.1 of CloudOnce has already made it on to the Getting Started guides. OnInitializeComplete will replace OnStartupComplete, so until v1.5.1 comes out (should be any day now), you can use that instead. Alternatively you could send us an email with your invoice number and we'll send you v1.5.1 right away.

    The most common reason that the Initialize method crashes is that the Saved Games feature in the Google Play developer console has not been activated yet. Please refer to the "Developer console setup" section of the Cloud Save guide here: http://trollpants.com/cloudonce/cloudSave.html

    We will be looking into a way of handling this error more gracefully. The Quick Start script is just a way to initialize CloudOnce without having to write any code yourself. But of course you get greater control if you code your own script :)

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  44. kurodp

    kurodp

    Joined:
    Aug 13, 2015
    Posts:
    6
    Thank you for the fast response, @Trollpants. An email has been sent to info@trollpants.com.

    the only feature that i will be using for now is Achievement, so do i still need to turn on the Saved Games switch in Google Dev Console? thanks
     
    Last edited: Aug 13, 2015
  45. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    @kurodp If you want to disable Cloud Save you can add "false" as a parameter to the Initialize method, like this:
    Code (CSharp):
    1. Cloud.Provider.Initialize(false);
    - Jan Ivar
     
    Last edited: Sep 10, 2015
  46. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    Hello,

    I bought your asset and so far I really liked it. It works as expected.

    However, when I deploy my game on Android, it doesn't do anything.

    Unity Editor gives me this warning message:
    I have no idea what to do!

    Any ideas?

    Thanks in advance :)
     
  47. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    Hi @elmar1028

    Happy to hear you are liking CloudOnce :)

    The two most common problems are that either the Application ID setup has not been run from the CloudOnce editor, or you have not activated "Saved Games" in the Google dev console. If you are not planning on using cloud save in your game, you can instead deactivate cloud saving using the method described in the post above yours.

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  48. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    Hi,

    Thank you for your reply! I got it working :D
     
  49. Trollpants

    Trollpants

    Joined:
    Jun 22, 2014
    Posts:
    113
    That's awesome @elmar1028, thanks for keeping us in the loop :)

    - Jan Ivar
     
    Last edited: Sep 10, 2015
  50. elmar1028

    elmar1028

    Joined:
    Nov 21, 2013
    Posts:
    2,359
    Hello again,

    I am trying to implement CloudSave and I am trying to save a string variable,

    I was able to create it, but have no idea how do I get/set its value.

    My code so far:
    Code (CSharp):
    1. CloudString myString= new CloudString("stringId", myString_normal, "");
    Thanks in advance! :)