Modding Videogames with AI Agents

In my previous post, I mentioned three game development workflows that I think AI will drastically change in the near term. I deliberately omitted a fourth one: modding. Not because it is less interesting, but because this one might not actually be under the game creators' control...

The Background

In the early nineties, game modding became increasingly accepted by the industry, and some companies began to provide documentation, mod-friendly game asset file formats, and even official modding tools. Over time, however, this openness became less common in the industry. My personal suspicion is that user-generated content doesn't align well with business models built around selling additional content like expansions and microtransactions. Thankfully, videogame modding is still quite active these days 1, but reverse-engineering game file formats and other data structures is often tedious and hard work (it was already so with older games!).

Last year, I combined manual reverse engineering with AI-assisted efforts to extract and potentially modify assets from one of my favourite games, Baldur's Gate: Dark Alliance. Reading about previous efforts and some tooling, I was able to reuse information on asset-extraction from the PlayStation 2 version, to instead get PC version assets. It is not a complete project, but I've been able to extract textures, sounds, and potentially 3D meshes (including those from the levels). Manually reviewing textures and custom-made JSON files is a slow and sometimes exhausting process. An example monster texture:

Baldur's Gate Dark Alliance Beholder monster texture

The Experiment(s)

So, in between my experiments, I decided to check how well an AI agent could do against a commercial videogame engine's assets. After all, if LLMs are trained on most of the internet and many books and videos... they should be pretty darn good with "mainstream" technologies, right?

Knowing the engine is one thing, but figuring out how a particular game uses it is another. That's what I wanted to test, how well that knowledge generalizes to individual games.

I made tests with the two best-known engines, Unity and Unreal Engine. While both succeeded, the Unreal Engine one was performed on a demo version of a yet unreleased title, so I'll wait for the proper retail release.

As a spoiler, what surprised me the most was how little game-specific knowledge I needed to give agents to create game mods. Both tests were done with Claude Sonnet 5.5, by the way.

Unreal Engine

About Unreal Engine modding with AI, let's just say that models are quite skilled at using UE4SS (Unreal Engine 4/5 Scripting System). The game mod was fully built by the agent; I only did the testing in-game. We had to go back and forth a bit, partially because the game demo I picked apparently had some stubbed methods (empty, and apparently not called), confusing my agent at first when it wired logic to them, but the patched methods were not being called. Still, it was less than 30 minutes, probably half if I used a full game instead.

It patched a few methods and was able to "generate wood from hitting a log with a club" (it is a first-person 3D survival game). No new assets yet (I want to have a proper axe), just spawning existing items and game logic. The fact that the existing log object had no hit logic was very fun to work around. In the end, at the agent's suggestion, we faked hitting the item: if you're looking at it, close enough, and you attack with the club, if the log body is inside a certain radius, it counts as a hit and spawns either sticks or another log. Smart trick!

UE4SS itself is quite spectacular, enabling a debug GUI from which you can tinker with game objects, then log and dump data, which then the agent can parse and extract information from. And despite the 4 in the name, it also supports Unreal Engine 5.

Unity

As for Unity, my AI agent suggested using BepInEx (Bepis Injector Extensible), as it supports both C#/Mono and IL2CPP (C# compiled to native code via C++). Alongside the Ildasm.exe and ILSpy tools 2, in no time we had a pretty interesting decompilation of the main game DLL into readable C# (I miss that language). The game is Cozy Game Restoration.

I first wanted to see how hard it would be to replace the fake game cartridges with real equivalents. I asked Claude Code to see how to extract image assets and game titles, and quickly I had all of them extracted. If you want details you can simply check this repository: https://github.com/Kartones/cozy-cart-art-plugin, but the TL;DR is that you get one cover image per cartridge/disk, plus some consoles have a rear sticker simulating the trademarks, safety recommendations and the like, plus a nice CSV list of all the game names.

I defined and partially coded the format to patch in replacement images (by following the same naming pattern, which is quite intuitive) and to optionally rename the game title also, and let the AI agent come up with the hooks and bits to plug it into BepInEx and the specific game methods. For example, it searched when and where to replace the textures, and found there was a texture cache and a way to modify the titles, both in-memory instead of having to patch Unity resource files.

Building the plugin took less than 30 minutes. Here is an in-game screenshot of the Donkey Kong Country cartridge "restored" to an approximation of the original cover:

Cozy Game Restoration modded cartridge in-game screenshot

After my Unreal Engine experience, and seeing how easily the agent could modify it, I decided to do a "tool boost plugin", to test if it could convert game-specific asks into valid patches, without prior knowledge of this videogame's internals. My prompts were along the lines of "I want the UV light to last 3 times longer", "I want to be able to specify the radius of toothbrush cleaning" or "make the tools be able to absorb more dirt".

In this case, I let it code everything on its own, and even created a BepInEx configuration file, so anybody can adjust each value without needing to recompile the source code. Best of all? It one-shotted the implementation on its own on the first try. In less than 15 minutes, including me asking for more features in a second and third round. It took more time to boot up the game to test than to come up with the changes.

The repository containing the plugin is https://github.com/Kartones/cozy-cart-boost-plugin. Tiny and clean, it could perfectly pass as human-generated code. It might break in the future if the game developers rename the methods I've patched, but it would become a cat-and-mouse scenario. Plus my intention was just to experiment, not to actively maintain this plugin.

Conclusion

All your engine are belong to us meme

This old gaming meme summarizes perfectly my point of view: I believe that we are going to enter into an era of insane game personalization, whether the creators originally intended to allow it or not. And, as videogame development is becoming increasingly more expensive, and more studios tend to rely on a shrinking group of game engines, it will be harder to avoid a flood of mods and reverse-engineer efforts than if you built your own thing from scratch (as in the old times). And why not allow modding? After all, we paid for the game, and we want to extend our enjoyment of it by moulding and expanding it in new ways, which is proof of the success in creating an entertaining piece of software.

Of course, games with server-side logic, online asset streaming, anti-cheat systems, and locked-down platforms are a different story, but for PC offline single-player games and older platforms, I think the barriers are going to keep falling. And we already have decades of existing games at our disposal.

And all of this, without needing to understand the game's internals yourself. Agents can perfectly probe and identify which engine a game uses, suggest tools (and install them on your behalf, if you allow them), and go all the way until you have the mod ready to test, complete with step-by-step instructions on how to set it up. Videogame modding is becoming accessible to almost anyone.


  1. ModDB and NexusMods are among the biggest and most active communities as of late 2026. ↩

  2. When C++ is involved, you'll need additional tools like Il2CppDumper or Cpp2IL. For this game, I didn't have to use them, as the title does not use IL2CPP. ↩

Tags: AI & ML C# C++ Development Game Dev Reverse Engineering Testing

The Modding Videogames with AI Agents article was written by Diego, originally published on