Skip to content
Dashboard

Offline Queue & Crash Catcher

Game environments are unpredictable: players enter airplane mode, subway tunnels drop Wi-Fi connections, and runtime exceptions can abruptly terminate the process.

The LogLudo GameMaker SDK is engineered with a multi-layered offline storage system, automatic crash recovery, and privacy-exempt cohort tracking.


1. Offline Event Resilience (logludo_offline.json)

Section titled “1. Offline Event Resilience (logludo_offline.json)”

To guarantee telemetry is never lost when a player’s connection drops:

  1. In-Memory Buffering: Every dispatched event enters the in-memory array LOGLUDO.event_buffer.
  2. Periodic Background Autosave: A recurring global time_source writes the buffer to logludo_offline.json every 5 seconds:
    scr_LOGLUDO.gml
    var _logludo_save = time_source_create(time_source_global, 5, time_source_units_seconds, function() {
    if (variable_global_exists("logludo_sdk")) {
    LOGLUDO.save_offline();
    }
    }, [], -1);
    time_source_start(_logludo_save);
  3. App Lifecycle Triggers (os_is_paused): If the user minimizes the game window on desktop or switches apps on iOS / Android, obj_LOGLUDO’s Step_0 detects os_is_paused(), immediately commits the buffer to disk, and triggers an urgent flush.
  4. Graceful Quit (Other_3): When the game closes normally, the SDK dispatches session_end, saves the buffer to disk, and attempts a final HTTP flush.
  5. Cold Boot Replay: When the game next launches, LOGLUDO.init() automatically checks for logludo_offline.json. Any unsent events are restored into event_buffer and transmitted as soon as internet connectivity returns.

2. Unhandled Crash Catcher (logludo_crash.json)

Section titled “2. Unhandled Crash Catcher (logludo_crash.json)”

When an unhandled runtime error occurs in GameMaker (such as referencing an undefined variable or accessing an out-of-bounds array index), the engine typically displays an error popup and terminates the game.

The LogLudo SDK registers a global exception interceptor using exception_unhandled_handler():

scr_LOGLUDO.gml
exception_unhandled_handler(function(ex) {
// Trap the fatal crash in a JSON file before the game dies
var _f = file_text_open_write("logludo_crash.json");
var _crash_data = {
severity: "fatal_crash",
message: ex.message,
stack_trace: ex.longMessage,
current_scene: room_exists(room) ? room_get_name(room) : "unknown"
};
file_text_write_string(_f, json_stringify(_crash_data));
file_text_close(_f);
show_message(ex.longMessage);
return 0;
});

Because the game process is terminating, attempting an asynchronous HTTP request during a crash is unreliable across operating systems.

Instead, the SDK uses a post-mortem recovery pattern:

  1. The crash details, error message, full call stack (longMessage), and active room name are trapped into logludo_crash.json.
  2. When the player re-opens your game, obj_LOGLUDO’s Create_0 detects logludo_crash.json.
  3. It immediately forwards the saved crash report as an "error" telemetry event to the LogLudo dashboard.
  4. Safely deletes logludo_crash.json.

You will see fatal crashes appear in your dashboard with the exact callstack, line number, and level where the crash occurred!


3. Privacy-Exempt Cohort Tracking (logludo_device.json)

Section titled “3. Privacy-Exempt Cohort Tracking (logludo_device.json)”

LogLudo is built from the ground up for strict compliance with GDPR, CCPA, and COPPA. The SDK never inspects or transmits device MAC addresses, IMEI numbers, advertising IDs (IDFA/GAID), or persistent user identities.

Instead, the SDK stores anonymous mathematical values in logludo_device.json:

logludo_device.json
{
"game_id": "9d3135a3-09a8-4bef-a855-41e5e677a8e4",
"bucket": 4,
"install_time": 1727549129,
"session_count": 8,
"active_mask": 73,
"first_open_date": 1727549129,
"last_session_date": "2026-9-28"
}

How does LogLudo calculate D1, D7, and D30 retention without tracking player identities?

  • On first launch, the game records first_open_date and assigns a random A/B test bucket (integer 1..10).
  • On every session launch:
    days_since_install = max(0, floor((logludo_get_unix_time() - first_open_date) / 86400));
    if (days_since_install <= 30) {
    active_mask = active_mask | (1 << days_since_install);
    }
  • By shifting a single bit for each day the user opens the game, a compact 32-bit integer (active_mask) records exactly which days across the player’s first month they returned.
  • This bitmask is transmitted with the session_start payload, enabling deep cohort retention analysis without retaining any personal activity history.