What is GMRoomLoader? β
GMRoomLoader is a pure GML Free and Open Source GameMaker library made for creating room prefabs and loading room contents at runtime, AKA "loading other rooms into the current room".
It provides tools to process the data returned by room_get_info(), use that data to load room contents efficiently during gameplay, and clean up created elements when needed.
Use Cases β
- Procedural Generation. Create custom level templates and place them procedurally throughout your levels (e.g. dungeon rooms, chunks, NPCs or randomized props).
- Chunking. Divide large worlds into smaller chunks that dynamically load when players approach and unload when they move away.
- Room Thumbnails. Take screenshots of your rooms and use them in level selection menus, seamless room transitions or loading previews.
- UI. Design your interfaces directly in the Room Editor and load them on the fly in-game (as of 2024.13,β this is mostly superseded by GameMaker's UI Layersβ).
DISCLAIMER
GMRoomLoader is designed specifically for loading room contents.
It does NOT provide tools for procedural generation or level layout creation of any kind (like deciding which room to load and where to place it). You'll need to handle that yourself.
Features β
- Pure GML Implementation. No extensions or external tools required.
- Easy Data Handling. Initialize and remove data in multiple ways: Single or Multiple, Array, Prefix, Tag, All. Retrieve core room parameters with Getters.
- Flexible Loading. Load Full Rooms, Instances or Tilemaps at any position in the current room, with optional Origin, Scaling, Mirroring, Flipping and Rotation.
- Filtering Options. Filter elements by Asset Type and/or layers by Layer Name.
- Full Lifecycle Control. Manage loaded contents with Payload tracking - Fetch IDs and Destroy loaded elements.
- Screenshotting. Capture room Screenshots from anywhere, without ever visiting target rooms - with optional part definition, scaling and filtering.
- Fluent State Builder. Configure optional arguments before loading or screenshotting in a simple, English-like flow.
How does it work? β
GMRoomLoader works by calling room_get_info() to grab the raw data of a room, parsing that data, optimizing it for loading, and then rebuilding room layers and elements when you use its Loading methods.
GameMaker can only have a single room active at a time and GMRoomLoader doesn't magically change that. Instead, it recreates the contents of other rooms inside the current room.
GameMaker Awards 2024 β
GMRoomLoader was nominated for Best Tool in the 2024 GameMaker Awards!