Declarative Game Description Languages

16 concepts11 papers1 proposal

When building artificial intelligence to play or generate video games, engineers traditionally face a fundamental bottleneck: the game engine itself. Traditional video games are written in imperative code, where mechanics are deeply intertwined with rendering, input handling, and state management. If you want an AI agent to play a new game, or if you want an algorithm to invent one, you typically have to write or modify thousands of lines of complex, game-specific code.

To bypass this complexity, researchers developed Declarative Game Description Languages. Instead of programming how a game runs step-by-step, these languages allow developers to describe what the game is—its entities, physics, interaction rules, and win conditions—in a structured, human-readable text format.

By decoupling a game's core logic from its underlying software implementation, this paradigm provides a clean, mathematically tractable abstraction layer. This shift enables general AI agents to adapt to entirely unseen games, allows automated planners to test software, and gives generative models a structured language for inventing entirely new mechanics.


The Anatomy of a Declarative Game

How do you compress an entire video game into a text file? The core intuition relies on an object-oriented environment representation. Instead of tracking raw pixels or arbitrary variables, the game world is decomposed into discrete, structured components.

As formalized by Ebner et al. in their foundational work on the Video Game Description Language (VGDL), a classic 2D game can be broken down into four core blocks:

  1. Object/Entity Definitions: A taxonomy of everything that exists in the game world (e.g., an Avatar, a Wall, a Goal, or a Missile).
  2. Spatial and Physical Properties: The rules governing how these objects move (e.g., grid-based movement, friction, or gravity).
  3. Interaction Logic: A set of conditional rules defining what happens when two objects collide. For example, if Avatar collides with Coin, the score increases and the coin is destroyed.
  4. Termination Conditions: The criteria that define success or failure (e.g., if all Coins are gone, the player wins; if the Avatar touches an Enemy, the player loses).

This structured approach allows for the rapid generation of diverse environments that share a common underlying logic while varying significantly in gameplay dynamics, as highlighted by Liu 0001 et al.. Because the game mechanics are explicitly declared rather than hard-coded, a unified framework can simultaneously generate both the rules of a game and the layout of its levels (Hu et al.).

# Conceptual example of a declarative game block
SpriteSet
    avatar > MovingAvatar
    wall   > Immovable
    coin   > Passive

InteractionSet
    avatar wall > stepBack
    avatar coin > killSprite scoreChange=1

TerminationSet
    SpriteCounter stype=coin limit=0 win=True

While VGDL excels at 2D grid worlds, the same declarative philosophy applies to more intricate domains. For instance, Bamford et al. demonstrate how high-level configuration files can specify complex reinforcement learning environments, ensuring portability across different software interfaces.

For games requiring deep quantitative reasoning—such as card games with health pools and mana costs—the authors of Strategic Sorcery: Automated Planning for ‘Magic: The Gathering’ show that the Planning Domain Definition Language (PDDL) can incorporate numeric fragments. This allows planners to accurately model and reason about dynamic, quantitative game elements like creature stats and player life totals (Tillo et al.).


Why It Works for General AI and Planning

If an AI agent is trained on a specific game engine, it overfits to that environment's specific API and state representations. If you hand it a new game, it fails.

Declarative languages solve this by providing a standardized interface for General Video Game Playing (GVGP). As Levine et al. explain, abstracting away game-specific programming allows AI agents to read or infer the standardized game definition, adapt to new challenges, and figure out the rules of entirely unseen games on the fly. This standardization is crucial for evaluating true general intelligence rather than specialized, single-game mastery (Lucas et al.; Pérez-Liébana et al.).

+------------------+     Declarative Rules     +--------------------+
|  Game Definition | ------------------------> |   General AI Agent |
|  (VGDL / PDDL)   |                           | (Infers mechanics, |
+------------------+                           |  plans strategies) |
         |                                             ^
         v                                             |
+------------------+         State / Actions           |
|  Standardized    | <---------------------------------+
|  Game Engine     |
+------------------+

This formal clarity is equally powerful for automated software engineering. By defining game rules and test goals in a declarative language like PDDL, a system can treat a video game as a formal planning problem. As demonstrated by Balyo et al., automated planners can read these rules to generate dynamic test plans. If a game designer changes a mechanic (e.g., making a hazard deal more damage), the declarative file is updated, and the AI planner instantly adapts its testing scripts without requiring manual reprogramming.


Why It Works for Automated Game Generation

Creating a brand-new, playable video game from scratch is an immense challenge for generative models. If an algorithm attempts to output raw source code, a single missing semicolon or logic error will crash the game. Furthermore, the search space of all possible code is far too vast and unstructured to navigate effectively.

Declarative languages drastically compress this search space into a flexible, computationally tractable format. Because the language enforces a strict, object-oriented syntax, any generated text file is highly likely to map to a syntactically coherent and executable game. This makes game design accessible to optimization and machine learning algorithms in three distinct ways:

  • Program Synthesis: By treating games as structured programs within a domain-specific language (DSL), models can bridge the gap between abstract human concepts and concrete mechanics. Davidson et al. leveraged this to synthesize reward-producing programs that capture nuanced agent positioning and goals, generating human-like game objectives.
  • Large Language Model Exploration: Large Language Models (LLMs) excel at token prediction but struggle with complex, low-level engine code. A compact, keyword-driven language allows LLMs to easily understand, mutate, and reason about game features semantically (Todd et al.).
  • Evolutionary Search: Because declarative rules can be broken down into discrete components (like changing an interaction keyword from killSprite to bounceForward), games can be treated as genomes. Systems like GAVEL combine LLMs for intelligent rule mutation with evolutionary Quality-Diversity algorithms to systematically explore the design space, discovering entirely new, playable genres of games (Todd et al.).

Ultimately, declarative game description languages turn the messy, imperative art of game development into a structured, readable, and mathematical science. By representing mechanics as data, they unlock the ability for both humans and machines to build, play, and reason about virtual worlds with unprecedented generality.

Key Foundational Work

Towards a Video Game Description Language (2013) — contributed 3 concept elements to this direction.
General Video Game Playing (2013) — contributed 2 concept elements to this direction.
Artificial and Computational Intelligence in Games (Dagstuhl Seminar 12191) (2012) — contributed 1 concept elements to this direction.
History & citationVersion 1 · 2026-10-04

Current · Permanent link

View frozen version 1

Cite this direction

Latest version (a living page):

@misc{lacuna_video_game_description_language_e9dfac40,
  title = {Video Game Description Language},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/video-game-description-language/rdr_e9dfac40e9cb44fba153a1de059a1222},
  note = {Latest version of a living research direction; cite a version for a fixed text. Accessed 2026-11-22},
}

This exact version (version 1, frozen text):

@misc{lacuna_video_game_description_language_e9dfac40_v1,
  title = {Video Game Description Language},
  author = {{Lacuna}},
  howpublished = {Lacuna research direction},
  year = {2026},
  url = {https://lacuna.tiptreesystems.com/direction/video-game-description-language/rdr_e9dfac40e9cb44fba153a1de059a1222/v/1},
  note = {Version 1, frozen 2026-10-04. Accessed 2026-11-22},
}
About

These directions overlap with this one through shared papers.

See something wrong? Report a mistake