Format:GameMaker data file
| On this wiki | Facts · Code · Notes · Topics |
|---|
The single data file of a GameMaker game (data.win and its platform variants): an IFF-like container with the magic FORM, followed by 4-character chunks each with a u32 length, in which GEN8 gives the bytecode version and CODE, VARI, FUNC and STRG hold the GML bytecode, its variable and function reference chains and all strings.
Container
The file begins FORM plus a u32 length, then chunks laid back to back. Every chunk is name[4], u32 length, then that many bytes; there is no table of contents, a reader walks the chunk headers once to learn all names (as UndertaleModTool does) before parsing. Little endian.
Chunk names
GEN8 (general info), OPTN, LANG, EXTN, SOND, AGRP, SPRT, BGND, PATH, SCPT, GLOB, GMEN, SHDR, FONT, TMLN, OBJT, ROOM, UILR, DAFL, EMBI, TPAG, TGIN, CODE, VARI, FUNC, STRG, TXTR, AUDO, plus the GameMaker Studio 2 additions ACRV, SEQN, TAGS, FEAT, FEDS, PSEM, PSYS. GEN8 is always first.
GEN8
Fields in order: u8 IsDebuggerDisabled, u8 BytecodeVersion, u16 padding, string FileName, string Config, u32 LastObj, u32 LastTile, u32 GameID, 16 bytes DirectPlay GUID, string Name, four u32 version numbers (major, minor, release, build), u32 window width, u32 height, u32 info flags, u32 license CRC32, 16 bytes license MD5, u64 timestamp, string DisplayName, u64 ActiveTargets, u64 FunctionClassifications, i32 SteamAppID, then (bytecode 14 and later) u32 DebuggerPort, then the room order list. Strings are u32 pointers (absolute file offsets) into STRG.
Bytecode versions
13 to 17 are known. 14 and older keep each code entry's instructions inline; 15 and later give each code entry a locals count (u16), an arguments count (u16, high bit 0x8000 is a flag) and a relative pointer into a shared instruction blob, so a child entry (a function inside a script) can share its parent's bytecode. VARI entries carry an instance type and variable id from version 15. GameMaker Studio 2 stays at 17.
YYC and VM. A VM build keeps the GML as bytecode in CODE, with VARI and FUNC naming variables and functions. A YYC build leaves CODE, VARI and FUNC present but empty (length 0) because the GML is compiled into the runner executable, so data.win then only holds assets and strings; UndertaleModTool cannot decompile such code. See Format:GameMaker data file#GMS2 version detection.
GMS2 stays at 17. Bytecode 17 has not changed since early GameMaker Studio 2; the runtime version is deduced from GEN8's four version numbers and from which chunks exist (TGIN 2.2.1, SEQN 2.3, FEDS 2.3.6, FEAT 2022.8, PSEM 2023.2, UILR 2024.13). Features inside chunks add further hints (for example the CodeLocals list of FUNC disappears in 2024.8; TXTR changes at 2022.3 and 2022.5). The LTS 2022 branch lacks some newer features, which is why a Branch field (Pre2022_0, LTS2022_0, Post2022_0) exists in the tool.
STRG
A count, then pointers to the strings, padded so the chunk ends on a 0x80 boundary. Other chunks refer to a string by the absolute address of its text.
Related
GMS2 version detection
UndertaleModTool runs a counting pass over all chunk headers before parsing, then tests chunk names against the table in Format:GameMaker data file#Bytecode versions. Other file names with the same container: data.win (Windows), game.unx (Linux), game.ios. Unverified: game.droid on Android; audio groups (audiogroupN.dat) as separate FORM files with only AUDO. The reader does skip game-specific setup when GEN8 is missing, with a comment naming audio group files.
Code & repositories
- https://github.com/UnderminersTeam/UndertaleModTool @
f43e12c445c37d50dc6244caa12ccab232983f3f· license: GPL-3.0-only (declared by the contributor; GitHub's detector did not recognize LICENSE.txt)
UndertaleModTool: C# library and GUI that reads and writes GameMaker data.win (chunk layouts, bytecode 13-17, GMS2 version detection) and decompiles GML.
Tested on: source read, not run: source read only · checked 2026-10-18