This guy hooked up Animal Crossing to an AI and now the NPCs are organizing against Tom Nook

Animal Crossing LLM

This is just too beautiful to pass up: Austin-based software engineer Josh Fonseca hooked up a large language model (LLM) to Animal Crossing and just fired up the game, letting it take a progression all of its own (thanks, 404 Media!). Enter Animal Crossing LLM!

Now, for the non-tech people out there, LLMs are, in short, the thing that makes ChatGPT…ChatGPT. They can be summarized as incredibly large datasets used to train generative artificial intelligence (GenAI) applications and are, of course, ever-evolving in their interactions with us.

So what happens when a game that features a jerk of a landlord and a bunch of characters you don’t control gets injected with one of said datasets?

Note: Affiliate Disclosure: At PlayRatedGames, our content is made possible by our readers. If you purchase a game or product through links on our site, we may receive a small commission. This support helps us continue publishing honest, independent reviews. Our recommendations are based solely on what we believe offers real value to players — never influenced by affiliate partnerships.

Communism, that’s what. Ok, not so much: while the humorous allegory is there, it is important to mention that Animal Crossing is not a political game. Still, something rather progressive happened, as NPCs within the game started organizing against Tom Nook, the game’s not-so-antagonistic antagonistic figure and landlord who sells you your first residence in-game (and overcharges a hefty mortgage because capitalism).

Just what is Animal Crossing LLM, anyway?

According to Mr. Fonseca’s own report, Animal Crossing LLM is a mod that he took on to develop just for kicks. Josh currently works at a tech startup and got to tinker with Animal Crossing—the original, from the Nintendo Gamecube days—and documented the entire process in his blog. Yeah, this is all about them oldies, as fun as New Horizons is.

According to him, he had a lot of initial difficulties, given the fact that the Gamecube was one of the last consoles to be completely offline, back when the industry was entirely reliant on the game-in-a-box concept and live service applications as we know today were not even dreamed of. On the other end, AI apps—especially GenAI—are notoriously online, requiring an internet connection to pull from those LLMs in order to find the answers to our daily queries.

So, how did he get both to work together? Well, he improvised.

“My first stroke of luck was immense. The week I started this project, a massive effort by the Animal Crossing decompilation community reached completion. Instead of staring at PowerPC assembly, I had access to readable C code.

Digging through the source, I quickly found the relevant functions under a file named m_message.c. This was it, the heart of the dialogue system. A simple test confirmed I could hijack the function call and replace the in-game text with my own string.”

Josh Fonseca

We’ll try to explain the process as simply as we can (since we’re not software developers ourselves): the core of this technique is called “Inter-Process Communication” (IPC) using shared memory. This is like creating a shared notepad in the computer’s memory that both the game and the external script can read from and write to. The script can then directly send commands or data to the game, allowing it to manipulate game elements from the outside.

However, making this work requires a tedious search. Josh had to become a “memory archaeologist” to find the exact, stable locations in the game’s memory where specific information—like dialogue text and character names—was stored. This was a painstaking process because these locations can change. He did this by writing a memory scanner, a tool that searched through the game’s entire memory for the exact text that appeared on screen at a given moment.

Animal Crossing LLM
(Credit: Josh Fonseca)

To pinpoint the correct locations, he followed a repetitive loop: trigger a character’s dialogue, freeze the game, run the scanner. This initial scan would return many possible locations, so he’d repeat the process with different dialogue. By comparing the results, it was possible to cross-reference and figure out which of the memory addresses consistently held the current text. Once these addresses were found, the script knew exactly where to “look” and “write,” enabling it to successfully modify the game’s behavior.

There were a ton of things that took place after this, but it is all very technical, and AI-aficionados can (and should, as it makes for fun reading!) check out Fonseca’s own blog post for the details.

The coolest part came after the “AI Brain”, as the author puts it, was build: “My initial approach was to have a single LLM do everything: write dialogue, stay in character, and insert the technical control codes. The results were a mess. The AI was trying to be a creative writer and a technical programmer simultaneously and was bad at both”, Fonseca says.

His solution, then, was to sort of create two AI processes: one to direct, one to write. Yes, kinda like a movie set: the “writer” AI was in charge of generating dialog in a more creative manner, while the “director” AI chose how to apply it in a scene(or “how to shoot it”, in the author’s words).

In the beginning, things were going pretty normal: most characters in Animal Crossing LLM were behaving just like expected. Although different dialogues were created, they were all pretty much on par with the characters’ personalities. The “problems” began when Fonseca hooked the project up with an RSS reader, essentially giving Animal Crossing LLM access to real world news.

Then, weird cases—like the duck Scoot, who’s obsessed with fitness routines, commenting on Donald Trump “fighting like hell” to get rid of mail-in voting by “using his stamina all the way”. Afterwards, a tiny shared memory piece allowed the characters to gossip and, lo and behold, almost all of them turned on Tom Nook.

Animal Crossing LLM
“Crap…”, said Tom Nook, presumably (Credit: Nintendo)

“Everything’s going great in town, but sometimes I feel like Tom Nook is, like, taking all the bells!” said Cookie, the pink dog.

“Those of us with big dreams are being squashed by Tom Nook! We gotta take our town back!” Cheri the bear cub stated valiantly.

“This place is starting to feel more like Nook’s prison, y’know?” pondered a thoughtful Scoot.

As funny as this all is, to Fonseca, projects like this are a way to bridge old and new tech, connecting past and future: “When I was a child I was like, ‘Games are gonna get better and better every year,’’ he told 404 Media. “But after 20 years of playing games I’ve become a little jaded and I’m like, ‘oh there hasn’t really been that much innovation.’ So I really like the idea of mixing those old games with all the future technologies that I’m interested in. And I feel like I’m fulfilling those promised futures in a way.”

Besides his blog post, the entire project has been documented on his YouTube channel, where you can also find other ideas involving old stuff with a more contemporary flair to them.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

*

Online News Association Member Badge

Proud member of the Online News Association (ONA)