2 v1.2 - Zach, original by Charlie
4 This document loosely follows IsmAvatar's documenting style, mostly because my typical
5 documentation style doesn't work well with GM formats, seeing as how it expects the format
6 to not be completely fucked.
8 Note that many of the structures in the EXE follow closely to the GMK format.
9 Also note that types such as timestamps, booleans, doubles, etc use the same format as the
10 GMK. Refer to IsmAvatar's GMK documentation for more detail.
12 Comments will be inside of brackets, [ ]
14 GMK Format (>=v5.3a): http://www.ismavatar.com/lgm/formats/gmformat8.txt
16 Please let me know if you find any errors or can fill in an unknown field.
27 0 4b Version [ Settings ]
28 4 4b LenOfData { Compressed <Settings> }
30 0 4b LenOfStr { String } [ DX8 Wrapper ]
31 4 4b LenOfData { Compressed <d3dx8.dll> }
33 0 4b NumberOfDwords [ d1 ]
34 4 4b NumberOfDwords [ d2 ]
35 8 ?b Junk size of d1 * 4
37 0 ?b Junk size of d2 * 4
39 0 4b LenOfData { Data } [ Encrypted ]
41 0 4b NumberOfDwords [ d3 ]
42 4 4b Junk size of d3 * 4
48 18 4b Version [ Extensions ]
54 0 4b Version [ Triggers ]
57 0 4b LenOfData { Compressed <Trigger> }
60 0 4b Version [ Constants ]
66 <Sounds, Sprites, Backgrounds, Paths, Scripts, Fonts, TimeLines, Objects, Rooms>
70 0 4b LenOfData { Compressed data }
73 0 4b ID of last object placed
74 4 4b ID of last tile placed
76 0 4b Version [ Includes ]
79 0 4b LenOfData { Compressed <Include> }
83 4 4b LenOfData { Compressed <Help> }
85 0 4b Version [ Library Init Code ]
88 0 4b LenOfString { String }
91 0 4b Version [ Room order ]
102 --- Resource Formats ---
106 4 4b Interpolate colors
107 8 4b No border around window
112 1C 4b Color outside room
113 20 4b Set resolution/refresh rate/bit depth
114 24 4b Bit depth option
115 28 4b Resolution option
116 2C 4b Refresh rate option
117 30 4b No buttons in window caption
118 34 4b Use vsync to avoid tearing
119 38 4b Disable screensavers
120 3C 4b F4 changes to fullscreen
122 44 4b Esc closes game
123 48 4b F5 and F6 save and load respectively
124 4C 4b F9 takes a screenshot
125 50 4b Close button treated as Esc
127 58 4b Freeze on loss of focus
131 60 4b ProgressBack Present
133 64 4b LenOfData { Compressed <Bitmap> }
136 0 4b ProgessFore Present
138 4 4b LenOfData { Compressed <Bitmap> }
142 0 4b Background Present
144 4 4b LenOfData { Compressed <Bitmap> }
147 0 4b Loading screen is translucent
148 4 4b Loading screen translucency
149 8 4b Scale progress bar indicator
152 14 4b Errors are all fatal
153 18 4b Treat uninitialized vars as 0
158 4 4b Length { String <Name> }
159 0 4b Length { String <TempName> }
163 4 4b Length { String <Filename> }
164 0 4b Type [ GML, DLL, Lib, Other ]
165 4 4b Length { String <InitializationCode> }
166 0 4b Length { String <FinalizationCode> }
171 4 4b Length { String <Name> }
172 0 4b Length { String <ExternalName> }
173 0 4b CallType [ 2 = GML, 12 = stdcall, 13 = cdecl ]
174 4 4b Internal ID? [ Starts at 0x100 ]
177 0 4b ArgumentKind [ 1 = String, 2 = Real ]
183 4 4b Length { String <Name> }
184 0 4b Length { String <Value> }
188 [ Note: This section is a bit odd, Mark flip-flops
189 standards here a whole lot, sorry :/ ]
190 0 4b LenOfData { <Data> }
193 Encrypted { [ Length = CurPos - ExtensionSize ]
194 For Count* { [ Count = Count*? Not sure ]
195 0 4b LenOfData { Compressed <File> }
206 8 4b Length { String <Name> }
207 0 4b Length { String <Condition> }
209 8 4b Length { String <ConstantName> }
214 0 4b Length { String <Name> }
215 0 4b Length { String <Value> }
221 0 4b Length { String <Name> }
224 8 4b Length { String <Filetype (".wav")> }
225 0 4b Length { String <Filename ("sound.wav")> }
228 0 4b Length { <File> }
241 0 4b Length { String <Name> }
245 [ Note: Again, this section is a little strange, I didn't even notice
246 that the If {} condition existed until Goomba Online stopped decompiling
247 at random, turns out spr_blank, which had no frames was causing it. ]
250 If NumberOfFrames > 0 {
255 C 4b LenOfData { <Raw RGBA> }
258 0 4b Separate Collision Mask
260 For NumberOfFrames* {
269 [ Note: If you find a 1 in the following array then
270 "precise collision checking" will be ticked. ]
285 [ Note: If you find a 1 in the following array then
286 "precise collision checking" will be ticked. ]
299 4 4b Length { String <Name> }
301 [ Note: I believe that Mark once had tileset information that has since been removed
302 in GM8, this may explain why there are two versions here. ]
307 If Width != 0 && Height != 0 {
308 0 4b Length { <Raw RGBA> }
316 4 4b Length { String <Name> }
333 4 4b Length { String <Name> }
335 4 4b Length { String <Script> }
342 4 4b Length { String <Name> }
344 4 4b Length { String <FontName> }
350 14 1808b Unknown [ Kerning? ]
351 61C 4b Length { <Unknown data> } [ Font header? ]
355 <Actions*> { [ Here to prevent re-documenting ]
363 10 4b May be relative
365 18 4b Applies to something
367 20 4b Length { String <Name> }
368 0 4b Length { String <Code> }
370 0 4b Arguments actually used
371 4 4b Total number of arguments (always 8)
376 0 4b Applies to ObjectIndex
379 8 4b Number of arguments (always 8)
381 0 4b Length { String <Argument> }
391 4 4b Length { String <Name> }
396 <Actions*> [ Documented above ]
404 0 4b Length { String <Name> }
406 4 4b SpriteIndex [ -1 = None ]
411 18 4b Parent ObjectIndex
412 1C 4b Mask SpriteIndex
414 [ Note: I would check out LGM's SVN and the GMK documentation
415 provided by IsmAvatar for this section, it's very, very,
416 very, very, very, very fucked. She explains it much better than
419 20 4b Number of events - 1 [ Unknown reason ]
421 Until EventNumber == -1 {
423 If EventNumber >= 0 {
428 0 4b -1 [ Marks end of primary event ]
436 0 4b Length { String <Name> }
438 4 4b Length { String <Room caption> }
445 1C 4b Length { String <Creation Code> }
447 0 4b Number of backgrounds (Always 8)
454 14 4b Tile horizontal
456 1C 4b Horizontal speed
462 4 4b Number of views (Always 8)
473 24 4b Horizontal border
474 28 4b Vertical border
475 2C 4b Horizontal speed
477 34 4b Following ObjectIndex
480 0 4b Number of instances
481 For NumberOfInstances {
486 10 4b Length { String <Creation Code> }
489 0 4b Number of tiles {
505 4 4b Length { String <Filename> }
506 0 4b Length { String <Original filename> }
507 0 4b Original file chosen
508 4 4b Original file size
510 If OriginalFileChosen && StoreInGMK {
515 4 4b Length { String <Folder to export to> }
518 8 4b Remove at end of game
523 4 4b Show in separate window
524 8 4b Length { String <Window caption> }
530 14 4b Allow player to resize
532 1C 4b Freeze game while help form is in focus
533 20 4b Length { String <Game Information> }