Est. 1999 Beginner

GML (Game Maker Language)

The proprietary scripting language of GameMaker, designed to make 2D game development accessible — and the language behind indie hits like Undertale, Hotline Miami, and Spelunky.

Created by Mark Overmars

Paradigm Procedural, Imperative, Event-driven (with object-oriented constructs added in later versions)
Typing Dynamic, Weak
First Appeared 1999
Latest Version GameMaker (GML Code, continuously updated)

GML, the Game Maker Language, is the proprietary scripting language of the GameMaker engine (originally Game Maker, later GameMaker: Studio, GameMaker Studio 2, and now simply GameMaker). Created by Mark Overmars and first released in 1999, GML was designed as an approachable scripting language layered on top of a drag-and-drop visual programming interface, allowing newcomers to ease into programming while giving experienced developers a complete textual language for building 2D games. Although it is rarely used outside the GameMaker ecosystem, GML has been the implementation language for some of the most commercially and critically successful indie games of the 2010s, including Undertale, Hotline Miami, Spelunky, Nuclear Throne, Hyper Light Drifter, and Risk of Rain.

History & Origins

Mark Overmars and the Birth of Game Maker

GML originated as the scripting component of Game Maker, a tool created by Dutch computer scientist Mark Overmars while he was a professor at Utrecht University. The first public release, in November 1999, was reportedly originally distributed under the name Animo before being renamed Game Maker shortly afterward. Overmars’s stated goal was educational: he wanted to give people with little or no programming background a way to create their own games, lowering the barrier to entry through a drag-and-drop event/action system. GML emerged as the textual “escape hatch” for users who wanted more power than the visual blocks could offer.

In the early versions, the language was deliberately simple. Statements could be terminated with semicolons or newlines, assignments used = (with := also accepted in early releases), and many constructs borrowed from the Pascal and BASIC tradition that was familiar in educational computing at the time. As Game Maker matured through versions 5, 6, 7, and 8, the syntax drifted closer to a C/JavaScript style, while retaining a forgiving parser that tolerated many idioms simultaneously.

Transition to YoYo Games

In 2007, Overmars handed control of Game Maker to YoYo Games, a company founded specifically to take the product commercial and expand its reach. Under YoYo Games, the product evolved significantly: Game Maker 8 (2009) was the last release in the original numbered line, and GameMaker: Studio launched in 2011 as a major rewrite focused on cross-platform export. With Studio, GML scripts could be compiled to native code for Windows, macOS, Linux, HTML5, Android, and iOS, dramatically expanding the reach of games built with the engine.

GameMaker Studio 2, released in 2017, introduced a redesigned IDE and a series of substantial GML updates in subsequent point releases. The 2.3 update in 2020 was particularly significant for GML as a language, introducing first-class functions, anonymous functions, structs, constructors, method binding, chained accessors, and other modernizations that brought GML much closer to contemporary scripting languages.

Opera and the Modern Era

In January 2021, the Opera browser company acquired YoYo Games for a reported sum in the range of US$10 million, bringing GameMaker under new corporate ownership. In 2022, the product was rebranded from “GameMaker Studio 2” to simply “GameMaker,” and the engine introduced the formal split between GML Code (the textual language) and GML Visual (the modern drag-and-drop authoring mode). In 2023, GameMaker moved to a free tier for non-commercial development, broadening access to hobbyists and students.

Design Philosophy

Accessibility First

GML’s defining design principle has always been accessibility. The language was created for hobbyists, students, and aspiring game developers, not professional software engineers. This shows in many ways: variables do not need to be declared before use, types are inferred at runtime, error messages are oriented toward the user rather than the compiler implementer, and the standard library is dominated by single-purpose functions with descriptive names like instance_create_layer, draw_sprite_ext, and audio_play_sound. The language sits inside an editor that explicitly supports a no-code path (GML Visual) for users who want to avoid typing code entirely.

Built Around the Game Loop

Unlike general-purpose languages, GML is built around a very specific execution model: the game loop. Code is organized into events attached to objects (with instances of those objects living in rooms). Common events include Create, Step (one per frame), Draw, Collision, Alarm, and various input and lifecycle hooks. Most GML programs are therefore not structured as monolithic main functions but as a constellation of small event handlers that the engine invokes at the appropriate moments. This shapes the language: many idiomatic patterns assume an enclosing game loop and per-instance variable scope.

Forgiving Semantics

GML is dynamically and weakly typed. Numbers and strings can often be mixed implicitly, undeclared variables read as zero or undefined in some contexts, and the engine generally errs on the side of “keep running” rather than “halt on dubious input.” This is deliberate — it keeps small projects moving and avoids burying beginners in error messages — but it has long been a source of complaints from professional developers, who must rely on discipline and tooling to catch the bugs that a stricter language would refuse to compile.

Key Features

Event-Driven Object Model

The fundamental unit of organization in GameMaker is the object, which has a set of event handlers written in GML. An object placed in a room becomes an instance with its own per-instance variables.

// Create Event — runs once when the instance is created
hp = 100;
speed = 4;
direction = 0;

// Step Event — runs once per frame
if (keyboard_check(vk_right)) x += speed;
if (keyboard_check(vk_left))  x -= speed;
if (keyboard_check(vk_up))    y -= speed;
if (keyboard_check(vk_down))  y += speed;

// Draw Event — runs when the instance is drawn
draw_self();
draw_text(x, y - 32, "HP: " + string(hp));

The variables x, y, speed, and direction are built-in per-instance variables recognized by the engine’s physics and rendering systems.

Modern GML: Functions, Structs, and Constructors

Since the 2.3 update, GML supports first-class functions, anonymous functions, and lightweight structs with constructors and methods:

function Vector2(_x, _y) constructor {
    x = _x;
    y = _y;

    static add = function(other) {
        return new Vector2(x + other.x, y + other.y);
    };

    static magnitude = function() {
        return sqrt(x * x + y * y);
    };
}

var position = new Vector2(10, 20);
var velocity = new Vector2(1, 2);
var next_pos = position.add(velocity);

This brings GML much closer to the feel of modern dynamic languages like JavaScript while preserving compatibility with the older procedural style that long-time users know.

Rich Built-in Library

GML’s standard library is enormous and heavily oriented toward game development. Hundreds of built-in functions cover sprite drawing, tile maps, particles, audio, input, networking, physics (via an integrated 2D physics system), shaders (GLSL ES), data structures (lists, maps, grids, queues, stacks, priority queues), file I/O, and platform-specific features such as in-app purchases. Most users rarely need to install external libraries because the engine bundles the things 2D game developers typically reach for.

Multiple Compilation Targets

GameMaker compiles GML projects to a wide range of platforms. The YoYo Compiler (YYC) generates native code for performance-critical builds, while a separate VM-based runtime is used for faster iteration during development. Officially supported platforms have evolved over the years and depend on license tier, but have historically included Windows, macOS, Linux, HTML5, Android, iOS, and several console platforms (PlayStation, Xbox, and Nintendo Switch via the appropriate developer programs). Consult the official GameMaker documentation for the current authoritative list, as supported targets change with licensing arrangements.

GML Visual

For users who prefer not to write code, GameMaker provides GML Visual, 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 underlying GML they represent — making GML Visual a useful on-ramp into textual programming.

Evolution

GML has evolved through several distinct eras:

EraApproximate YearsKey Changes
Classic Game Maker1999–2011Original Pascal/BASIC-influenced syntax, gradual shift to C-like style, growth of the built-in function library through versions 1–8
GameMaker: Studio2011–2017Cross-platform compilation via YYC, refined IDE, broader runtime feature set
GameMaker Studio 22017–2022New IDE, incremental GML improvements, 2.3 update adds first-class functions, anonymous functions, structs, constructors, and method binding (2020)
GameMaker (current)2022–presentRebrand, GML Code / GML Visual split formalized, free non-commercial tier, ongoing language and runtime updates

The 2.3 update of 2020 stands out as the most substantial single language-level change in GML’s history, transforming it from a relatively basic procedural scripting language into something with recognizably modern features.

Current Relevance

GML remains the primary language of the GameMaker engine, which continues to be one of the most widely used tools for 2D game development among indie developers. The combination of approachable tooling, a free tier for hobbyists, and a track record of commercially successful titles keeps it relevant for newcomers and small studios. While Unity (C#) and Godot (GDScript, C#) are stronger alternatives for 3D and for developers who want a general-purpose language, GameMaker — and therefore GML — retains a strong position in the specific niche of polished 2D games, particularly action games, roguelikes, and narrative-driven RPGs.

The community is active across forums, the official Discord, YouTube tutorial creators, and the GameMaker Marketplace, which hosts user-contributed assets and code libraries. Asset and tutorial ecosystems for GML are substantial, although smaller than those of Unity or Unreal.

Why It Matters

GML’s importance in programming history is less about technical innovation and more about cultural impact:

  1. Democratization of game development: For more than two decades, Game Maker (and GML) has been one of the most common first programming experiences for aspiring game developers. The deliberate accessibility of the language, combined with an editor that does not require learning a build system or a command line, has introduced a generation of developers to programming through games.

  2. Disproportionate commercial impact: For a language essentially restricted to a single engine, GML has an unusual concentration of commercially and culturally important titles. Undertale, Hotline Miami, Spelunky, Nuclear Throne, Hyper Light Drifter, and Risk of Rain are all part of the modern indie-game canon, and all were written in GML.

  3. A case study in DSL evolution: GML began as a deliberately limited educational scripting language and has been incrementally extended over twenty-five years into something approaching a modern dynamic language, while continuing to support code written in its earliest dialects. It is an instructive example of how a domain-specific language can grow without abandoning its original user base.

  4. Lowering the floor without lowering the ceiling: GML’s design demonstrates a useful tension that other educational languages have wrestled with — how to remain easy enough for a beginner’s first day while being capable enough for a shipping commercial game. GameMaker’s continued use by professional indie studios suggests that, for the 2D-game niche at least, this balance is achievable.

Timeline

1999
Mark Overmars releases the first version of Game Maker (reportedly initially named Animo) at Utrecht University in the Netherlands in November, providing a drag-and-drop interface and an embedded scripting language that would become GML
2004
Game Maker 6.0 released, adding limited 3D graphics support and expanding GML's standard function library
2007
YoYo Games acquires the rights to Game Maker from Mark Overmars and takes over development
2009
Game Maker 8.0 released, the last version of the original numbered Game Maker product line before the transition to GameMaker: Studio
2011
GameMaker: Studio released, introducing cross-platform export (Windows, macOS, HTML5, Android, iOS) and a redesigned IDE; GML compiled to platform-native targets via the YoYo Compiler (YYC)
2017
GameMaker Studio 2 released, a major rewrite of the IDE; GML syntax modernized further with optional struct support and other refinements added in subsequent updates
2020
GameMaker Studio 2.3 update adds first-class functions, anonymous functions, structs, constructors, method binding, and chained accessors — a substantial modernization of GML
2021
Opera (the browser company) acquires YoYo Games in January for approximately US$10 million
2022
Product rebranded from 'GameMaker Studio 2' to simply 'GameMaker'; the editor introduces 'GML Code' and 'GML Visual' as the two official authoring modes, replacing the older Drag-and-Drop terminology
2023
GameMaker shifts to a free tier for non-commercial use, broadening access; engine continues incremental updates to GML and the runtime

Notable Uses & Legacy

Undertale (Toby Fox, 2015)

Toby Fox developed the critically acclaimed RPG primarily in GameMaker: Studio using GML for all gameplay, dialogue, and bullet-pattern systems. Undertale sold millions of copies and brought significant attention to GameMaker as a tool for ambitious solo development.

Hotline Miami (Dennaton Games, 2012)

The top-down ultraviolent action game and its sequel Hotline Miami 2: Wrong Number (2015) were built in Game Maker, using GML for the fast-paced AI and combat systems.

Spelunky (Derek Yu, 2008)

The original freeware version of Spelunky was developed in Game Maker, with its procedurally generated levels and physics implemented in GML. It became a landmark in the roguelike genre before later being remade for consoles in a different engine.

Nuclear Throne (Vlambeer, 2015)

The frenetic post-apocalyptic roguelike was built in GameMaker: Studio, with GML powering its procedural level generation, mutation systems, and chaotic combat.

Hyper Light Drifter (Heart Machine, 2016)

The atmospheric action-adventure game was developed in GameMaker: Studio, demonstrating that the engine and GML could produce visually striking titles with intricate combat systems.

Risk of Rain (Hopoo Games, 2013)

The original Risk of Rain was developed in GameMaker, using GML for its scaling-difficulty roguelike systems and item interactions.

Language Influence

Influenced By

Running Today

Run examples using the official Docker image:

docker pull
Last updated: