A tool for unpacking and modding GameMaker games such as Undertale or Deltarune.
- Parsing and building data files is ~8x faster than UndertaleModLib.
- Clean and maintainable library code.
- Thorough documentation on docs.rs.
- Configurable lenient options for trying to load half-broken data files (see
LoadingOptions). - Helpful error messages:
- No
NullReferenceException, ever!!! - No meaningless stack traces over 50 lines long.
- Still more information than just "Reading out of bounds".
- Strict data integrity checks catch errors earlier, making debugging easier.
- No
This is an example error trace printed out using error.chain():
Invalid boolean value 4294967295 (0xFFFFFFFF) at position 51924
> while deserializing element 1/3 of sequence::track::keyframe::Keyframe<sequence::track::keyframe::color::Color> simple list
> while deserializing element 0/1 of sequence::track::Track simple list
> while deserializing element 0/1 of nullable sequence::Sequence pointer list
> while deserializing chunk SEQN
> while deserializing GameMaker data file gm48/sixty-seconds_do-it-fast.win
LibGM supports unpacking GameMaker games made between GameMaker: Studio 1 and GameMaker 2026.
GameMaker Classic (GM8 and older) has a completely different format. You can use OpenGMK for these old games.
The new GMRT runtime (currently in beta) will also have a new format which LibGM will not support.
- GML Decompiler and Compiler not yet implemented. (Help would be greatly appreciated!)
- No editor GUI yet, only a Rust library.
| Feature | Default | Dependencies |
|---|---|---|
| catch-panic | enabled | |
| check-integrity | enabled | |
| bzip2-image | enabled | bzip2 |
| png-image | enabled | image/png |
catch-paniccatches panics in GameMaker (de)serialization functions and returns them as a LibGM error. (Panics can only occur when there is a bug in LibGM.)check-integrityenables alignment and constant validation while parsing. These checks may still be demoted to a warning usingLoadingOptions. Some checks regarding panic safety or memory allocation are always enabled.bzip2-imageenables (de)serialization of BZip2+QOI encoded texture pages. If you try to change the format of aGMImagethat stores BZip2-QOI data with this feature disabled, an error will be returned.png-imageenables PNG (de)serialization. In games older than GM 2022.2, you will not be able to serializeGMImages storingDynamicImages with this feature disabled.
Huge thanks to the Underminers Team! Without UndertaleModTool, this project would've been impossible. I also want to thank the people in the Underminers Discord who helped me along the way, especially @colinator27.
This project is licenced under the GNU Public License v3.0.
This means that all projects using this library must also be licensed under GPL-3 to protect the open source community.
All contributions are welcome! Whether that's a pull request, a feature you would like to see added, a bug you found; just create an Issue/PR in this repo. (Please do not submit AI-generated content.)
- GameMaker resource (de)serialization code is located in
libgm/src/wad/elem/. - Data file loading/saving code is located in
libgm/src/wad/load.rsandlibgm/src/wad/save.rs. - A disassembler and assembler are available in
libgm/src/gml/assembly/. - The highly desired
Instructiontype is inlibgm/src/gml/instruction.rs. - There is a basic CLI to interact with LibGM in
libgm-cli/src/.