mwk
mwk

Reputation: 1979

Google Play game services -- are unlocked achievements automatically shared through g+ or not?

We're adding Google Play game services achievements to our game (Epic Swords). We're in final testing, it works except I had expected that unlocked achievements would be visible or posted in some manner through g+. I do not see this sharing occurring.

Google's docs imply these are shared, e.g. "Sign in with Google to share your scores and achievements with friends" http://goo.gl/V3Y41 and various other places, although it is vague on how these are shared.

Q1: Are unlocked play services achievements automatically visible through g+?

Q2: If yes, then are we doing something wrong in how we are testing these?

Q3: If no... well, why implement achievements using play services instead of rolling our own? It would be simpler and more reliable to do our own implementation (there's a lot of complexity due to synchronizing state with google's cloud, not to mention some interesting bugs in their client code ;-)

Background: We have published the Google Play game services. Everything works fine in-game, and the state is being shared/retrieved from google. I selected Public visibility for game progress when signing in to game services.

btw we could add explicit g+ sharing when achievements unlock using the general sharing API http://goo.gl/L70sY but again... if we have to do that then why use the play services achievements at all?

Upvotes: 4

Views: 2985

Answers (2)

mwk
mwk

Reputation: 1979

Thanks ianhanniballake for your help, I'm adding this to clarify the answer (e.g. achievements could be auto-posted) and to summarize what we've learned adding this feature.

Hopefully a Googler will look at our Pro/Con because with the 1.0 SDK it's hard to recommend the API, but with improvements it would be valuable.

Automatic sharing of google play services achievement (as of 7/13 SDK):

  • Achievement progress (e.g. unlock) is not shared/visible through g+
  • The sdk does not facilitate sharing achievements. Something like PlusShare.Builder.shareUnlock() would help if automatic sharing is not added, but currently to share achievements on g+ you must implement from scratch
  • imo nothing prevents Google adding automatic achievement sharing in the future. Their sign in flow gets user permission to share "game progress", and other posts say leaderboards do have social sharing

From our experience: Pro/Con of Achievements with Google Play services:

Pro:

  • It's Google's official solution so hopefully will be defacto Android standard
  • Google could make achievement progress shared/visible through g+ if they want. That would make it much more valuable

Con:

  • User must be willing to sign into g+ to view/save achievements. Some users will not do this and be annoyed they cannot use achievements
  • Synchronizing client-server has complex policy and implementation issues. E.g. the user may sign in after substantial game progress; may simultaneously play on multiple devices; may sign out and sign in as a different user mid-game
  • Testing is difficult because there's no way to reset achievement progress for test accounts through Android API or server UI. I assume google can fix this... please! Some posts say remove/re-add a tester account resets but that did not work for us, or perhaps it only works pre-Publishing
  • Google's design intends that their server manages UI assets (icons, strings) and achievement policy. This is good if achievements will be visible in g+ in the future, but until then it's a hassle. E.g. see code below
  • Client UI is ok but not polished. E.g. description text area is limited, "Defeat a Skeleton King in battle" is truncated in some UI modes and there's no way to see the full detail. Incremental achievements are limited to 10,000 steps (why?)

Recommendation: If you believe Google will make achievements visible through g+, that's a great feature and explains most of the "Con" above. However if achievements remain unshared then using google's API was less reliable and substantially more work than it would be to roll our own client implementation.

WARNING: Google Play game services as of 7/15/13 appears to have an intermittent crashing bug if you use ImageManager. See ClassCastException: com.google.android.gms.common.images.e We have switched to bundling the unlock images in the APK and no longer use ImageManager

This was our now-deprecated code to retrieve a bitmap when a user unlocks an achievement:

    Uri unlockedUri = achievement.getUnlockedImageUri();
    if (unlockedUri != null) {
        ImageManager im = ImageManager.create(context);
        // Warning -- loadImage may silently skip call back if called too soon after achievement load
        im.loadImage(new ImageManager.OnImageLoadedListener() {
            @Override public void onImageLoaded(Uri arg0, Drawable drawable) {
                // Attempt to convert the Drawable to a sharable image; if it fails we'll post text only
                Bitmap bitmap = null;
                if (drawable instanceof BitmapDrawable) {
                    bitmap = ((BitmapDrawable) drawable).getBitmap();
                } else {
                    log.warn("not BitmapDrawable ", drawable);
                }
                listener.onBitmapLoaded(bitmap);
            }
        }, unlockedUri);
    } else {
        log.debug("no unlockedImageUri");
        listener.onBitmapLoaded(null);
    }

One upside of google not providing automatic g+ sharing is that when you have to roll your own sharing anyway, you may as well do it for other services in addition to g+. E.g. we offer sharing unlocked achievemets to twitter as well. But perversely this is a good reason why Google should make achievements social on g+ asap... developers are lazy and that would ensure lots of games where social achievements were on g+ first ;-)

Upvotes: 4

ianhanniballake
ianhanniballake

Reputation: 200120

No Android app can auto-post to Google+ - you must go through the Google+ app via a traditional share intent or via the interactive post API you mentioned. There are App Activities which can be created by applications and seen in a user's Apps page via their profile (and then shared by the user from there). However, App Activities are currently not integrated into Google Play Game Services. That isn't to say that it won't magically happen at any time (and, as it is a server side change, could happen automatically as all games already request permission to create Game Activities (of which there are currently none)).

Achievements, as described on the Google Play Game Service main page, "Encourage users to explore your game in new and interesting ways" and, of course, do offer a consistent experience across all Google Play enabled games. Whether that is important enough to you or your users will probably change with time, but offering a complete experience up front (as those who are willing to go through signing in with Google+ likely expect) may offer a better user experience.

Upvotes: 1

Related Questions