Wolf killer game system and method based on artificial intelligence agent
Through the werewolf killing game system based on artificial intelligence agents, the multi-player participation restrictions, uneven player quality and game balance in traditional werewolf killing games are solved, and the strategic and emotional expression ability of NPCs are improved, and players can start the game anytime, anywhere and improve the game experience.
Patent Information
- Application Number
- CN202410135906.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-31
- Publication Date
- 2025-08-01
AI Technical Summary
Traditional werewolf killing games have problems such as multiple players’ participation restrictions, uneven player quality and game balance, limitations of artificial intelligence NPCs, and limited interactive ability and emotional value.
The werewolf killing game system based on artificial intelligence agents is adopted, including character allocation module, character action module, character speech module, voting module and NPC decision-making module, simulate the interaction and game process between human players and NPCs, and use large-scale text data pre-training deep learning models to improve NPC's strategic and emotional expression capabilities.
It enables players to start games anytime, anywhere, improves game balance and NPC strategy, enhances interactive ability and emotional communication, and provides a richer emotional experience.
Smart Images

Figure CN120393436A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field, and particularly to a Werewolf game system and method based on an artificial intelligence agent. Background Art
[0002] In the field of games, the development of NPCs (Non-Playable Characters) has always been one of the key areas of artificial intelligence (AI) technology.
[0003] In the early stage, NPCs were usually very basic, driven by simple algorithms, such as the enemies in Space Invaders and Pac-Man. The behaviors of these NPCs were usually predictable and highly repetitive.
[0004] In the 1990s, NPCs began to exhibit more complex behaviors. For example, in games such as Half-Life and The Legend of Zelda series, NPCs began to show more complex behavior patterns, including reactions to the player's behavior.
[0005] In the early 2000s, AI technology innovations such as finite state machines (FSMs) and behavior trees made the behaviors of NPCs more natural and credible.
[0006] There are still the following problems in existing multiplayer interactive games: Multiplayer participation limitation: Traditional Werewolf games have the limitation that multiple players need to be online at the same time, resulting in players being unable to start the game anytime and anywhere.
[0007] Uneven player quality and game balance issues: Due to differences in player levels and game styles, as well as gaps in levels and strategies, it is often difficult for the game to reach an ideal balanced state, which may lead to inconsistent game experiences for some players.
[0008] Limitations of artificial intelligence NPCs: Traditional artificial intelligence NPCs are insufficient in terms of strategies, adaptability, and decision-making complexity, unable to effectively simulate the behaviors and thinking processes of real players, and unable to accurately understand the intentions of players' words and behaviors, resulting in unnatural or unreasonable reactions.
[0009] Limited interactive ability and emotional value: Traditional artificial intelligence NPCs usually lack the ability to express and understand emotions, which is particularly important in Werewolf games that highly rely on social interaction and psychological games. They lack personalization and are unable to provide players with more and richer emotional values.
[0010] To solve the above problems existing in multiplayer games, those skilled in the art have provided a Werewolf game system and method based on an artificial intelligence agent. Summary of the Invention
[0011] The present invention provides a Werewolf game system based on an artificial intelligence agent, which solves the following problems of existing game systems: Restriction on multi-person participation: Traditional Werewolf games have the restriction that multiple players need to be online simultaneously, resulting in players being unable to start the game anytime and anywhere.
[0012] Uneven player quality and game balance issues: Due to differences in player levels and playing styles, as well as gaps in levels and strategies, it is often difficult for the game to reach an ideal balanced state, which may lead to inconsistent game experiences for some players.
[0013] Limitations of artificial intelligence NPCs: Traditional artificial intelligence NPCs are insufficient in terms of strategies, adaptability, and decision-making complexity, unable to effectively simulate the behaviors and thought processes of real players, and unable to accurately understand the intentions of players' words and actions, resulting in unnatural or unreasonable reactions.
[0014] Limited interactive ability and emotional value: Traditional artificial intelligence NPCs usually lack the ability to express and understand emotions, which is particularly important in Werewolf games that highly rely on social interaction and psychological games. They lack personalization and are unable to provide players with more and richer emotional values.
[0015] This system includes a role assignment module, a role action module, a role speech module, a voting module, an NPC decision-making module, and a host judgment module. Each module works together to simulate the interaction and game process between human players and NPCs. The role assignment module automatically assigns roles to participating players and NPCs at the start of the game, ensuring that each participant has a role and providing a basis for the progress of the game. The execution logic of the role assignment module begins with selecting from the overall pool of players and NPCs and assigning them specific roles in the game; The role action module manages and executes the night actions of all players and NPCs during the game, ensuring the smooth progress of the game and ensuring that the actions of each role are carried out in the correct order and rules. The role action module is executed during the night phase of the game; The role speech module manages and executes the speech process of players and NPCs during the day phase of the game. The role speech module is responsible for ensuring that each role has the opportunity to speak in the established order, promoting communication and discussion in the game. The role speech module is executed during the day phase of the game; The voting module manages the voting process during the day phase of the game. The voting module allows players and NPCs to vote on who might be a Werewolf. The voting module is carried out after the day speech phase; The NPC decision-making module enables NPCs to make intelligent decisions in the game. The NPC decision-making module is responsible for analyzing the game state, generating actions and speeches, and making voting decisions. It is called as needed during the character action, speech, and voting phases. The host judgment module automatically processes the key turning points of the game process in the game, as well as whether the game end conditions are met. The host judgment module simulates the functions of a human host to ensure that the game rules are followed and the game is conducted fairly. The host judgment module is executed at the end of each night action and day phase, and also after voting to determine whether the game ends.
[0016] The execution process of the said character allocation module includes the following steps: S1. Preparation before character allocation: The system collects game setting information, including the number of players and character types. S2. Initial allocation of AI Agents (Artificial Intelligence Agents): Allocate roles to the participating AI agents. S3. Allocation to NPCs and players: The system allocates roles to NPCs and players according to game requirements and character balance. S4. Serial number allocation for characters: The system assigns a unique number to each character to determine their action and speech order in the game. S5. Function division of characters: According to the character types, the system will determine the functions and roles of each character in the game. S6. Speech sequence: The system will create a speech order based on the character numbers for the discussion phase in the game. S7. Action sequence: The system will also create an action sequence for the night phase in the game to determine the action order of each character.
[0017] The execution logic of the said character action module is as follows: S1. Start: Enter the night action phase. S2. Action sequence: The action module receives a sorted action sequence, which determines which character will act first. S3. Judge whether there are players or characters that need to execute actions: Check whether there are characters that need to execute specific actions this night. - If so, continue to the actor execution. - If not, or all actions have been executed, end this phase. S4. Judge whether the action subject is a player or an NPC: Determine whether the current actor is a player or an NPC. If it is a player, the player will execute their actions; if it is an NPC, enter the NPC decision-making module. S5. NPC Decision Module: NPCs determine their actions through the decision module, and this step involves reading the game state database to obtain the current game information.
[0018] S6. Action Result: After the action is executed, the result will be recorded in the game state database.
[0019] S7. Action Result Feedback: The action result will be fed back to the action module to facilitate the execution of the next action.
[0020] The execution logic of the character speech module is as follows: S1. Start: Enter the day speech phase; S2. Speech Sequence: The module receives a determined speech sequence to decide the order of speaking; S3. Judge Whether There are Players or Characters Who Need to Speak: Check whether there are still characters who need to speak; - If so, continue to speech execution; - If not, or all speeches have been completed, end this phase; S4. Judge Whether the Speaking Subject is a Player or an NPC: Determine whether the current speaker is a player or an NPC; - If it is a player, the player will make their speech; - If it is an NPC, enter the NPC decision module to make a decision to determine its speech content; S5. NPC Decision Module: Based on the information in the game state database, the NPC uses the decision module to perform reasoning and strategy planning to generate its speech content. After the speech is completed, the speech content will be recorded in the game state database. At the same time, it may have an impact on other characters, which requires corresponding logical processing (enter the next module). The speech result and any game state changes generated will be updated back to the game state database.
[0021] The execution logic of the voting module is as follows: S1. NPCs and Players: In the voting phase, each NPC and player needs to make a voting decision; S2. NPC Decision Module: Based on the information in the game state database, perform reasoning and strategy planning. NPCs determine their voting targets through the decision module; S3. Player Voting: Players determine their voting targets based on their own reasoning and communication in the game; S4. Voting Results: All voting results will be recorded in the game state database; S5. Voting Result Processing: The system will process the voting results, including counting the votes and determining whether any characters are eliminated; S6. Game state update: The results of the voting will be used to update the game state database, which may lead to the elimination of certain characters.
[0022] The NPC decision-making module includes the following sub-modules: First, the game state database: This is one of the inputs to the decision-making module, providing all relevant information about the current game, including the status of players and NPCs, historical actions and speeches, etc.; Second, action, speech, or voting guidelines: These are a set of predefined rules or guiding principles to assist the large language model in making decisions based on the current game situation; Third, Prompt templates: Natural language text templates designed for different game stages (action, speech, voting) to guide the large prediction model to generate outputs that conform to the context; Fourth, the large language model: Processes the input data and guidelines, and combines the preset Prompt templates to generate the action decisions, speech texts, or voting results of the NPCs; The execution logic of the NPC decision-making module is as follows: S1. The NPC decision-making module receives the game rules, the preset text of the current game character identities, and the current game state database information; S2. According to the current stage of calling the NPC decision-making module (action, speech, voting), obtain the corresponding Prompt template, and fill the Prompt template with the data in S1 (game rules, preset text of character identities, current game state data); S3. The large language model analyzes the filled Prompt template, refers to the potential information, formulates the best strategy according to the current game situation, and finally generates the action decisions or speech contents of the NPCs; S4. The large language model will output the action decisions or speech contents of the NPCs and update these outputs to the game state database for the game to continue.
[0023] The execution logic of the host judgment module includes the following steps: S1. The game state database: This is the input to this module, containing the current status of all characters and the results of night actions; S2. Action results: The module receives the action results from each character, such as which character was killed by the werewolf or saved by the witch; S3. Character speeches: In the daytime phase, the module will determine the next step of the game based on the speech contents of the players and NPCs; S4. Host decision: The module will simulate the decision-making process of the host, and comprehensively consider the action results at night and the speech contents during the day to determine the current state of the game; S5. Whether the game ends: The decision-making module checks whether the victory condition of one party is met; - If the game-ending condition is met, enter the game-ending process and announce the winning party; - If the game has not ended, the game continues to the next night or day phase.
[0024] A Werewolf game method based on artificial intelligence agents, including a host, players, and NPCs in the game. The system assigns specific roles to players and NPCs. The roles include two opposing camps, the Werewolf camp and the Good People camp. The function of the Werewolf role is to kill a player every night. The ultimate goal is to eliminate all non-Werewolf players and become the only survivor of the game; The roles in the Good People camp include villagers, seers, witches, hunters, guards, and idiots; The villagers have no special abilities and decide to execute suspected Werewolf players through discussion and voting during the day. The goal of the villagers is to eliminate all Werewolves through voting; The seer has the right to check the identity of a player every night to help the villagers identify Werewolves; The witch has an antidote and a poison, which are used for saving and killing respectively, that is, for saving a player or eliminating a player, each can be used once, and by using the potions reasonably, it helps the Good People camp; When the hunter is eliminated, he can shoot and take away a player to ensure that the one taken away is a Werewolf; The guard can protect a player from being killed by Werewolves every night to protect key players; When the idiot is voted out for the first time, he will not die but lose the voting right, confusing the situation and interfering with the judgment of the Werewolves.
[0025] The game players proceed according to the assigned roles and their basic functions. The specific process is divided into two alternating phases: "day" and "night". At night, the Werewolves choose to kill, and other roles with night skills execute their skills. During the day, all surviving players discuss and vote to decide to execute a suspected Werewolf player; Communication and strategy: Players communicate verbally, reason, deceive, and cooperate to achieve their respective goals; The role of the host: The host is responsible for guiding the game process, announcing the results of the night, maintaining order, and ensuring the smooth progress of the game; Winning conditions: The Good People camp wins when all Werewolves are eliminated; The Werewolf camp wins when the number of Werewolves is equal to or more than the number of non-Werewolf players.
[0026] The technical effects and advantages of the present invention: 1. Optimization Goals for Multiplayer Participation Restrictions: Develop a new game mode by introducing AI Agents as NPCs so that players can start the game at any time. Develop a game mode where one real player and multiple NPCs can start the game, reducing the impact of the number of players on the game.
[0027] 2. Optimization Goals for Uneven Player Quality and Game Balance: Improve game balance to ensure that all players can enjoy a similar gaming experience. Set multiple game difficulties, and players can choose and match NPCs with different levels of intelligence according to their own levels and experiences to participate in the game. Optimize game rules and character abilities to ensure that various strategies are somewhat effective and avoid obvious game imbalances.
[0028] 3. Limitations of Artificial Intelligence NPCs: Improve the strategic, adaptable, and decision-making complexity of artificial intelligence NPCs to make them more similar to the performance of real players. Through large-scale text data for pre-training, improve the intelligence of deep learning models so that NPCs can better simulate the behaviors and thinking processes of real players, strengthen the understanding of players' words and behaviors, and improve the naturalness and rationality of responses.
[0029] 4. Limited Interactive Capabilities and Emotional Value: Increase the interactivity and emotional communication in the game to enhance players' social experience. Introduce more emotionally expressive NPCs, such as using natural language processing technology to understand players' emotional states and respond in a more personalized way; introduce voice and expression systems to promote deeper interaction between players and NPCs; enhance the personalized settings of characters to provide a richer emotional experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 is the system flow chart in Embodiment 2; Figure 2 is the structural schematic diagram of the role assignment module in Embodiment 2; Figure 3 is the structural schematic diagram of the role action module in Embodiment 2; Figure 4 is the structural schematic diagram of the role speech module in Embodiment 2; Figure 5 is the structural schematic diagram of the voting module in Embodiment 2; Figure 6 is the structural schematic diagram of the NPC decision-making module in Embodiment 2; Figure 7 is the structural schematic diagram of the host judgment module in Embodiment 2; DETAILED DESCRIPTION OF THE INVENTION The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. The embodiments of the present invention are given for purposes of illustration and description, and are not exhaustive or limit the present invention to the disclosed form. Many modifications and variations will be obvious to those of ordinary skill in the art. The embodiments are selected and described to better illustrate the principles and practical applications of the present invention, and to enable those of ordinary skill in the art to understand the present invention and design various embodiments with various modifications suitable for specific purposes.
[0031] Embodiment 1 In this embodiment, a Werewolf game method based on an artificial intelligence agent is provided. This game is a social game that combines role-playing, reasoning, communication, and strategy, and is derived from the "Mafia" game in the United States. It is usually led by a host (referee), and the players in the game are divided into two opposing camps: the Werewolf camp and the Good Guys camp. The following are some common roles and basic rules: Common Roles 1) Werewolves: - Function: Select and kill a player every night.
[0032] - Goal: Eliminate all non-Werewolf players and become the sole survivor of the game.
[0033] 2) Villagers: - Function: Have no special abilities and mainly decide to execute suspected Werewolf players through discussions and votes during the day.
[0034] - Goal: Identify and eliminate all Werewolves.
[0035] 3) Seers: - Function: Can check the identity of a player every night.
[0036] - Goal: Help the villagers identify Werewolves.
[0037] 4) Witches: - Function: Have an antidote (to save people) and a poison (to kill people), each of which can be used once.
[0038] - Goal: Reasonably use the potions to help the Good Guys camp.
[0039] 5) Hunters: - Function: Can shoot and take away a player when being eliminated.
[0040] - Goal: Ensure that the player taken away is a Werewolf.
[0041] 6) Guards: - Function: Can protect a player from being killed by Werewolves every night.
[0042] - Goal: Protect key players.
[0043] 7) Idiot: - Function: Will not die when voted out for the first time, but loses the voting right.
[0044] - Objective: Confuse the public and interfere with the judgment of the werewolves.
[0045] Basic Rules 1) Game Process: The game is divided into two alternating phases: "Day" and "Night".
[0046] - Night: The werewolves choose to kill; other characters with night skills execute their skills.
[0047] - Day: All surviving players discuss and vote to decide on executing a player suspected of being a werewolf.
[0048] 2) Victory Conditions: - Victory for the good guys camp: All werewolves are eliminated.
[0049] - Victory for the werewolves camp: The number of werewolves is equal to or more than the number of non-werewolf players.
[0050] 3) Communication and Strategy: Players communicate verbally, reason, deceive, and cooperate to achieve their respective goals.
[0051] 4) Role of the Host: The host is responsible for guiding the game process, announcing the results of the night, maintaining order, and ensuring the smooth progress of the game.
[0052] Embodiment 2 Please refer to Figures 1-7 , according to a Werewolf game method based on an artificial intelligence agent, a Werewolf game system based on an artificial intelligence agent has emerged. The system includes a role assignment module, a role action module, a role speech module, a voting module, an NPC decision-making module, and a host judgment module. Each module works together to simulate the interaction and game process between human players and NPCs. The role assignment module automatically assigns roles to participating players and NPCs at the start of the game, ensuring that each participant has a role and providing a basis for the progress of the game. The execution logic of the role assignment module starts with selecting from the overall pool of players and NPCs and assigning them specific roles in the game, providing the basis for role information for other modules (such as the role action module, speech module, etc.); The role action module manages and executes all night actions of players and NPCs during the game, ensuring the smooth progress of the game, ensuring that the actions of each role are carried out in the correct order and rules. The role action module executes during the night phase of the game. The role action module requires the role information provided by the role assignment module to execute actions and passes the results to the host judgment module to determine whether the game continues; The Character Speech Module manages and executes the speech process of players and NPCs during the day phase in the game. The Character Speech Module is responsible for ensuring that each character has the opportunity to speak in a predefined order, promoting communication and discussion in the game. The Character Speech Module executes during the day phase of the game. The Character Speech Module receives instructions from the Host Judgment Module to enter the day phase, and the speech results may affect the decision-making of the Voting Module; The Voting Module manages the voting process during the day phase in the game. The Voting Module allows players and NPCs to vote on who might be the werewolf. The Voting Module takes place after the day speech phase. The Voting Module usually follows the execution of the Character Speech Module and uses the speech content to influence the voting decision. The voting results are fed back to the Host Judgment Module to update the game state; The NPC Decision Module enables NPCs to make intelligent decisions in the game. The NPC Decision Module is responsible for analyzing the game state, generating actions and speeches, and making voting decisions. During the character action, speech, and voting phases, the NPC Decision Module is called as needed. The NPC Decision Module provides decision support for the Character Action Module, the Character Speech Module, and the Voting Module, and is the intelligent core for NPCs to participate in the activities of these modules; The Host Judgment Module automatically processes the key turning points of the game process in the game, as well as whether the conditions for ending the game are met. The Host Judgment Module simulates the functions of a human host, ensuring that the game rules are followed and the game is conducted fairly. The Host Judgment Module executes at the end of each night action and day phase, and also executes after voting to determine whether the game ends. The Host Judgment Module integrates the results of the Character Action Module, the Character Speech Module, and the Voting Module to make a judgment on whether the game continues or ends, and guides the game into the next phase.
[0053] The above-mentioned modules are closely related to each other, forming the logic chain of the game. Each phase of the game depends on the output of the previous module as input to ensure the continuity and logic of the game. From the start to the end of the game, each module plays its role at its specific time point, jointly creating a smooth, interactive, and intelligent gaming experience.
[0054] As Figure 2 shown, the execution process of the Character Allocation Module includes the following steps: S1. Preparation before character allocation: The system collects game setting information, including the number of players and the types of characters; S2. Initial allocation of AI Agents: Allocate roles to the participating AI agents; S3. Allocation to NPCs and players: The system allocates characters to NPCs and players according to the game requirements and the balance of the characters; S4. Serial Number Assignment for Roles: The system assigns a unique number to each role to determine their action and speaking order in the game; S5. Function Division of Roles: Based on the types of roles, the system will determine the functions and roles of each role in the game; S6. Speaking Sequence: The system will create a speaking order based on the role numbers for the discussion phase in the game; S7. Action Sequence: The system will also create an action sequence for the night phase in the game to determine the action order of each role.
[0055] Among them, the inputs of the role assignment module include: - The total number of participating players and NPCs.
[0056] - The list of available roles (such as werewolves, villagers, seers, etc.).
[0057] The outputs of the role assignment module include: - The specific role assigned to each player and NPC.
[0058] - The number assigned to each role, which will determine their action and speaking order in the game.
[0059] As Figure 3 shown, the execution logic of the said role action module is as follows: S1. Start: Enter the night action phase; S2. Action Sequence: The action module receives a sorted action sequence, which determines which role will act first; S3. Judge Whether There are Players or Roles Needing to Execute Actions: Check whether there are roles that need to execute specific actions on this night; - If so, continue to the actor's execution; - If not, or all actions have been executed, end this phase; S4. Judge Whether the Action Subject is a Player or an NPC: Determine whether the current actor is a player or an NPC. If it is a player, the player will execute their actions; if it is an NPC, enter the NPC decision-making module; S5. NPC Decision-Making Module: The NPC decides their actions through the decision-making module, and this step involves reading the game status database to obtain the current game information; S6. Action Result: After the action is executed, the result will be recorded in the game status database; S7. Action Result Feedback: The action result will be fed back to the action module to facilitate the execution of the next action.
[0060] Among them, the inputs of the role action module include: - Action sequence (received from the role assignment module).
[0061] - Game state database (containing all necessary information about the current game, including Figures 1-4 the game round data and round data in it).
[0062] The outputs of the character action module include: - Action result (updated to the game state database).
[0063] - Determine whether the game can continue or enter the next stage.
[0064] The key of the character action module lies in being able to accurately handle the action logic of each character, including the decisions of players and NPCs. For the actions of NPCs, the module needs to be able to call a complex decision-making system to simulate intelligent behavior, making the actions of NPCs both appropriate and in line with the strategy of the game. At the same time, this module is also responsible for ensuring that the results of the actions can correctly update the game state, providing accurate data support for the next step of the game or the discussion and voting sessions in the day phase.
[0065] The effective operation of the character action module depends on the accuracy and real-time update of the game state database, so as to ensure the smoothness of the game process and the gaming experience of participating players. In this way, the game can simulate a complex night action sequence, including the use of various character skills, while providing a fair and strategy-filled gaming environment for players.
[0066] As Figure 4 shown, the execution logic of the character speech module is as follows: S1. Start: Enter the day speech phase; S2. Speech sequence: The module receives a determined speech sequence to decide the order of speeches; S3. Judge whether there are players or characters who need to speak: Check whether there are still characters who need to give speeches; - If so, continue to speech execution; - If not, or all speeches have been completed, end this phase; S4. Judge whether the speech subject is a player or an NPC: Determine whether the current speaker is a player or an NPC; - If it is a player, the player will give their speech; - If it is an NPC, enter the NPC decision-making module to make a decision to determine its speech content; S5. NPC Decision Module: Based on the information in the game state database, the NPC uses the decision module to perform reasoning and strategic planning to generate its speech content. After the speech is completed, the speech content will be recorded in the game state database, and at the same time, it may have an impact on other characters, which requires corresponding logical processing (subsequently entering the next module). The speech result and any game state changes generated will be updated back to the game state database.
[0067] Among them, the inputs of the character speech module include: - Speech sequence (provided by the character assignment module).
[0068] - Game state database (containing all relevant information in the game).
[0069] The outputs of the character speech module include: - Speech content (the specific content of the player or NPC's speech).
[0070] - Update of the game state (any changes that may occur based on the speech content).
[0071] The character speech module is crucial because it handles the main social interaction links in the game. It must handle various logics, such as ensuring that the speech reflects the player's knowledge and strategy and reacts according to the player's role and the game state. For NPCs, the module needs to be intelligent enough to generate reasonable speeches that should match the NPC's role and position in the game. In addition, the recording of the speech result and the state update ensure that the game can progress appropriately according to the speech content.
[0072] As Figure 5 shown, the execution logic of the voting module is as follows: S1. NPCs and Players: In the voting stage, each NPC and player needs to make a voting decision; S2. NPC Decision Module: Based on the information in the game state database, perform reasoning and strategic planning. The NPCs use the decision module to decide their voting targets; S3. Player Voting: Players decide their voting targets based on their own reasoning and the communication situation in the game; S4. Voting Results: All voting results will be recorded in the game state database; S5. Voting Result Processing: The system will process the voting results, including counting the votes and determining whether any character is eliminated; S6. Game State Update: The voting results will be used to update the game state database, which may lead to the elimination of some characters.
[0073] Among them, the inputs of the voting module include: - The current game state database (containing all necessary game information and player status).
[0074] - The voting choices of players and NPCs.
[0075] The outputs of the voting module include: - The voting results (recording the voting decisions of each person).
[0076] - The update of the game state (the update of the game database reflecting the voting results).
[0077] The module is crucial because it handles one of the key decision points in the game, that is, eliminating players suspected of being werewolves through voting.
[0078] Correctly executing this link is not only crucial for the fairness of the game, but also plays an important role in promoting the game plot and increasing the tension of the game. In addition, it also needs to ensure that the results of all votes are transparent and traceable, so that all players can clearly understand the voting results and their impact on the game state.
[0079] For the voting decisions of NPCs, the voting module needs to be able to call an intelligent enough algorithm to analyze the game state, as well as the behaviors of other players and NPCs, so as to make voting decisions that conform to their roles and current game strategies. For players, the module needs to provide a simple and intuitive interface to receive and record their voting decisions. After all votes are completed, the module needs to be able to accurately calculate the votes, decide whether a character is eliminated, and the possible changes in the game state.
[0080] As Figure 6 shown, the concept of the NPC decision module is detailed as follows: First, the game state database: This is one of the inputs of the decision module, providing all relevant information about the current game, including the status of players and NPCs, historical actions and speeches, etc.; Second, action, speech or voting guidelines: These are a set of predefined rules or guiding principles, including game rules, previous game dynamics, player behavior patterns, to assist the large language model in making decisions based on the current game situation.
[0081] Third, the Prompt template: A natural language text template designed according to different game stages (action, speech, voting) to guide the large prediction model to generate outputs that conform to the context.
[0082] Fourth, the large language model: Processes the input data and guidelines, and combines the preset Prompt template to generate the action decisions, speech texts or voting results of NPCs.
[0083] The execution logic of the NPC decision-making module is as follows: S1. The NPC decision-making module receives the game rules, the preset text of the current game character's identity, and the current game state database information.
[0084] S2. According to the current stage of calling the NPC decision-making module (action, speech, voting), obtain the corresponding Prompt template, and fill the Prompt template with the data in step S1 (game rules, preset text of the character's identity, current game state data). S3. The large language model analyzes the filled Prompt template, refers to the potential information, formulates the best strategy according to the current game situation, and finally generates the action decision or speech content of the NPC.
[0085] S4. The large language model will output the action decision or speech content of the NPC, and update these outputs to the game state database for the game to continue.
[0086] The inputs of the NPC decision-making module include: - Game rules - The preset text of the character's identity in this game - The current game information in the game state database.
[0087] - The self-Prompt templates designed for different game stages (action, speech, voting).
[0088] The outputs of the NPC decision-making module include: - If the character action module calls the NPC decision-making module, the output result is: the action decision result of the NPC, which will be used in the character action execution stage at night.
[0089] - If the character speech module calls the NPC decision-making module, the output result is: the speech text of the NPC, which will be used in the character's opinion expression stage during the day.
[0090] - If the voting module calls the NPC decision-making module, the output result is: the voting decision result of the NPC, which will be used in the character voting stage during the day.
[0091] By integrating the powerful language understanding and generation capabilities of the large language model, the NPC decision-making module ensures that the NPC can make complex and logical in-game decisions, thereby enhancing the challenge and fun of the game. By simulating the decision-making process of human players, it not only increases the challenge and fun of the game, but also enables the NPC to better simulate the behavior of real players, providing all participants with a more rich and dynamic game experience, increasing the unpredictability and strategic depth of the game.
[0092] Such as Figure 7As shown, the execution logic of the host judgment module includes the following steps: S1. Game status database: This is the input of this module, containing the current status of all characters and the results of night actions; S2. Action results: The module receives the action results from each character, such as which character was killed by the werewolf or saved by the witch; S3. Character speeches: During the day phase, the module determines the next step of the game based on the speeches of players and NPCs; S4. Host decision-making: The module simulates the host's decision-making process, synthesizes the action results at night and the speech content during the day to determine the current state of the game; S5. Whether the game ends: The decision-making module checks whether the victory condition of one side is met (for example, the number of werewolves is equal to or more than the number of non-werewolf players, or all werewolves are eliminated); - If the game end condition is met, enter the process of ending the game and announce the winning side; - If the game has not ended, the game continues to the next night or day phase.
[0093] Among them, the inputs of the host judgment module include: - The current game information in the game status database.
[0094] - The action results of each character at night.
[0095] - The speech content of characters during the day phase.
[0096] The outputs of the host judgment module include: - The determination of whether the game continues; - If the game ends, announce the winning side.
[0097] The key of this module lies in being able to accurately interpret the game rules and make quick and fair judgments at each key node of the game. It needs to be able to handle complex logics, such as considering the use of special character skills and the results of daytime discussions, to ensure the smooth progress of the game. At the same time, this module is also a bridge connecting all stages of the game, ensuring a smooth transition from one stage to another.
[0098] Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art and related fields without creative efforts shall fall within the protection scope of the present invention. The structures, devices, and operation methods not specifically described and explained in the present invention shall be implemented according to the conventional means in the art without special instructions and limitations.
Claims
1. A Werewolf game system based on an artificial intelligence agent, characterized in that, The system includes a role assignment module, a role action module, a role speech module, a voting module, an NPC decision-making module, and a host judgment module. Each module works together to simulate the interaction and game process between human players and NPCs. The role assignment module automatically assigns roles to participating players and NPCs at the start of the game, ensuring that each participant has a role and providing a foundation for the progress of the game. The execution logic of the role assignment module begins with selecting from the overall pool of players and NPCs and assigning them specific roles in the game; The role action module manages and executes all the night actions of players and NPCs during the game, ensuring the smooth progress of the game and that the actions of each role are carried out in the correct order and according to the rules. The role action module is executed during the night phase of the game; The role speech module manages and executes the speech process of players and NPCs during the day phase of the game. The role speech module is responsible for ensuring that each role has the opportunity to make statements in the established order, promoting communication and discussion in the game. The role speech module is executed during the day phase of the game; The voting module manages the voting process during the day phase of the game. The voting module allows players and NPCs to vote on who might be the werewolf. The voting module takes place after the day speech phase; The NPC decision-making module enables NPCs to make intelligent decisions in the game. The NPC decision-making module is responsible for analyzing the game state, generating actions, speeches, and voting decisions. The NPC decision-making module is called as needed during the role action, speech, and voting phases; The host judgment module automatically processes the key turning points of the game process and whether the conditions for ending the game are met during the game. The host judgment module simulates the function of a human host, ensuring that the game rules are observed and the game is conducted fairly. The host judgment module is executed at the end of each night action and day phase, and also after voting to determine whether the game ends.
2. The werewolf killing game system based on an artificial intelligence agent according to claim 1, characterized in that, The execution process of the role assignment module includes the following steps: S1. Preparation before role assignment: The system collects game setting information, including the number of players and the types of roles; S2. Preliminary assignment of AI agents: Assign roles to participating AI agents; S3. Assignment to NPCs and players: The system assigns roles to NPCs and players according to game requirements and role balance; S4. Serial number assignment for roles: The system assigns a unique number to each role to determine their action and speech order in the game; S5. Function division of roles: According to the types of roles, the system determines the functions and roles of each role in the game; S6. Speech sequence: The system creates a speech order based on the role numbers for the discussion phase in the game; S7. Action sequence: The system also creates an action sequence for the night phase in the game to determine the action order of each role.
3. The werewolf killing game system based on an artificial intelligence agent according to claim 1, wherein, The execution logic of the role action module is as follows: S1. Start: Enter the night action phase; S2. Action sequence: The action module receives a sorted action sequence that determines which role will act first; S3. Determine whether there are players or characters who need to perform actions: Check whether there are characters who need to perform specific actions during this night; - If so, continue to the actor's execution; - If not, or if all actions have been completed, end this stage; S4. Determine whether the actor is a player or an NPC: Determine whether the current actor is a player or an NPC. If it is a player, the player will perform their actions; If it is an NPC, enter the NPC decision-making module; S5. NPC decision-making module: NPCs decide their actions through the decision-making module. This step involves reading the game state database to obtain the current game information; S6. Action result: After the action is executed, the result will be recorded in the game state database; S7. Action result feedback: The action result will be fed back to the action module to facilitate the execution of the next action.
4. The werewolf killing game system based on an artificial intelligence agent according to claim 1, characterized in that, The execution logic of the character speech module is as follows: S1. Start: Enter the daytime speech stage; S2. Speech sequence: The module receives a definite speech sequence to determine the order of speeches; S3. Determine whether there are players or characters who need to speak: Check whether there are still characters who need to speak; - If so, continue to the speech execution; - If not, or if all speeches have been completed, end this stage; S4. Determine whether the speaker is a player or an NPC: Determine whether the current speaker is a player or an NPC; - If it is a player, the player will make their speech; - If it is an NPC, enter the NPC decision-making module to make a decision to determine its speech content; S5. NPC decision-making module: Based on the information in the game state database, NPCs use the decision-making module to reason and plan strategies to generate their speech content. After the speech is completed, the speech content will be recorded in the game state database, and the speech result and any resulting game state changes will be updated back to the game state database, and then enter the next module.
5. The werewolf killing game system based on an artificial intelligence agent according to claim 1, characterized in that The execution logic of the voting module is as follows: S1. NPCs and players: During the voting stage, each NPC and player needs to make a voting decision; S2. NPC decision-making module: Through reasoning and strategic planning based on the information in the game state database, NPCs use the decision-making module to decide their voting targets; S3. Player voting: Players decide their voting targets based on their own reasoning and communication in the game; S4. Voting result: All voting results will be recorded in the game state database; S5. Voting result processing: The system will process the voting results, including counting the votes and determining whether any characters are eliminated; S6. Game state update: The voting results will be used to update the game state database, which may result in the elimination of some characters.
6. The werewolf killing game system based on an artificial intelligence agent according to claim 1, characterized in that, The NPC decision-making module includes the following sub-modules: First, the game state database: This is one of the inputs to the decision-making module, providing all relevant information about the current game, including the status of players and NPCs, historical actions, and speeches; Second, action, speech, or voting guidelines: These are a set of predefined rules or guiding principles to assist the large language model in making decisions based on the current game situation; Third, Prompt Template: A natural language text template designed according to different game stages, used to guide the large prediction model to generate outputs that conform to the context; Fourth, Large Language Model: Processes input data and guidelines, and combines the preset Prompt template to generate the action decisions, speech texts, or voting results of NPCs; The execution logic of the NPC decision module is as follows: S1. The NPC decision module receives the game rules, the preset text of the current game character's identity, and the information in the current game state database; S2. According to the stage when the NPC decision module is currently called, obtain the corresponding Prompt template, and fill the Prompt template with the data of S1; S3. The large language model analyzes the filled Prompt template, refers to the potential information, formulates the best strategy according to the current game situation, and finally generates the action decision or speech content of the NPC; S4. The large language model will output the action decision or speech content of the NPC, and update these outputs to the game state database for the game to continue.
7. The werewolf killing game system based on an artificial intelligence agent according to claim 1, characterized in that, The execution logic of the host judgment module includes the following steps: S1. Game State Database: This is the input of this module, containing the current states of all characters and the results of night actions; S2. Action Results: The module receives the action results from each character, such as which character was killed by the werewolf or saved by the witch; S3. Character Speeches: In the daytime phase, the module will determine the next step of the game based on the speech content of the players and NPCs; S4. Host Decision: The module will simulate the decision-making process of the host, and comprehensively consider the action results at night and the speech content during the day to determine the current state of the game; S5. Whether the Game Ends: The decision module will check whether the victory condition of one side is met; - If the game end condition is met, enter the process of ending the game and announce the winning side; - If the game has not ended, the game will continue to the next night or daytime phase.
8. A Werewolf game method based on an artificial intelligence agent, characterized in that, The game includes a host, players, and NPCs. The system assigns specific roles to the players and NPCs. The roles include two opposing camps, the werewolf camp and the good guy camp. The function of the werewolf role is to kill a player every night, and the ultimate goal is to eliminate all non-werewolf players and become the only survivor of the game.
9. The method for Werewolf game based on artificial intelligence agent according to claim 8, characterized in that, The roles in the good guy camp include villagers, seers, witches, hunters, guards, and idiots; The villagers have no special abilities. They decide to execute the suspected werewolf players through discussions and votes during the day. The purpose of the villagers is to eliminate all werewolves through voting; The seer has the right to check the identity of a player every night to help the villagers identify werewolves; The witch has an antidote and a poison, which are used for saving people and killing people respectively, that is, for saving a player or eliminating a player, and each can be used once, and helps the good guy camp by using the potions reasonably; The hunter can shoot and take away a player when being eliminated, ensuring that the one taken away is a werewolf; The guard can protect a player from being killed by the werewolf every night to protect key players; When the idiot is voted out for the first time, they do not die but lose their voting rights, confusing the public and interfering with the werewolves' judgment.
10. A method for Werewolf game based on artificial intelligence agent according to claim 8, characterized in that, The game players proceed according to the assigned roles and their basic functions. The specific process is divided into two alternating phases: "day" and "night". At night, the werewolves choose to kill, and other characters with night skills execute their skills. During the day, all surviving players discuss and vote to decide on executing a player suspected of being a werewolf. Communication and strategy: Players communicate verbally, reason, deceive, and cooperate to achieve their respective goals. The role of the host: The host is responsible for guiding the game process, announcing the results of the night, maintaining order, and ensuring the smooth progress of the game. Winning conditions: The good-aligned faction wins when all werewolves are eliminated. The werewolf-aligned faction wins when the number of werewolves is equal to or more than the number of non-werewolf players.
Citation Information
Cited By
Multi-agent-based cross-terminal game interaction system and method
CN121266123A
Inference information processing method and device, computer readable storage medium and equipment
CN121695510A