Game script generation method and device, equipment and storage medium

By assigning virtual characters to game accounts and using generative models to generate simulated speech and operation data, the problem of low quality game scripts in existing technologies has been solved, and diversified and high-quality script generation has been achieved.

CN122006256APending Publication Date: 2026-05-12NETEASE (HANGZHOU) NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
NETEASE (HANGZHOU) NETWORK CO LTD
Filing Date
2026-02-03
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies rely on manually defined rules and templates when generating game scripts, resulting in low script quality, monotonous operations and language expressions, and difficulty in meeting the needs of large-scale artificial intelligence training.

Method used

Virtual characters are assigned to target game accounts, and simulated speech and operation data are generated based on global and local game strategies using a generative model to drive the behavior of virtual characters in the game, which is then summarized into a simulation script.

Benefits of technology

It has achieved diversification of game scripts and operations, reduced reliance on manual definition, improved script quality, and approached the strategic depth and realism of high-level players.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122006256A_ABST
    Figure CN122006256A_ABST
Patent Text Reader

Abstract

The invention provides a game script generation method and device, equipment and a storage medium. The method comprises the steps that a virtual character in a game is allocated to a target game account; distributing a global game strategy suitable for all rounds to the target game account according to the virtual character; in each round of the game, calling the generative model to generate real-time simulation situation information for the target game account, and distributing a local game strategy suitable for a single round for the target game account according to the simulation situation information and the virtual character, calling a generative model to generate simulation speech data and simulation operation data according to the global game strategy, the local game strategy and the simulation situation information; and summarizing the speaking data generated by each virtual character in all rounds and the simulation operation data into a simulation script. According to the embodiment, the quality of automatically produced game scripts is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of artificial intelligence, and in particular relates to a method, apparatus, device and storage medium for generating game scripts. Background Technology

[0002] Werewolf and its derivative and imitation games, as a multiplayer language-based game that integrates strategic reasoning, role-playing, and social interaction, provide experimental scenarios for artificial intelligence research due to their complex game mechanics and rich strategic variations.

[0003] Recording game scripts through online platforms and offline competitions is inefficient due to low data collection, cleaning, and formatting processes, which is insufficient for large-scale AI training. Furthermore, the skill levels of real players vary greatly, resulting in significant fluctuations in the quality of game data in the scripts and a large number of low-quality game processes.

[0004] Therefore, current methods mostly rely on rules and templates to simulate and generate game scripts.

[0005] Rule-based generation methods construct the game flow through predefined game rules and logic trees, use finite state machines or behavior trees to describe the game's state transitions, and simulate the player's decision-making process by setting various condition judgments and action execution rules, thereby constructing the game's script.

[0006] Template-based generation methods construct game scripts using pre-designed dialogue templates and behavioral patterns. This involves manually creating or mining a vast database of dialogue templates, containing typical statements from various characters in different situations, and then generating game data through template matching and parameter replacement.

[0007] However, since rules and templates rely on manual definition, not only is the cost high, but the game script also becomes formulaic, resulting in simpler operations and language, with a high repetition rate of operations and language, leading to lower script quality. Summary of the Invention

[0008] In view of this, the present invention provides a method, apparatus, device and storage medium for generating game scripts, so as to improve the quality of automatically generated game scripts.

[0009] The first aspect of the present invention provides a method for generating a game script, comprising: Assign virtual characters in the game to the target game account; Assign a global game strategy applicable to all rounds to the target game account based on the virtual character; In each round of the game, a generative model is invoked to generate real-time simulated situation information for the target game account. Based on the simulated situation information and the virtual character, a local game strategy suitable for a single round is assigned to the target game account. The generative model is then invoked to generate simulated speech data and simulated operation data based on the global game strategy, the local game strategy, and the simulated situation information. The simulated speech data and the simulated operation data are used to drive the behavior of the virtual character in the game. The speech data generated by each virtual character in all rounds and the simulation operation data are summarized into a simulation script.

[0010] A second aspect of the present invention provides a game script generation apparatus, comprising: The virtual character assignment module is used to assign virtual characters in the game to a target game account; The game initialization module is used to assign a global game strategy applicable to all rounds to the target game account based on the virtual character; The game simulation control module is used to call a generative model to generate real-time simulated situation information for the target game account in each round of the game, assign a local game strategy suitable for a single round to the target game account based on the simulated situation information and the virtual character, and call a generative model to generate simulated speech data and simulated operation data based on the global game strategy, the local game strategy and the simulated situation information. The simulated speech data and the simulated operation data are used to drive the behavior of the virtual character in the game. The simulation script generation module is used to aggregate the speech data and simulation operation data generated by each virtual character in all rounds into a simulation script.

[0011] A third aspect of the present invention provides an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the game script generation method as described in the first aspect above.

[0012] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the game script generation method as described in the first aspect above.

[0013] Compared with the prior art, the embodiments of the present invention have the following beneficial effects: In this embodiment, a virtual character in the game is assigned to the target game account; a global game strategy applicable to all rounds is assigned to the target game account based on the virtual character; in each round of the game, a generative model is invoked to generate real-time simulated situation information for the target game account; based on the simulated situation information and the virtual character, a local game strategy applicable to a single round is assigned to the target game account; the generative model is invoked to generate simulated speech data and simulated operation data based on the global game strategy, local game strategy, and simulated situation information; the simulated speech data and simulated operation data are used to drive the behavior of the virtual character in the game; the speech data and simulated operation data generated by each virtual character in all rounds are summarized into a simulated script. This embodiment uses global game strategy as macro-level guidance and local game strategy as micro-level guidance. Based on the reasoning ability of generative models, it simulates users controlling virtual characters according to the real-time game situation. This process is flexible and diverse, with dynamic changes in speech and operation, effectively reducing the dependence on manual definition. This not only reduces costs but also makes the game script more diverse, manifested in diversified operation and language expression. It simulates collaborative game between users and effectively simulates complex game behaviors such as strategy iteration. It effectively improves the quality of automated game script production and approaches the quality standards of high-level players in terms of strategy depth and realism. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a schematic diagram of a game script generation method provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of another method for generating a game script provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of another method for generating a game script provided by an embodiment of the present invention; Figure 4 This is a schematic diagram of a game script generation device provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0016] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, in order to provide a thorough understanding of the embodiments of the present invention. However, those skilled in the art will recognize that the present application may be implemented in other embodiments without these specific details. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods have been omitted to avoid unnecessary detail that could obscure the description of the present application.

[0017] There are many types of Werewolf and its derivative and imitation games. Most of them divide virtual characters into different camps for multiple rounds of games to facilitate understanding. In this embodiment, Werewolf is used as an example of a game for illustration.

[0018] Werewolf is a tabletop game that combines identity concealment, logical reasoning, and verbal combat. It revolves around the confrontation between different factions. Players eliminate opponents by using skills during the night and by speaking and voting during the day. The game ends when one faction achieves its victory conditions.

[0019] There are multiple versions of the Werewolf game. In different versions of Werewolf, the game rules (such as the types and number of virtual characters, the skills of virtual characters, the process of the night phase and the day phase, etc.) may vary. The following explanation will be based on a specific version of Werewolf.

[0020] In this example, a total of 12 players participated in the Werewolf game, divided into two factions: I. Good Faction (8 people): Includes four gods (Seer, Witch, Hunter, Idiot) and four villagers. The goal is to find and eliminate all werewolves.

[0021] In this game, the Seer selects one player each night to verify their identity and conveys the verification information through their speech; the Witch possesses both poison and antidote; the poison is used to eliminate one player, while the antidote can save a player eliminated by the werewolves; when the Hunter is eliminated by the werewolves or by the daytime vote, they can reveal their identity and eliminate one player along with them; when the Fool is eliminated by the daytime vote, they can reveal their identity to avoid elimination and remain in the game (still able to speak), but subsequently lose their voting rights; the Villagers have no unique skills, but can speak and vote during the daytime, and can eliminate werewolves by disguising themselves, identifying loopholes in the werewolves' speech, and cooperating with the villagers to vote for their own elimination.

[0022] II. Werewolf Faction (4 people): Includes 4 werewolves. The goal is to eliminate all civilians or all gods. They will act together at night.

[0023] The werewolves discuss and choose one player to eliminate each night (called the "killer"); during the day, they can pretend to be good people and speak in a way that misleads the vote.

[0024] The game begins at night and transitions to day, cycling through day and night until one faction achieves victory.

[0025] I. Nighttime Phase (All players close their eyes, proceeding in the order of their virtual characters) The host will activate the character in the following order to complete the skill operation (the entire process is silent, with only the host communicating with the player corresponding to the virtual character): 1. All players, please close your eyes; werewolves, please open your eyes. — Werewolves, please kill (choose 1 player) — Werewolves, please close your eyes. 2. Seer, please open your eyes. Seer, please check (select 1 player). He / She is (gesture: good guys give a thumbs up, werewolves give an index finger). Seer, please close your eyes. 3. Witch, please open your eyes—Tonight, the player to be stabbed is (tell the player's number)—Witch, do you want to use the antidote? Do you want to use poison? (Choose 1 player or give up)—Witch, please close your eyes; 4. Hunter, please open your eyes—Hunter confirms identity (host nods in acknowledgment)—Hunter, please close your eyes; 5. Idiot, please open your eyes — Idiot confirms identity (host nods) — Idiot, please close your eyes.

[0026] II. Daytime Phase (All players open their eyes and interact publicly) 1. The host announces the players who were eliminated during the night session.

[0027] Eliminated players (non-hunters) can speak, and then leave the game.

[0028] If the hunter is eliminated, their skill will be triggered immediately after they speak, allowing them to eliminate one player along with them.

[0029] 2. Player comments The remaining players speak in a certain order (e.g., starting with the eliminated player and rotating clockwise or counterclockwise). Their speeches include stating their own identity (e.g., "I am the Seer, and last night I checked and found XX to be a good person"), identifying suspects (e.g., "XX's statement had many loopholes, and he might be a werewolf"), analyzing the situation (e.g., "Last night was peaceful, and the witch might have used her antidote"), and so on.

[0030] 3. Elimination by voting After all the remaining players have finished speaking, the host initiates a vote. Each remaining player can choose one player to eliminate. The player with the most votes is eliminated, and the eliminated player can then speak before leaving the game.

[0031] After the day ends, the night phase begins again, and day and night alternate until either the werewolf faction or the good faction achieves its victory condition.

[0032] The victory conditions for the werewolf faction include eliminating all civilians (4 people), eliminating all gods (4 people), or having only 1 werewolf and 1 civilian remaining.

[0033] The victory condition for the good guys is to eliminate all 4 werewolves.

[0034] The technical solution of the present invention will be illustrated below through specific embodiments.

[0035] Reference Figure 1 The diagram illustrates a method for generating a game script according to an embodiment of the present invention, which may specifically include the following steps: Step 101: Assign a virtual character in the game to the target game account.

[0036] In this embodiment, the game is a comprehensive product that includes multiple elements such as programming, art, music, and plot. The programming is the foundation for the interactive operation of these contents, and it is responsible for game logic control, user input response, data processing, and system scheduling.

[0037] During the preparation phase, the game version (including the type of virtual character, the number of virtual characters under each type, game rules, etc.) can be determined. The corresponding version of the game is launched, and a corresponding process is created for it. According to the requirements of the game version, a corresponding number of processes or threads are created independently of the game's process to serve as virtual users (also known as virtual digital humans). In-game accounts are assigned to virtual users and recorded as target game accounts. Virtual characters in the game are assigned to each virtual user (i.e., target game account) using random methods. The process / thread where the virtual user resides and the process where the game resides can interact through inter-process communication, SDK (Software Development Kit), etc., so that the virtual user (i.e., target game account) can control the virtual characters in the game.

[0038] This embodiment uses virtual users (i.e., target game accounts) to simulate real players, and uses a generative model to dynamically simulate the game habits of real players in speaking and acting according to the changes in the game situation, thereby generating a high-quality script for the Werewolf game.

[0039] Generative models are a type of model that learns the underlying probability distribution of training data, simulates the data generation process, and then autonomously produces entirely new samples that are consistent with the original data distribution.

[0040] For example, generative models include LLM (Large Language Model), VLM (Vision Language Model), and so on.

[0041] Furthermore, some large generative models are often deployed in a clustered manner (especially distributed deployment), where multiple different generative models may be deployed in the same cluster, and the same generative model may be deployed on multiple nodes.

[0042] In this embodiment, when calling a generative model, it may be a different generative model or the same generative model. When calling the same generative model, a new session can be created for operation, maintaining the independence of sessions (especially the context information of the session) between different operations, maintaining the independence of different virtual players (i.e., target game accounts) in controlling virtual characters, and satisfying the rules of the game.

[0043] Step 102: Assign a global game strategy applicable to all rounds to the target game account based on the virtual character.

[0044] In practical applications, a game can be divided into multiple rounds. Taking Werewolf as an example, in the game scenario of Werewolf, a night and a day constitute a round (the day follows the night). In a game of Werewolf, night and day alternate in turn.

[0045] In this embodiment, a strategy library can be pre-built and maintained for each virtual character in the game. The strategy library stores global game strategies applicable to each virtual character in all rounds of the game, as well as local game strategies applicable to each round of the game.

[0046] Both the global game strategy and the local game strategy can be structured data that is readable by the generative model, such as JSON (JavaScript Object Notation) data.

[0047] Global game strategy is a macro-level control guide designed based on the virtual character's role and position in the game. It is applicable to all rounds and aims to achieve victory.

[0048] Local game strategy is a micro-management guide designed based on the virtual character's role and position in the game. It is used specifically for a particular situation in a certain round and aims to achieve victory.

[0049] The global game strategy provides a baseline and direction for controlling the virtual character, while the local game strategy, while adhering to the baseline and direction, provides fine-tuning based on the progress of the game.

[0050] Both global and local game strategies can be manually configured by operators, or they can be summarized and verified based on historical game scenarios, etc. This embodiment does not impose any restrictions on this.

[0051] For different versions of the same type of game, since the game rules may differ, the global game strategy and local game strategy of the same virtual character may also differ. This embodiment does not impose any restrictions on this.

[0052] Generally, multiple global game strategies can be set for each virtual character in the strategy library. At the start of the game, the virtual character (represented by the character ID, etc.) is used as the keyword (Qurey) to search for a global game strategy configured for the virtual character from all global game strategies in the strategy library using random and traversal methods, and then the global game strategy is assigned to the virtual user (i.e. the target game account).

[0053] Taking Werewolf as an example, the Seer's global game strategy includes providing real information for the good guys, vying for the sheriff's badge to control the voting pace, and guiding the good guys to eliminate the werewolves. The Witch's global game strategy includes using the antidote to protect the villagers (prioritizing the Seer), using the poison to eliminate the werewolves, and gaining a round advantage for the good guys. The Villagers' global game strategy includes proving themselves to be good guys, voting with the villagers, and exposing the werewolves' logical flaws through their speeches. The werewolves' global game strategy includes eliminating all villagers or all villagers, and so on.

[0054] Step 103: In each round of the game, the generative model is invoked to generate real-time simulated situation information for the target game account. Based on the simulated situation information and the virtual character, a local game strategy suitable for a single round is assigned to the target game account. The generative model is invoked to generate simulated speech data and simulated operation data based on the global game strategy, local game strategy and simulated situation information.

[0055] In this game, each virtual user (i.e., the target game account) advances the game's progress round by round according to the game's rules (such as the night phase + day phase in Werewolf).

[0056] In each round of the game, when it is a virtual user's (i.e., the target game account) turn to speak or take action (such as activating a virtual character's skill, voting, etc.), real-time simulated situation information can be generated for that virtual user. The simulated situation information is information that represents the current game situation and can be structured data that is readable by the generative model, such as JSON data.

[0057] In practice, the simulated speech data and simulated operation data generated during the historical speech of all virtual users (i.e., the target game account) before the current moment can be queried from the cache and other locations in the game process.

[0058] In general, regardless of faction or identity, any player in the game can fully access the speeches of other players. This is one of the foundations of logical reasoning and factional game theory. That is, the simulated speech data generated by all virtual users (i.e., the target game account) controlling virtual characters in the game can be heard by any virtual user (i.e., the target game account).

[0059] Therefore, the callable generative model uses NLP (Natural Language Processing) techniques to traverse through various historical simulation speech data and filter out noisy data from these historical simulation speech data, such as face-to-face communication, profanity, and idle chatter.

[0060] If filtering is complete, the generative model is invoked to extract key information related to the game situation from historical simulation speech data, which will then be used as the key points of the simulation speech.

[0061] That is, inputting historical simulation speech data into a pre-set generative model to generate key information of the simulation speech.

[0062] Using LLM as an example of a generative model, a prompt can be constructed from historical simulation speech data. The prompt can then be input into the LLM to guide it in generating key information about the simulation speech from the historical simulation speech data.

[0063] Furthermore, according to the game's rules, the simulated operation data generated by virtual users (i.e., the target game account) controlling virtual characters in the game may be public information or private information.

[0064] Public information refers to simulated operation data generated by virtual users controlling virtual characters that is visible to any virtual user.

[0065] Taking Werewolf as an example, publicly available information includes simulated operation data generated by voting, simulated operation data generated by the hunter activating their skill, and so on. Private information refers to the data generated by a virtual user (i.e., the target game account) controlling a virtual character. This data is visible to the specified virtual character. However, some virtual users (i.e., the target game account) cannot see the data generated by certain virtual users (i.e., the target game account) controlling virtual characters due to the virtual characters they control.

[0066] Taking Werewolf as an example, private information includes simulated operation data generated during the werewolves' nighttime negotiations (visible to the host and werewolves, but not to other virtual characters), simulated operation data generated during the seer's investigation (visible to the host, but not to other virtual characters), simulated operation data generated when the witch uses antidotes or poisons (visible to the host, but not to other virtual characters), and so on.

[0067] Therefore, key information related to the game situation and visible visuals of the virtual character controlled by the current virtual user (i.e., the target game account) is extracted from historical simulation operation data and used as key information for simulation operation to ensure that each virtual user's control of the virtual character conforms to the game's norms.

[0068] Generally, by using templates, rules, and other methods to standardize the visible and historical simulation operation data of the virtual character controlled by the current virtual user, the key information of the simulation operation can be obtained.

[0069] In addition, the current recorded simulation game progress information can be determined. The simulation game progress information is information that represents the progress of the game. Taking Werewolf as an example, it includes information such as a virtual user (i.e., the target game account) being eliminated by other virtual users (i.e., the target game account), a virtual user (i.e., the target game account) being voted out, the speaking order of each virtual user (i.e., the target game account), and so on.

[0070] The key information of simulated speech, key information of simulated operation, and simulated game process are packaged together and converted into real-time simulated situation information for the virtual user (i.e., the target game account).

[0071] In practical applications, the current real-time simulation situation information reflects the changes in the game situation to a certain extent. Therefore, based on the current real-time simulation situation information, local game strategies suitable for a single round can be assigned to virtual characters to adapt to changes in the game situation.

[0072] Generally, multiple local game strategies can be set for each virtual character in different game situations in each round in the strategy library. In the current round of the game, a local game strategy suitable for use in the current game situation can be searched from all local game strategies in the strategy library using random, traversal and other methods, so as to assign the local game strategy to the virtual user (i.e. the target game account).

[0073] Taking Werewolf as an example, the Seer's local game strategies in the first round of the night phase include randomly checking a player, checking the player in the middle position, or checking the player with the most simulated speech data, etc. In the first round of the day phase, local game strategies include vying for the sheriff's badge, truthfully describing the night phase's checks, and voting for the fake werewolf, etc. In the second round of the night phase, if the game situation indicates that the identity has been exposed, the local game strategies include checking players who have not spoken and have a clear stance (i.e., neutral), or checking players who support the fake werewolf, etc. In the second round of the day phase, if the game situation indicates that the player has been eliminated, the local game strategies include truthfully describing the night phase's checks, identifying the werewolves that have been checked, and guiding the Witch to use poison, etc. If the game situation indicates that the player has not been eliminated, the local game strategies include truthfully describing the night phase's checks, identifying the werewolves that have been checked, and guiding the werewolves to be checked in the next round, etc.

[0074] In practice, the system can query the target information generated by the virtual character controlled by the virtual user (i.e., the target game account) in the current round. The target information is the explicit condition used to converge the search for local game strategies. Taking Werewolf as an example, the target information includes the speaking position of the virtual character controlled by the virtual user (i.e., the target game account) in the current round, the order of speaking, the conditions for speaking (such as one-on-one speaking, speaking when the sheriff is on the job, etc.), specific situation conditions in the game (such as the seer claiming to be the seer, etc.), and so on.

[0075] In the strategy library, using virtual characters (represented by ID, etc.), the number of rounds in the current round, and simulation game progress information as keywords (Qurey), we search for local game strategies configured for virtual characters when they have target information in the current round.

[0076] Each local game strategy is configured with real-world situation information, which represents the situation in the historical game. The real-world situation information can be structured data that the generative model can read, such as JSON data.

[0077] The current simulated situation information is compared with the searched real situation information.

[0078] When the simulated situation information is similar to the real situation information (i.e., the simulated situation information and the real situation information are fuzzy matched), it is determined that the virtual character controlled by the virtual user (i.e. the target game account) applies the local game strategy in the current round.

[0079] For example, simulated situation information can be encoded into simulated situation vectors, and real situation information can be encoded into real situation vectors. The similarity (such as cosine similarity) between simulated situation vectors and real situation vectors can be calculated. If the similarity is greater than or equal to a preset threshold, then the simulated situation information and real situation information are determined to be similar.

[0080] In Werewolf and its derivative and imitation games, some factions' virtual characters are independent and cannot negotiate with each other, while virtual characters from other factions can negotiate with each other. In this case, virtual characters who negotiate with each other can be recorded as target objects.

[0081] Taking Werewolf as an example, the virtual users in the good guys' camp are independent of each other, which makes it inconvenient to maintain the allocation of their local game strategies.

[0082] Virtual users in the werewolf camp can negotiate with each other during each night's phase. In addition to maintaining their assigned local game strategies, they can also update their local game strategies based on the characteristics of mutual negotiation, enabling virtual users in the werewolf camp to cooperate and coordinate during the game.

[0083] In the specific implementation, the strategy library stores the cooperative game strategies applicable to the target object in all rounds of the game. The cooperative game strategies can be structured data readable by the generative model, such as JSON data.

[0084] Cooperative game strategy is a set of cooperative control guidance data designed based on the target's role and position in the game. It is applicable to all rounds and aims to win. It is used to update the target's local game strategy.

[0085] Collaborative game strategies can be manually configured by operators, or they can be summarized and verified based on the scripts of real historical games, etc. This embodiment does not impose any restrictions on this.

[0086] Different versions of the game may have different rules, and the cooperative game strategies of the target objects may also differ. This embodiment does not impose any restrictions on this.

[0087] Generally, multiple cooperative game strategies can be set for a target object in the strategy library. At the start of the game, if the virtual character is the target object, the strategy is searched from all cooperative game strategies in the strategy library using the target object (represented by the character ID, etc.) and the current round number as keywords (Qurey). A cooperative game strategy configured for the target object is then assigned to the virtual user (i.e. the target game account) who controls the target object in the current round for all target objects to cooperate.

[0088] Taking Werewolf as an example, in the first round of the night, cooperative game strategies include determining the division of labor (such as bluffing werewolf, charging werewolf, backstabbing werewolf, hidden werewolf, etc.), determining the target to kill, and agreeing on the details of bluffing. In the second round of the night, cooperative game strategies include adjusting the target to kill, adjusting the division of labor, dealing with the witch, and so on.

[0089] For the current round, the generative model can be invoked to update the local game strategy based on the global game strategy, cooperative game strategy, and simulation situation information.

[0090] That is, the global game strategy, cooperative game strategy, simulation situation information and local game strategy are input into the pre-set generative model to update the local game strategy.

[0091] Using LLM as an example of a generative model, a prompt can be constructed using the global game policy, cooperative game policy, simulation situation information, and local game policy. The prompt is then input into the LLM to guide it in updating the local game policy based on the global game policy, cooperative game policy, and simulation situation information.

[0092] For a virtual user (i.e., the target game account) who is about to speak or act, if the local game strategy and simulated situation information have been updated, NLP technology can be used to generate simulated speech data and simulated operation data based on the global game strategy, local game strategy, and simulated situation information. The simulated speech data and simulated operation data are used to drive the behavior of the virtual character in the game, that is, to drive the virtual user (i.e., the target game account) to control the virtual character to speak and act, and obtain the simulated speech data generated by the speech and the simulated operation data generated by the operation.

[0093] In practice, global game strategy, local game strategy and simulation situation information can be input into a pre-set generative model to generate control guidance information. The control guidance information is structured data that the game can read, such as JSON data, which records the instructions for controlling the virtual character.

[0094] Using LLM as an example of a generative model, a prompt can be constructed using the global game policy, local game policies, and simulation situation information. The prompt is then input into the LLM to guide it in updating the local game policy based on the global game policy, cooperative game policy, and simulation situation information.

[0095] Based on the control guidance information, simulated speech data and simulated operation data are generated for the target game account. That is, the virtual user (i.e. the target game account) is driven to control the corresponding virtual character to speak and operate, and simulated speech data and simulated operation data generated by the speech are obtained.

[0096] Step 104: Summarize the speech data and simulation operation data generated by each virtual character in all rounds into a simulation script.

[0097] In a certain round of the game, if a certain faction meets the victory conditions, the game ends. At this time, the speech data and simulation operation data generated by each virtual character in each round of the game can be read from the buffer. The speech data and simulation operation data generated by each virtual character in each round of the game are organized to obtain a structured simulation script (such as JOSN data).

[0098] In this embodiment, a virtual character in the game is assigned to the target game account; a global game strategy applicable to all rounds is assigned to the target game account based on the virtual character; in each round of the game, a generative model is invoked to generate real-time simulated situation information for the target game account; based on the simulated situation information and the virtual character, a local game strategy applicable to a single round is assigned to the target game account; the generative model is invoked to generate simulated speech data and simulated operation data based on the global game strategy, local game strategy, and simulated situation information; the simulated speech data and simulated operation data are used to drive the behavior of the virtual character in the game; the speech data and simulated operation data generated by each virtual character in all rounds are summarized into a simulated script. This embodiment uses global game strategy as macro-level guidance and local game strategy as micro-level guidance. Based on the reasoning ability of generative models, it simulates users controlling virtual characters according to the real-time game situation. This process is flexible and diverse, with dynamic changes in speech and operation, effectively reducing the dependence on manual definition. This not only reduces costs but also makes the game script more diverse, manifested in diversified operation and language expression. It simulates collaborative game between users and effectively simulates complex game behaviors such as strategy iteration. It effectively improves the quality of automated game script production and approaches the quality standards of high-level players in terms of strategy depth and realism.

[0099] Reference Figure 2 The diagram illustrates another method for generating a game script according to an embodiment of the present invention, which may specifically include the following steps: Step 201: Assign a virtual character in the game to the target game account.

[0100] Step 202: Assign a global game strategy applicable to all rounds to the target game account based on the virtual character.

[0101] Step 203: In each round of the game, the generative model is invoked to generate real-time simulated situation information for the target game account. Based on the simulated situation information and the virtual character, a local game strategy suitable for a single round is assigned to the target game account. The generative model is invoked to generate simulated speech data and simulated operation data based on the global game strategy, local game strategy and simulated situation information.

[0102] Among them, simulated speech data and simulated operation data are used to drive the behavior of virtual characters in the game.

[0103] Step 204: Summarize the speech data and simulation operation data generated by each virtual character in all rounds into a simulation script.

[0104] Step 205: Generate game feature information from the simulation script.

[0105] In this embodiment, various business data in the simulation script can be analyzed to generate game feature information.

[0106] Among them, game feature information is a shallow feature generated during game games, used to characterize the basic data of game games and some data that can affect game evaluation.

[0107] For example, the game feature information includes at least one of the following: 1. Characteristics of conflicts arising from virtual characters Taking Werewolf as an example, the characteristics that cause conflict among virtual characters include whether there are two people claiming to be the Seer, the number of people claiming to be the Seer, whether there are two people claiming to be the Witch, the number of people claiming to be the Witch, and so on.

[0108] 2. Characteristics when the situation reverses Taking Werewolf as an example, the characteristics of a reversal in the situation include the number of players whose stances changed between the two rounds of speaking and the two rounds of voting, etc.

[0109] 3. Characteristics of special situations Taking Werewolf as an example, the characteristics of special situations include the number of rounds of speaking in a tie vote, the number of times the sheriff's badge is handed over when eliminated, whether the hunter activates their skill, whether two players are eliminated during the night phase, and so on.

[0110] Of course, the above-described game feature information is merely an example. When implementing this embodiment, other game feature information can be set according to actual circumstances, and this embodiment does not impose any limitations on this. Furthermore, in addition to the above-described game feature information, those skilled in the art can also use other game feature information as needed, and this embodiment does not impose any limitations on this either.

[0111] For simple game feature information such as numerical data, game feature information can be obtained by directly statistically analyzing the data in the simulation script using scripts or other methods.

[0112] For complex game feature information such as non-numerical data, the simulation script can be input into a pre-set generative model to generate game feature information.

[0113] Using LLM as an example of a generative model, a prompt can be constructed using a simulation script. The prompt is then input into the LLM to guide it in generating game feature information from the simulation script.

[0114] Step 206: Select target game accounts with significant characteristics based on the simulation script, and use them as typical accounts.

[0115] In this embodiment, the statements and operations of each virtual user (i.e., target game account) in the simulation script can be statistically analyzed, and virtual users (i.e. target game accounts) with significant characteristics can be selected as typical users (i.e. typical accounts).

[0116] In one filtering method, filtering rules representing value and filtering rules representing errors can be determined separately.

[0117] Taking Werewolf as an example, the selection rules for value include the number of werewolves or villagers identified, the earliest round in which werewolves or villagers were identified, the number of times werewolves or villagers were explicitly named in the speech, the number of times werewolves or villagers were correctly voted for in the vote, the number of times key actions (such as the hunter activating their skill, the witch using poison, etc.) were performed correctly, and so on.

[0118] The filtering rules for indicating errors include the number of times a werewolf or a villager was mistakenly identified, the number of times an identity was mistakenly identified, the number of times an identity was mistakenly named during a speech, the number of times a vote was made incorrectly, the number of times a key operation (such as the hunter activating a skill, the witch using poison, etc.) was mistakenly performed, and so on.

[0119] Of course, the above-described filtering rules for representing value and error are merely examples. When implementing this embodiment, other filtering rules for representing value and error can be set according to actual circumstances, and this embodiment does not impose any limitations on this. Furthermore, in addition to the above-described filtering rules for representing value and error, those skilled in the art can also adopt other filtering rules for representing value and error according to actual needs, and this embodiment does not impose any limitations on this either.

[0120] The simulation script and various filtering rules are input into the pre-set generative model to filter the virtual user (i.e. the target game account) with the highest value, which is recorded as the most valuable player. The virtual user (i.e. the target game account) with the greatest filtering error is recorded as the player with the greatest error, which is used as the typical user (i.e. the typical account).

[0121] Using LLM as an example of a generative model, a prompt can be constructed using simulation scripts and various screening rules. The prompt is then input into the LLM to guide it in screening salient virtual users (i.e., target game accounts) as typical users (i.e. typical accounts).

[0122] Step 207: Call the generative model to calculate the quality value of the simulation script based on the game feature information and typical account pairs.

[0123] By calling the generative model, based on the simulation script, the quality of the simulation script is quantified using game feature information and typical users (i.e. typical accounts) as one of the main features of the game, and a quality value is obtained.

[0124] In practice, scoring rules can be determined to represent the excitement of the game, the accuracy of terminology, and the rationality of the speech (there may be errors in the speech).

[0125] The simulation script, game feature information, typical users (typical accounts) and scoring rules are input into a pre-set generative model to generate a first indicator value representing the excitement of the game, a second indicator value representing the accuracy of terminology, and a third indicator value representing the rationality of the speech.

[0126] Using LLM as an example of a generative model, a prompt can be constructed using simulation scripts, game feature information, target users, and scoring rules. The prompt is then input into the LLM to guide it in generating a first indicator value representing the excitement of the game, a second indicator value representing the accuracy of terminology, and a third indicator value representing the rationality of the speech.

[0127] The first, second, and third indicator values ​​are integrated into a quality value for the simulation script using linear or nonlinear methods, thereby evaluating the quality of the simulation script in three dimensions: the excitement of the game, the accuracy of the terminology, and the rationality of the speech.

[0128] For example, a first weight can be pre-configured for the excitement of the game, a second weight for the accuracy of terminology, and a third weight for the rationality of the speech. The first, second, and third weights are all configurable parameters that can be configured by operators according to actual business needs, or can be adaptively adjusted according to the type and version of the game, etc. This embodiment does not limit this.

[0129] Then, the first indicator value is multiplied by the preset first weight to obtain the first product value representing the excitement of the game; the second indicator value is multiplied by the preset second weight to obtain the second product value representing the accuracy of the terminology; the third indicator value is multiplied by the preset third weight to obtain the third product value representing the rationality of the speech; and the sum of the first product value, the second product value and the third product value is calculated as the quality value of the simulation script.

[0130] In this example, the quality value of the simulation script can be expressed as: Score=α×Excellence+β×Terminology+γ×Speech; Among them, the simulation script's score is the quality value, Excellence is the first indicator value representing the excitement of the game, Terminology is the second indicator value representing the accuracy of terminology, Speech is the third indicator value representing the rationality of the speech, α is the first weight, β is the second weight, and γ is the third weight.

[0131] Step 208: Verify the validity of the simulation script based on the quality value.

[0132] In this embodiment, the validity of the simulation script can be verified based on its quality value. When the simulation script is valid, it can be used to conduct artificial intelligence experiments, such as training a large language model and verifying the capabilities of the large language model. When the simulation script is invalid, it can be discarded.

[0133] For example, the quality value of the simulated script is compared with a preset quality threshold. If the quality value of the simulated script is greater than or equal to the quality threshold, it means that the quality of the simulated script is high and the validity of the simulated script is determined to be valid. If the quality value of the simulated script is less than the quality threshold, it means that the quality of the simulated script is low and the validity of the simulated script is determined to be invalid.

[0134] For example, the simulation scripts are sorted from highest to lowest quality value, and the top N (i.e., Top N, where N is a positive integer) simulation scripts are deemed valid, while the other simulation scripts are deemed invalid.

[0135] If operators manually evaluate the simulated scripts, the evaluation efficiency will be low and the cost will be high, making it difficult to meet the needs of large-scale evaluations. In addition, different operators have different evaluation standards and preferences, resulting in poor consistency and repeatability of the evaluation results.

[0136] This embodiment establishes a multi-dimensional and multi-level automated evaluation system, which comprehensively evaluates the quality of matches in the simulation script from multiple perspectives such as the level of excitement, rationality, and rationality of speech. It effectively reduces the influence of the subjectivity of human evaluation, improves the efficiency of evaluating the quality of simulation scripts, and provides objective and reliable technical support for marketing data quality control and large-scale data screening. The standardization and repeatability of the evaluation results are significantly improved.

[0137] Reference Figure 3 The diagram illustrates another method for generating a game script according to an embodiment of the present invention, which may specifically include the following steps: Step 301: Collect the real scripts generated when candidate game accounts participate in the game.

[0138] In this embodiment, with the authorization of a real user (a natural person, represented by a user ID, etc.), the process of a real user participating in the game using a candidate game account can be recorded to obtain a real script.

[0139] The real script includes real speech data and real operation data generated when real users (i.e., candidate game accounts) control virtual characters to speak in each round.

[0140] Step 302: Identify the candidate game accounts that win in the real scenario as sample accounts.

[0141] In this embodiment, real users (i.e., candidate game accounts) of the winning side in the game (such as the good guys' camp and the werewolf camp in Werewolf) can be identified from the fields specified in the real script and used as sample users (i.e., sample accounts).

[0142] Step 303: Invoke the generative model to generate a global game strategy applicable to all rounds based on the virtual characters controlled by the sample account according to the real script.

[0143] In this embodiment, a generative model can be invoked to analyze the content of the real script using NLP techniques, and generate a global game strategy applicable to all rounds for the virtual characters controlled by the sample users (i.e., sample accounts).

[0144] That is, by inputting real scripts into a pre-set generative model, virtual characters that operate on sample users (i.e. sample accounts) are generated to create a global game strategy applicable to all rounds.

[0145] Using LLM as an example of a generative model, a prompt can be constructed using a real script. The prompt is then input into the LLM to guide the LLM in generating a global game strategy applicable to all rounds for virtual characters that act on sample users (i.e., sample accounts).

[0146] Step 304: In each round of the real script, call the generative model to generate real-time situation information for the sample account, and call the generative model to generate candidate game strategies for the virtual character using the real situation information, real speech data and real operation data.

[0147] In this embodiment, each round in the real scenario can be traversed. If it is the turn of a sample user (i.e., sample account) to speak or perform an action (such as activating the virtual character's skill, voting, etc.), the generative model can be invoked to generate real-time situation information for that sample user (i.e. sample account) to represent the current game situation.

[0148] In the specific implementation, the system queries the real speech data and the real operation data generated by all real users (i.e., candidate game accounts) in the history of speech before the current moment. Noise data, such as face-to-face chat, profanity, and idle chat, is filtered out from the historical real speech data.

[0149] If filtering is complete, the generative model is invoked to use NLP techniques to traverse all historical real speech data and extract key information related to the game situation from the historical real speech data as the key information of the real speech.

[0150] That is, inputting historical real speech data into a pre-set generative model to generate real speech key information.

[0151] Using LLM as an example of a generative model, a prompt can be constructed from various historical real speech data. The prompt can then be input into the LLM to guide it in generating key information about real speeches from these historical real speech data.

[0152] Furthermore, key information related to the game situation and visible to the virtual character controlled by the current sample user (i.e., sample account) is extracted from historical real operation data as key information for real operation.

[0153] Generally, by using templates, rules, and other methods to standardize the visible and historical simulation operation data of the virtual character controlled by the current sample user (i.e., sample account), the key points of the actual operation can be obtained.

[0154] In addition, the actual game progress information currently recorded can be determined. The actual game progress information is information that indicates the progress of the game. Taking Werewolf as an example, the game progress information includes a real user (i.e., a candidate game account) being eliminated by other real users (i.e., candidate game accounts), a real user (i.e., a candidate game account) being voted out, the speaking order of each real user (i.e., candidate game account), and so on.

[0155] The key information of real speech, key information of real operation, and real game process are packaged together and converted into real situation information for sample users (i.e. sample accounts).

[0156] In each round of the real-world scenario, a generative model is invoked to generate candidate game strategies used by sample users (i.e., sample accounts) to control virtual characters, based on real-world situation information, real-world speech data, and real-world action data.

[0157] In the specific implementation, the real situation information faced by the sample user (i.e., the sample account) in the current round, as well as the real speech data and real operation data generated by the virtual character controlled by the sample user (i.e., the sample account) in the current round, are input into a preset generative model to generate candidate game strategies used by the sample user (i.e., the sample account) when controlling the virtual character in the current round. At this time, a mapping relationship is established between the candidate game strategies and the virtual character (represented by the character ID) and the round (represented by the number of times).

[0158] Using LLM as an example of a generative model, we can use the real situation information faced by the sample user (i.e., the sample account) in the current round, as well as the real speech data and real operation data generated by the virtual character controlled by the sample user (i.e., the sample account) in the current round to construct a prompt. The prompt is then input into the LLM to guide the LLM in generating candidate game strategies used by the sample user when controlling the virtual character in the current round.

[0159] Step 305: Aggregate candidate game strategies into local game strategies applicable to a single round for virtual characters.

[0160] In practical applications, each virtual character has a large number of candidate game strategies available in each round. Under the game's rules, some real users (i.e., candidate game accounts) may use similar or even the same candidate game strategies, while some real users (i.e., candidate game accounts) may innovate and use new candidate game strategies. Therefore, NLP techniques can be used to aggregate the candidate game strategies available to each virtual character in each round to obtain local game strategies suitable for each virtual character in a single round.

[0161] At this point, local game strategies can be stored in a strategy library. In the strategy library, a mapping relationship can be established between local game strategies and virtual characters (represented by character IDs) and rounds (represented by the number of rounds). Additionally, local game strategies can be associated with real-world situation information (or real-world situation vectors).

[0162] In one aggregation method, the target information generated by the virtual characters controlled by the sample user (i.e., the sample account) in each round is queried.

[0163] Candidate game strategies for the same virtual character in the same round, when the target information is available, are grouped into the same category.

[0164] Within the same category, clustering algorithms such as K-means are used to cluster candidate game strategies, resulting in multiple clusters.

[0165] Within the same cluster, candidate game strategies are used to construct local game strategies applicable to each round. For example, the candidate game strategy closest to the cluster center is selected as the local game strategy, and a generative model is used to summarize the candidate game strategies into local game strategies, and so on.

[0166] At this point, local game strategies can be stored in a strategy library. In the strategy library, a mapping relationship can be established between local game strategies and virtual characters (represented by character ID), rounds (represented by number of rounds), and target information. Additionally, local game strategies can be associated with real situation information (or real situation vectors).

[0167] Furthermore, if the virtual character controlled by the sample user (i.e., the sample account) is the target (such as a werewolf in Werewolf), meaning the target's faction wins, then the generative model is invoked to use real situation information, real speech data, and real operation data to generate a collaborative game strategy for all target players to cooperate in each round.

[0168] In the specific implementation, the real situation information faced by the sample users in the current round, as well as the real speech data and real operation data generated by the target objects controlled by all sample users (i.e., sample accounts) in the current round, are input into a pre-set generative model to generate a collaborative game strategy for all (i.e., sample accounts) to cooperate in each round.

[0169] Using LLM as an example of a generative model, we can use the real situation information faced by the sample users (i.e., sample accounts) in the current round, as well as the real speech data and real operation data generated by the target objects controlled by all sample users (i.e. sample accounts) in the current round to construct a prompt. The prompt is then input into the LLM to guide the LLM to generate a cooperative game strategy for all (i.e. sample accounts) to cooperate in each round.

[0170] This embodiment establishes a game strategy iterative update system, summarizing different levels of game strategies from real users' game matches, namely global game strategies, local game strategies, and collaborative game strategies. This complements the game strategies manually configured by operators. Furthermore, it can uncover constantly evolving game strategies, which helps improve the realism of game simulation and thus improve the quality of the simulation script.

[0171] Step 306: Assign a virtual character in the game to the target game account.

[0172] Step 307: Assign a global game strategy applicable to all rounds to the target game account based on the virtual character.

[0173] Step 308: In each round of the game, the generative model is invoked to generate real-time simulated situation information for the target game account. Based on the simulated situation information and the virtual character, a local game strategy suitable for a single round is assigned to the target game account. The generative model is invoked to generate simulated speech data and simulated operation data based on the global game strategy, the local game strategy, and the simulated situation information.

[0174] Among them, simulated speech data and simulated operation data are used to drive the behavior of virtual characters in the game.

[0175] Step 309: Summarize the speech data and simulation operation data generated by each virtual character in all rounds into a simulation script.

[0176] It should be noted that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0177] Reference Figure 4 The diagram shows a schematic of a game script generation device provided by an embodiment of the present invention, which may specifically include the following modules: The virtual character allocation module 401 is used to allocate virtual characters in the game to the target game account; The game initialization module 402 is used to assign a global game strategy applicable to all rounds to the target game account based on the virtual character; The game simulation control module 403 is used to call a generative model to generate real-time simulation situation information for the target game account in each round of the game, assign a local game strategy suitable for a single round to the virtual user based on the simulation situation information and the virtual character, and call a generative model to generate simulation speech data and simulation operation data based on the global game strategy, the local game strategy and the simulation situation information. The simulation speech data and the simulation operation data are used to drive the behavior of the virtual character in the game. The simulation script generation module 404 is used to summarize the speech data and simulation operation data generated by each virtual character in all rounds into a simulation script.

[0178] In one embodiment of the present invention, the game simulation control module 403 includes: The historical simulation data query module is used to query all simulation speech data and simulation operation data generated by the target game account before the current moment. The simulation speech key point information generation module is used to call the generative model to generate simulation speech key point information from the historical simulation speech data; The simulation operation key information extraction module is used to extract the visible simulation operation key information of the virtual character controlled by the current target game account from the historical simulation operation data. The simulation game progress information determination module is used to determine the current simulation game progress information; The simulation situation information conversion module is used to convert the simulation speech points, simulation operation points, and simulation game progress information into real-time simulation situation information for the target game account.

[0179] In one embodiment of the present invention, the game simulation control module 403 includes: The simulation target information query module is used to query the target information generated by the virtual character in the current round; A local game strategy search module is used to search for local game strategies configured for the virtual character when it possesses the target information in the current round; the local game strategy is configured with real situation information; The local game strategy application module is used to determine that the target game account should apply the local game strategy in the current round when the simulated situation information is similar to the real situation information.

[0180] In one embodiment of the present invention, the game simulation control module 403 further includes: The cooperative game strategy allocation module is used to allocate a cooperative game strategy for all target objects to cooperate in the current round if the virtual character is the target object. The local game strategy update module is used to call the generative model to update the local game strategy based on the global game strategy, the cooperative game strategy, and the simulation situation information.

[0181] In one embodiment of the present invention, the game simulation control module 403 includes: The control guidance information generation module is used to input the global game strategy, the local game strategy and the simulation situation information into the generative model to generate control guidance information. The virtual user driver module is used to generate simulated speech data and simulated operation data based on the target game account according to the control guidance information.

[0182] In one embodiment of the present invention, it further includes: A game feature information generation module is used to generate game feature information from the simulation script; The typical account filtering module is used to filter the target game accounts that are significant based on the simulation script, and use them as typical accounts. The script quality calculation module is used to call the generative model to calculate the quality value of the simulation script based on the game feature information and the typical account. The validity verification module is used to verify the validity of the simulation script based on the quality value.

[0183] In one embodiment of the present invention, the game feature information generation module includes: The feature-generating module is used to input the simulation script into the generative model to generate game feature information; The typical account filtering module includes: The filtering rule determination module is used to determine the filtering rules that represent value and errors; The user-generated filtering module is used to input the simulation script and the filtering rules into a preset generative model to filter the target game account with the highest value and the target game account with the greatest error, and use them as typical accounts.

[0184] In one embodiment of the present invention, the script quality calculation module includes: The scoring rules determination module is used to determine the scoring rules for evaluating the quality of the game, the accuracy of terminology, and the rationality of the statements. The indicator value generation module is used to input the simulation script, the game feature information, the typical account and the scoring rules into the generative model to generate a first indicator value representing the excitement of the game, a second indicator value representing the accuracy of terminology and a third indicator value representing the rationality of the speech. The indicator value fusion module is used to fuse the first indicator value, the second indicator value and the third indicator value into the quality value of the simulation script.

[0185] In one embodiment of the present invention, the indicator value fusion module includes: The first product value calculation module is used to multiply the first index value by a preset first weight to obtain a first product value representing the excitement level of the game. The second product value calculation module is used to multiply the second index value by a preset second weight to obtain a second product value that represents the accuracy of the terminology. The third product value calculation module is used to multiply the third index value by a preset third weight to obtain a third product value that represents the rationality of the speech; The product summation module is used to calculate the sum of the first product value, the second product value, and the third product value, which serves as the quality value of the simulation script.

[0186] In one embodiment of the present invention, it further includes: The real script collection module is used to collect real scripts generated when candidate game accounts participate in the game; the real scripts include real speech data and real operation data generated by the candidate game accounts when controlling virtual characters in each round; The sample account determination module is used to determine the candidate game account that wins in the real scenario as a sample account. The global game strategy generation module is used to call the generative model to generate a global game strategy applicable to all rounds for the virtual character controlled by the sample account based on the real script. The candidate game strategy generation module is used to call a generative model to generate real-time real situation information for the sample account in each round of the real script, and to call the generative model to generate candidate game strategies for the virtual character using the real situation information, the real speech data and the real operation data. The local game strategy aggregation module is used to aggregate the candidate game strategies into local game strategies suitable for the virtual character in a single round.

[0187] In one embodiment of the present invention, the candidate game strategy generation module includes: The historical real data query module is used to query the real speech data and real operation data generated by all the candidate game accounts before the current moment. The module for generating key information of real speeches is used to call a generative model to generate key information of real speeches from the historical real speech data; The real operation key information extraction module is used to extract the visible real operation key information of the virtual character controlled by the current sample account from the historical real operation data. The real game progress information determination module is used to determine the current real game progress information; The system converts the key information of the actual speech, the key information of the actual operation, and the actual game progress information into real-time real situation information for the sample account.

[0188] In one embodiment of the present invention, the local game strategy aggregation module includes: The real target information query module is used to query the target information generated by the virtual character controlled by the sample account in each round; The category division module is used to classify the candidate game strategies of the same virtual character in the same round when the target information is available into the same category; A candidate game strategy clustering module is used to cluster the candidate game strategies within the same category to obtain multiple clusters; A local game strategy construction module is used to construct local game strategies applicable to each round within the same cluster using the candidate game strategies.

[0189] In one embodiment of the present invention, it further includes: The collaborative game strategy generation module is used to call a generative model to generate collaborative game strategies for all target objects to cooperate in each round if the virtual character controlled by the sample account is the target object.

[0190] This invention provides a game script generation device, which can be used to implement the steps in the aforementioned game script generation method embodiments.

[0191] It should be noted that the module division in the various game script generation devices provided in the above embodiments is illustrative and only represents a logical functional division. In actual implementation, other division methods are also possible. Furthermore, the functional modules in the various embodiments of this invention can be integrated into a single processor, exist as separate physical entities, or consist of two or more modules integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0192] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the technical solution of the embodiments of the present invention can be embodied in the form of a computer program product, which is stored in a computer storage medium and includes several instructions to cause an electronic device or processor to execute all or part of the steps of the methods in the various embodiments of the present invention. The aforementioned computer storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0193] Furthermore, the game script generation apparatus and the game script generation method provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0194] Reference Figure 5 The diagram illustrates an electronic device according to an embodiment of the present invention. Figure 5As shown, the electronic device in this embodiment of the invention includes: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps in the above-described game script generation method embodiment. Alternatively, when the processor executes the computer program, it implements the functions of each module in the above-described game script generation apparatus embodiment.

[0195] For example, the computer program may be divided into one or more modules, which are stored in the memory and executed by the processor to complete this application. The one or more modules may be a series of computer program instruction segments capable of performing a specific function, which can be used to describe the execution process of the computer program in the electronic device.

[0196] The electronic device may be a desktop computer, a cloud server, or other computing device. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that... Figure 5 This is merely one example of an electronic device and does not constitute a limitation on the electronic device. It may include more or fewer components than illustrated, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.

[0197] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0198] The memory can be an internal storage unit of the electronic device, such as a hard drive or RAM. Alternatively, it can be an external storage device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc. Furthermore, the memory can include both internal and external storage units. The memory is used to store the computer program and other programs and data required by the electronic device. The memory can also be used to temporarily store data that has been output or will be output.

[0199] This invention also discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the game script generation method as described in the foregoing embodiments.

[0200] This invention also discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the game script generation method as described in the foregoing embodiments.

[0201] This invention also discloses a computer program product that, when run on a computer, causes the computer to execute the game script generation method described in the foregoing embodiments.

[0202] The embodiments described above are only used to illustrate the technical solutions of this application, and are not intended to limit it. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.

Claims

1. A method for generating a game script, characterized in that, include: Assign virtual characters in the game to the target game account; Assign a global game strategy applicable to all rounds to the target game account based on the virtual character; In each round of the game, a generative model is invoked to generate real-time simulated situation information for the target game account. Based on the simulated situation information and the virtual character, a local game strategy suitable for a single round is assigned to the target game account. The generative model is then invoked to generate simulated speech data and simulated operation data based on the global game strategy, the local game strategy, and the simulated situation information. The simulated speech data and the simulated operation data are used to drive the behavior of the virtual character in the game. The speech data generated by each virtual character in all rounds and the simulation operation data are summarized into a simulation script.

2. The method according to claim 1, characterized in that, The process of calling the generative model to generate real-time simulated situation information for the target game account includes: Query all simulated speech and operation data generated by the target game account up to the current time. Generative models are invoked to generate key points of the simulated speech from the historical simulated speech data; Extract the key simulation operation information of the virtual character controlled by the current target game account from the historical simulation operation data; Determine the current progress information of the simulation game; The simulated speech points, simulated operation points, and simulated game progress information are converted into real-time simulated situation information for the target game account.

3. The method according to claim 1, characterized in that, The step of assigning a local game strategy suitable for a single round to the game account based on the simulated situation information and the virtual character includes: Query the target information generated by the virtual character in the current round; The search is a local game strategy configured for the virtual character when it possesses the target information in the current round; the local game strategy is configured with real-time situation information. When the simulated situation information is similar to the real situation information, it is determined that the target game account applies the local game strategy in the current round.

4. The method according to claim 1, characterized in that, After assigning a local game strategy suitable for a single round to the target game account based on the simulated situation information and the virtual character, the method further includes: If the virtual character is the target object, then the target game account is assigned a cooperative game strategy for all target objects to cooperate in the current round. The generative model is invoked to update the local game strategy based on the global game strategy, the cooperative game strategy, and the simulation situation information.

5. The method according to claim 1, characterized in that, The generative model is invoked to generate simulation speech data and simulation operation data based on the global game strategy, the local game strategy, and the simulation situation information, including: The global game strategy, the local game strategy, and the simulation situation information are input into the generative model to generate control guidance information. Based on the target game account, simulated speech data and simulated operation data are generated according to the control guidance information.

6. The method according to claim 1, characterized in that, Also includes: Generate game feature information from the simulated murder mystery script; Based on the simulation script, the target game accounts with significant characteristics are selected as typical accounts; The generative model is invoked to calculate the quality value of the simulation script based on the game feature information and the typical account. The validity of the simulation script is verified based on the quality value.

7. The method according to claim 6, characterized in that, The generation of game feature information from the simulation script includes: The simulation script is input into the generative model to generate game feature information; The target game accounts selected based on the simulation script, as typical accounts, include: Determine the screening rules for representing value and errors; The simulation script and the filtering rules are input into the generative model to filter the target game account with the highest value and the target game account with the greatest error, which are then used as typical accounts.

8. The method according to claim 7, characterized in that, The calculation of the quality value of the simulation script based on the game feature information and the typical account includes: Establish scoring rules to indicate the quality of the game, the accuracy of terminology, and the rationality of the speeches; The simulation script, the game feature information, the typical account and the scoring rules are input into the generative model to generate a first index value representing the excitement of the game, a second index value representing the accuracy of terminology and a third index value representing the rationality of the speech. The first indicator value, the second indicator value, and the third indicator value are combined to form the quality value of the simulation script.

9. The method according to claim 8, characterized in that, The step of fusing the first indicator value, the second indicator value, and the third indicator value into the quality value of the simulation script includes: Multiply the first index value by the preset first weight to obtain the first product value representing the excitement level of the game; Multiply the second index value by the preset second weight to obtain a second product value that represents the accuracy of the terminology; Multiply the third indicator value by the preset third weight to obtain the third product value representing the rationality of the speech; The sum of the first product value, the second product value, and the third product value is calculated as the quality value of the simulation script.

10. The method according to any one of claims 1-9, characterized in that, Also includes: Collect real-life scenarios generated when candidate game accounts participate in the game; The real script includes the real speech data and real operation data generated by the candidate game account when controlling the virtual character in each round; The candidate game accounts that win in the real-life scenario are identified as sample accounts; The generative model is invoked to generate a global game strategy applicable to all rounds for the virtual character controlled by the sample account based on the real script; In each round of the real-world scenario, a generative model is invoked to generate real-time situation information for the sample account. The generative model then uses the real-world situation information, the real speech data, and the real operation data to generate candidate game strategies for the virtual character. The candidate game strategies are aggregated into local game strategies suitable for the virtual character in a single round.

11. The method according to claim 10, characterized in that, The process of calling the generative model to generate real-time situational information for the sample accounts includes: Query the real speech data and real operation data of all candidate game accounts before the current time. Generative models are invoked to generate key information of real speeches from historical real speech data; Extract the key information of the visible real operation of the virtual character controlled by the current sample account from the historical real operation data; Determine the current actual progress of the game; The real speech points, real operation points, and real game progress information are converted into real-time situation information for the sample account.

12. The method according to claim 10, characterized in that, The aggregation of the candidate game strategies into a local game strategy suitable for the virtual character in a single round includes: Query the target information generated by the virtual character controlled by the sample account in each round; The candidate game strategies of the same virtual character in the same round, when the target information is available, are classified into the same category; Within the same category, the candidate game strategies are clustered to obtain multiple clusters; Within the same cluster, local game strategies suitable for each round are constructed using the candidate game strategies.

13. The method according to claim 10, characterized in that, Also includes: If the virtual character controlled by the sample account is the target object, then the generative model is invoked to use the real situation information, the real speech data, and the real operation data to generate a cooperative game strategy for all target objects to cooperate in each round.

14. A device for generating a game script, characterized in that, include: The virtual character assignment module is used to assign virtual characters in the game to a target game account; The game initialization module is used to assign a global game strategy applicable to all rounds to the target game account based on the virtual character; The game simulation control module is used to call a generative model to generate real-time simulated situation information for the target game account in each round of the game, assign a local game strategy suitable for a single round to the target game account based on the simulated situation information and the virtual character, and call a generative model to generate simulated speech data and simulated operation data based on the global game strategy, the local game strategy and the simulated situation information. The simulated speech data and the simulated operation data are used to drive the behavior of the virtual character in the game. The simulation script generation module is used to aggregate the speech data and simulation operation data generated by each virtual character in all rounds into a simulation script.

15. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method for generating a game script as described in any one of claims 1-13.

16. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method for generating a game script as described in any one of claims 1-13.