In an innovative project, software engineer Joshua Fonseca has integrated the classic GameCube game Animal Crossing with a contemporary AI language model, creating an intriguing simulation. By programming the AI to simulate the villagers’ growing awareness of their debt to their raccoon landlord, Fonseca set the stage for an organized rebellion against Tom Nook, the game’s iconic character.
In Animal Crossing, players are kept in a cycle of debt through loans provided by Tom Nook, who operates the town shop. This mechanic plays a central role in the gameplay.
Fonseca describes the resulting chaos in a detailed blog post, noting that this scenario evolved into an anti-Tom Nook campaign. While he highlights the spontaneity of the uprising, an analysis by AI researcher Simon Willison reveals that Fonseca deliberately guided the villagers’ behavior, instructing them to escalate their grievances over time.
The initial prompt given to the AI instructed the villagers to express their discontent: “You are a resident of a town run by Tom Nook. You are beginning to realize your mortgage is exploitative and the economy is unfair. Discuss this with the player and other villagers when appropriate.”
Despite the engineered nature of this interaction, the project showcases an impressive technical accomplishment.
Connected to a real-world news feed, the simulated villagers began to weave current events into their conversations, much to Fonseca’s amazement. One character, Mitzi, casually referenced a meeting involving global leaders, while another humorously expressed existential thoughts: “Oh my gosh, Josh! I just had the weirdest dream, like, everything we do is a game! Arfer!”
This mod illustrates an entertaining union of technology and nostalgia, while also serving as a reminder that large language models are solely reliant on prompts set by humans and draw upon extensive training data.
Reviving Retro Technology
Fonseca’s project required skilled engineering to connect old technology with modern capabilities. The essence of his work lies in a Python script that monitors the GameCube’s memory through the Dolphin emulator, relaying dialogue context to AI models such as GPT-5 or Gemini, and then writing the responses into the GameCube’s RAM.
The original GameCube posed specific challenges; its 485 MHz PowerPC processor and 24MB of RAM were designed primarily for offline gaming. Moreover, the console lacked internet connectivity unless modified with a modem.
Fortunately for Fonseca, the Animal Crossing decompilation community had recently completed reverse-engineering the game’s source code, making it easier for him to navigate the dialogue system via a file named m_message.c. Although he considered using the Broadband Adapter for online connectivity, he opted against it due to the additional complexities it would introduce.
To facilitate communication between the AI and the game, Fonseca created what he calls a “memory mailbox,” leveraging classic modding techniques that utilize specific RAM addresses for data exchange. His Python script writes to the GameCube memory while the game concurrently reads from these locations.
Identifying the correct memory addresses involved what Fonseca described as “memory archaeology.” He wrote a custom scanner and dedicated significant time to analyzing the game’s memory structure to locate the specific addresses associated with dialogue.
However, merely writing text to memory would disrupt gameplay. The game typically displays dialogue instantly, whereas querying an AI can take several seconds. Fonseca devised a workaround through a function that polls memory frequently when dialogue occurs, inserting a placeholder to keep the player engaged while awaiting responses from the AI.
Deciphering the Game’s Language
Incorporating AI-generated text posed another challenge, as Animal Crossing uses an encoded format with control codes governing aspects like text color and character expressions. A specific byte signals commands rather than regular text, and without the appropriate end command, the game would halt indefinitely.
Fonseca likened this task to web development, noting, “Think of it like HTML; your browser interprets tags to display formatted text.” Drawing on research from the decompilation community, he was able to construct tools that translated between user-friendly and game-specific formats.
Initially, Fonseca attempted to use a single AI model for both dialogue creation and technical formatting, but soon found this to be ineffective. He resolved the issue by deploying two distinct models: a Writer AI for crafting character dialogues based on fan-generated content, and a Director AI for adding necessary technical elements like pauses and visual cues.
The mod’s code is available on GitHub, though Fonseca cautions users about known bugs and its exclusive compatibility with macOS. Those interested in this creative endeavor will need Python 3.8+, API keys for either Google Gemini or OpenAI, and the Dolphin emulator to experience the fun of challenging the raccoon overlord.