Game Maker Language
A procedural scripting language built into the GameMaker engine, designed to make 2D game development accessible to non-programmers while still being powerful enough for commercial titles.
Also known as: GML
Created by Mark Overmars
Game Maker Language (GML) is the built-in scripting language of the GameMaker engine, a 2D-focused game development environment originally created by Mark Overmars and now developed by YoYo Games (a subsidiary of Opera). GML is unusual among programming languages: it is proprietary, tied to a single IDE, and designed primarily to be approachable for beginners — yet it has been used to ship dozens of commercially successful, critically acclaimed indie games.
History & Origins
GML began in the late 1990s at Utrecht University in the Netherlands, where Mark Overmars — a professor of computer science specialising in computational geometry — built a small tool to help students and hobbyists create games without first having to learn a systems programming language. The first public release appeared in 1999 under the name Animo, soon renamed Game Maker.
In its earliest form Game Maker was almost entirely drag-and-drop. Users assembled games by attaching predefined actions (move, create instance, play sound) to events on game objects. As the tool matured, Overmars added a textual scripting facility to let advanced users break out of the drag-and-drop sandbox. By Game Maker 4 and 5, this scripting facility had grown into a recognisable language with variables, control flow, and function calls — what would eventually be called Game Maker Language.
In 2007, Overmars partnered with the UK-based company YoYo Games, which assumed responsibility for the engine’s commercial development. Overmars has continued his academic career while YoYo Games has steered the engine through major rewrites: GameMaker: Studio in 2012, GameMaker Studio 2 in 2017, and the simply branded “GameMaker” of recent releases. In 2021 Opera acquired YoYo Games, and in 2022 the engine became free to use for non-commercial projects.
The first public release came in November 1999. Overmars’s stated goal was educational: to give people with little or no programming background a way to create their own games, with GML as the textual escape hatch for users who wanted more than the visual blocks offered. Opera’s January 2021 purchase of YoYo Games was reportedly in the range of US$10 million. The 2022 rebrand to “GameMaker” also formalised the split between GML Code, the textual language, and GML Visual, the drag-and-drop authoring mode.
Design Philosophy
GML was designed to be the gentlest possible ramp from drag-and-drop event programming into “real” code. Its design choices reflect that goal:
- Familiar C-like syntax — curly braces, semicolons (optional in most contexts), and
if/while/forkeywords reminiscent of C-family languages - Dynamic, weak typing — variables hold whatever you put in them, and the engine performs implicit conversions between numbers and strings
- Heavy reliance on built-in functions — graphics, input, audio, networking, and physics are all exposed through hundreds of global functions rather than imported libraries
- First-class engine concepts — instances, objects, rooms, sprites, and events are language-level citizens, not user-defined types layered on top of a general-purpose runtime
- Event-driven structure — most GML code lives inside event handlers (Create, Step, Draw, Collision, etc.) attached to objects, not in a single linear program
The result is a language where a complete game can be written using only procedural constructs and global state, but where more disciplined developers can still build large, structured codebases.
The semantics are deliberately forgiving. Numbers and strings can often be mixed implicitly, undeclared variables read as zero or undefined in some contexts, and the engine generally prefers to keep running over halting on dubious input. This keeps small projects moving and avoids burying beginners in error messages, but it has long drawn complaints from professional developers, who must rely on discipline and tooling to catch bugs that a stricter language would reject at compile time.
Key Features
Event-driven object model
A GameMaker project is built from objects, each of which can define handlers for engine events. The Step event runs every frame, the Draw event runs when the object should render, the Create event fires when an instance is spawned, and so on. GML code typically lives inside these handlers:
// Create event
hp = 100;
speed = 4;
direction = 0;
// Step event
if (keyboard_check(vk_right)) x += speed;
if (keyboard_check(vk_left)) x -= speed;
if (hp <= 0) instance_destroy();
Variables like x, y, speed, and direction are built-in instance variables that the engine reads and writes automatically — assigning to them affects rendering and movement directly.
Instance and object scoping
Each instance of an object has its own variable scope, but GML allows code in one instance to read or write variables on another instance using a with block:
with (obj_enemy) {
hp -= 10;
if (hp <= 0) instance_destroy();
}
This construct iterates over every live instance of obj_enemy and runs the block with that instance as the implicit context — a powerful, if sometimes surprising, feature unique to GML.
Built-in data structures
Early versions of GML offered ds_lists, ds_maps, ds_grids, ds_queues, ds_stacks, and ds_priority queues — opaque handles managed via library calls (ds_list_add, ds_map_find_value, etc.). Modern GameMaker has supplemented these with native arrays and struct literals:
var inventory = {
gold: 50,
items: ["potion", "key", "torch"]
};
inventory.gold += 10;
array_push(inventory.items, "map");
Scripts and (more recently) functions and structs
In classic Game Maker, “scripts” were standalone files containing a single procedure invoked by name. GameMaker Studio 2 introduced first-class user-defined functions, structs, and constructor functions that bring GML closer to a conventional procedural language with lightweight object support:
function Vector2(_x, _y) constructor {
x = _x;
y = _y;
static add = function(other) {
return new Vector2(x + other.x, y + other.y);
}
}
Built-in library
The standard library is heavily oriented toward game development. Hundreds of built-in functions, with descriptive names such as instance_create_layer, draw_sprite_ext and audio_play_sound, cover sprite drawing, tile maps, particles, audio, input, networking, an integrated 2D physics system, GLSL ES shaders, file I/O and platform features such as in-app purchases. Most users rarely need external libraries.
GML Visual
GML Visual is a block-based authoring mode that maps one-to-one onto GML Code constructs. Projects can mix the two, and visual blocks can be inspected as the GML they represent, which gives beginners an on-ramp into textual programming.
Evolution
GML has changed substantially across the engine’s major versions. Game Maker 8 and earlier used a runtime interpreter and shipped Windows-only executables. GameMaker: Studio (2012) added cross-platform export and a transitional compiler. GameMaker Studio 2 (2017) and subsequent versions introduced significant syntactic and semantic changes: locally scoped var declarations, struct literals, anonymous functions, method binding, and a JIT-style compiler for some platforms.
In the early versions the language was deliberately simple. Statements could end with semicolons or newlines, assignment used = (with := also accepted in early releases), and many constructs borrowed from the Pascal and BASIC tradition familiar in educational computing at the time. As Game Maker matured through versions 5, 6, 7 and 8, the syntax drifted toward a C and JavaScript style, while a forgiving parser went on tolerating many idioms at once.
The 2.3 update of 2020 is the largest single language-level change in GML’s history. It added first-class functions, anonymous functions, structs, constructors, method binding and chained accessors, turning a relatively basic procedural scripting language into something much closer to contemporary dynamic languages.
Because of this evolution, older GML code — particularly tutorials from the Game Maker 7 or 8 era — often does not run unchanged in modern GameMaker without adjustments. YoYo Games has provided migration guides and project converters, but the language’s history of incremental, sometimes breaking changes is a recurring topic in the community.
Current Relevance
GameMaker remains one of the most popular engines for solo and small-team indie 2D game development. Its appeal rests on a few strengths:
- A tightly integrated editor where sprites, rooms, sounds, and code live in one project
- A short path from “blank project” to “something moving on screen”
- A track record of commercially successful games shipped by very small teams
- Free non-commercial licensing since 2022, with paid tiers gated by export target and revenue
Because GML is tied to the GameMaker IDE and runtime, it has no independent implementations, no formal standard, and no real presence outside of game development. Its influence on other languages is therefore narrow, though it has helped shape what a generation of indie developers consider a “first language.”
Unity (C#) and Godot (GDScript, C#) are stronger alternatives for 3D work and for developers who want a general-purpose language. GameMaker’s position is strongest in polished 2D games, particularly action games, roguelikes and narrative-driven RPGs. Console export for PlayStation, Xbox and Nintendo Switch has been available through the appropriate developer programs. The community is active across forums, the official Discord, YouTube tutorial channels and the GameMaker Marketplace, which hosts user-contributed assets and code libraries, although these ecosystems are smaller than those of Unity or Unreal.
Why It Matters
GML is interesting less as a language design artefact than as a case study in lowering the barrier to entry. The combination of a friendly IDE, an event-driven object model, and a permissive C-like syntax has allowed people who never thought of themselves as programmers to ship games that reach millions of players. Undertale, Hotline Miami, Spelunky, Nuclear Throne, and Nidhogg are existence proofs that a deliberately approachable, proprietary scripting language can produce work of lasting cultural importance.
Timeline
Notable Uses & Legacy
Undertale
Toby Fox's role-playing game, released in 2015, was written almost entirely in GameMaker Studio using GML and became a cultural phenomenon, demonstrating that a single developer could produce a hit commercial game in the engine.
Hotline Miami
Dennaton Games used Game Maker to build the 2012 top-down action game, whose violent, neon-soaked style helped popularise GameMaker as a serious tool for indie developers.
Spelunky (original)
Derek Yu's original 2008 freeware version of Spelunky was built in Game Maker, pioneering the modern roguelite platformer genre before later ports rewrote the engine.
Nuclear Throne
Vlambeer's fast-paced post-apocalyptic roguelike shooter was developed in GameMaker: Studio and is frequently cited as a high-profile example of action-oriented GML development.
Risk of Rain (original)
Hopoo Games' original 2013 Risk of Rain, a side-scrolling roguelike, was built in GameMaker before the sequel moved to Unity.
Nidhogg
Messhof's competitive fencing game, released in 2014, was created in GameMaker and became a fixture of indie game tournaments and showcases.
Hyper Light Drifter
Heart Machine's atmospheric 2016 action-adventure game was developed in GameMaker: Studio, showing that the engine and GML could produce visually striking titles with intricate combat systems.
Hotline Miami 2: Wrong Number
Dennaton Games' 2015 sequel was also built in Game Maker, using GML for its fast-paced AI and combat systems.
Language Influence
Influenced By
Running Today
Related Languages
Sources & Further Reading
- GameMaker (official site) Official
- GameMaker downloads Download
- GameMaker Language (GameMaker Manual) Documentation
- GameMaker Community forum Community
- GameMaker Studio 2.3: New GML Features History
- GameMaker: inside gaming's most user-friendly design tool (PC Gamer) History
- Game Maker early versions and internals (Retro Reversing) History
- GameMaker (Wikipedia) Reference