Releasing GameMaker games: automating bug reports like a pro Part 1

Yuan Gao (Meseta)
4 min readFeb 23, 2019

--

Your development story doesn’t end at release. You have to support the game and release patches and updates to correct for bugs found by your players.

It’s challenging to get every one of your players to submit detailed bug reports when the find a bug. If you’re lucky, dedicated players will diligently copy/paste error messages for you, and dig out your games log files and send them. This is a process best automated.

Luckily, there is an excellent service for collecting bug reports: sentry.io, an error tracker that helps you collect, filter, and sort bugs. It’s used by companies like Reddit, Dropbox, Uber, Airbnb and many others.

I’ve written a simple (and free) GameMaker Studio 2 extension to put the power of sentry.io automated bug reporting into your hands: GMSentry . With the help of YellowAfterlife’s catch_error extension for GameMaker, it becomes possible to automatically catch errors in GMS2 games, and automatically submit them to your sentry.io account for perusal.

Below is an example of GMSentry and catch_error being used during development and beta testing of the GMS2 game Forager.

What a list of bug reports might look like. Forager’s development/beta test bug reports

In this blog post, I show how you’d set up a sentry.io account and start collecting automated bug reports.

In Part 2, I document how GMSentry works.

Step 1: Sign up for a free sentry.io account

Go to sentry.io and click on “Get started”, and follow the signup instructions to create an account.

When asked to choose a language or framework during the signup process, just go ahead and ignore that section.

No need to select a language or framework when registering

At the end when asked to configure your application, you can go ahead and ignore that and the possible “Page Not Found” error, and just click on “All Done!”

Ignore this, just clicke “All done!”

It’s also worth noting that sentry.io is actually an open-source project, meaning you can run a copy of their entire service internally, and modify or contribute to the code if you wanted to.

Step 2: Get your project’s DSN

Once registered, go to Settings > Projects; then click on the new project you created to get into the project settings. Then go to Client Keys (DSN). The DSN is the key your game needs to send reports to the right sentry.io account.

Your project’s DSN. Copy this!

Copy the first short DSN.

Step 3: Get the GMSentry extension

Acquire my GMSentry extension from the YYG marketplace and install it into your project

Import GMSentry

Step 4: Initialise GMSentry

At some point in your code, before any other gmsentry functions are used, initialise GMSentry using the sentry_init("<your DSN here>") function, including your DSN from Step 2 as the only argument. This will automatically spawn a persistent sentry_handler object into your room.

This is not a real DSN

Step 5: Install YAL’s catch_error

YellowAfterlife’s catch_error extension is an invaluable extension for all GMS2 professionals releasing a game. It taps into GMS2’s error system and allows you to pull out the error as a string in GML, and pass it onto GMSentry to be fired off to sentry.io. Using these three systems together allows errors that normally cause the game to quit to be handled by the game itself.

Follow instructions on installing the catch_error extension on https://yellowafterlife.itch.io/gamemaker-catch-error

Step 6: Write your error catching code

To use catch_error with GMSentry, it’s as simple as dequeuing errors from catch_error’s queue in a step event or equivalent, and firing off a setry_capture_exception which accepts GM’s error strings.

Put this in a step event

Your game now has automated error reporting! Any time your game encounters an error that can be caught with catch_error, GMSentry will send it over to sentry.io (as long as the player has an internet connection of course).

For advanced usage and customization, see Part 2

Appendix A: Removing GMSentry extension

To remove GMSentry extension resources, delete sentry_handler object and all scripts under the sentry folder (they all begin with sentry_)

--

--

Yuan Gao (Meseta)

🤖 Build robots, code in python. Former Electrical Engineer 👨‍💻 Programmer, Chief Technology Officer 🏆 Forbes 30 Under 30 in Enterprise Technology