Home Tehnoloģija Modder injicē AI dialogu 2002. gada dzīvnieku šķērsošanai, izmantojot atmiņas hack

Modder injicē AI dialogu 2002. gada dzīvnieku šķērsošanai, izmantojot atmiņas hack

4
0

 

But discovering the address was only half the problem. When you talk to a villager in Animal Crossing, the game usually displays dialogue immediately. Calling the AI ​​model over the internet takes several seconds. Willison examined the code and found Fonseca’s solution: a Watch_Dialogue() function that polls memory 10 times per second. When it detects a conversation, it immediately writes placeholder text: three periods with hidden pause commands between them, followed by the prompt “Press A to continue.”

“So the user gets a ‘Press A to continue’ button, and hopefully the LLM is done by the time they press that button,” Willison noted in a Hacker News comment. As players watch the dots appear and reach for the A button, the mod races to get a response from the AI ​​model and translate it into in-game dialogue.

Learning the secret language of the game

Simply writing text to memory would freeze the game. Animal Crossing uses an encoded format with control codes that control everything from text color to character emotions. The special prefix byte (0x7F) signals commands, not characters. Without the correct conversion control code, the game waits forever.

“Think of it like HTML,” Fonseca explains. “Your browser doesn’t just display words; it interprets tags… so that text is bold.” The decompilation community had documented this code, allowing Fonseca to create encoder and decoder tools that translate between the human-readable format and the byte sequences expected by the Gamecube.

Screenshot of LLM-powered dialogue entered in Animal Crossing on the Gamecube.


Credit:

 

Joshua Fonseca

 

He initially tried using a single AI model to handle both creative writing and technical formatting. “The results were a mess,” he notes. “The AI ​​tried to be a creative writer and a technical programmer at the same time and was bad at both.”

Solution: Split the work between two models. The Writer AI creates dialogue using character sheets scraped from the Animal Crossing Fan wiki. The Director AI then adds technical elements, including pauses, color changes, character expressions, and sound effects.

The code is available on github, though Fonseca warns that it has known bugs and has only been tested on MacOS. The mod requires Python 3.8+, API keys for either Google Gemini or Openai, and the Dolphin emulator. Have fun sticking it to a man or a raccoon, as the case may be.

source

LEAVE A REPLY

Please enter your comment!
Please enter your name here