Level Capture & Dev Mode
To overlay heatmaps, death markers, and player movement vectors onto your level layouts in the LogLudo dashboard, LogLudo needs an orthographic visual snapshot of your rooms.
The LogLudo GameMaker SDK features a Dev Mode Level Capture Engine that automatically captures, tiles, base64-encodes, and uploads your game rooms while you test your game inside the GameMaker IDE.
How Room Capture Works
Section titled “How Room Capture Works”Room captures are transmitted to LogLudo’s /capture endpoint. Because modern 2D game rooms often span thousands of pixels (e.g., 9000 × 6000 px), attempting to capture the entire room in a single surface would crash lower-end GPUs and exceed HTTP payload limits.
The SDK solves this with an asynchronous 3000px Tiling Engine:
+------------------+------------------+------------------+| Tile (0, 0) | Tile (1, 0) | Tile (2, 0) || 3000 x 3000 px | 3000 x 3000 px | Remainder px |+------------------+------------------+------------------+| Tile (0, 1) | Tile (1, 1) | Tile (2, 1) || 3000 x 3000 px | 3000 x 3000 px | Remainder px |+------------------+------------------+------------------+- Grid Calculation: Determines columns and rows (
ceil(room_width / 3000),ceil(room_height / 3000)). - Dedicated Render Camera: Employs GameMaker’s
view_camera[7]andview_visible[7]so your gameplay camera (view_camera[0]) remains completely undisturbed. - Chunk Processing State Machine:
- State 1: Creates a surface and positions
view_camera[7]over the current tile slice. - State 2: Waits 1 frame for GameMaker’s render pipeline to draw into the surface.
- State 3: Saves the surface, encodes it to base64, uploads the tile via
LOGLUDO.send_room_capture_tile(), frees the surface, and advances to the next tile.
- State 1: Creates a surface and positions
- Manifest Dispatch: Once all tiles are sent, the SDK calls
LOGLUDO.send_room_manifest()with the dimensions, tile size, and column/row counts. The LogLudo cloud reconstructs the level map into an interactive zoomable canvas.
Automatic Dev Capture on Room Load
Section titled “Automatic Dev Capture on Room Load”When running your game from the GameMaker IDE (GM_build_type == "run"):
- Exactly 1 second after entering any room (
room_timer == game_get_speed(gamespeed_fps)), the SDK checks if that room has been captured during this session. - If uncaptured, it initiates the background tiling capture without interrupting your gameplay.
- Each room is tracked in
captured_rooms, preventing repeated re-captures as you move back and forth between rooms.
Dev Mode Prompt on Launch
Section titled “Dev Mode Prompt on Launch”On game launch in dev mode, if room captures have not yet been performed and reminders are not snoozed, the SDK triggers a non-blocking get_integer_async() dialog asking whether you want to run the automated SceneLytics capture:
1(Default): Run the automated SceneLytics capture tour across all rooms.2: Skip for this session.3: Snooze / don’t remind for 1 week.
The developer response is handled cleanly via GameMaker’s asynchronous dialog event (Other_63.gml).
Automated Whole-Game Tour: The "capture" Secret Code
Section titled “Automated Whole-Game Tour: The "capture" Secret Code”If your game has dozens of levels, you do not need to manually play through each room to generate map captures. The SDK includes an automated room-sweeping tour:
-
Launch Your Game in the GameMaker IDE
Section titled “Launch Your Game in the GameMaker IDE”Run your project with F5.
-
Type
Section titled “Type capture on Your Keyboard”captureon Your KeyboardAnywhere during gameplay, simply type the letters:
c a p t u r e -
Sit Back and Watch
Section titled “Sit Back and Watch”The SDK intercepts
keyboard_string, activatesauto_capture_mode, and executes the automated tour:- Remembers your current starting room (
auto_capture_original_room). - Teleports to
room_first. - Waits 2 frames for tiles to settle, captures and tiles the room.
- Advances to
room_next(room). - Repeats until all rooms in your project tree have been captured and uploaded.
- Automatically teleports you back to your starting room and restores normal gameplay!
- Remembers your current starting room (