InGame Advertising for Android Apps using AdMob and Game Maker Studio

(Please note: This tutorial was written before extensions were required for advertising in Game Maker Studio, and thus is outdated. The relatively simple method for setting up advertising in newer versions of GMS with extensions can be found at this very handy link I came across!: http://help.yoyogames.com/entries/24461331-Ads-Google-Mobile-Advertising-v1-3- )

Last night I finally sat down and did what I’ve needed to do for weeks – take a dive into the approach and methods of mobile app in-game advertising. And I can now reassuringly say that in-app advertising isn’t quite as scary (or complicated) as it seems!

Now, don’t quote me on any of this, because the only ad distribution platform I’ve experimented with so far has been the Google AdSense/AdWords/AdMob combination. I’m not certain how much of this information is relevant to other digital advertisement networks, but I’m assuming most of it would carry over from one to the other. I’ll be speaking purely in terms of AdMob/Game Maker: Studio/Android though.

The basic idea behind in-game advertising? First, you sign up for an account with AdMob, which also requires registered AdSense/AdWords accounts, (during AdMob registration, you’ll be prompted to create these if you don’t have either set up). AdSense and AdWords are two of Google’s powerful advertising services which help to create ads and target the most logical audience. Next, add an app name to your AdMob account which will host the advertisements. If the app isn’t up on the the PlayStore yet, no worries, you can just use a placeholder name and no link for now. Next, you determine the type of advertisement you’d like to place in your app – banner or interstitial. A banner ad is just as it sounds – a short, wide rectangle that can be overlaid in any position on the screen. Interstitial ads are fullscreen advertisements that require user input (to either click the ad, or cancel out). You can select the advertisement colors and assign a name (eg. Top Home Banner).

Finally, you’ll recieve a unique Ad ID code which references this particular ad. This is very important, as this code is basically the link between your app and the AdMob network, allowing them to speak and communicate with each other.

Once that’s all set up, back in Game Maker Studio under the advertising tab in (Global Game??) settings, choose AdMob as your android advertisement platform and check “Enable Ads”. Make sure “Use Test Ads” is disabled at the moment (we’ll enable that in the next step).You’ll notice a few empty fields underneath, each labeled “Key” and a number. This is where you can paste your individual Ad ID codes. For now, we just have the single one from the ad we created, so paste that in the “Key0” field. I’m not at my computer at the moment, but the format of the code should be some text (something like ca-pub- or something) followed by a bunch of random digits and letters. You’ll notice there’s another empty field near the bottom, Device ID. We’ll need to fill this in with an appropriate value, here’s how:

Connect your Android device via USB and, with Android set as the target device, test run your project. In the adb window that pops up (the MS-DOS command prompt-looking window that launches after GMS compiles your program), you’ll notice a line near the bottom that gives a unique code in quotes (the text preceding that line should read something to the effect that you need to use that code in your AdMob application. I can’t remember the exact text though). Copy the code to the clipboard by right clicking >> marking, highlighting the code, then hitting enter. Paste this code in the Device ID field in Game Maker Studio at the bottom of the Advertising tab settings for Android. You can now enable “Test Ads” by checking the appropriate box.

Lastly, we have to actually enable and specify the position of the ad in the room. Create an object, and in the create event, write the following line of code:

ads_enable(0,0,0);

The first argument is the x position, second argument is y position, and third argument is which ad you’d like to enable (which “key”, and as we pasted our code in key0, we would thus enable ad 0).

And you’re good to go! Test compile your game again, and you’ll now notice a blue box that represents the position and dimensions of your ad. If you’d like to see what your ad really looks like with real advertisements, just uncheck the “Use Test Ads” box.

Just a couple things to note. First, be very aware of the terms and guidelines for using AdMob/AdSense/AdWords. Most of it is common sense, like never pairing ads with illegal, crude, discriminatory, violent content, ensuring that the ad is clearly separate from the game, not misleading the player to click it in any means whatsoever, etc. You have to make sure to never EVER click your ad! EVER. I’ve heard many horror stories about accidentally clicking your ad, and having your AdMob account terminated. This is because every click, of course, should be representative of a consumer taking interest in an ad, clicking it, and thus generating revenue for you, the app developer. If you click on it yourself, that’s basically stealing money. So don’t do it, bad man.

One other thing I’d like to touch on real quick. Be aware of where and when to position ads. Each ad type has a set width and height in pixels, and this can cause some major frustration running the same app with advertisements on devices with different resolutions. If, for example, your ad covers a width of 300 pixels and you run it on a Nexus 7, it’ll take up just a little space. Run it on a low resolution phone though, and the ad covers a significant portion of the screen, possibly even blocking gameplay elements. The ad is NOT resized appropriately to the resolution of the device displaying it. If the ad is 300 pixels, then no matter what device you run it on, gosh darn it, it’ll take up all of those 300 pixels. How do we work around this?

I haven’t experimented yet, but I’d assume the best case is – place ads in positions where they can’t mess up! Far away from buttons, areas of the screen where users would never touch, places that wouldn’t look distracting, a distance from important menu elements and graphics, etc. This doesn’t always necessarily guarantee 100% compatibility on all devices, but you need to aim for the majority of the market, and the tiny list of devices that would encounter problems? You can check their resolution, then literally adjust menu and ad positions ingame to accommodate for differing resolutions.

And finally, when and where to display ads? Anywhere you’d like, so long as it doesn’t detract from gameplay! The most common areas for a banner seem to be on title screens and all menus, and in some cases, in gameplay too (but title screen/menus combination for banners seems to ring true to the majority of apps). Mostly, the ad is centered on the x axis, and at the very top or bottom of the screen on the y axis. And Interstitial ads? If your game includes longer levels, then after every couple of levels is fine, but if your app has you switching between levels every 15 seconds, you might want to hold off and instead display an interstitial ad in a timed interval (eg. every 90 seconds).

A good rule to follow when deciding where to place ads? Get your information across, but just don’t be a jerk about it (I was enjoying a game earlier, but I just could NOT continue playing, when each round lasted 20 seconds, and I’d be greeted with a 5 second fullscreen interstitial ad after every single round. No thanks!)

Hope this helped! The AdMob setup information might be slightly off, as I’m still new and I wrote that from my hazy memory. I’ll be sure to update as I come across more advertising opportunities and tips!

Weekly Assessment – week 1

Something that I’d like to become a weekly requirement for this blog: Posting a brief analysis and update about my progress for the week, as well as goals and projected accomplishments for the following week. Of course, I use the word “requirement” very loosely. I won’t hold myself to doing these updates, but it’s definitely recommended. I’ll aim for every Monday.

This past week, I made two new tracks (music) for PBall, fixed a few glitches, made some extremely minor graphical improvements, and some other little adjustments. I also created the trailer (which was actually a lot of fun!). As it’s a simple arcade game, I thought an equally simple 25 second trailer would cover pretty much everything I needed to touch on. I’m trying to prepare the app for launch ASAP, but being that this will be my first publicly released title, there is quite a bit left to do before I can launch. This includes signing up to distribute my apps on Google Play, getting my company bank account in order, revamping the official site (right now it’s pretty much just a basic “Coming Soon!” splash page), and a whole slew of other headaches. Also, as is the requirement for just about every app (or at least the ones I’d like to protect), I have to register the domain name, create the social network pages (Youtube, Facebook, Twitter), and create promotion material. All of this is the part of game development I sort of… despise: Marketing, financial stuff. It’s not terrible, but it’s a bit monotonous, but it must be done.

If I could sit down and make a game, then hand it off to someone else to do all the marketing and promotion, register it across the web, deal with getting it on a digital distribution platform, etc., I’d be a happy duck. But ducks aren’t always happy. And until my company expands enough and generates enough revenue to hire somebody (who loves that stuff) to do that stuff, I’m at a bit of a loss with doing “only what I want”. I’m not sure why I put that in quotes. I’ve never spoken or typed those words in my life, prior to that sentence.

I also began planning out code for my 2nd appstore title and solved some quadratic curve stuff. Basically, I needed an object to start at point A and move to point B, BUT I needed to specify the number of steps to transition from point A to point B while easing into and out of a third arc-point between the two, with the engine calculating the most realistic projection of when to increase and decrease the vertical movement. It’s all “Jump from here to there in a certain number of steps and make it look realistic, so solve the acceleration and physics”… it works well! Of course, considering the complexity involved in the game, I could’ve done something much, much simpler, but it’s nice to have these scripts handy so I can reuse them for more tolling games. And plus, it opens the possibilites for expanding upon this game.

Lastly, I read up a bit more about managing an LLC. Heads up, don’t buy the LLC for Dummies book. The 2nd edition is terribly outdated, and as laws governing an LLC may change rather quickly, it’s best to purchase one of the more recent publications dealing with LLC formation and management. I began reading a different book, NOLO’s Guide to LLC’s (or something, that may not be the exact title), and within the first 20 pages, I already found 3 or 4 facts that render the Dummies book grossly outdated (for example, single member LLCs are allowed in ALL states now, and additionally, a single member LLC CAN register to be taxed in other methods rather that a disregarded entity/pass-through taxation).

So what’s this week entail? I’d like to have good design docs roughed out for 2 more titles. Also, implementing ingame advertising in PBall, or at least grasping the entire concept. I’m beginning to understand a few things about planning:

First, daily goals are BAD. It’s a terrible idea to lock yourself into set goals every day, especially if some of the later ones piggyback off of the earlier ones. You might be saying, “What?! You fool, daily goals are the essence of life!” Let me explain –  If, for example, you get sick for a day, or something comes up and you can’t devote enough time as you had thought, or you get distracted by a temporary emotional/physical/health problem, or a random headache sets in for a few hours, or you suddenly have to babysit the kids for the night, etc. If you work on game development fulltime, then daily goals might be much more manageable. Me, on the other hand, considering I work a separate fulltime job and indie game dev is purely in my limited spare time, I instead like to stick to….

Weekly goals!  If you plan to have something accomplished by the end of the week and some upset occurs during the week, it’s not the end of the world! You have other days to play catch up. It allows you to think a bit larger in the scope of things. And then, there’s monthly goals, which should be set in conjunction with weekly goals.

I’ll share more planning tips as I encounter/experience them. Back to work!

 

How I Focus at a Local Cafe

On Sundays after church, I usually set aside about 4 – 6 hours and head over to a local cafe/bookstore. It’s during this time that I’m by far the most productive out of the entire week. Well, perhaps not the most productive per se, but undoubtedly the most focused. One of the biggest distractions while trying to get anything done is the Internet, and my mental conversation usually unfolds as follows: Oh hi, Internet, you have some Facebook posts and some tweets and tech news you’d like me to take a look at? Oh, of course! I mean, I’m in the middle of trying to build my future, but Internet, your seductive ways are reason enough for me to sacrifice everything I am just for a few meager seconds of 9gag! No, truthfully. The cafe I frequent does have WiFi, but I never ask for the password. In all honesty, I don’t want the password. I want to not trust their networks. I want to compile a list of reasons why using their Internet would be a very, very bad idea, all for the sake of trying to prevent myself from allowing the Internet to consume the entirety of my soul during focused work hours. This is also the same reason I’m a bit weary of upgrading to a smartphone (I have a few, but none on any Internet-capable networks) , I know that if I have the Internet with me 24-7, I won’t be able to resist constantly pulling out my phone and checking random junk. Once I cut out the Internet, progress is golden – no more major distractions.

Plus, it’s so enjoyable sitting down in a comfortable chair working away in a nice, airy light cafe with a beautifully inviting atmosphere and tons of open space, people all around, the social activity, with a tall coffee and a mini supreme pizza in front of me… much nicer than it is sitting all alone at home in my bedroom in a crowded tiny space hunched over my monitor trying to prevent myself from launching Chrome. And the most unusual thing of it all? The cafe should be a distraction, considering the busy hustle of people walking in and out, children laughing and yelling, couples engaging in loud conversations a few tables over, the employees blending coffee, taking orders, dishes clanking, but for some odd reason, I can tune it all out. It sort of just becomes rhythmic noise in the background, part of the ambiance of the locale, just like the beating of the rain or the rustling of the leaves on a windy day (Woah, did this become creative writing class?).

So for all of you who seem to constantly find yourself distracted, unable to focus, uncomfortable, maybe it might simply be time for a change of environment. It’ll do your focus wonders.

Or take some pills. Just kidding, don’t do that.

Intro

Hey.

This is about the 387th blog that I’ve started, and as per the usual, I have to toss in a slight disclaimer: I may disappear for months at a time, or even years, only to suddenly resurface with a completely unexpected and awkwardly random post.

I’ve needed a blog for awhile now to detail my adventures towards game development. I like the title indie… it has a sort of ‘Random-dude-with-big-aspirations-coding-in-his-spare-time-in-his-bedroom’ sort of feel. Which is exactly what the situation is.  But more importantly, I need this blog to serve as a place to store all of my notes, a good compilation of steps during my journey that I can reference whenever.