Tappy Chicken Example Question

I’m checking out the GameCenter achievements and Leaderboards in the Tappy Chicken example and I’m noticing that you’re looping a certain range of numbers for each achievement and putting it into an array called Achievement Values/Achievement Progress:

High Score: 0-11
Found Egg Count: 12-20
Games Played: 21-29

What’s with the range? And why those numbers specifically?

Hi , those numbers are the Achievement ID ranges for those 3 different types of achievements in Game Center or Google Play. I also save these values into those arrays you mentioned at the same id locations in the savegame. I use this to manually track which Achievements need to be updated in Game Center or Google Play.

I guess I’m curious about why you need a range rather than just one location per achievement. Also, is there anything outside of the blueprint you need to mess with to ensure GameCenter is working as intended? (like on the Apple side of things).

The ranges are done that way so the nodes don’t have to be duplicated for each individual ‘event’. For example, there are a bunch of achievements for varying numbers of posts passed. This way you can use a for loop, looking into one array that says ‘1 post, 5 posts, 10 posts, etc…’ and compare that against the total number of posts passed in order to report the achievement. If you have a one-off achievement, you can skip the array and ranges, etc… The actual achievement names are strings, not numbers. There’s another array with those names in them.

Other internal and external setup:

For iOS:
In Unreal, enable game center in your iOS project settings.

On iTunesConnect, you need to enable game center for your app ID, and add data for each leaderboard or achievement to the web site (name, hidden or not, point value, icon, at least one localized language, etc…). It’s actually a bit annoying the number of individual steps you have to do on the site, I wish they had a spreadsheet upload function. You also need to have a non-wildcarded provision I think (not 100% sure on this one).

On Android, you need to enable Google play for the project and make sure you have a cert (or Google Play will crash at runtime :(). There should be some information in a post in the Android forum section about that. Much of the rest of the process is similar, you have to define the achievements / leaderboards, etc… on the Google Play web site. However, one additional step is needed for Android: the achievement IDs/etc… are GUIDs instead of strings, so there is a mapping table from string to GUID in the project settings that you need to fill out.

Cheers,
Michael Noland

Awesome, thanks for the info! I was able to get achievements and leaderboards hooked into my Sandbox environment pretty easily following your tips.

Cool, glad to hear it!

Cheers,
Michael Noland