Game Maker Studio Setup Firebase Tools

This tutorial details Game Maker Studio Setup Firebase Tools.

Creating a Firebase Project

For creating a firebase project, head over to Firebase Console. If you haven’t logged-in with your Google account yet, you’ll be greeted with a login screen. After that Projects screen will be presented to you.

Select Add project, you’ll then be shown a window.

Project name : The name of your project, you can write it as your Game’s Name.
Project ID : Identifier of your project, must be unique.
Locations : These are the location centers that’ll be used for some of the Firebase Tools. For Analytics, I recommend you to choose your own country or where you live. For Cloud Firestore, I recommend you to choose whichever serves you to best. Your database will be located in this area and therefore serve better for the players living close to it.

Click Create Project Button to proceed. Now, Firebase usually changes its UI but you should get the context easily. We will create an Android App on our Firebase project now.

On the Project Overview screen, you’ll see a big area. Click the Android Icon (Marked in dashed circle on the image above). This will bring a new screen, there we will fill our Android App’s details.

Android package name must be the same as your Android package name that you set on Game Maker Studio IDE. Click to Register app button to proceed.

Finally, you’ll get to the page where you will download your google-services.json file.

Download this file and put it on your Desktop. We will use this file in a moment.

Now, we’re done with Firebase Panel. We can now move onto the Game Maker Part.

Setting Up Game Maker Studio for Firebase Tools

Unfortunately, Game Maker Studio does not include “changing runtime files on the IDE”, we must do it manually. First, check your Game Maker Studio Runtime version.

My current version is 2.2.1.291. By the time you’re reading this, the version may be different. We need this information because we will go to that folder.

C:\ProgramData\GameMakerStudio2\Cache\runtimes

Now select the folder which contains your runtime : For me, it’s 2.2.1.291

Now, first thing to do is to backup your original android folder. Copy paste it and rename the new one as android_original.

Now, go to the android folder. There you’ll see runner folder, open it. We must edit two files inside of it.

In here, we only need to change two things;

  • RootFiles\build.gradle
  • ProjectFiles\build.gradle

Now, go to RootFiles\build.gradle (You can open it with Notepad). Insert the following code inside the dependencies bracket.

 classpath 'com.google.gms:google-services:4.0.1' 

The final version the file should look like this (The code inserted at 12th line)
Be careful as Yoyogames sometimes update this code. Try to insert the code above to the correct place instead of just copying the code below!

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
		mavenCentral()
		maven { 
			url "http://repo.spring.io/plugins-release/" 
		}
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.2.0+'
        classpath 'com.google.gms:google-services:4.0.1'
    }
}
allprojects {
    repositories {
		maven {
            url "https://maven.google.com"
        }
		maven { 
			url "http://repo.spring.io/plugins-release/" 
		}
        jcenter()
    }
}

The second file we must edit is ProjectFiles\build.gradle. You can open it with Notepad. Add the following code to the very end of the file

apply plugin: 'com.google.gms.google-services'

The final version of the file should look like this

apply plugin: 'com.android.application'

android {
    compileSdkVersion ${YYAndroidCompileSDKVersion}
    buildToolsVersion '${YYAndroidBuildToolsVersion}'

	${YYAndroidJavaMaxHeapSize}

    defaultConfig {
        applicationId "${YYAndroidPackageName}"
        minSdkVersion ${YYAndroidMinSDKVersion}
        targetSdkVersion ${YYAndroidTargetSDKVersion}
		multiDexEnabled true
    }

	signingConfigs {
        release {
            storeFile file("${YYAndroidKeyStoreFile}")
            storePassword "${YYAndroidKeyStoreFilePassword}"
            keyAlias "${YYAndroidKeyAlias}"
            keyPassword "${YYAndroidKeyPassword}"
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
			signingConfig signingConfigs.release
        }
    }

	${YYAndroidSplits}
}

dependencies {
    compile 'com.android.support:support-v4:${YYAndroidSupportLibVersion}'
	compile 'com.android.support:multidex:1.0.1'
    compile files('libs/ini4j-0.5.2.jar')



	${YYAndroidGradleDependencies}

}
apply plugin: 'com.google.gms.google-services'

Finally, remember the google-services.json file we downloaded and put it on the Desktop ? Drag and drop this file to the ProjectFiles\ folder.

Congratulations!

You have finished implementing Firebase tools to Game Maker Studio. Now you can use GMDevBlog Firebase Extensions in your apps.

Share

Marty

Truely speaking, I don't know what am I doing most of the time.

5 Responses

  1. ZigZag says:

    Hi I have some issues compiling for Android with this, I suspect it’s due to the new yoyo notification extension since I get some duplication errors and they use firebase for that extension, are you able to look in to this? It works perfectly without 🙂
    Kind regards

    • Hello ZigZag. I am aware of this issue. It is caused because both parties try to initialize Firebase.

      The only solution is to use my Firebase Notifications extension which is way more powerful than Yoyogames’ extension. I’m currently working on it and will share it in couple days.

      Thanks 🙂

  2. Kay Win says:

    Good job on this extension. I saw some requests for an iOS version. I have also written a simple firebase extension for Android but have no idea how to modify AppDelegate in GameMaker. It would be great if you can provide me some guidance. Thank you in advance

    • Marty McFly says:

      Hi Kay. Sorry to reply late. I haven’t had the chance to work on iOS extension yet. Simply, I don’t own an iPhone and it gets kinda harder for me to do the testing and things etc. So, I’m in the dark as well. Let me know if you find anything useful

  1. 17th April 2019

    […] Setup Firebase Tools for Game Maker Studio (Please also read “Setting Up” section below as it needs two more steps to include the library. […]

Leave a Reply