No results found
October 03, 2016Jon Pulsipher
In the previous post in our series we walked through how to implement in-app purchases in your game using GameMaker: Studio. So now that you have an IAP catalog full of great items and ready to generate revenue, we have to make sure your users stay engaged—and spending. We’ve seen that incorporating social elements into your game is a great way to boost engagement and help drive revenue.
Players today expect social features like friends, leaderboards and achievements. They also expect to be able to play your game on all of their devices without losing their progress and settings. Amazon GameCircle offers several features to improve engagement and retention. Leaderboards allow players to compare scores with their friends (and maybe their enemies) to capture the coveted top score status. Achievements provide mileposts for players to help pull them through the experience and keep them engaged and exploring the game. Finally, Whispersync for Games provides a way to store game progress and settings in the cloud so they automatically sync to every device on which your customers play your game. GameCircle is supported on Amazon Appstore titles running on Amazon devices and other Android devices.
To use GameCircle in your game, you first need to create the application in the Appstore developer portal and then create your GameCircle configuration. Click on “Apps & Services” and then click on the “GameCircle” link, highlighted with the blue box, below. Click the button labeled “Add a configuration”.
Figure 1 - Starting the GameCircle configuration
Select the app that will use the GameCircle configuration and complete the information on the Game Details page. At the bottom of the page, select “Create a new security profile” from the Security Profile drop-down list.
Note that it is possible to have multiple apps use the same GameCircle configuration, such as if you have a “lite” and a full featured version of the app that you want to share the same leaderboards and achievements. For more details, see the “Shared Configuration” section of “How does Amazon GameCircle work?”
The next step is to generate the API key for your game. To create the API Key, you’ll need the Android package name for your app, and the MD5 and SHA256 signatures for your app.
The package name is the name you set on the Android tab of the GameMaker: Studio Global Game Settings dialog box, highlighted in the picture below.
Figure 2 - Package Name in Global Game Settings
The MD5 and SHA256 signatures come from the keystore you use to sign your app. The keystore is configured in the GameMaker: Studio Preferences dialog box. However, the signatures you need are not shown in this dialog. You can obtain the signatures using a Java utility, keytool, as described in this document.
The keytool output you care about is in the “Certificate fingerprints” section.
Certificate fingerprints: MD5: 25:FC:3A:3D:D7:09:56:E7:85:AF:C9:C1:92:51:CE:1E SHA1: 3F:91:6E:7C:4B:08:17:44:68:FB:29:EB:1F:33:3B:D9:F6:5F:C6:7D SHA256: C6:5D:51:8C:76:9D:09:69:F6:EB:17:DF:08:17:7E:48:A0:98:25:05:6B:76:68:09:1A:D7:96:C8:38:05:65:23
Copy the signatures exactly as they are and paste them into the MD5 and SHA256 text boxes.
Click the button to generate the new API key for your game. The API key is a long string of characters and is what associates your game with the configuration you’ve created.
Now that you’ve set up the basic configuration on the developer portal and downloaded your API key, let’s set up your game project to connect to GameCircle.
Click the “Download to file” button and add this file to your GameMaker: Studio project as an “included file”. Right click on the “Included Files” node in the project tree and select “Create Included File”.
Figure 3 - Adding the api_key.txt
As with the in-app purchasing that we added in the previous installment in this series, GameCircle requires the Amazon GameCircle extension to be added to the project.
You will also need to add the GameCircle features you plan to use to the AmazonGameCircle_InitFeatures statement. If you followed the IAP blog, you currently have:
If you don’t need IAP for your game, the process to initialize the features is still the same as described there.
The full set of features you can include here are:
In-app purchasing. This is not actually a feature of GameCircle, but YoYo Games has combined it in the same extension.
To include multiple features, you need to logically “OR” them together by separating them with the GML bitwise OR character “|” – such as:
AmazonGameCircle_InitFeatures(AmazonGameCircle_Achievements | AmazonGameCircle_IAP);
When the game starts up, a GameCircle notification pop-ups showing an icon for each of the GameCircle features – Leaderboards, Achievements and Whispersync – that your game supports. This is driven by the features you select in AmazonGameCircle_InitFeatures and helps inform your players what to expect.
In our next installment, we’ll work through adding Leaderboards and basic Whispersync features.
Part 2: Basic Controller Detection
Part 4: Fire TV Remote and Controller Selection
Part 5: Implementing Amazon In-App Purchasing