Quick setup of Google Play services in Game Maker

Before you get started, make sure you have the following setup:

  1. Android SDK is linked with Game Maker (how to set up Android SDK)
  2. You have access to Google Play developer console (if not, then simply sign up)

Google allows Game Maker use of achievements and leaderboards only. (Google Play game engine integrations)

Google Play Services setup

  1. Go to game services tab, and a new game.
  2. Fill in game details
  3. In Linked apps tab, enter appropriate package name (this can be found in your game’s Global game settings / Android : package name, you can view this documentation for more details), move onto step 2, and get the Signing certificate fingerprint (SHA1) from Game Maker’s Preference / Android / Keystore : Key hash (SHA1) (if you haven’t got a key, then follow the keystore setup guide given in Android SDK setup) and paste this key, your app should now be verified.
  4. Skip the Events tab
  5. If you would like to add an achievement, move to Achievements tab and add a new achievement with appropriate details. Once this is done, go back to the Achievement tab and now you should be able to see the achievement list. We will use the achievement’s ID in game maker to update this achievement.
  6. If you would like to add leaderboards, move to leaderboards tab and add a new leaderboard with appropriate details. Once done, go to leaderboards tab again, and you should see the list of leaderboards. We will use the leaderboard’s ID to update this leaderboard.
  7. Before you move forward, set up things in your game maker (like update the code to login the user to play services, etc.)

Game Maker Setup

  1. First of all, go to your Game Maker’s Global game setting / Android / Social tab : App ID (Guide from Game Maker’s documentation) and add the “App ID” from your game’s page on google play’s developer console (Its on the top left, under your App’s name, and looks something like this 4212354341312).
  2. Once you add your App ID, you are ready to use the Google Play services, you can use a Set of GML Functions given in this reference document and go into details with the services.

Here is what I did with GML when I made my App

When the game starts, call

achievement_login()

Game maker already knows where to contact because of the “App ID”, so don’t worry about that bit.

To post an achievement, get the achievement’s ID from the developer console, and use

achievement_post(“achievement id”, completion) // id must be entered as a string, completion is from 0 to 100, where 100 means completed.

To post to leader board, get the Leaderboard’s ID from the developer console, and use

achievement_post_leaderboard(“leaderboard id”, score) //id must be entered as a string, and score could be any number

To view Achievements and leaderboards in game, you can use the code below on a key press

achievement_show_leaderboards()

Testing and Publishing the App

You cannot test the services with YoYo Runner, and there fore you will have to compile the App and then run it on a device to test it. Sometimes the achievements don’t show up on the developer console page once unlocked, so make sure you use the achievement_show_leaderboards() to debug. Also, use your developer account to test, unless you have people invited for testing.

You can also invite people to test out the services from the testing tab in the developer console. Once

Key points

  1. Get SHA1 Hash key to verify App
  2. Use IDs to link to Google Play Services(App ID, Achievement ID, Leaderboard ID)
  3. Android Tab in Game Maker
  4. GML Functions to use with Google Play Services
  5. Compile the App to test the services