Compiling VGDL into Causal Models
Summary
The paper proposes a deterministic framework that compiles games specified in VGDL into Dynamic Structural Causal Models to guarantee causal fidelity, enabling transparent causal pathways for counterfactual reasoning and causal reinforcement learning.
View Cached Full Text
Cached at: 09/10/26, 08:35 AM
# Compiling VGDL into Causal Models
Source: [https://arxiv.org/html/2609.05459](https://arxiv.org/html/2609.05459)
###### Abstract
Reinforcement learning and large language models often struggle to accurately capture the causal mechanics of game environments\. Standard reinforcement learning agents tend to rely on spurious correlations, while large language models are prone to hallucinating game rules\. Although causal reinforcement learning improves interpretability, there is currently no formal methodology to map complex game mechanics directly into causal models\. To address this, we propose a deterministic framework that compiles games specified in the Video Game Description Language into Dynamic Structural Causal Models\. Rather than inferring causal structures from gameplay traces or noisy large language models’ outputs, our methodology directly translates game components, including sprite dynamics, interaction rules, and termination conditions, into explicit structural equations\. Each game tick represents a causal transition from state variables at timetttot\+1t\+1\. By establishing this grounded mapping, the approach guarantees absolute causal fidelity to the ground\-truth game mechanics\. The resulting models offer transparent causal pathways that support counterfactual reasoning, causal reinforcement learning agent training, and procedural content validation\. This framework provides a principled bridge between symbolic game descriptions and causally grounded game AI\.
## IIntroduction
Reinforcement learning \(RL\) is widely used in modern game AI, but standard methods struggle to understand underlying causal game mechanics\. The deep learning models used in RL are generally opaque, which limits the interpretability of their decisions\[[3](https://arxiv.org/html/2609.05459#bib.bib11)\]\. Games frequently involve hidden rules or changing environments \(e\.g\., new enemies or game phases\) which pose adaptation challenges for naive learners\[[8](https://arxiv.org/html/2609.05459#bib.bib13)\]\. To make such rules explicit to an agent, Apeldoorn et al\.\[[1](https://arxiv.org/html/2609.05459#bib.bib14)\]have used hierarchical knowledge bases that are updated while playing the game\. As those are learned by observation, they may include spurious correlations and therefore not represent the true rules of the underlying environment\. Causal RL addresses these core problems by filtering out spurious correlations and focusing on causally relevant information, while also remaining interpretable\[[3](https://arxiv.org/html/2609.05459#bib.bib11)\]\. Recent studies\[[10](https://arxiv.org/html/2609.05459#bib.bib5)\]further prove that causal explanations of RL agents significantly improve user understanding and trust\.
Despite this promise, existing game benchmarks and agents rarely incorporate causality explicitly, and there exists no formal framework for mapping game mechanics into causal models\. While logic\-based game description languages \(e\.g\., GDL and systems like Ludocore\[[13](https://arxiv.org/html/2609.05459#bib.bib15)\]\) have supported strategy analysis and logical forms of causal reasoning\[[4](https://arxiv.org/html/2609.05459#bib.bib16)\], they do not provide the type of structured causal models targeted here\. Similarly, large language models \(LLMs\) applied to game reasoning suffer from hallucinations, misunderstand spatial relationships, and often perform subpar in gameplay\[[9](https://arxiv.org/html/2609.05459#bib.bib3),[7](https://arxiv.org/html/2609.05459#bib.bib1)\]\. Although incorporating causal models can improve their understanding of game mechanics\[[6](https://arxiv.org/html/2609.05459#bib.bib2)\], LLMs may still misidentify such models, and without ground truth, verification is often intractable\. We address this gap by introducing a formal mapping framework that equips AI agents with deterministic causal models, enabling more efficient learning through grounded causal information\.
## IIBackground and Related Work
### II\-ACausality
Causality studies cause–and–effect relationships, enabling models to predict outcomes rather than just correlations\[[11](https://arxiv.org/html/2609.05459#bib.bib10)\]\. Pearl’s ladder of causation defines three levels: association \(statistical correlations\), intervention \(actively setting variables independent of their causes\), and counterfactuals \(reasoning about alternative outcomes to observed events\)\[[11](https://arxiv.org/html/2609.05459#bib.bib10)\]\.
A Structural Causal Model \(SCM\) is a triple\(U,V,F\)\(U,V,F\)whereUUis a set of exogenous variables,VVa set of endogenous variables, andF=\{fv\}v∈VF=\\\{f\_\{v\}\\\}\_\{v\\in V\}a set of functions deriving eachv∈Vv\\in Vfrom its parentsPa\(v\)⊆V\\mathrm\{Pa\}\(v\)\\subseteq Vand corresponding noise variableUvU\_\{v\}\. SCMs allow for a systematic derivation of intervention effects and therefore facilitate the design of algorithms that exploit causal structures in complex domains\[[11](https://arxiv.org/html/2609.05459#bib.bib10)\]\. Furthermore, a Dynamic Structural Causal Model \(DSCM\) extends this framework to temporal sequences by indexing variables over discrete time stepst∈𝒯t\\in\\mathcal\{T\}\[[11](https://arxiv.org/html/2609.05459#bib.bib10)\]\. In a DSCM, the functionsFFdetermine the state ofvt∈Vtv\_\{t\}\\in V\_\{t\}based on its parents in current and preceding time steps,Pa\(vt\)⊆V≤t\\mathrm\{Pa\}\(v\_\{t\}\)\\subseteq V\_\{\\leq t\}, thereby capturing the causal dependencies over time\[[11](https://arxiv.org/html/2609.05459#bib.bib10)\]\. An example of a DSCM is shown in[Figure1](https://arxiv.org/html/2609.05459#S2.F1)\. Madumal et al\.\[[10](https://arxiv.org/html/2609.05459#bib.bib5)\]use SCMs to explain RL agent behavior, generating causal explanations by analyzing counterfactuals\. Hammond et al\.\[[5](https://arxiv.org/html/2609.05459#bib.bib9)\]extend causal modeling to games, proposing “causal games” that encode agents’ strategies and dependencies in a unified framework\. These works illustrate how causal models offer insight into decision\-making and prediction beyond correlations\.
XtX\_\{t\}ZtZ\_\{t\}YtY\_\{t\}Xt\+1X\_\{t\+1\}Zt\+1Z\_\{t\+1\}Yt\+1Y\_\{t\+1\}StepttStept\+1t\+1UtXU^\{X\}\_\{t\}UtZU^\{Z\}\_\{t\}UtYU^\{Y\}\_\{t\}UnXU^\{X\}\_\{n\}UnZU^\{Z\}\_\{n\}UnYU^\{Y\}\_\{n\}Xt\+1=fX\(Xt,Ut\+1X\)Zt\+1=fZ\(Zt,Xt,Xt\+1,Ut\+1Z\)Yt\+1=fY\(Yt,Zt,Zt\+1,Ut\+1Y\)\\begin\{aligned\} X\_\{t\+1\}&=f\_\{X\}\(X\_\{t\},U^\{X\}\_\{t\+1\}\)\\\\ Z\_\{t\+1\}&=f\_\{Z\}\(Z\_\{t\},X\_\{t\},X\_\{t\+1\},U^\{Z\}\_\{t\+1\}\)\\\\ Y\_\{t\+1\}&=f\_\{Y\}\(Y\_\{t\},Z\_\{t\},Z\_\{t\+1\},U^\{Y\}\_\{t\+1\}\)\\end\{aligned\}Figure 1:Dynamic SCM: Graph \(left\) showing causal dependencies and structural equations \(right\) defining recursive assignments\.
### II\-BGeneral Video Game AI \(GVGAI\) and Video Game Description Language \(VGDL\)
The GVGAI framework\[[12](https://arxiv.org/html/2609.05459#bib.bib7)\]allows comparing the performance of AI agents in playing a large corpus of arcade\-like video games using a unified interface\. Each game is defined in VGDL, a lightweight, human\-readable language format consisting of a sprite set, a level mapping, a termination set, and an interaction set\. While the sprite set describes all components of a game, the termination and interaction set describes the game’s logic\. The latter does so by describing the outcome of collision events in terms of cause and effect relationships, effectively representing a high\-level SCM\.
Our approach models a video game as a*dynamic*SCM: a two\-time\-slice graph in which variables at timettinfluence those att\+1t\+1\. Prior work by Jiwatode et al\.\[[6](https://arxiv.org/html/2609.05459#bib.bib2)\]and Chen et al\.\[[2](https://arxiv.org/html/2609.05459#bib.bib8)\]integrates SCMs with LLMs for causal induction in diverse environments\. We take a complementary route: rather than prompt an LLM to predict rules, we deterministically compile the known VGDL rules into an SCM\. This guarantees causal fidelity \(the model matches the ground\-truth game mechanics\) without relying on noisy language\-model inference\.
## IIIDynamic Causal Model of Games
We model a VGDL game as a Dynamic SCM \(DSCM\), focusing on mapping VGDL directly to SCM components rather than learning correlations from traces\[[6](https://arxiv.org/html/2609.05459#bib.bib2)\]\. While VGDL encodes these elements compactly, formalizing them as an SCM enables causal RL, interventions, and counterfactual analysis, which VGDL alone does not support for decision\-making\. Each game tick is treated as a causal transition from statetttot\+1t\+1, where sprite dynamics, layout, interactions, and termination rules define the causal structure\.
Sprites are mapped to state representations defined by the dynamics of the selected games\. We propose the following labels based on the possible descriptions of sprites in theSpriteSetin a VGDL:Position,Orientation,Velocity,IsAlive,Resource,Health, andTime\. Not every selected game uses every attribute\. For example,basicgame\(see[Figure2](https://arxiv.org/html/2609.05459#S3.F2)\) uses position, orientation, velocity, alive\-state, live\-instance counts, and terminal\-state variables, while resource and health variables are needed only for games whose VGDL dynamics include collection, inventory, damage, or health\-based interactions\. For a game ticktt, the general endogenous state can be written as
𝒱t=\{\\displaystyle\\mathcal\{V\}^\{t\}=\\\{Pst,Ost,Velst,Ast,Rst,Hst,Tt,\\displaystyle P\_\{s\}^\{t\},O\_\{s\}^\{t\},\\textit\{Vel\}\_\{s\}^\{t\},A\_\{s\}^\{t\},R\_\{s\}^\{t\},H\_\{s\}^\{t\},T^\{t\},\(1\)Countst,Terminalkt\|s∈𝒮,k∈𝒦\}\.\\displaystyle Count\_\{s\}^\{t\},Terminal\_\{k\}^\{t\}\\;\|\\;s\\in\\mathcal\{S\},\\ k\\in\\mathcal\{K\}\\\}\.
where𝒮\\mathcal\{S\}is the set of sprite types and instances, and𝒦\\mathcal\{K\}is the set of termination conditions\. Here,PstP\_\{s\}^\{t\}denotes the position of spritess,OstO\_\{s\}^\{t\}its orientation,Velst\\textit\{Vel\}\_\{s\}^\{t\}its velocity,AstA\_\{s\}^\{t\}whether the sprite is alive or active,RstR\_\{s\}^\{t\}its resource state,HstH\_\{s\}^\{t\}its health state, andTtT^\{t\}the current game time or tick\. The variableCountstCount\_\{s\}^\{t\}denotes the number of live instances of a sprite type, andTerminalktTerminal\_\{k\}^\{t\}denotes whether a win or loss condition has been reached\. In[TableI](https://arxiv.org/html/2609.05459#S3.T1), these variables are abbreviated asPP,OO,VV,AA,CountCount, andTerminalTerminalto keep the mapping readable\.
The exogenous variables include the player action, random choices, and the initial layout:
𝒰t=\{Uactiont,Urngt,Initc0\}\.\\mathcal\{U\}^\{t\}=\\\{U\_\{\\mathrm\{action\}\}^\{t\},U\_\{\\mathrm\{rng\}\}^\{t\},Init\_\{c\}^\{0\}\\\}\.\(2\)The variableUactiontU\_\{\\mathrm\{action\}\}^\{t\}represents the action selected by the player or agent\. The variableUrngtU\_\{\\mathrm\{rng\}\}^\{t\}represents randomness used by stochastic sprite classes such asRandomNPC\. The variableInitc0Init\_\{c\}^\{0\}represents the level\-layout symbol at initialization\. The layout is exogenous because it is given before play begins and determines which sprite instances exist and where they are placed\. The VGDL and level layout forbasicgameare shown in[Figure2](https://arxiv.org/html/2609.05459#S3.F2), and their corresponding SCM mapping is given in[TableI](https://arxiv.org/html/2609.05459#S3.T1)\.
[⬇](data:text/plain;base64,QmFzaWNHYW1lCiAgICBTcHJpdGVTZXQKICAgICAgICBhdmF0YXIgPiBNb3ZpbmdBdmF0YXIKICAgICAgICB3YWxsICAgPiBJbW1vdmFibGUKICAgICAgICBnb2FsICAgPiBJbW1vdmFibGUKICAgICAgICBlbmVteSAgPiBSYW5kb21OUEMKICAgIEludGVyYWN0aW9uU2V0CiAgICAgICAgYXZhdGFyIHdhbGwgID4gc3RlcEJhY2sKICAgICAgICBnb2FsIGF2YXRhciAgPiBraWxsU3ByaXRlCiAgICAgICAgYXZhdGFyIGVuZW15ID4ga2lsbFNwcml0ZQogICAgTGV2ZWxNYXBwaW5nCiAgICAgICAgQSA+IGF2YXRhcgogICAgICAgIHcgPiB3YWxsCiAgICAgICAgZyA+IGdvYWwKICAgICAgICBlID4gZW5lbXkKICAgIFRlcm1pbmF0aW9uU2V0CiAgICAgICAgU3ByaXRlQ291bnRlciBzdHlwZT1nb2FsIGxpbWl0PTAgd2luPVRydWUKICAgICAgICBTcHJpdGVDb3VudGVyIHN0eXBlPWF2YXRhciBsaW1pdD0wIHdpbj1GYWxzZQ==)BasicGameSpriteSetavatar\>\>MovingAvatarwall\>\>Immovablegoal\>\>Immovableenemy\>\>RandomNPCInteractionSetavatarwall\>\>stepBackgoalavatar\>\>killSpriteavatarenemy\>\>killSpriteLevelMappingA\>\>avatarw\>\>wallg\>\>goale\>\>enemyTerminationSetSpriteCounterstype=goallimit=0win=TrueSpriteCounterstype=avatarlimit=0win=False
\(a\)VGDL specification
[⬇](data:text/plain;base64,ICAgIHd3d3d3CiAgICB3QWVndwogICAgd3d3d3c=)wwwwwwAegwwwwww
\(b\)Level layout
Figure 2:Basicgamedefinition and example level layoutTABLE I:Concrete mapping forbasicgame\(see[Figure2](https://arxiv.org/html/2609.05459#S3.F2)\)\. Notation:PP= position,OO= orientation,VV= velocity,AA= alive,CountCount= live\-instance count,TerminalTerminal= win/loss node,UU= exogenous input, RNG = random input\.VGDL elementSCM nodesSCM edgesStructural equationSpriteSetavatar \> MovingAvatarUactiontU\_\{\\mathrm\{action\}\}^\{t\},PavatartP\_\{\\mathrm\{avatar\}\}^\{t\}OavatartO\_\{\\mathrm\{avatar\}\}^\{t\},VavatartV\_\{\\mathrm\{avatar\}\}^\{t\}AavatartA\_\{\\mathrm\{avatar\}\}^\{t\},Pavatart\+1P\_\{\\mathrm\{avatar\}\}^\{t\+1\}Oavatart\+1O\_\{\\mathrm\{avatar\}\}^\{t\+1\},Vavatart\+1V\_\{\\mathrm\{avatar\}\}^\{t\+1\}Aavatart\+1A\_\{\\mathrm\{avatar\}\}^\{t\+1\}Uactiont→Pavatart\+1U\_\{\\mathrm\{action\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{avatar\}\}^\{t\+1\},Uactiont→Oavatart\+1U\_\{\\mathrm\{action\}\}^\{t\}\\rightarrow O\_\{\\mathrm\{avatar\}\}^\{t\+1\}Uactiont→Vavatart\+1U\_\{\\mathrm\{action\}\}^\{t\}\\rightarrow V\_\{\\mathrm\{avatar\}\}^\{t\+1\},Pavatart→Pavatart\+1P\_\{\\mathrm\{avatar\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{avatar\}\}^\{t\+1\}Oavatart→Pavatart\+1O\_\{\\mathrm\{avatar\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{avatar\}\}^\{t\+1\},Vavatart→Pavatart\+1V\_\{\\mathrm\{avatar\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{avatar\}\}^\{t\+1\}Aavatart→Aavatart\+1A\_\{\\mathrm\{avatar\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{avatar\}\}^\{t\+1\}Pavatart\+1:=fpos\(Pavatart,Oavatart,Vavatart,Uactiont\)P\_\{\\mathrm\{avatar\}\}^\{t\+1\}:=f\_\{\\mathrm\{pos\}\}\(P\_\{\\mathrm\{avatar\}\}^\{t\},O\_\{\\mathrm\{avatar\}\}^\{t\},V\_\{\\mathrm\{avatar\}\}^\{t\},U\_\{\\mathrm\{action\}\}^\{t\}\)Oavatart\+1:=fori\(Oavatart,Uactiont\)O\_\{\\mathrm\{avatar\}\}^\{t\+1\}:=f\_\{\\mathrm\{ori\}\}\(O\_\{\\mathrm\{avatar\}\}^\{t\},U\_\{\\mathrm\{action\}\}^\{t\}\)Vavatart\+1:=fvel\(Vavatart,Uactiont\)V\_\{\\mathrm\{avatar\}\}^\{t\+1\}:=f\_\{\\mathrm\{vel\}\}\(V\_\{\\mathrm\{avatar\}\}^\{t\},U\_\{\\mathrm\{action\}\}^\{t\}\)wall \> ImmovablePwalltP\_\{\\mathrm\{wall\}\}^\{t\},AwalltA\_\{\\mathrm\{wall\}\}^\{t\}Pwallt\+1P\_\{\\mathrm\{wall\}\}^\{t\+1\},Awallt\+1A\_\{\\mathrm\{wall\}\}^\{t\+1\}Pwallt→Pwallt\+1P\_\{\\mathrm\{wall\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{wall\}\}^\{t\+1\},Awallt→Awallt\+1A\_\{\\mathrm\{wall\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{wall\}\}^\{t\+1\}Pwallt\+1:=PwalltP\_\{\\mathrm\{wall\}\}^\{t\+1\}:=P\_\{\\mathrm\{wall\}\}^\{t\}Awallt\+1:=AwalltA\_\{\\mathrm\{wall\}\}^\{t\+1\}:=A\_\{\\mathrm\{wall\}\}^\{t\}goal \> ImmovablePgoaltP\_\{\\mathrm\{goal\}\}^\{t\},AgoaltA\_\{\\mathrm\{goal\}\}^\{t\}Pgoalt\+1P\_\{\\mathrm\{goal\}\}^\{t\+1\},Agoalt\+1A\_\{\\mathrm\{goal\}\}^\{t\+1\}Countgoalt\+1Count\_\{\\mathrm\{goal\}\}^\{t\+1\}Pgoalt→Pgoalt\+1P\_\{\\mathrm\{goal\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{goal\}\}^\{t\+1\},Agoalt→Agoalt\+1A\_\{\\mathrm\{goal\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{goal\}\}^\{t\+1\}Agoalt\+1→Countgoalt\+1A\_\{\\mathrm\{goal\}\}^\{t\+1\}\\rightarrow Count\_\{\\mathrm\{goal\}\}^\{t\+1\}Pgoalt\+1:=PgoaltP\_\{\\mathrm\{goal\}\}^\{t\+1\}:=P\_\{\\mathrm\{goal\}\}^\{t\}Agoalt\+1:=AgoaltA\_\{\\mathrm\{goal\}\}^\{t\+1\}:=A\_\{\\mathrm\{goal\}\}^\{t\}Countgoalt\+1:=fcount\(Agoalt\+1\)Count\_\{\\mathrm\{goal\}\}^\{t\+1\}:=f\_\{\\mathrm\{count\}\}\(A\_\{\\mathrm\{goal\}\}^\{t\+1\}\)enemy \> RandomNPCUenemy\_rngtU\_\{\\mathrm\{enemy\\\_rng\}\}^\{t\},PenemytP\_\{\\mathrm\{enemy\}\}^\{t\}OenemytO\_\{\\mathrm\{enemy\}\}^\{t\},VenemytV\_\{\\mathrm\{enemy\}\}^\{t\}AenemytA\_\{\\mathrm\{enemy\}\}^\{t\},Penemyt\+1P\_\{\\mathrm\{enemy\}\}^\{t\+1\}Oenemyt\+1O\_\{\\mathrm\{enemy\}\}^\{t\+1\},Venemyt\+1V\_\{\\mathrm\{enemy\}\}^\{t\+1\}Aenemyt\+1A\_\{\\mathrm\{enemy\}\}^\{t\+1\}Uenemy\_rngt→Penemyt\+1U\_\{\\mathrm\{enemy\\\_rng\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{enemy\}\}^\{t\+1\},Uenemy\_rngt→Oenemyt\+1U\_\{\\mathrm\{enemy\\\_rng\}\}^\{t\}\\rightarrow O\_\{\\mathrm\{enemy\}\}^\{t\+1\}Uenemy\_rngt→Venemyt\+1U\_\{\\mathrm\{enemy\\\_rng\}\}^\{t\}\\rightarrow V\_\{\\mathrm\{enemy\}\}^\{t\+1\},Penemyt→Penemyt\+1P\_\{\\mathrm\{enemy\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{enemy\}\}^\{t\+1\}Oenemyt→Penemyt\+1O\_\{\\mathrm\{enemy\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{enemy\}\}^\{t\+1\},Venemyt→Penemyt\+1V\_\{\\mathrm\{enemy\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{enemy\}\}^\{t\+1\}Aenemyt→Aenemyt\+1A\_\{\\mathrm\{enemy\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{enemy\}\}^\{t\+1\}Penemyt\+1:=fpos\(Penemyt,Oenemyt,Venemyt,Uenemy\_rngt\)P\_\{\\mathrm\{enemy\}\}^\{t\+1\}:=f\_\{\\mathrm\{pos\}\}\(P\_\{\\mathrm\{enemy\}\}^\{t\},O\_\{\\mathrm\{enemy\}\}^\{t\},V\_\{\\mathrm\{enemy\}\}^\{t\},U\_\{\\mathrm\{enemy\\\_rng\}\}^\{t\}\)Oenemyt\+1:=fori\(Oenemyt,Uenemy\_rngt\)O\_\{\\mathrm\{enemy\}\}^\{t\+1\}:=f\_\{\\mathrm\{ori\}\}\(O\_\{\\mathrm\{enemy\}\}^\{t\},U\_\{\\mathrm\{enemy\\\_rng\}\}^\{t\}\)Venemyt\+1:=fvel\(Venemyt,Uenemy\_rngt\)V\_\{\\mathrm\{enemy\}\}^\{t\+1\}:=f\_\{\\mathrm\{vel\}\}\(V\_\{\\mathrm\{enemy\}\}^\{t\},U\_\{\\mathrm\{enemy\\\_rng\}\}^\{t\}\)LevelMapping \+ layoutLevelMapping \+ layoutInitc0Init\_\{c\}^\{0\},PstP\_\{s\}^\{t\}AstA\_\{s\}^\{t\},c↦sc\\mapsto sInitc0→PstInit\_\{c\}^\{0\}\\rightarrow P\_\{s\}^\{t\},Initc0→AstInit\_\{c\}^\{0\}\\rightarrow A\_\{s\}^\{t\}Pst:=init\_position\(Initc0\)P\_\{s\}^\{t\}:=\\mathrm\{init\\\_position\}\(Init\_\{c\}^\{0\}\)Ast:=init\_existence\(Initc0\)A\_\{s\}^\{t\}:=\\mathrm\{init\\\_existence\}\(Init\_\{c\}^\{0\}\)for any layout symbolccmapped to spritessInteractionSetavatar wall \> stepBackUactiontU\_\{\\mathrm\{action\}\}^\{t\},PavatartP\_\{\\mathrm\{avatar\}\}^\{t\}PwalltP\_\{\\mathrm\{wall\}\}^\{t\},Pavatart\+1P\_\{\\mathrm\{avatar\}\}^\{t\+1\}Uactiont→Pavatart\+1U\_\{\\mathrm\{action\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{avatar\}\}^\{t\+1\},Pavatart→Pavatart\+1P\_\{\\mathrm\{avatar\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{avatar\}\}^\{t\+1\}Pwallt→Pavatart\+1P\_\{\\mathrm\{wall\}\}^\{t\}\\rightarrow P\_\{\\mathrm\{avatar\}\}^\{t\+1\}Pavatart\+1:=stepBack\(Pavatart,Pwallt,Uactiont\)P\_\{\\mathrm\{avatar\}\}^\{t\+1\}:=\\mathrm\{stepBack\}\(P\_\{\\mathrm\{avatar\}\}^\{t\},P\_\{\\mathrm\{wall\}\}^\{t\},U\_\{\\mathrm\{action\}\}^\{t\}\)goal avatar \> killSpritePgoaltP\_\{\\mathrm\{goal\}\}^\{t\},PavatartP\_\{\\mathrm\{avatar\}\}^\{t\}AgoaltA\_\{\\mathrm\{goal\}\}^\{t\},AavatartA\_\{\\mathrm\{avatar\}\}^\{t\}Agoalt\+1A\_\{\\mathrm\{goal\}\}^\{t\+1\}Pgoalt→Agoalt\+1P\_\{\\mathrm\{goal\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{goal\}\}^\{t\+1\},Pavatart→Agoalt\+1P\_\{\\mathrm\{avatar\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{goal\}\}^\{t\+1\}Agoalt→Agoalt\+1A\_\{\\mathrm\{goal\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{goal\}\}^\{t\+1\},Aavatart→Agoalt\+1A\_\{\\mathrm\{avatar\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{goal\}\}^\{t\+1\}Agoalt\+1:=killSprite\(Agoalt,A\_\{\\mathrm\{goal\}\}^\{t\+1\}:=\\mathrm\{killSprite\}\(A\_\{\\mathrm\{goal\}\}^\{t\},overlap\(Pgoalt,Pavatart\),\\mathrm\{overlap\}\(P\_\{\\mathrm\{goal\}\}^\{t\},P\_\{\\mathrm\{avatar\}\}^\{t\}\),Aavatart\)A\_\{\\mathrm\{avatar\}\}^\{t\}\)avatar enemy \> killSpritePavatartP\_\{\\mathrm\{avatar\}\}^\{t\},PenemytP\_\{\\mathrm\{enemy\}\}^\{t\}AavatartA\_\{\\mathrm\{avatar\}\}^\{t\},AenemytA\_\{\\mathrm\{enemy\}\}^\{t\}Aavatart\+1A\_\{\\mathrm\{avatar\}\}^\{t\+1\}Pavatart→Aavatart\+1P\_\{\\mathrm\{avatar\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{avatar\}\}^\{t\+1\},Penemyt→Aavatart\+1P\_\{\\mathrm\{enemy\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{avatar\}\}^\{t\+1\}Aavatart→Aavatart\+1A\_\{\\mathrm\{avatar\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{avatar\}\}^\{t\+1\},Aenemyt→Aavatart\+1A\_\{\\mathrm\{enemy\}\}^\{t\}\\rightarrow A\_\{\\mathrm\{avatar\}\}^\{t\+1\}Aavatart\+1:=killSprite\(Aavatart,A\_\{\\mathrm\{avatar\}\}^\{t\+1\}:=\\mathrm\{killSprite\}\(A\_\{\\mathrm\{avatar\}\}^\{t\},overlap\(Pavatart,Penemyt\),\\mathrm\{overlap\}\(P\_\{\\mathrm\{avatar\}\}^\{t\},P\_\{\\mathrm\{enemy\}\}^\{t\}\),Aenemyt\)A\_\{\\mathrm\{enemy\}\}^\{t\}\)TerminationSetSpriteCounter stype=goal
limit=0 win=TrueAgoalt\+1A\_\{\\mathrm\{goal\}\}^\{t\+1\},Countgoalt\+1Count\_\{\\mathrm\{goal\}\}^\{t\+1\}Terminalgoalt\+1Terminal\_\{\\mathrm\{goal\}\}^\{t\+1\}Agoalt\+1→Countgoalt\+1A\_\{\\mathrm\{goal\}\}^\{t\+1\}\\rightarrow Count\_\{\\mathrm\{goal\}\}^\{t\+1\},Countgoalt\+1→Terminalgoalt\+1Count\_\{\\mathrm\{goal\}\}^\{t\+1\}\\rightarrow Terminal\_\{\\mathrm\{goal\}\}^\{t\+1\}Countgoalt\+1:=fcount\(Agoalt\+1\)Count\_\{\\mathrm\{goal\}\}^\{t\+1\}:=f\_\{\\mathrm\{count\}\}\(A\_\{\\mathrm\{goal\}\}^\{t\+1\}\)Terminalgoalt\+1:=𝟏\[Countgoalt\+1≤0\]Terminal\_\{\\mathrm\{goal\}\}^\{t\+1\}:=\\mathbf\{1\}\[Count\_\{\\mathrm\{goal\}\}^\{t\+1\}\\leq 0\]SpriteCounter stype=avatar
limit=0 win=FalseAavatart\+1A\_\{\\mathrm\{avatar\}\}^\{t\+1\},Countavatart\+1Count\_\{\\mathrm\{avatar\}\}^\{t\+1\}Terminalavatart\+1Terminal\_\{\\mathrm\{avatar\}\}^\{t\+1\}Aavatart\+1→Countavatart\+1A\_\{\\mathrm\{avatar\}\}^\{t\+1\}\\rightarrow Count\_\{\\mathrm\{avatar\}\}^\{t\+1\},Countavatart\+1→Terminalavatart\+1Count\_\{\\mathrm\{avatar\}\}^\{t\+1\}\\rightarrow Terminal\_\{\\mathrm\{avatar\}\}^\{t\+1\}Countavatart\+1:=fcount\(Aavatart\+1\)Count\_\{\\mathrm\{avatar\}\}^\{t\+1\}:=f\_\{\\mathrm\{count\}\}\(A\_\{\\mathrm\{avatar\}\}^\{t\+1\}\)Terminalavatart\+1:=𝟏\[Countavatart\+1≤0\]Terminal\_\{\\mathrm\{avatar\}\}^\{t\+1\}:=\\mathbf\{1\}\[Count\_\{\\mathrm\{avatar\}\}^\{t\+1\}\\leq 0\]The transition fromtttot\+1t\+1is defined by structural functions:
Xit\+1:=fi\(Pa\(Xit\+1\)\),X\_\{i\}^\{t\+1\}:=f\_\{i\}\(\\mathrm\{Pa\}\(X\_\{i\}^\{t\+1\}\)\),\(3\)wherePa\(Xit\+1\)\\mathrm\{Pa\}\(X\_\{i\}^\{t\+1\}\)denotes the causal parents ofXit\+1X\_\{i\}^\{t\+1\}\. These parents are not learned from correlations\. They are obtained from the VGDL elements:SpriteSet,LevelMapping,InteractionSet, andTerminationSet\.[TableI](https://arxiv.org/html/2609.05459#S3.T1)gives the mapping forbasicgame\.
### III\-ASprite Dynamics
Each sprite class contributes a local causal mechanism\. These mechanisms are derived from the sprite definitions in theSpriteSetof the VGDL description shown in[Figure2](https://arxiv.org/html/2609.05459#S3.F2)\. In the mapping in[TableI](https://arxiv.org/html/2609.05459#S3.T1), sprite dynamics define how attributes such as position, orientation, velocity, and alive\-state are updated from timettto timet\+1t\+1\.
For a moving spritess, the next position is caused by its current position, orientation, velocity, and the relevant input:
Pst\+1:=fpos\(Pst,Ost,Velst,Ust\)\.P\_\{s\}^\{t\+1\}:=f\_\{\\mathrm\{pos\}\}\(P\_\{s\}^\{t\},O\_\{s\}^\{t\},Vel\_\{s\}^\{t\},U\_\{s\}^\{t\}\)\.\(4\)For the avatar,Ust=UactiontU\_\{s\}^\{t\}=U\_\{\\mathrm\{action\}\}^\{t\}\. For a random enemy,Ust=Uenemy\_rngtU\_\{s\}^\{t\}=U\_\{\\mathrm\{enemy\\\_rng\}\}^\{t\}\. The orientation and velocity updates are
Ost\+1:=fori\(Ost,Ust\),Velst\+1:=fvel\(Velst,Ust\)\.O\_\{s\}^\{t\+1\}:=f\_\{\\mathrm\{ori\}\}\(O\_\{s\}^\{t\},U\_\{s\}^\{t\}\),\\quad Vel\_\{s\}^\{t\+1\}:=f\_\{\\mathrm\{vel\}\}\(Vel\_\{s\}^\{t\},U\_\{s\}^\{t\}\)\.\(5\)
For immovable sprites such as walls and goals, the position mechanism is an identity function:Pst\+1:=PstP\_\{s\}^\{t\+1\}:=P\_\{s\}^\{t\}\. Their alive\-state persists unless an interaction rule changes it:Ast\+1:=AstA\_\{s\}^\{t\+1\}:=A\_\{s\}^\{t\}\.
This distinction makes the causal role of sprite classes explicit\. AMovingAvatarhas an action\-dependent movement mechanism, aRandomNPChas an RNG\-dependent movement mechanism, and anImmovablesprite has a persistence mechanism\. The sprite dynamics, therefore, define the baseline state transition before interaction rules such asstepBackorkillSpritemodify the next state\.
### III\-BInteraction Mechanisms
Interaction mechanisms are derived from theInteractionSetin the VGDL description\. They define how the state of one sprite changes when it spatially interacts with another sprite\. In the mapping in[TableI](https://arxiv.org/html/2609.05459#S3.T1), these mechanisms include rules such asstepBackandkillSprite\. For two spritesiiandjj, an interaction is activated by a spatial condition:
Cijt:=overlap\(Pit,Pjt\)\.C\_\{ij\}^\{t\}:=\\mathrm\{overlap\}\(P\_\{i\}^\{t\},P\_\{j\}^\{t\}\)\.\(6\)The resulting state update can be written as
Xit\+1:=fint\(Xit,Pit,Pjt,Ait,Ajt,Cijt\),X\_\{i\}^\{t\+1\}:=f\_\{\\mathrm\{int\}\}\(X\_\{i\}^\{t\},P\_\{i\}^\{t\},P\_\{j\}^\{t\},A\_\{i\}^\{t\},A\_\{j\}^\{t\},C\_\{ij\}^\{t\}\),\(7\)whereXit\+1X\_\{i\}^\{t\+1\}is the affected next\-state variable\.
For example, the ruleavatar wall \> stepBackchanges the avatar’s next position when the attempted movement causes contact with a wall:
Pavatart\+1:=stepBack\(Pavatart,Pwallt,Uactiont\)\.P\_\{\\mathrm\{avatar\}\}^\{t\+1\}:=\\mathrm\{stepBack\}\(P\_\{\\mathrm\{avatar\}\}^\{t\},P\_\{\\mathrm\{wall\}\}^\{t\},U\_\{\\mathrm\{action\}\}^\{t\}\)\.\(8\)Similarly,killSpritechanges the alive\-state of the affected sprite when the required overlap condition holds:
Ait\+1:=killSprite\(Ait,Cijt,Ajt\)\.A\_\{i\}^\{t\+1\}:=\\mathrm\{killSprite\}\(A\_\{i\}^\{t\},C\_\{ij\}^\{t\},A\_\{j\}^\{t\}\)\.\(9\)
Thus, interaction mechanisms specify causal effects of spatial contact\. They do not merely record that two sprites are close to each other\. They define which sprite state is changed, under which spatial condition, and by which VGDL rule\.
### III\-CTermination Mechanisms
Termination mechanisms are derived from theTerminationSetin the VGDL description\. They define when the game reaches a win or loss state\. In the mapping in[TableI](https://arxiv.org/html/2609.05459#S3.T1)forbasicgame, termination depends on live\-instance counts for sprites such as the goal and the avatar\.
For a sprite typess, the live\-instance count is computed from the alive\-state variables:
Countst\+1:=fcount\(Ast\+1\)\.Count\_\{s\}^\{t\+1\}:=f\_\{\\mathrm\{count\}\}\(A\_\{s\}^\{t\+1\}\)\.\(10\)A terminal variable is then computed from this count:
Terminalst\+1:=𝟏\[Countst\+1≤limits\]\.Terminal\_\{s\}^\{t\+1\}:=\\mathbf\{1\}\[Count\_\{s\}^\{t\+1\}\\leq limit\_\{s\}\]\.\(11\)
For example, inbasicgame, the game is
- •won when no goal sprites remain: Terminalgoalt\+1:=𝟏\[Countgoalt\+1≤0\]\.\\hphantom\{\.\}\\qquad\\quad~Terminal\_\{\\mathrm\{goal\}\}^\{t\+1\}:=\\mathbf\{1\}\[Count\_\{\\mathrm\{goal\}\}^\{t\+1\}\\leq 0\]\.
- •lost when no avatar sprites remain: Terminalavatart\+1:=𝟏\[Countavatart\+1≤0\]\.\\hphantom\{\.\}\\qquad\\quad Terminal\_\{\\mathrm\{avatar\}\}^\{t\+1\}:=\\mathbf\{1\}\[Count\_\{\\mathrm\{avatar\}\}^\{t\+1\}\\leq 0\]\.
Termination nodes are, therefore, leaf nodes in the SCM\. They summarize the consequences of earlier sprite dynamics and interaction mechanisms, but they do not directly cause movement or collision outcomes within the same transition\.
## IVDiscussion and Future Work
This dynamic SCM framework has several benefits\. It provides*explainability*by making causal pathways explicit, allows*simulation of counterfactuals*, and supports*causal RL*by supplying a full state model to agents\. It also enables*procedural content validation*by testing whether a newly generated game description is logically consistent through its implied causal model, as done by Jiwatode et al\.\[[6](https://arxiv.org/html/2609.05459#bib.bib2)\]for VGDL synthesis\.
One of the primary limitations of this approach is that the causal model’s size scales with the complexity of the VGDL description\. Additionally, games with intricate physics or hidden states may require structural approximations\. Furthermore, if the actual game implementation deviates from the VGDL design \(e\.g\., due to bugs or unmodeled nuances\), errors will naturally arise in the causal mapping\.
Future work should address these issues by developing semi\-automated tools to extract SCMs directly from game code and by extending the framework to multi\-agent or real\-time games\. This framework could also be extended to other games in the GVGAI suite and to other game definitions\. Future research should also empirically evaluate these SCMs to quantify their impact on agent performance\. Different methods to encode spatial relationships in the causal model could also be explored\.
In conclusion, by mapping video games to a dynamic causal framework, we enable reasoning about actions and outcomes in games, complementing statistical and learning\-based methods\.
### Acknowledgements:
This work is jointly supported by the “HybrInt \- Hybrid Intelligence through Interpretable AI in Machine Perception and Interaction” project \(Zukunft Nds, Niedersächsisches Ministerium für Wissenschaft, Grant ID: ZN4219\) and the Novo Nordisk Foundation grant NNF25OC0105856\.
The editing process was supported by Google’s Gemini\.
## References
- \[1\]D\. Apeldoorn and A\. Dockhorn\(2021\)Exception\-tolerant hierarchical knowledge bases for forward model learning\.IEEE Transactions on Games,pp\. 1–14\.Cited by:[§I](https://arxiv.org/html/2609.05459#S1.p1.1)\.
- \[2\]W\. Chen, J\. Zhang, H\. Zhu, B\. Xu, Z\. Hao, K\. Zhang, J\. Ye, and R\. Cai\(2025\)Causal\-aware large language models: enhancing decision\-making through learning, adapting and acting\.arXiv:2505\.24710\.Cited by:[§II\-B](https://arxiv.org/html/2609.05459#S2.SS2.p2.2)\.
- \[3\]Z\. Deng, J\. Jiang, G\. Long, and C\. Zhang\(2023\)Causal reinforcement learning: a survey\.arXiv preprint arXiv:2307\.01452\.Cited by:[§I](https://arxiv.org/html/2609.05459#S1.p1.1)\.
- \[4\]M\. Genesereth and M\. Thielscher\(2022\)Analyzing games with logic\.InGeneral Game Playing,pp\. 129–149\.Cited by:[§I](https://arxiv.org/html/2609.05459#S1.p2.1)\.
- \[5\]L\. Hammond, J\. Fox, T\. Everitt, R\. Carey, A\. Abate, and M\. Wooldridge\(2023\)Reasoning about causality in games\.Artificial Intelligence320,pp\. 103919\.Cited by:[§II\-A](https://arxiv.org/html/2609.05459#S2.SS1.p2.11)\.
- \[6\]M\. Jiwatode, A\. Dockhorn, and B\. Rosenhahn\(2026\)From gameplay traces to game mechanics: causal induction with large language models\.arXiv:2602\.00190\.Cited by:[§I](https://arxiv.org/html/2609.05459#S1.p2.1),[§II\-B](https://arxiv.org/html/2609.05459#S2.SS2.p2.2),[§III](https://arxiv.org/html/2609.05459#S3.p1.2),[§IV](https://arxiv.org/html/2609.05459#S4.p1.1)\.
- \[7\]M\. Jiwatode, R\. Fuchs, R\. Schmöcker, B\. Rosenhahn, and A\. Dockhorn\(2026\)Spatial reasoning in llm game agents: impact of causal context and multi\-step planning\.In2026 IEEE Conference on Games \(CoG\),pp\. 1–8\.Cited by:[§I](https://arxiv.org/html/2609.05459#S1.p2.1)\.
- \[8\]M\. Li, J\. Zhang, and E\. Bareinboim\(2026\)Confounding robust deep reinforcement learning: a causal approach\.Advances in Neural Information Processing Systems38,pp\. 138292–138325\.Cited by:[§I](https://arxiv.org/html/2609.05459#S1.p1.1)\.
- \[9\]Y\. Li, C\. Lin, M\. U\. Nasir, P\. Bontrager, J\. Liu, and J\. Togelius\(2025\)GVGAI\-llm: evaluating large language model agents with infinite games\.arXiv:2508\.08501\.Cited by:[§I](https://arxiv.org/html/2609.05459#S1.p2.1)\.
- \[10\]P\. Madumal, T\. Miller, L\. Sonenberg, and F\. Vetere\(2020\)Explainable reinforcement learning through a causal lens\.InProceedings of the AAAI conference on artificial intelligence,Vol\.34,pp\. 2493–2500\.Cited by:[§I](https://arxiv.org/html/2609.05459#S1.p1.1),[§II\-A](https://arxiv.org/html/2609.05459#S2.SS1.p2.11)\.
- \[11\]J\. Pearl\(2009\)Causality\.Cambridge University Press\.Cited by:[§II\-A](https://arxiv.org/html/2609.05459#S2.SS1.p1.1),[§II\-A](https://arxiv.org/html/2609.05459#S2.SS1.p2.11)\.
- \[12\]D\. Perez\-Liebana, S\. M\. Lucas, R\. D\. Gaina, J\. Togelius, A\. Khalifa, and J\. Liu\(2019\)General video game artificial intelligence\.Vol\.3,Morgan & Claypool Publishers\.Note:[https://gaigresearch\.github\.io/gvgaibook/](https://gaigresearch.github.io/gvgaibook/)Cited by:[§II\-B](https://arxiv.org/html/2609.05459#S2.SS2.p1.1)\.
- \[13\]A\. M\. Smith, M\. J\. Nelson, and M\. Mateas\(2010\)Ludocore: a logical game engine for modeling videogames\.InProceedings of the 2010 IEEE Conference on Computational Intelligence and Games,pp\. 91–98\.Cited by:[§I](https://arxiv.org/html/2609.05459#S1.p2.1)\.Similar Articles
Causal Reasoning with Bipartite Graphical Causal Models
The paper proposes bipartite graphical causal models (BGCMs) to resolve ambiguities in causal interventions for systems at equilibrium with cyclic dependencies, generalizing existing frameworks like causal Bayesian networks and structural causal models.
[R] CausalVLBench: Benchmarking Visual Causal Reasoning in Large VLMs.
This arXiv paper introduces CausalVLBench, a benchmark for evaluating visual causal reasoning in large vision-language models across three tasks: causal structure inference, intervention target prediction, and counterfactual prediction. It evaluates open-source LVLMs on three causal representation learning datasets, revealing strengths and weaknesses.
YoCausal: How Far is Video Generation from World Model? A Causality Perspective
This paper introduces YoCausal, a benchmark based on the Violation of Expectation paradigm from cognitive science, to evaluate whether video diffusion models truly understand causality or merely overfit to temporal patterns. Evaluation of 13 state-of-the-art models reveals a significant gap compared to human-level causal cognition.
Beyond Directed Acyclic Graphs: Causal Zeros and Causal Differential Equations
This paper extends Pearl's structural causal model framework by introducing causal zeros and causal differential equations to handle symmetric constraints and feedback cycles, which are not allowed in directed acyclic graphs.
CausalDS: Benchmarking Causal Reasoning in Data-Science Agents
Introduces CausalDS, a benchmark for evaluating causal reasoning in LLM-based data science agents, using synthetic structural causal models and natural language stories to test associational, interventional, and counterfactual reasoning along with tool use and abstention.