Quick answer: A GameMaker bug report button is one persistent controller object plus one line that opens the form. Add the Bugnet script to the project, create an object such as obj_bugnet with Create, Async - HTTP, Draw GUI, Key Press - Any, Global Left Pressed, Step and Game End events, and call bugnet_show_widget() from a key, a pause-menu button or a gamepad button. The Async - HTTP event is the one people forget, and without it the SDK never receives a single server response.

GameMaker gives players no way to tell you what went wrong short of leaving the game and writing a forum post. A report button inside the game closes that gap, and because GameMaker has no background threads the whole thing hangs off the events of a single object. This guide builds that object event by event, wires the button three ways (keyboard, pause menu, gamepad), keeps the game from reacting while the player types, and adds the context that makes a report fixable: the room, the save slot and a screenshot.

Add the script

The GameMaker SDK is a single GML script. From the project root (where the .yyp file is), this downloads it into scripts/BugnetSDK/:

curl -s https://bugnet.io/sdks/gamemaker/install.sh | bash

Or do it by hand: download BugnetSDK.gml, create a Script asset named BugnetSDK and paste the contents in. There is nothing else to install. Windows users have a PowerShell one-liner in the SDK docs.

Create the persistent controller object

Create an object called obj_bugnet, tick Persistent, and place one instance in the first room of the game. Then add these events. Each is a single line:

EventCodeWhat it does
Createbugnet_init("sk_live_your_key", "https://api.bugnet.io");Starts the SDK and a play session
Async - HTTPbugnet_async_http();Receives every server response
Draw GUIbugnet_draw_widget();Draws the report form
Key Press - Anybugnet_widget_input(keyboard_key);Typing, Tab, Enter and Escape in the form
Global Left Pressedbugnet_widget_click(device_mouse_x_to_gui(0), device_mouse_y_to_gui(0));Clicking fields and buttons
Stepbugnet_check_freeze();Notes room changes in the SDK’s log
Game Endbugnet_cleanup();Ends the session and frees buffers and surfaces

The API key is on your project’s Integrate tab. It is an ingestion key meant to ship inside the game: it can file reports and read SDK settings, and nothing else.

Why the Async - HTTP event matters

http_request in GameMaker returns immediately with a request id. The answer arrives later, as an Async - HTTP event on whichever instances have one. If no instance has that event, the response is simply dropped.

The SDK depends on those responses for three things. At startup it asks the server for the project’s settings, which is how it learns whether screenshot capture is switched on in your dashboard. After a report it reads the new report’s id, which it needs to send the performance snapshot, to upload a session replay, and to call your own callback. Without bugnet_async_http() in an Async - HTTP event, the settings never load, so screenshots stay off, and nothing that follows a report ever happens. If screenshots are missing from every report, check this event first.

Open the form from a key, a menu and a gamepad

The form is shown with one call. Add it to the controller’s Step event, after bugnet_check_freeze():

// obj_bugnet: Step
bugnet_check_freeze();

if (!global.bugnet_widget_visible) {
    if (keyboard_check_pressed(vk_f1) || gamepad_button_check_pressed(0, gp_select)) {
        bugnet_show_widget();
    }
}

The visibility check matters: bugnet_show_widget() clears the fields each time it is called, so without it a second press of F1 would wipe what the player had typed. A hotkey is fine for testers. Players need something they can see, so add a “Report a bug” entry to your pause menu and have it call the same function:

// In your pause menu, when "Report a bug" is chosen
bugnet_show_widget();

Escape closes the form, Enter submits it, and Tab moves between fields. The category and priority selectors cycle to the next option each time they are clicked. Both a title and a description are required; a report with either one empty is not sent, so say so in your menu text if your testers are terse.

There is one trap with pause menus. If your pause works by calling instance_deactivate_all(true), it deactivates the controller as well, and a deactivated instance runs no events: no drawing, no input, no HTTP responses. Reactivate it straight away:

instance_deactivate_all(true);
instance_activate_object(obj_bugnet);

Stop the game reacting while the player types

The SDK routes key presses into the form, but it cannot stop your own objects from reading the same keys. Typing “jump” in the description should not make the character jump. The form’s state is a global, so gate your input on it:

// obj_player: Step (first line)
if (global.bugnet_widget_visible) exit;

Do the same in any object with its own mouse events. bugnet_widget_click() returns true when the click landed on the form, which is useful if the controller itself also handles clicks for something else:

// obj_bugnet: Global Left Pressed
if (bugnet_widget_click(device_mouse_x_to_gui(0), device_mouse_y_to_gui(0))) exit;
// ...anything else this object does with a click

The built-in form keeps text entry deliberately simple: it reads key presses, which suits a short title and a sentence or two. If you want full text entry (lower case, punctuation, non-Latin input), draw your own form from keyboard_string and submit it with bugnet_report_bug(), which is what the built-in form calls underneath.

Report from code, with context

bugnet_report_bug() takes a title and description, then optional category, priority, steps, expected and actual behaviour, a metadata struct and an array of file paths:

bugnet_report_bug(
    "Quick report from " + room_get_name(room),
    "Player flagged a problem with the gamepad shortcut.",
    "gameplay",
    "medium",
    "", "", "",
    {
        room: room_get_name(room),
        save_slot: global.save_slot,
        checkpoint: global.checkpoint,
        fps_real: fps_real
    },
    ["save" + string(global.save_slot) + ".json"]
);

This is the answer for controller-only players, including anyone on a Steam Deck without a keyboard attached: bind a button to a one-press report like this one, show a short “Report sent, thank you” message, and you get the room, the save file and a screenshot without the player typing a word.

The metadata struct is stored on the report as free-form JSON (up to 16 KB) and shown in the dashboard. Attachment paths are read with buffer_load, so they must be inside the game’s sandbox, which is where your save files already are. Up to 10 files, 10 MB each, and they must be text, image, video or JSON.

Titles matter more than they look. Reports with exactly the same title are stacked onto one bug as extra occurrences, so a fixed title per room groups quick reports by where they happened. Put anything unique, such as coordinates, in the metadata instead.

Add context to reports from the form

Reports typed into the built-in form do not pass through your code, so they carry no metadata of their own. The fix is the on-reported callback, which runs after any report is accepted and hands you its id. Upload a small state file to it:

// obj_bugnet: Create, after bugnet_init(...)
bugnet_set_on_bug_reported(function(_bug_id, _report_number) {
    var _state = json_stringify({
        room: room_get_name(room),
        save_slot: global.save_slot,
        checkpoint: global.checkpoint,
        playtime_s: get_timer() div 1000000
    });

    var _buf = buffer_create(string_byte_length(_state), buffer_fixed, 1);
    buffer_write(_buf, buffer_text, _state);
    bugnet_upload_attachment_buffer(_bug_id, "state.json", _buf, "application/json");
    buffer_delete(_buf);

    bugnet_upload_attachment(_bug_id, "save" + string(global.save_slot) + ".json");
});

The callback fires from inside bugnet_async_http(), which is one more reason that event has to exist. bugnet_upload_attachment_buffer() does not free the buffer you pass it, so delete it yourself as shown.

Screenshots and the player’s identity

You do not call anything for screenshots. When Screenshot Capture is on for the project in the dashboard, every report includes one, and you can switch it off later without shipping a build. The image is copied from application_surface, which has two consequences. The report form is never in the picture, because it is drawn on the GUI layer. And neither is anything else you draw in Draw GUI, such as a HUD, so a bug in the HUD itself needs a sentence of description.

To tie reports to a player, call bugnet_set_player() once you know who they are. With the Steamworks extension:

bugnet_set_player(string(steam_get_user_steam_id()), steam_get_persona_name());

A third argument takes an email address if the player has given you one and you want to be able to reply. Every report also carries the platform, the OS, a hardware summary and the version from Game Options (GM_version), so bump that version on every release or you will not be able to tell which build a report came from.

Common mistakes

What about crashes?

A report button covers bugs the player can describe. For runtime errors you catch yourself, the SDK has a helper that takes the exception struct from a try/catch and files it with its stack trace and the recent lines you wrote with bugnet_log() or bugnet_debug_message():

try {
    load_level(_level_id);
} catch (_ex) {
    bugnet_exception_handler(_ex);
    room_goto(rm_menu);
}

Errors nobody catches end the game, and a request started at that moment never completes. bugnet_init() therefore registers an unhandled exception handler that saves the error to a file in the save area and files the report the next time the game starts. You get this without writing anything, as long as the controller object and its Async - HTTP event are in place on that next launch. How the mechanism works, and how to combine it with a handler of your own, is covered in GameMaker exception_unhandled_handler: Catch Crashes and Save the Error Before the Game Closes.

Where the reports go

Every report lands in your Bugnet project with its screenshot, attachments, metadata, platform and version. Identical titles are stacked with an occurrence count, so you can see which problems are common. From the dashboard you can assign and prioritize reports, get a Discord or Slack message when a new one arrives, and publish a public tracker so players can see what is already known. The free plan covers one project and up to 100 bug reports, enough for a demo or a closed playtest. The full function list is in the GameMaker SDK docs, and Bugnet for GameMaker has the overview.

Frequently asked questions

How do I send a bug report from a GameMaker game to a server?

Use http_request with a POST body and handle the answer in an Async - HTTP event, because GameMaker HTTP calls are asynchronous. A bug reporting SDK wraps this: you call one function with a title and description and it builds the JSON, adds the platform and version, and sends it.

Why does my GameMaker bug report widget not appear?

The widget is drawn by a function call in a Draw GUI event. If the controller object has no Draw GUI event, is not in the room, or has been deactivated by a pause system that calls instance_deactivate_all, nothing is drawn even though the widget is open.

Does the controller object need to be persistent?

Yes. Mark it Persistent and place it once, in the first room. A non-persistent controller is destroyed on every room change, which loses in-flight HTTP responses and hides the widget, and placing it in several rooms initializes the SDK more than once.

Can gamepad players report bugs in a GameMaker game?

They can open the form from a gamepad button, but typing needs a keyboard. For controller-only players, bind a button to a one-press report that sends a fixed title with the room, save slot and a screenshot, so they can flag a problem without typing.

Does the screenshot include the bug report form?

No. The screenshot is copied from the application surface and the form is drawn on the GUI layer, so the form is never in the picture. Anything else you draw in Draw GUI, such as a HUD, is left out for the same reason.

One persistent object with the right events is the whole integration. Most broken setups are a missing Async - HTTP event or a controller that a pause menu deactivated.