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:
- In-Memory Buffering: Every dispatched event enters the in-memory array
LOGLUDO.event_buffer. - Periodic Background Autosave: A recurring global
time_sourcewrites the buffer tologludo_offline.jsonevery 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); - App Lifecycle Triggers (
os_is_paused): If the user minimizes the game window on desktop or switches apps on iOS / Android,obj_LOGLUDO’sStep_0detectsos_is_paused(), immediately commits the buffer to disk, and triggers an urgent flush. - Graceful Quit (
Other_3): When the game closes normally, the SDK dispatchessession_end, saves the buffer to disk, and attempts a final HTTP flush. - Cold Boot Replay: When the game next launches,
LOGLUDO.init()automatically checks forlogludo_offline.json. Any unsent events are restored intoevent_bufferand 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():
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;});Post-Mortem Crash Reporting
Section titled “Post-Mortem Crash Reporting”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:
- The crash details, error message, full call stack (
longMessage), and active room name are trapped intologludo_crash.json. - When the player re-opens your game,
obj_LOGLUDO’sCreate_0detectslogludo_crash.json. - It immediately forwards the saved crash report as an
"error"telemetry event to the LogLudo dashboard. - 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:
{ "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"}Mathematical Bitmask Retention
Section titled “Mathematical Bitmask Retention”How does LogLudo calculate D1, D7, and D30 retention without tracking player identities?
- On first launch, the game records
first_open_dateand assigns a random A/B testbucket(integer1..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_startpayload, enabling deep cohort retention analysis without retaining any personal activity history.