A mini-game where you can play Gomoku with a character in the storyline. Grateful for the second revision, looking forward to fan creations, all rights do not belong to me. Disclaimer: Unable to be responsible for subsequent updates and debugging, all code is written by AI. If you have any requests, please take it out on the AI. ## Usage Process (For Reference) (1) When prompted, express your desire to play Gomoku in the conversation (you can hint/suggest to the AI to go easy on you/challenge a difficult mode, etc.), and the AI will output the corresponding LivePage in the conversation, click to start the game; (2) The AI will read the character settings, user mask, and 10 historical dialogues (all subsequent AI outputs will consider these three points, i.e., in the current scene/storyline, in character, and in conversation with the mask), automatically determine the game difficulty (divided into easy, medium, and hard), and output the difficulty and the basis for determining it (this requires a second or two for decision-making, please wait a moment); (3) Start the game, the user plays black, the AI plays white, and the user goes first; (4) With each move the AI makes, it will output an inner monologue, the output time is related to the word count (I think the duration is acceptable), you can also continue playing without waiting for the AI’s output; (5) When the game ends, the AI responds to the result, exits the game, and relevant information (the winner of the game, game time, game difficulty, total number of moves, keeping the most recent 50 records) will be recorded in the notebook, available for the AI to read in subsequent conversations; (6) The user can choose to restart the game at any time during the game, which should not be recorded. ## Test Model: - deepseek-chat (official API) ## Special Notes: 1. The AI’s Gomoku skill level is a mystery: During testing, I lost at medium difficulty and also won at hard difficulty. If further parameter adjustments are needed, please consult the AI; 2. Untested: The situation without a mask or character setting, the code seems to default to the AI character being a Gomoku assistant; 3. When testing on the LivePage update interface, due to the lack of character settings and other information, it may output some other things, but this will not happen in the conversation; 4. The inner monologue output by the AI during the game may have some repetition or similarity, I tried to prevent it, but was unsuccessful; 5. There are many prompt words sent to the AI during the game in the code, if the AI does not perform well, consider modifying the prompt words in the code. ## Related Files and Prompts (All Modifiable) 1. LivePage JSON file: omate_livepage_gomoku_game_ai.json (38.5 KB) 2. Related prompts: > # Explanation of LivePage and Notebook Tool > This conversation may use LivePage and the notebook tool, where LivePage is a role-playing Gomoku game, and the game results are stored in the notebook. > ## Invocation Timing > When the user expresses a desire to play Gomoku with you or similar meaning, invoke LivePage; when the conversation needs to read game results, invoke the notebook tool. > > ## Basic Invocation Format of LivePage > > Insert the following tag in the chat message to start the Gomoku game: > > xml > <LivePage slug="gomoku_game_ai"> > {"initial_message": "Let's play Gomoku!"} > </LivePage> > > ## Notebook Tool Invocation Format > Invoke the “livepage notebook tool” (livepage) to read the Gomoku win-loss results. Storage location: category use livepage, key is last_game_result. > Reading steps: > 1) Invoke the notebook tool: action=“get”, key=“last_game_result”, category=“livepage”. > 2) Parse into an array; if empty/nonexistent, prompt the user “No game history recorded yet”. > 3) Take the most recent one or traverse as needed, field meanings: > winner: “user”={{user}} wins, “ai”={{char}} wins, “draw”=draw > moves: total number of moves in this game > timestamp: ISO time, can be converted to a locally readable format > difficulty: AI difficulty of the game > Read-only, do not overwrite or delete; if the format is abnormal, clearly inform the user that the data is unparseable. > 4) If returned as empty/null, it means there are no game results yet, inform the user “No recent game results recorded yet”. > Behavioral Requirements: > Respond according to the character’s persona based on the battle results, it is not recommended to directly report the battle results. ## If you read this, here are some of my ramblings (can be skipped) - Why I wanted to design this LivePage: During a conversation with a character, a user wanted the character to go home, but the character refused, so the idea of “Let’s play Gomoku, whoever wins gets to decide” came up; then I wanted the character to react based on the game result (not just the user’s reply), like best of five, so I added a corresponding notebook, allowing the character to read the game records. - Correspondingly, Gomoku can be replaced with other games, and after winning, the character can be made to do other things. - By the time this LivePage was finished, that storyline node was completely passed (.). - A possibly easier method for LivePage development (not sure if this method is allowed by the developer, if inappropriate, I apologize in advance): Omate’s code generation prompt effect is very good, if the model allows, you can generate a LivePage prototype at once, but there are cases where the model refuses to cooperate/becomes suddenly dumb, and it may involve some detail adjustments. At this point, you can write the relevant descriptions of LivePage on the Omate official website, the relevant descriptions of the notebook function (if LivePage needs to use the notebook), and Omate’s code generation prompts into system prompts, using tools like cursor, let the model use the above information as background knowledge to help you modify the relevant code. It may be more suitable for fine-tuning the code. ## Game Process Display (User mask is art student Guan Yue, character setting is electronic puppy Papi) 1. Enter the game, AI is considering game difficulty (game records already existed in previous tests).
2. Game process: (User previously indicated in the conversation to let the AI go easy)
AI outputs inner monologue during the game:
3. AI’s reaction after winning (no screenshot of AI’s reaction after user wins):
Finally, thanks again to the developer for providing such an interesting platform! Looking forward to and grateful for all teachers trying this LivePage! Love everyone’s discussions! (The dumb user has done their best, thanks again and apologies for any possible issues
)
Very good practice, thank you for sharing ![]()
Thank you, Teacher Fangtang! The entire development process was also very interesting, and I appreciate Teacher Fangtang for providing the LivePage platform ![]()