Modder injects AI dialogue into 2002’s Animal Crossing using memory hack

But the discovery of addresses was only half the problem. When you talk to a village resident in Animal intersectionThe game usually displays the dialog instantly. Calling the AI ​​model over the Internet takes a few seconds. Willison studied the code and found Fonseca solution: Watch_Dialogue () function, which drives memory 10 times per second. When he discovers the initial conversation, he immediately writes the text of the aggregate: three points with hidden teams of pauses between them, followed by the hint “click A to continue”.

“Thus, the user receives the“ click A to continue ”button, and I hope LLM will end by the time he clicks on this button”, “Willison marked In a comment on news hackers. While players look at the points that appear and reach the A button, the mod rushes to get the answer from the AI ​​model and translate it into the format of the game dialogue.

Learning the secret language of the game

Just write a text in memory froze the game. Animal intersection Uses a coded format with control codes that control everything from the color of the text to the emotions of the characters. A special byte of the prefix (0x7f) signs commands, not symbols. Without the proper management code, the game will eventually wait forever.

“Think about it like HTML,” Fonseca explains. “Your browser does not just display words; He interprets tags … to make the text with bold. ” The decompilation community has documented these codes, which allowed FonSeca to create an encoder and decoder tools, which are broadcast between the readable person and the expected byte sequences of GameCube.

Screenshot of dialogue with the LLM engine, introduced into Animal intersection For GameCube.


Credit:

Joshua Fonseca


Initially, he tried to use one model of artificial intelligence to process creative writing and technical formatting. “The results were disorder,” he notes. “II tried to be a creative writer and technical programmer at the same time and was bad in both.”

Solution: divide the work between two models. The writer of AI creates a dialogue using sheets of characters, scraped from Animal intersection Fan of Vicki. Then the director of AI adds technical elements, including pauses, color changes, characters and sound effects.

A Code is available on githubAlthough Fonseca warns that it contains known errors and was tested only on MacOS. Mod requires Python 3.8+, API keys for Google Gemini or Openai and a dolphin emulator. Make pleasure, gluing it to a person – or a raccoon, depending on the circumstances.

Leave a Comment