A plot triggering interaction control method, device, equipment and medium
Patent Information
- Application Number
- CN202611170410.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2046-08-04
AI Technical Summary
[0004]本发明的主要目的在于提供一种剧情触发交互控制方法、装置、设备及介质,旨在解决现有技术中难以在提高剧情类玩具交互自由度的同时确保剧情推进可靠性的问题
[0009]有益效果:本发明公开了一种剧情触发交互控制方法、装置、设备及介质,相比于现有技术,本发明实施例通过对目标剧情触发介质进行数据读取,获取所述目标剧情触发介质中预先写入的剧情标识、分支信息和角色适配信息;根据所述角色适配信息对当前载体角色与所述剧情标识对应的剧情包进行角色匹配校验,并在校验通过后切换为剧情模式;创建剧情状态机实例,根据所述剧情包在所述剧情状态机实例中装载当前剧情节点的状态数据;接收用户输入数据并采集前序完成数据,根据所述用户输入数据、前序完成数据以及当前剧情节点的状态数据生成相应的节点跳转控制指令,以基于所述分支信息进入相应的目标剧情节点;根据所述用户输入数据,结合所述目标剧情节点的状态数据,在剧情自由度约束下生成并输出相应的角色化对白。通过剧情状态机维护节点状态并在每个剧情节点均在自由度约束下结合用户输入生成相应的角色对白,在提高剧情交互自由度的同时确保剧情推进可靠性和角色一致性。
Smart Images

Figure CN122702147B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of artificial intelligence technology, and in particular to a plot-triggered interactive control method, device, equipment, and medium. Background Technology
[0002] Story-driven toys are toys whose gameplay is driven by built-in or triggerable narratives, role-playing, and interactive plots. Existing story-driven toys typically use a trigger-based playback method with pre-stored fixed content. That is, resources corresponding to specific plots are pre-stored in the device, and users can only trigger the playback of predetermined content by pressing buttons or scanning, etc. The playback content is completely fixed and cannot dynamically advance the plot based on real-time user input.
[0003] Although the popularization of smart hardware and artificial intelligence has led to the emergence of some story-based toys that utilize generative AI, these toys, while allowing for free dialogue and thus increasing the freedom of interaction to some extent, also make generative models prone to problems such as plot jumps, character distortion, and progress errors in story-based interactive scenarios, making it difficult to balance the freedom and reliability of story-based interaction. Summary of the Invention
[0004] The main objective of this invention is to provide a plot-triggered interactive control method, device, equipment, and medium, aiming to solve the problem in the prior art of ensuring the reliability of plot progression while improving the degree of interactive freedom in plot-based toys.
[0005] The technical solution of the present invention is as follows: The first aspect of this invention provides a plot-triggered interaction control method, comprising: Data is read from the target plot triggering medium to obtain the plot identifier, branch information and character adaptation information pre-written in the target plot triggering medium; Based on the character adaptation information, the current carrier character is matched with the story package corresponding to the story identifier, and the story mode is switched after the verification is passed. Create a story state machine instance, and load the state data of the current story node into the story state machine instance according to the story package; Receive user input data and collect previous completed data. Generate corresponding node jump control instructions based on the user input data, previous completed data and the status data of the current plot node, so as to control the plot state machine to enter the corresponding target plot node based on the branch information. Based on the user input data and the status data of the target plot node, corresponding character-based dialogue is generated and output under the constraints of plot freedom.
[0006] A second aspect of the present invention provides a plot-triggered interactive control device, comprising: The data reading module is used to read data from the target plot triggering medium and obtain the plot identifier, branch information and character adaptation information pre-written in the target plot triggering medium; The character matching verification module is used to perform character matching verification between the current carrier character and the plot package corresponding to the plot identifier based on the character adaptation information, and switch to plot mode after the verification is successful. The plot state machine module is used to create plot state machine instances and load the state data of the current plot node into the plot state machine instance according to the plot package; The plot node control module is used to receive user input data and collect previous completed data, and generate corresponding node jump control instructions based on the user input data, previous completed data and the current plot node status data, so as to enter the corresponding target plot node based on the branch information; The plot constraint generation module is used to generate and output corresponding character-based dialogue based on the user input data and the state data of the target plot node, under the constraints of plot freedom.
[0007] A third aspect of the present invention provides a computer device including at least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the aforementioned plot-triggered interactive control method.
[0008] A fourth aspect of the present invention provides a computer-readable storage medium storing computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the above-described plot-triggered interactive control method.
[0009] Beneficial Effects: This invention discloses a plot-triggered interactive control method, device, equipment, and medium. Compared to existing technologies, this invention reads data from a target plot-triggered medium to obtain pre-written plot identifiers, branch information, and character adaptation information. Based on the character adaptation information, it performs character matching verification between the current carrier character and the plot package corresponding to the plot identifier, and switches to plot mode upon successful verification. A plot state machine instance is created, and the state data of the current plot node is loaded into the plot state machine instance according to the plot package. User input data is received, and preceding completion data is collected. Based on the user input data, preceding completion data, and the state data of the current plot node, corresponding node jump control instructions are generated to enter the corresponding target plot node based on the branch information. Based on the user input data and the state data of the target plot node, corresponding characterized dialogue is generated and output under plot freedom constraints. By maintaining node states through a plot state machine and generating corresponding character dialogue at each plot node under freedom constraints and in conjunction with user input, the reliability of plot progression and character consistency are ensured while improving the freedom of plot interaction. Attached Figure Description
[0010] To more clearly illustrate the solutions in this invention, the accompanying drawings used in the description of the embodiments of this invention will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0011] Figure 1 A schematic diagram of an application environment for the plot-triggered interaction control method provided in this embodiment of the invention; Figure 2 A flowchart of a plot-triggered interaction control method provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the functional modules of the plot-triggered interactive control device provided in an embodiment of the present invention; Figure 4 A schematic diagram of the hardware structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0012] To make the objectives, technical solutions, and effects of this invention clearer and more explicit, the invention is further described in detail below. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. The embodiments of the invention are described below in conjunction with the accompanying drawings.
[0013] The plot-triggered interaction control method provided in this embodiment of the invention can be applied to, for example... Figure 1The illustrated intelligent agent interaction scenario with a hardware carrier includes a terminal device 101, a hardware carrier 102 bound to the target intelligent agent, a network 103, and a server 104. The network 103 serves as a medium to provide a communication link between the terminal device 101, the hardware carrier 102, and the server 104. The network 103 can include various connection types, such as wired and / or wireless communication links (e.g., Bluetooth, Wi-Fi, NFC, etc.).
[0014] Users can interact with server 104 via network 103 using terminal device 101 and hardware carrier 102 to receive or send messages, etc. Terminal device 101 may have a client installed that supports virtual scenarios. For example, when the virtual scenario is pet companionship, the client could be a virtual pet application. Users can log in to the client to view, edit, or control the interactions of the bound target intelligent agent in the virtual scenario (this is just an example). Terminal device 101 can be various electronic devices with a display screen and web browsing support, including but not limited to smartphones, tablets, and desktop computers.
[0015] The hardware carrier 102, bound to the target intelligent agent, serves as a real-world interaction medium between the user and the target intelligent agent. It can sense the user's close-range touch, shaking, movement, and other real-world activities in real time and associate them with corresponding interactive events. The hardware carrier 102 can be a plush toy, smart wearable accessory, desktop smart ornament, smart speaker, etc., integrating motion sensing and near-field communication recognition functions. Furthermore, the hardware carrier 102 can also come into contact with physical plot triggering media, such as plot badges, plot base modules, plot keychains, or any automatically recognizable plot triggering device, to read plot-related information stored in the physical medium. This allows the interaction mode with the intelligent agent to switch from ordinary chat mode to plot mode, realizing an immersive plot interaction scenario.
[0016] Server 104 can be a server that provides various services, such as a backend server that supports the content browsed by the user using terminal device 101 and hardware carrier 102 (this is just an example). The backend server can analyze and process data such as received user requests, and feed the processing results back to the user through terminal device 101 and hardware carrier 102. Server 104 can be a cloud server, a server of a distributed system, or a server combined with blockchain.
[0017] It should be understood that the number of terminal devices 101, hardware carriers 102, networks 103, and servers 104 mentioned above is merely illustrative. Depending on the implementation needs, there can be any number of terminal devices 101, hardware carriers 102, networks 103, and servers 104. For example, a single user can correspond to one terminal device 101 and one hardware carrier 102, and multiple users can achieve interactive linkage between target intelligent agents through the network.
[0018] like Figure 2 As shown, the plot-triggered interaction control method provided in this embodiment of the invention specifically includes the following steps: S201. Read data from the target plot triggering medium to obtain the plot identifier, branch information and character adaptation information pre-written in the target plot triggering medium.
[0019] In this embodiment, the target plot triggering medium is a physical object containing plot metadata, such as a plot card, plot badge, plot base module, or plot keychain, which is used for near-field triggering of plot entry. Specifically, the target plot triggering medium can be brought into contact with the bottom, top, or side of the hardware carrier to establish a near-field communication link between the NFC induction coil in the hardware carrier and the NFC tag in the target plot triggering medium, thereby parsing out the pre-written plot identifier, branch information, and character adaptation information. The plot identifier is a globally unique UUID or custom code that identifies the plot package and can be used to index complete plot package resources stored in the cloud or locally; the branch information is structured data describing the jump relationships between plot nodes, including at least the branch entry point, branch conditions, and node connection mask of the current chapter; and the character adaptation information is data used to verify the character's access conditions.
[0020] For example, in a children's interactive educational scenario, a child places a rectangular story card with a "Misty Forest" pattern onto the sensor area on the chest of a smart plush toy. After data reading, the data is parsed to obtain story identifiers, branch information, and character compatibility information, in preparation for character verification and story mode switching. This embodiment triggers story entry through a physical medium, which, compared to existing story triggering methods such as screen touch or voice wake-up, improves the interactivity and playability of story initiation, while avoiding unintentional accidental triggers, thereby reducing the ambiguity of the boundary between story mode and non-story mode.
[0021] S202. Based on the character adaptation information, perform character matching verification between the current carrier character and the story package corresponding to the story identifier, and switch to story mode after the verification is successful.
[0022] In this embodiment, different hardware carriers have different carrier roles. For example, different intelligent dolls have corresponding roles, or intelligent ornaments can activate corresponding virtual roles through role cards, etc. To ensure the compatibility between the currently triggered plot and the current carrier role, before switching to plot mode, a role matching verification is performed on the current carrier role and the plot package corresponding to the plot identifier based on the role adaptation information. This is to prevent character distortion or plot jumps caused by inconsistencies in character language style, background settings, etc., with the plot requirements.
[0023] Specifically, character compatibility information consists of predefined plot access rules that describe the compatibility requirements of the current plot package for the carrier character, such as character identity requirements, version requirements, permission requirements, world view requirements, etc. The system retrieves the character description data of the current carrier character from local storage or the cloud and loads the corresponding plot package based on the plot identifier. It then matches and verifies specified data items in the character description data against corresponding data in the plot package based on the character compatibility information. If the verification passes, the interaction mode is switched from normal chat mode to plot mode, and general dialogue interfaces unrelated to the plot are disabled.
[0024] For example, in a children's interactive scenario, the current character is "Little Knight," and the target story pack is "Underwater Adventure." Character compatibility requires the character to be within the allowed character set and meet the ocean worldview requirements. Therefore, the character identifier and version data of the current character are compared with the corresponding data in the story pack. It is found that the current character's worldview identifier is land-based, so the verification fails. Therefore, entering the story mode is aborted, and the message "Little Knight's armor is not suitable for diving. Would you like to change the story map?" is displayed. After the user switches to another target story trigger medium, such as "Misty Forest," based on the prompt, the character verification is successfully passed, and the user enters the story mode.
[0025] This embodiment performs character matching verification before entering the story mode, which can avoid mismatch between characters and story settings, ensure character consistency, and switch the chat mode to story mode after the verification is passed. This can ensure that resources are focused on the story recommendation service, reduce the interference of non-story dialogues on the main storyline, and improve the reliability of story interaction control.
[0026] S203. Create a plot state machine instance, and load the state data of the current plot node into the plot state machine instance according to the plot package.
[0027] In this embodiment, a plot state machine is created to maintain plot nodes, branch conditions, node jumps, completion conditions, and rollback logic, etc. After entering the plot mode, a plot state machine instance is created, and the state data of the current plot node is loaded into the plot state machine instance according to the plot package corresponding to the current plot identifier. The state data of the current plot node is a structured data set describing the current node of the plot and its associated attributes. Specifically, it may include a current node table (recording the current node identifier, node name, node type, etc.), a node input condition table (recording the user input mode, required items, and previous node completion markers required to enter or stay at the current node, etc.), a node output action table (recording the action data to be executed after the node is activated, etc.), a branch condition table (recording all branch paths starting from the current node, the jump condition expression of each path, and the branch priority weight, etc.), and a rollback rule table (recording the rollback trigger conditions and the safe rollback node identifier, etc.).
[0028] Specifically, the plot state machine can be implemented using a tree-like branching structure, a rule graph, or a finite state automaton, etc., and the specific method can be flexibly selected according to actual needs. This embodiment does not limit this method. In this embodiment, by creating a plot state machine and loading the relevant data of the current node, the standardization, traceability, and rewindability of the plot progression process are achieved. This allows for the switching of plot node states under the control of the corresponding plot nodes, avoiding plot progression errors caused by chaotic plot branches.
[0029] S204. Receive user input data and collect previous completed data. Generate corresponding node jump control instructions based on the user input data, previous completed data and the status data of the current plot node, so as to control the plot state machine to enter the corresponding target plot node based on the branch information.
[0030] In this embodiment, in story mode, users can still interact with the intelligent agent through voice, touch, or buttons to advance story nodes. In addition to receiving user input data, when controlling story node jumps, it also collects previous completed data, that is, the user's historical interaction records in this story, including visited nodes, triggered branches, collected items, or completed story events, etc.
[0031] After receiving user input data and collecting prior completion data from the session context, the system integrates user input data, prior completion data, and the state data of the current plot node. It then evaluates the plot progression direction through a preset jump decision logic and generates corresponding node jump control instructions. The specific jump decision logic can be rule-based condition matching, probability-based evaluation calculation, or learning-based strategy inference, etc. The final generated node jump control instructions are used to instruct the plot state machine to enter the target plot node, which can be the current node, the next node, or a safe node, in order to maintain, advance, or safely rewind the plot, thereby adapting to different plot interaction situations.
[0032] For example, jump decisions can be implemented through deterministic matching based on a rule engine. This involves matching user input data with branch conditions in the current story node's state data using keywords or regular expressions. If the user input meets the triggering conditions for a certain branch, a jump instruction pointing to the target node of that branch is generated; otherwise, an instruction to stay at the current node is generated, and so on. Alternatively, jump decisions can be implemented through probabilistic evaluation based on a decision tree. This involves pre-constructing a story jump decision tree, using user input semantics, item status in previous completed data, and story progress as feature variables for tree nodes. The matching degree of each candidate node is evaluated probabilistically by traversing the branches of the decision tree, and the node with the highest matching degree is selected as the target node. The specific jump control method can be flexibly selected based on factors such as the complexity of the storyline; this embodiment does not limit this approach.
[0033] This embodiment makes jump decisions by combining real-time user input with historical progress status, realizing context awareness of plot advancement, avoiding plot logic breaks caused by isolated judgment based on a single input, and improving the reliability of plot interaction.
[0034] S205. Based on the user input data and the status data of the target plot node, generate and output the corresponding character-based dialogue under the constraints of plot freedom.
[0035] In this embodiment, upon entering a target plot node, the system combines user input data and the target plot node's state data to extract the plot theme boundaries, available dialogue materials, and character expression styles corresponding to the current node. This allows for the generation and output of character-specific dialogue that conforms to the current character's language style and the plot context, all within the constraints of plot freedom. Specifically, the plot freedom constraints limit the generative AI's free generation range in plot mode, confining the generation range to the theme boundaries related to the current plot node and preventing generated content from deviating from the main plot or disrupting character settings.
[0036] Specifically, the freedom of narrative can be constrained through a keyword filtering mechanism. For example, a whitelist of keywords related to the current narrative node can be pre-configured (such as narrative entity names, action verbs, and emotional adjectives). When generating dialogue, the language model only samples and combines words from the whitelist and common grammatical connectors, thereby automatically filtering out open-domain entities unrelated to the narrative. Alternatively, it can be achieved through template filling. Multiple dialogue templates are pre-set, each containing slots to be filled. Based on user input data and target node state data, a matching template is selected and the slots are filled to generate complete character-based dialogue.
[0037] This embodiment effectively balances the flexibility of free interactive dialogue with the stability of the plot script by introducing plot freedom constraints during the generation stage, thus avoiding problems such as theme jump, character distortion, and progress disorder that are prone to occur in generative models in plot mode.
[0038] For example, at the "three-way intersection" node in the Misty Forest storyline, when a user enters "I want to take the left path," the target node's state data is retrieved to determine the current theme boundary as "forest path selection." The corresponding guide template is selected and filled through a template-filling mechanism to generate the character-based dialogue, "You have chosen the dark path on the left. The guide reminds you: This path seems to be rarely traveled." This strictly limits the interactive feedback to the forest path theme without introducing any irrelevant open-domain knowledge, thus improving the freedom of story interaction while ensuring the reliability of story progression.
[0039] In the above embodiments, the present invention discloses a plot-triggered interactive control method. This method involves reading data from a target plot-triggered medium to obtain pre-written plot identifiers, branch information, and character adaptation information. Based on the character adaptation information, it performs character matching verification between the current carrier character and the plot package corresponding to the plot identifier, and switches to plot mode upon successful verification. A plot state machine instance is created, and the state data of the current plot node is loaded into the plot state machine instance according to the plot package. User input data is received, and preceding completion data is collected. Based on the user input data, preceding completion data, and the state data of the current plot node, corresponding node jump control instructions are generated to enter the corresponding target plot node based on the branch information. Based on the user input data and the state data of the target plot node, corresponding character-specific dialogue is generated and output under plot freedom constraints. By maintaining node states through a plot state machine and generating corresponding character dialogue at each plot node under freedom constraints and in conjunction with user input, the method improves the freedom of plot interaction while ensuring the reliability of plot progression and character consistency.
[0040] In one embodiment, step S202 includes: Obtain the character attribute data of the current carrier character, including character identifier, character version, account permission identifier, and world view identifier; Based on the character adaptation information, the data items to be verified in the character attribute data are identified, and the data items to be verified are compared item by item with the corresponding allowed character set, minimum version requirement, permission requirement and / or world view requirement in the story pack. If all comparisons pass, the game switches to story mode; otherwise, the story mode is aborted and a message indicating character mismatch is displayed.
[0041] In this embodiment, when performing role matching verification, the role attribute data of the current carrier role is first obtained. This role attribute data can be stored in the local role database or the user profile of the cloud account system, specifically including the role identifier, role version, account permission identifier, and world view identifier of the current carrier role.
[0042] Next, based on the character compatibility information, the data items to be verified in the character attribute data are identified. This character compatibility information is predefined access rule metadata. By using the fields in the character compatibility information that require matching and verification, data items that correspond to the character compatibility information are dynamically extracted from the character attribute data as data items to be verified. For example, if the character compatibility information contains four keys: allowed character set, minimum version requirement, permission requirement, and world view requirement, then the corresponding character identifier, character version, account permission identifier, and world view identifier are extracted from the character attribute data as data items to be verified. If the character compatibility information only contains some fields, such as some story packs not restricting the world view, then only data items with corresponding relationships are extracted for verification, and attribute data corresponding to undefined fields are not included in the comparison, thus achieving flexible configuration of verification rules.
[0043] Based on the current character compatibility requirements, the extracted data items to be verified are compared item by item with the corresponding allowed character set, minimum version requirement, permission requirement, and / or world view requirement in the story package. Specifically, the character identifier is compared with the allowed character set to determine membership; the character version is compared with the minimum version requirement through semantic version comparison, such as a hierarchical comparison of major version number, minor version number, and revision number; the account permission identifier is compared with the permission requirement to determine whether the permissions are overridden; and for the world view identifier, string exact matching or synonym expansion matching is performed to ensure that world views such as land, sea, and magical worlds are compatible. During the comparison process, it is preferred to execute according to a preset priority order. Once a comparison fails, the abort logic is triggered, and there is no need to continue subsequent comparisons, thereby reducing unnecessary calculations.
[0044] If all the data to be verified for comparison passes, the interaction mode will be switched from normal chat mode to story mode, and the open domain chat interface will be closed. If any comparison fails, the story progression will be aborted, and differentiated mismatch prompts will be output based on the type of the failed item. For example, if the world view does not match, the prompt will be "The current character does not match the story world. Please switch characters and try again"; if the version is insufficient, the prompt will be "The character data version is too low. Please upgrade to the specified version and try again," etc., thus achieving targeted adjustment prompts.
[0045] This embodiment can efficiently and reliably block incompatible plot entry requests by comparing character-related data item by item, reducing invalid resource loading and network requests. The prompts also ensure a high degree of matching between the character's language style, world background knowledge and the current plot package, fundamentally avoiding conflicts between the character and the plot.
[0046] In one embodiment, step S204 includes: Receive user input data and collect preceding completion data, generate user input embedding based on the user input data and generate preceding completion marker based on the preceding completion data; Extract the item status vector and character attribute data from the status data of the current story node, and concatenate the user input embedding, the previous completion mark, the item status vector and the character attribute data into a joint input feature; The joint input features are input into a plot node jump prediction model built on a Bayesian neural network to obtain the cognitive uncertainty value of the probability of the next plot node jump. The cognitive uncertainty value is compared with a preset threshold range to generate a corresponding node jump control instruction, so as to control the plot state machine to enter the corresponding target plot node based on the branch information.
[0047] In this embodiment, when controlling the jump between story nodes, user input data is received and preceding completion data is collected. A pre-trained language model, such as BERT, maps the text corresponding to the user input data into a dense vector in a high-dimensional semantic space, capturing the semantic intent and slot information of the input, thereby generating a user input embedding. Furthermore, a preceding completion marker is generated based on the preceding completion data. This marker can be encoded using a binary mask, with the mask length equal to the total number of predefined completeable elements in the story package. Each bit's 0 / 1 state represents whether the corresponding element has been completed, thus achieving a quantitative representation of the preceding completion status.
[0048] Furthermore, item status vectors and character attribute data are extracted from the status data of the current story node. The item status vector can be multi-hot encoded, with each dimension representing the item's state of being unowned, owned, or used. User input embedding, prior completion markers, item status vectors, and character attribute data are concatenated into joint input features. Before concatenation, each feature is normalized to eliminate differences in units.
[0049] The joint input features are then fed into a plot node jump prediction model built on a Bayesian neural network to obtain the cognitive uncertainty value of the probability of jumping to the next plot node. Specifically, this plot node jump prediction model uses a multi-layer fully connected Bayesian neural network. This model encodes the network weights through variational inference to obtain approximate posterior distribution parameters. In the jump prediction inference stage, based on the approximate posterior distribution parameters, T random forward propagations are performed using Monte Carlo Dropout. Each forward propagation outputs a set of target node prediction probability distributions. p ( t The algorithm outputs the predicted probability values of T groups of target nodes. Based on these values, it calculates the mean and variance of the predicted probabilities. It then calculates the prediction entropy based on the mean and the expected data likelihood based on the predicted probability values of the T groups of target nodes. Finally, it calculates the cognitive uncertainty value of the jump probability based on the prediction entropy and the expected data likelihood.
[0050] in, The first term on the right is the prediction entropy, and the second term is the expected data likelihood. The prediction entropy reflects the model's overall uncertainty about the prediction result, while the expected data likelihood reflects the model's average confidence over multiple samplings. The difference between the two is the cognitive uncertainty value, which quantifies the model's confidence in the current jump decision. The cognitive uncertainty value is then compared with a preset threshold range to evaluate the reliability of the jump decision and generate corresponding node jump control instructions. Based on branch information, the plot state machine is then controlled to enter the corresponding target plot node, determining whether the current plot progression action is to move forward, hold, or safely rewind.
[0051] This embodiment quantifies the triggering of plot state transitions as a comparison between a cognitive uncertainty value and a preset threshold range, enabling reliable plot advancement, maintenance, or reversal operations based on objective multi-dimensional data, thereby improving the accuracy and reliability of plot state transitions.
[0052] In one embodiment, comparing the cognitive uncertainty value with a preset threshold range to generate a node jump control instruction, so as to control the plot state machine to enter the corresponding target plot node based on the branch information, includes: The cognitive uncertainty value is compared with a first threshold and a second threshold, wherein the first threshold is less than the second threshold; If the cognitive uncertainty value is less than or equal to the first threshold, a first node jump control instruction is generated to instruct the plot state machine to perform a normal node jump, so as to jump to the next plot node according to the branch information; If the cognitive uncertainty value is greater than the first threshold and less than or equal to the second threshold, a second node jump control instruction is generated to instruct the plot state machine to maintain the current plot node, and prompting dialogue is output; If the cognitive uncertainty value is greater than the second threshold, a third node jump control instruction is generated to instruct the plot state machine to roll back, so as to enter the safest node closest to the current plot node according to the branch information.
[0053] In this embodiment, the cognitive uncertainty value is compared with a preset threshold range. The preset threshold range includes a first threshold and a second threshold, with the first threshold being less than the second threshold. The specific first and second thresholds can be determined statistically from historical interaction data, or dynamically adjusted by operators based on the storyline type. For example, for linear narrative storylines, a more lenient threshold range can be set, such as a first threshold of 0.4 and a second threshold of 0.8, to encourage users to try diverse input methods; while for puzzle-solving and reasoning storylines, a stricter threshold is set, such as a first threshold of 0.2 and a second threshold of 0.6, to ensure the precise progression of key nodes.
[0054] Specifically, if the cognitive uncertainty value is less than or equal to the first threshold, it indicates a high degree of confidence in the jump decision. Therefore, the first node jump control instruction is generated, instructing the plot state machine to execute the normal node jump to the next plot node based on the branch information in the branch condition table.
[0055] If the cognitive uncertainty value is greater than the first threshold and less than or equal to the second threshold, it indicates that the current jump decision is somewhat ambiguous under the influence of, for example, user input, but is still within a controllable range. Therefore, a second node jump control instruction is generated, instructing the plot state machine to maintain the current plot node and output prompting dialogue to guide the user to clarify their intention. For example, if the user input data partially matches the branch conditions but lacks a key item, the current plot node is retained and the message "You seem to want to take the left path, but I heard that path requires a special key. Do you have it with you?" is output.
[0056] If the cognitive uncertainty value exceeds the second threshold, it indicates that the current user input deviates significantly from the plot path or the system state is insufficient to support reliable node jump decisions. In this case, a third node jump control instruction is generated, instructing the plot state machine to backtrack to the safest node closest to the current plot node based on branch information. Specific safe nodes are usually set as the most recent checkpoint or logical closure point in the plot, such as the chapter start node, the node before item acquisition, or the intersection of plot branches, etc., to ensure the correctness of plot progression.
[0057] This embodiment achieves quantitative and objective hierarchical plot transition control by using multi-level threshold control combined with cognitive uncertainty. This ensures the reliability of plot progression while also enabling intelligent fault tolerance, thereby reducing the probability of uncontrolled plot interaction.
[0058] In addition, during the interaction of the story mode, the story progress, user selection records and key item status are continuously written to the local progress cache. When it is detected that the user actively exits the story mode, the device loses power or the network connection is interrupted due to weak connection, the latest status data in the progress cache can be read after the power is restored or the network is reconnected, and the story can be restored to the most recently completed node or the preset safe node, thereby ensuring the continuity and recoverability of the story experience.
[0059] In one embodiment, step S205 includes: Query the preset plot constraint table to obtain the set of allowed intentions, the set of prohibited intentions, the set of answerable topics, and the proportion of free dialogue corresponding to the target plot node, and determine the allowed generation range; The user input data is subjected to intent classification processing to obtain the user intent recognition result; If the user intent recognition result falls into the prohibited intent set, then return the plot guidance message or node-related prompt; If the user intent recognition result falls into the allowed intent set, the allowed generation range is updated to the allowed word slot range corresponding to the state data of the target plot node, and the characterized dialogue is generated and output within the updated allowed generation range.
[0060] In this embodiment, when generating character-based dialogue by combining user input and node status under the constraints of plot freedom, a preset plot constraint table is first queried to obtain the allowed intent set, prohibited intent set, answerable topic set, and free dialogue ratio corresponding to the target plot node, thereby determining the allowed generation range. The allowed intent set defines the categories of user intents that can be responded to under the current node, such as plot Q&A, item interaction, character interaction, node selection, etc.; the prohibited intent set defines the intent categories that need to be intercepted, such as open-domain casual conversation, mathematical calculation, weather inquiries, irrelevant knowledge Q&A, etc.; the answerable topic set is the set of entity names, background knowledge terms, and related concepts involved in the current node, used to limit the topic boundaries of the response content; the free dialogue ratio is the percentage of free Q&A allowed to deviate from the main plot in the current interaction round. By obtaining the above constraint data, the maximum allowed generation range is determined to impose plot constraints on the generation.
[0061] Before generating dialogue, the user input data undergoes intent classification to obtain user intent recognition results. This can be achieved through a fine-tuned multi-label classification model, such as a BERT-based intent classifier. The model receives user input text and outputs corresponding intent labels and confidence scores. The intent classification results are then matched against a set of prohibited intents. If a match is found, a plot guide or node-related prompt is directly returned to smoothly transition the topic back to the main plot.
[0062] If the user intent recognition result falls into the allowed intent set, the allowed slot range of the current node is further queried, and the allowed generation range is updated. The allowed slot range is a predefined set of structured slots in the state data of the current plot node used to limit the boundaries of dialogue generation content. It includes at least entity slots (such as character name, item name, location name, event name), action slots (such as open, check, go to, use, etc.), emotion slots (such as encouragement, warning, surprise, doubt), and knowledge slots (such as node background knowledge, historical legends, scientific principles, etc.). When the intent is determined to be allowed, the allowed generation range is further narrowed to the allowed slot range, realizing two-layer control from coarse filtering at the intent level to fine constraints at the slot level.
[0063] Within the updated allowed generation range, corresponding characterized dialogue is generated and output. That is, during the decoding output stage, the generation model can filter candidate tokens in real time through constraint decoding or prefix tree filtering mechanism to ensure that the generated token sequence does not exceed the allowed slot range and only contains vocabulary and grammatical structures within the allowed slot range. Thus, by combining coarse-grained filtering at the intent level with fine-grained constraints at the slot level, a two-layer plot freedom control mechanism is achieved, which not only prevents the plot topic from jumping off course but also avoids errors in dialogue details.
[0064] In one embodiment, generating and outputting the characterized dialogue within the updated allowed generation range includes: The user input data is matched with the node input condition table in the status data of the target plot node to determine whether the user input data belongs to the type of input, query, or deviation, and the input type label is obtained. If the input type label is a progressive input, then the restricted generation strategy or template data corresponding to the target plot node is invoked, and plot progression dialogue is generated and output within the updated allowed generation range according to the restricted generation strategy or template data; If the input type label is an inquiry type input, then query the node permission range data of the target plot node, and generate and output supplementary explanatory dialogue within the node permission range data; If the input type label is an off-label input, then guiding dialogue is generated and output.
[0065] In this embodiment, when generating character dialogue, the type of the current user input data is first determined. That is, the user input data is matched with the node input condition table in the state data of the target plot node. The node input condition table pre-stores the following templates: the advancement template (e.g., the sentence structure containing action verbs, item names, and direction words), the query template (e.g., the sentence structure containing why, what, how to use, etc.), and the deviation template (e.g., the sentence structure containing external entities and open domain name words). By calculating the semantic similarity between the user input and each type of template, the highest value is taken as the input type label.
[0066] For progressive inputs, a restricted generation strategy is invoked when generating dialogue. Under the constraint of allowing word slots, a large language model is used to generate responses that conform to the plot objectives. Alternatively, pre-stored templates in the node output action table can be directly called to quickly generate standardized dialogue by filling slots.
[0067] For query-type input, the node's permission scope data is queried. This permission scope data can be a predefined knowledge base for the current storyline node, containing common questions that the user might ask and their standard answers. For example, if a user asks "Where did this key come from?", by querying the node's permission scope, supplementary explanatory dialogue can be generated: "You found this key in xx."
[0068] For off-target inputs, guiding dialogue is generated and output to naturally guide the interaction back to the main storyline, ensuring the efficiency and accuracy of plot progression.
[0069] Preferably, when generating various character-based dialogues, the system also supports dynamic adjustment of the narrative freedom strategy. That is, during the interaction in narrative mode, the proportion of free dialogue can adaptively switch between a fully restricted mode and a free window mode. When the proportion of free dialogue is zero or less than a preset proportion, it enters the fully restricted mode, where only input directly related to the narrative is allowed while other free dialogue content is restricted. When the proportion of free dialogue is not zero or greater than the preset proportion, the corresponding proportion of free dialogue windows is retained, allowing users to conduct a limited number of questions and answers outside the main storyline. This maximizes the freedom of narrative interaction by combining the actual node situation and interaction situation.
[0070] In one embodiment, the proportion of free dialogue is obtained through the following steps: Obtain the node urgency, overall plot completion rate, cumulative user deviation, and remaining time budget of the target plot node; The node urgency, overall plot completion, cumulative user deviation, and remaining time budget of the node are weighted and summed according to preset weighting coefficients to obtain the free interaction weighted value. The weighted values of free interaction are normalized and mapped to output the proportion of free dialogue in the current interaction round.
[0071] In this embodiment, the proportion of free dialogue is obtained by integrating data from multiple dimensions, including node urgency, overall plot completion, cumulative user deviation, and remaining time budget for each node. Node urgency is a quantitative indicator representing the urgency of the current plot node in the main storyline's progression. For example, nodes are divided into key progression nodes, transition nodes, and explanatory nodes, and each type of node is assigned a corresponding urgency level. Overall plot completion is the ratio of the number of nodes visited in the current plot to the total number of nodes in the plot package, used to represent the overall progress of the plot. Cumulative user deviation is a quantitative value of the user's continuous deviation from the main plot in this plot. For example, each deviation-type input can be assigned a deviation weight (e.g., 1.0), each query-type input can be assigned a partial deviation weight (e.g., 0.3), and each progression-type input can be assigned a zero weight (e.g., -0.5). This is accumulated using an exponentially decaying sliding window to ensure that the impact of recent deviations on the current decision is greater than that of historical deviations, thus obtaining the cumulative user deviation. The remaining time budget for each node is the ratio of the maximum allowed interaction time for the current node to the time already consumed.
[0072] Based on the acquired multi-dimensional data, each data point is weighted and summed according to preset weighting coefficients to obtain a weighted value for free interaction. These preset weighting coefficients can be flexibly set in advance according to different storylines or user needs. For example, for suspenseful mystery storylines, the weight of the urgency of key points can be increased to reduce the user's freedom at crucial moments; for open-ended exploration storylines, the weight of the overall completion of the storyline can be increased to allow users more freedom to explore in the early stages of the story.
[0073] Finally, the calculated weighted values of free interaction are normalized and mapped, for example, using the Sigmoid function to map the weighted values of free interaction to the [0,1] interval, thereby outputting the free dialogue ratio of the current interaction round. This free dialogue ratio represents the proportion of free Q&A allowed to deviate from the main storyline in the current interaction round. For example, when the free dialogue ratio is 0.8, it means that 80% of the responses are allowed to deviate from the main storyline in the current round; if it is 0.1, it means that only 10% deviation is allowed, which is close to the fully restricted mode. Preferably, this free dialogue ratio can be dynamically updated during the interaction. For example, when the user deviates from the main storyline multiple times in a row, the current node is a key advancement node, or the remaining time budget is lower than the threshold, a lower free dialogue ratio is calculated, thereby reducing the free window ratio or even switching to the fully restricted mode, thus dynamically constraining the user interaction process in the story mode.
[0074] This embodiment achieves dynamic adaptation of the plot freedom strategy by quantifying multi-dimensional factors into the proportion of free dialogue. It can smoothly adjust the constraint intensity according to the real-time interaction status, tighten control at key nodes to ensure the progress of the main plot, and relax restrictions at transition nodes to enhance the interactive fun, thereby achieving a dynamic balance between free dialogue and plot script.
[0075] There is no necessary order between the above steps. As can be understood by those skilled in the art from the description of the embodiments of the present invention, the above steps may have different execution orders in different embodiments, that is, they may be executed in parallel or in turn, etc.
[0076] Further reference Figure 3 As a response to the above Figure 2 The present invention provides an embodiment of a plot-triggered interactive control device, which, in accordance with the implementation of the method shown, provides an embodiment of a plot-triggered interactive control device. Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0077] like Figure 3 As shown, the plot-triggered interactive control device 30 described in this embodiment includes: The data reading module 301 is used to read data from the target plot triggering medium and obtain the plot identifier, branch information and character adaptation information pre-written in the target plot triggering medium; The role matching verification module 302 is used to perform role matching verification between the current carrier role and the plot package corresponding to the plot identifier according to the role adaptation information, and switch to plot mode after the verification is passed. The plot state machine module 303 is used to create a plot state machine instance and load the state data of the current plot node into the plot state machine instance according to the plot package. The plot node control module 304 is used to receive user input data and collect previous completed data, and generate corresponding node jump control instructions based on the user input data, previous completed data and the current plot node status data, so as to enter the corresponding target plot node based on the branch information; The plot constraint generation module 305 is used to generate and output corresponding characterized dialogue based on the user input data and the state data of the target plot node, under the constraints of plot freedom.
[0078] The module referred to in this invention is a series of computer program instruction segments that can perform specific functions. It is more suitable than a program for describing the execution process of plot-triggered interactive control. For the specific implementation of each module, please refer to the corresponding method embodiments above, which will not be repeated here.
[0079] In one embodiment, the role matching verification module 302 includes: The character attribute acquisition unit is used to acquire the character attribute data of the current carrier character, the character attribute data including character identifier, character version, account permission identifier and world view identifier; The character data comparison unit is used to confirm the data items to be verified in the character attribute data based on the character adaptation information, and to compare the data items to be verified with the corresponding allowed character set, minimum version requirement, permission requirement and / or world view requirement in the story pack item by item. The mode switching unit is used to switch to story mode if all comparisons pass, otherwise the story progression is stopped and a message indicating character mismatch is output.
[0080] In one embodiment, the plot node control module 304 includes: The data processing unit is used to receive user input data and collect preceding completion data, generate user input embedding based on the user input data, and generate preceding completion marker based on the preceding completion data; The feature splicing unit is used to extract the item state vector and character attribute data from the state data of the current plot node, and splice the user input embedding, the previous completion mark, the item state vector and the character attribute data into a joint input feature. The jump prediction unit is used to input the joint input features into the plot node jump prediction model built on a Bayesian neural network to obtain the cognitive uncertainty value of the probability of jumping to the next plot node; The jump control unit is used to compare the cognitive uncertainty value with a preset threshold range and generate a corresponding node jump control command to control the plot state machine to enter the corresponding target plot node based on the branch information.
[0081] In one embodiment, the jump control unit includes: A threshold comparison unit is used to compare the cognitive uncertainty value with a first threshold and a second threshold, wherein the first threshold is less than the second threshold; The instruction generation and jump unit is used to generate a first node jump control instruction for instructing the plot state machine to perform a normal node jump if the cognitive uncertainty value is less than or equal to the first threshold, so as to jump to the next plot node according to the branch information. If the cognitive uncertainty value is greater than the first threshold and less than or equal to the second threshold, a second node jump control instruction is generated to instruct the plot state machine to maintain the current plot node, and prompting dialogue is output; If the cognitive uncertainty value is greater than the second threshold, a third node jump control instruction is generated to instruct the plot state machine to roll back, so as to enter the safest node closest to the current plot node according to the branch information.
[0082] In one embodiment, the plot constraint generation module 305 includes: The constraint query unit is used to query a preset plot constraint table to obtain the set of allowed intentions, the set of prohibited intentions, the set of answerable topics, and the proportion of free dialogue corresponding to the target plot node, and to determine the allowed generation range. An intent recognition unit is used to perform intent classification processing on the user input data to obtain user intent recognition results; The prohibition unit is used to return a plot guide or node-related prompt if the user intent recognition result falls into the prohibited intent set; The constraint generation unit is used to update the allowed generation range to the allowed slot range corresponding to the state data of the target plot node if the user intent recognition result falls into the allowed intent set, and generate and output the characterized dialogue within the updated allowed generation range.
[0083] In one embodiment, the constraint generation unit includes: The type matching unit is used to match the user input data with the node input condition table in the status data of the target plot node, determine whether the user input data belongs to the type of input, query type, or deviation type, and obtain the input type label. The comparison generation unit is used to, if the input type label is a progressive input, call the restricted generation strategy or template data corresponding to the target plot node, and generate and output plot progression dialogue within the updated allowed generation range according to the restricted generation strategy or template data; If the input type label is an inquiry type input, then query the node permission range data of the target plot node, and generate and output supplementary explanatory dialogue within the node permission range data; If the input type label is an off-label input, then guiding dialogue is generated and output.
[0084] In one embodiment, the device 30 further includes: The plot parameter acquisition module is used to acquire the node urgency, overall plot completion, cumulative user deviation, and remaining time budget of the target plot node; The free interaction weighting module is used to perform weighted summation on the node urgency, overall plot completion, user cumulative deviation and node remaining time budget according to preset weighting coefficients to obtain the free interaction weighting value. The normalization mapping module is used to normalize and map the weighted values of the free interaction, and output the proportion of free dialogue in the current interaction round.
[0085] In the above embodiments, the present invention discloses a plot-triggered interactive control device. This device reads data from a target plot-triggered medium to obtain pre-written plot identifiers, branch information, and character adaptation information. Based on the character adaptation information, it performs character matching verification between the current carrier character and the plot package corresponding to the plot identifier, and switches to plot mode upon successful verification. A plot state machine instance is created, and the state data of the current plot node is loaded into the plot state machine instance according to the plot package. User input data is received, and preceding completion data is collected. Based on the user input data, preceding completion data, and the state data of the current plot node, corresponding node jump control instructions are generated to enter the corresponding target plot node based on the branch information. Based on the user input data and the state data of the target plot node, corresponding character-specific dialogue is generated and output under plot freedom constraints. By maintaining node states through the plot state machine and generating corresponding character dialogue at each plot node under freedom constraints combined with user input, the device improves the freedom of plot interaction while ensuring the reliability of plot progression and character consistency.
[0086] Specific limitations regarding the plot-triggered interaction control device can be found in the limitations of the plot-triggered interaction control method described above, and will not be repeated here. Each module in the aforementioned plot-triggered interaction control device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0087] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0088] Another embodiment of the present invention provides a computer device, such as... Figure 4 As shown, the computer device 40 includes: One or more processors 401 and memory 402, Figure 4 The following section uses a processor 401 as an example. The processor 401 and the memory 402 can be connected via a bus or other means. Figure 4 Taking the example of a connection between China and Israel via a bus.
[0089] The processor 401 is used to perform various control logics of the computer device 40. It can be any conventional processor, microprocessor, state machine, general-purpose processor, digital signal processor (DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), microcontroller, ARM (Acorn RISC Machine) or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or any combination of these components.
[0090] The memory 402, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the program instructions corresponding to the plot-triggered interactive control method in the embodiments of the present invention. The processor 401 executes various functional applications and data processing of the computer device 40 by running the non-volatile software programs, instructions, and units stored in the memory 402, thereby implementing the plot-triggered interactive control method in the above method embodiments.
[0091] Another embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by one or more processors, perform the steps of the plot-triggered interactive control method in any of the above method embodiments.
[0092] It should be noted that the functions or steps that can be implemented by the computer-readable storage medium or computer device described above can be referred to the relevant descriptions in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.
[0093] Based on the above description of the embodiments, those skilled in the art will understand that the methods described in the embodiments can be implemented using software plus necessary general-purpose hardware platforms. Of course, they can also be implemented using hardware, but in many cases, the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0094] Of course, those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware (such as a processor, controller, etc.). The computer program can be stored in a non-volatile, computer-readable storage medium, and when executed, it can include the processes described in the above method embodiments. The storage medium can be a memory, magnetic disk, floppy disk, flash memory, optical storage, etc.
[0095] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.
[0096] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention 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. Such 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 the present invention, and should all be included within the protection scope of the present invention.
Claims
1. A method for controlling interactive plot-triggered events, characterized in that, include: Data is read from the target plot triggering medium to obtain the plot identifier, branch information and character adaptation information pre-written in the target plot triggering medium; Based on the character adaptation information, the current carrier character is matched with the story package corresponding to the story identifier, and the story mode is switched after the verification is passed. Create a story state machine instance, and load the state data of the current story node into the story state machine instance according to the story package; Receive user input data and collect previous completed data. Generate corresponding node jump control instructions based on the user input data, previous completed data and the status data of the current plot node, so as to control the plot state machine to enter the corresponding target plot node based on the branch information. Based on the user input data and the state data of the target plot node, corresponding characterized dialogue is generated and output under the plot freedom constraint; wherein, the plot freedom constraint is to constrain the free generation range of the generative AI in the plot mode, so as to limit the generation range to the theme boundary related to the current plot node. The step of performing character matching verification between the current carrier character and the story package corresponding to the story identifier based on the character adaptation information, and switching to story mode after the verification is successful, includes: Obtain the character attribute data of the current carrier character, including character identifier, character version, account permission identifier, and world view identifier; Based on the character adaptation information, the data items to be verified in the character attribute data are identified, and the data items to be verified are compared item by item with the corresponding allowed character set, minimum version requirement, permission requirement and world view requirement in the story pack. If all comparisons pass, the game switches to story mode; otherwise, the story mode is aborted and a message indicating character mismatch is displayed.
2. The plot-triggered interactive control method according to claim 1, characterized in that, The process of receiving user input data and collecting prior completed data, and generating corresponding node jump control instructions based on the user input data, prior completed data, and the current plot node's state data, to control the plot state machine to enter the corresponding target plot node based on the branch information, includes: Receive user input data and collect preceding completion data, generate user input embedding based on the user input data and generate preceding completion marker based on the preceding completion data; Extract the item status vector and character attribute data from the status data of the current story node, and concatenate the user input embedding, the previous completion mark, the item status vector and the character attribute data into a joint input feature; The joint input features are input into a plot node jump prediction model built on a Bayesian neural network to obtain the cognitive uncertainty value of the probability of the next plot node jump. The cognitive uncertainty value is compared with a preset threshold range to generate a corresponding node jump control instruction, so as to control the plot state machine to enter the corresponding target plot node based on the branch information.
3. The plot-triggered interactive control method according to claim 2, characterized in that, The step of comparing the cognitive uncertainty value with a preset threshold range to generate a corresponding node jump control command, so as to control the plot state machine to enter the corresponding target plot node based on the branch information, includes: The cognitive uncertainty value is compared with a first threshold and a second threshold, wherein the first threshold is less than the second threshold; If the cognitive uncertainty value is less than or equal to the first threshold, a first node jump control instruction is generated to instruct the plot state machine to perform a normal node jump, so as to jump to the next plot node according to the branch information; If the cognitive uncertainty value is greater than the first threshold and less than or equal to the second threshold, a second node jump control instruction is generated to instruct the plot state machine to maintain the current plot node, and prompting dialogue is output. If the cognitive uncertainty value is greater than the second threshold, a third node jump control instruction is generated to indicate the rollback of the plot state machine, so as to enter the safest node closest to the current plot node according to the branch information. The safest node is the most recent checkpoint or logical closure point of the plot.
4. The plot-triggered interactive control method according to claim 1, characterized in that, The step of generating and outputting corresponding character-based dialogue based on the user input data and the state data of the target plot node, under the constraints of plot freedom, includes: Query the preset plot constraint table to obtain the set of allowed intentions, the set of prohibited intentions, the set of answerable topics, and the proportion of free dialogue corresponding to the target plot node, and determine the allowed generation range; wherein, the proportion of free dialogue is the percentage of free question and answer quota allowed to deviate from the main plot in the current interaction round; The user input data is subjected to intent classification processing to obtain the user intent recognition result; If the user intent recognition result falls into the prohibited intent set, then a plot guide or node-related prompt is returned; If the user intent recognition result falls into the allowed intent set, the allowed generation range is updated to the allowed word slot range corresponding to the state data of the target plot node, and the characterized dialogue is generated and output within the updated allowed generation range.
5. The plot-triggered interactive control method according to claim 4, characterized in that, The process of generating and outputting the characterized dialogue within the updated allowed generation range includes: The user input data is matched with the node input condition table in the status data of the target plot node to determine whether the user input data belongs to the type of input, query, or deviation, and the input type label is obtained. If the input type label is a progressive input, then the restricted generation strategy or template data corresponding to the target plot node is invoked, and plot progression dialogue is generated and output within the updated allowed generation range according to the restricted generation strategy or template data; If the input type label is an inquiry type input, then query the node permission range data of the target plot node, and generate and output supplementary explanatory dialogue within the node permission range data; If the input type label is an off-label input, then guiding dialogue is generated and output.
6. The plot-triggered interactive control method according to claim 4, characterized in that, The proportion of free dialogue is obtained through the following steps: The node urgency, overall plot completion, cumulative user deviation, and remaining time budget of the target plot node are obtained. The node urgency is a quantitative indicator that represents the urgency of the current plot node in the main storyline. The overall plot completion is the ratio of the number of nodes visited in the current plot to the total number of nodes in the plot package. The cumulative user deviation is the quantitative value of the user's continuous deviation from the main storyline in this plot. The remaining time budget of the node is the ratio of the difference between the maximum allowed interaction time of the current node and the time already consumed. The node urgency, overall plot completion, cumulative user deviation, and remaining time budget of the node are weighted and summed according to preset weighting coefficients to obtain the free interaction weighted value. The weighted values of free interaction are normalized and mapped to output the proportion of free dialogue in the current interaction round.
7. A plot-triggered interactive control device, characterized in that, include: The data reading module is used to read data from the target plot triggering medium and obtain the plot identifier, branch information and character adaptation information pre-written in the target plot triggering medium; The character matching verification module is used to perform character matching verification between the current carrier character and the plot package corresponding to the plot identifier based on the character adaptation information, and switch to plot mode after the verification is successful. The plot state machine module is used to create plot state machine instances and load the state data of the current plot node into the plot state machine instance according to the plot package; The plot node control module is used to receive user input data and collect previous completed data, and generate corresponding node jump control instructions based on the user input data, previous completed data and the current plot node status data, so as to enter the corresponding target plot node based on the branch information; The plot constraint generation module is used to generate and output corresponding characterized dialogue based on the user input data and the state data of the target plot node, under the plot freedom constraint; wherein, the plot freedom constraint is to constrain the free generation range of the generative AI in the plot mode, so as to limit the generation range to the theme boundary related to the current plot node. The role matching verification module includes: The character attribute acquisition unit is used to acquire the character attribute data of the current carrier character, the character attribute data including character identifier, character version, account permission identifier and world view identifier; The character data comparison unit is used to confirm the data items to be verified in the character attribute data based on the character adaptation information, and to compare the data items to be verified with the corresponding allowed character set, minimum version requirement, permission requirement and world view requirement in the story pack item by item. The mode switching unit is used to switch to story mode if all comparisons pass, otherwise the story progression is stopped and a message indicating character mismatch is output.
8. A computer device, characterized in that, Includes at least one processor; and, A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, which, when executed by the at least one processor, enables the at least one processor to perform the plot-triggered interactive control method according to any one of claims 1-6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions that, when executed by one or more processors, cause the one or more processors to perform the plot-triggered interactive control method according to any one of claims 1-6.
Citation Information
Patent Citations
Game plot generation method and device, equipment and storage medium
CN118512770A
Interactive information dynamic generation method and device based on user behavior data, equipment and medium
CN118787947A