Interactive narrative method and device based on artificial intelligence and storage medium
By introducing a finite plot state machine, the problem of uncontrollable plot development in interactive narrative AI interactive products is solved, realizing the coherence and logic of the plot and ensuring the controllable development of the narrative within a structured framework.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-29
- Publication Date
- 2026-04-07
AI Technical Summary
In existing interactive narrative AI interactive products, the plot development is uncontrollable, the logic is unreliable, and it is difficult to maintain complex plot structures and logical coherence.
By introducing a finite plot state machine as a narrative framework, user interaction events are mapped as state transition conditions to drive state migration and execute predetermined plot logic, ensuring that the plot develops within a structured narrative graph.
It effectively guides and controls the overall direction of the narrative, ensuring the coherence and logic of the narrative, and solving the problem of uncontrollable plot development.
Smart Images

Figure CN121808015A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of artificial intelligence, in particular to an interactive narrative method and device based on artificial intelligence and a storage medium. BACKGROUND
[0002] With the development of artificial intelligence (AI) technology, interactive narrative AI interaction products such as AI chat applications or plot interaction platforms have emerged to meet the communication needs of humans and have broad development prospects.
[0003] In current interactive narrative AI interaction products, plot development is mainly generated randomly by an AI model according to interactive context, which can achieve high interactive flexibility and content openness. However, in such an interactive narrative process, the advancement of the plot highly depends on the understanding ability of the AI model, the quality of the prompt, and the like, and is easily deviated from reasonable logic or becomes loose in structure due to the randomness of the AI model, lacks control and guidance of the macro trend of the plot, and is difficult to reliably maintain a complex plot. SUMMARY
[0004] Therefore, the embodiments of the present disclosure aim to provide an interactive narrative method and device based on artificial intelligence and a storage medium to solve the problem of uncontrollable plot development and poor logic reliability in the interactive narrative process in the related art.
[0005] In a first aspect, the present disclosure provides an interactive narrative method based on artificial intelligence, comprising: receiving input information from a user; capturing a current user interaction event according to the input information; determining a transition condition set corresponding to a current plot state based on a limited plot state machine; determining a state transition condition satisfied by the current user interaction event from the transition condition set, and migrating from the current plot state to a target plot state corresponding to the state transition condition; and executing plot logic corresponding to the target plot state to present plot content to the user.
[0006] In combination with the first aspect, in some optional implementation manners, when the current user interaction event simultaneously satisfies multiple state transition conditions in the transition condition set, the determining of the state transition condition satisfied by the current user interaction event from the transition condition set and the migrating from the current plot state to the target plot state corresponding to the state transition condition comprises: reading a current global state variable, wherein the current global state variable records narrative information generated in the whole process of the current interactive process; selecting a target transition condition matching the current global state variable from the multiple state transition conditions satisfied by the current user interaction event; and migrating from the current plot state to the target plot state corresponding to the target transition condition.
[0007] With reference to the first aspect, in some possible implementations, the finite scenario state machine includes a plurality of state nodes, and the finite scenario state machine defines a set of transition conditions for each state node and a list of reachable child nodes, the set of transition conditions including at least one state transition condition, and the list of reachable child nodes including at least one reachable child node, each state transition condition being used to define a condition required to be met for transitioning from the state node to a reachable child node.
[0008] With reference to the first aspect, in some possible implementations, the current scenario state corresponds to a first state node of the plurality of state nodes, and the target scenario state corresponds to a first child node of the at least one reachable child node, and the selecting, from the plurality of state transition conditions met by the current user interaction event, a target transition condition that matches the current global state variable includes: inputting, as a prompt word, the current user interaction event, the current global state variable, a set of transition conditions corresponding to the first state node, and a list of reachable child nodes into a large language model; obtaining a state transition suggestion output by the large language model according to the prompt word, where the state transition suggestion includes at least one candidate transition condition selected from the set of transition conditions and a transition probability corresponding to each candidate transition condition; and determining, as the target transition condition, a candidate transition condition with the highest transition probability from the at least one candidate transition condition.
[0009] With reference to the first aspect, in some possible implementations, the method further includes updating the current global state variable to record newly added narrative information generated by the current state transition, where the current global state variable is an initial global state variable before the current interaction process starts, and the initial global state variable is empty or a default value.
[0010] With reference to the first aspect, in some possible implementations, the narrative information includes user background information, user state information, and interaction process information, where the user background information includes at least one of user age, user knowledge level, user language, and user number, the user state information includes at least one of user emotion information, user intention information, user interest level, user satisfaction, user body information, and user action information, and the interaction process information includes at least one of the number of interactions, user selection in each interaction, scenario progress, an item list, a character relationship, and historical interaction information.
[0011] With reference to the first aspect, in some optional implementations, before the execution of the scenario logic corresponding to the target scenario state to present the scenario content to the user, the method further includes: performing real-time auditing on the scenario logic and / or the scenario content; and when it is determined that the scenario logic and / or the scenario content involve content that does not meet preset auditing rules, adjusting the scenario logic and / or the scenario content.
[0012] With reference to the first aspect, in some optional implementations, the execution of the scenario logic corresponding to the target scenario state to present the scenario content to the user includes: parsing the scenario logic and invoking corresponding modal instructions, and performing multi-modal fusion output on the scenario logic, wherein the scenario logic includes at least one of a virtual character behavior, dialogue content, and audio-visual effect instruction.
[0013] The second aspect provides an interactive narrative device based on artificial intelligence, which includes: a perception module configured to receive input information from a user and capture a current user interaction event according to the input information; a decision module configured to determine a set of transition conditions corresponding to a current scenario state based on a finite scenario state machine, determine a state transition condition satisfied by the current user interaction event from the set of transition conditions, and migrate from the current scenario state to a target scenario state corresponding to the state transition condition; and a scenario execution module configured to execute scenario logic corresponding to the target scenario state to present scenario content to the user.
[0014] The third aspect provides a storage medium for storing a computer program, which, when executed by a processor, implements the interactive narrative method based on artificial intelligence provided in any of the implementations of the first aspect.
[0015] The interactive narrative method, device, and storage medium based on artificial intelligence provided by the present disclosure introduce a finite scenario state machine as a narrative framework, map a user interaction event to a state transition condition based on the finite scenario state machine, drive state migration according to the state transition condition, and then execute predetermined scenario logic corresponding to a new scenario state after migration. In the scheme provided by the present disclosure, the originally random narrative process is constrained within a structured narrative graph defined by the finite scenario state machine, thereby achieving effective guidance and control of the macroscopic trend of the narrative while maintaining the openness of the interaction, ensuring the coherence and logic of the narrative, and effectively solving the problem of uncontrollable scenario development and poor logic reliability in the interactive narrative process in the related art. BRIEF DESCRIPTION OF DRAWINGS
[0016] Figure 1 An application scenario schematic diagram of an exemplary interactive narrative system provided by the present disclosure is shown.
[0017] Figure 2 Fig. 1 shows a flowchart of an AI-based interactive narrative method according to an embodiment of the present disclosure.
[0018] Figure 3 Fig. 2 shows a flowchart of an AI-based interactive narrative method according to another embodiment of the present disclosure.
[0019] Figure 4 Fig. 3 shows a flowchart of an AI-based interactive narrative method according to another embodiment of the present disclosure.
[0020] Figure 5 Fig. 4 shows an architecture diagram of an exemplary narrative engine system for performing an interactive narrative method according to the present disclosure.
[0021] Figure 6 Fig. 5 shows a structural diagram of an AI-based interactive narrative device according to an embodiment of the present disclosure.
[0022] Figure 7 Fig. 6 shows a structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present disclosure.
[0024] In the field of artificial intelligence technology, the interactive narrative system in the interactive narrative AI interaction product aims to create an immersive experience through dynamic story interaction between artificial intelligence and users. As mentioned earlier, in the related art, a solution based on an AI model (e.g., a generative large language model LLM) is usually adopted to achieve this goal. For example, the system provides an initial story background or character setting for the user, and then each input (e.g., dialogue, instruction) of the user together with the previous dialogue history forms a context, and the LLM generates subsequent plot content in real time, and the system presents the content generated by the LLM to the user, thereby realizing a highly flexible interactive process.
[0025] However, the above method of the related art has inherent defects: first, the macro trend of the narrative is highly random and uncontrollable, and the AI model may generate a plot deviating from the preset theme or logic due to insufficient understanding (e.g., subtle deviations in understanding of context or forgetting key plot, etc.), resulting in incomplete narrative structure; second, although the generative model is good at handling local dialogues, it is difficult to effectively maintain and track complex narrative elements (e.g., consequences of multiple branch choices, changes in prop systems or character relationships, etc.) across multiple interaction rounds, resulting in loose plot structure and difficulty in achieving complex narrative logic.
[0026] The inventors of the present disclosure found through in-depth analysis that the above defects are due to a technical contradiction: while pursuing interactive openness and flexible generated content, it is difficult to avoid the decline of controllability and reliability of narrative structure. This is because in the related art, the decision of the generative model completely depends on the immediate context window, and there is a lack of a stable and traceable macro narrative framework to constrain and guide the plot generation process.
[0027] To address this technical contradiction, the inventors realized that it can be resolved by introducing a structured narrative control framework. Specifically, in the scheme proposed by the present disclosure, a limited plot state machine is introduced as the core framework of narrative reasoning, which can define boundaries for open interaction and control the plot development path, ensuring that the plot does not deviate from the preset main line.
[0028] Based on this, the core inventive concept of the present disclosure is to introduce a limited plot state machine as a narrative framework, map user interaction events to state transition trigger conditions based on the limited plot state machine, and drive state migration according to the state transition conditions, and then execute the predetermined plot logic corresponding to the new plot state after migration, thereby realizing a controlled open interactive narrative process.
[0029] Figure 1 An application scenario of an interactive narrative system provided by the present disclosure is shown.
[0030] As shown in Figure 1 The interactive narrative system 100 provided by the present disclosure can include an interactive device 110 and a processing device 120. For example, the application scenario can be a museum, and the interactive narrative system 100 can be an interactive terminal device set in the museum.
[0031] As shown in Figure 1As shown, a user A stands in front of the interactive narrative system 100 and is interacting with a virtual character B displayed on the interactive device 110. The processing device 120 in the interactive narrative system 100 executes the interactive narrative method provided in this disclosure, performs state transitions based on user A's input information using a finite plot state machine, and determines the plot content that needs to be presented to user A through the virtual character B. Then, the interactive device 110 can convey the plot content presented by the virtual character B to user A through multiple modalities, completing the current interactive phase.
[0032] The interactive device 110 may include multiple functional modules or devices, such as a display screen (for displaying plot content, such as the image of a virtual character and its facial expressions and actions), a touch panel (which may be integrated into the display screen for users to input text or mark and select content displayed on the screen), a microphone (for users to input voice), a speaker (for playing audio to users), and a camera (for acquiring visual information including the user and the environment), and may also include other functional modules or devices for interaction.
[0033] The interactive device 110 is communicatively connected to the processing device 120, transmitting the acquired user input information to the processing device 120, and presenting the output information provided by the processing device 120 to the user in a multimodal manner.
[0034] After receiving the user's input information, the processing device 120 executes the AI-based interactive narrative method provided in this application embodiment to determine the plot content to be presented to the user. For example, the processing device 120 can divide the instructions for presenting the plot content into different modalities and send them to the corresponding functional modules or devices in the interactive device 110, so that the interactive device 110 can present the plot content to the user through multiple modalities.
[0035] The solution provided in this disclosure can also be applied to various other interactive narrative scenarios, such as story generation systems in educational scenarios or dynamic plot management systems in game scenarios. This disclosure does not limit the specific application scenarios.
[0036] Figure 2 The diagram shown is a flowchart illustrating an artificial intelligence-based interactive narrative method provided in an embodiment of this disclosure. This interactive narrative method can, for example, be derived from... Figure 1 The processing device 120 shown can perform the processing, or it can be performed by other processing devices / servers or other devices with processing capabilities in other scenarios or systems.
[0037] like Figure 2 As shown, the interactive narrative method provided in this embodiment may include the following steps S210~S250.
[0038] S210: Receive input information from the user.
[0039] Specifically, user input can be instructions or data provided by the user through various interactive methods. Instructions can be, for example, text or voice input directly by the user through the interactive device, or selections made by the user among multiple options. Data can be extracted from text or voice input directly by the user through the interactive device, or obtained by analyzing user actions and expressions captured in images or videos collected by the interactive device. User input reflects the user's intent and can express the user's subjective or potential needs.
[0040] S220: Capture current user interaction events based on input information.
[0041] Based on input information that reflects user intent, user intent can be determined, and corresponding user interaction events can be identified accordingly. User interaction events are inputs or behaviors initiated or generated by the user that may affect the development of the plot. For example, they can be structured data abstracted from user intent, which can clearly reflect the user's narrative intent and enable various modules in the system to identify and process them.
[0042] As some specific examples, user interaction events can include a user asking a question to a virtual character, a user looking at a specific exhibit, a user moving or clicking in a virtual space, a user's specific gestures or expressions, and a user selecting preset options.
[0043] S230: Determine the set of transition conditions corresponding to the current plot state based on a finite plot state machine.
[0044] In this disclosure, a finite plot state machine refers to a mathematical model or data structure that can formally describe the narrative process through a finite number of states and transition rules between states. It is used to define the various plot states (which can be regarded as stages) that may exist in the narrative process, and to specify the conditions (i.e., the set of transition conditions) that must be met to enter the next plot state from one plot state (i.e., state transition). This enables the system to perform state transitions within a preset narrative framework based on user interaction events, thereby achieving structured narrative control and ensuring the coherence and logic of the narrative.
[0045] For example, a finite narrative state machine can be implemented as a directed graph consisting of state nodes, transition edges, and transition conditions, or as a data structure that defines state enumeration and transition functions. This disclosure does not limit the specific implementation of the finite narrative state machine, as long as the narrative state and the corresponding transition rules can be clearly defined.
[0046] In some applications, a finite narrative state machine can be a narrative state diagram in a museum interactive narrative; in other applications, a finite narrative state machine can be a teaching path diagram in an educational story system, or a branching decision tree in a game plot.
[0047] A narrative state refers to a stage in the narrative process, representing the current situation and progress of the plot. Based on a finite narrative state machine, the set of transition conditions corresponding to the current narrative state can be determined. This set of transition conditions encompasses all conditions that allow the plot to transition to other states, and should cover all possible narrative transition paths. Based on the satisfaction of the transition conditions corresponding to the current narrative state, the next narrative state to which the plot will transition can be determined.
[0048] S240: Determine the state transition conditions satisfied by the current user interaction event from the set of transition conditions, and transition from the current story state to the target story state corresponding to the state transition conditions.
[0049] Based on the current user interaction event, the state transition conditions satisfied by the event in the transition condition set can be determined, and the corresponding target plot state, i.e. the next narrative stage that the narrative process needs to proceed to, can be determined according to the satisfied state transition conditions.
[0050] State transition conditions are the conditions that trigger a state transition in the plot (for example, a set of multiple sub-conditions). They are used to clearly define the triggering conditions for state transitions so that the system can accurately determine when and whether to perform a state transition. This allows the plot to naturally transition to a new narrative stage when migrating from the current plot state to the target plot state, maintaining the immersion and logic of the narrative.
[0051] For example, state transition conditions (or their sub-conditions) can be user questions, changes in user location, user emotional feedback, etc.
[0052] As some specific examples, the current plot state can be "museum entrance scene", and the target plot state to be migrated to can be "detailed explanation of a specific historical event"; in other embodiments, the current plot state can be "historical event explanation stage", and the target plot state to be migrated to can be "interactive dialogue of virtual characters"; in other embodiments, the current plot state can be "puzzle-solving task in progress", and the target plot state to be migrated to can be "new puzzle-solving task".
[0053] S250: Execute the plot logic corresponding to the target plot state to present the plot content to the user.
[0054] Plot logic is a set of rules and instructions that describe how to present a specific plot state. It specifies how plot content is presented so that the system can generate plot content that meets narrative requirements. Finally, by presenting the plot content to the user, the overall interactive narrative process with the user is completed.
[0055] According to the AI-based interactive narrative method provided in this disclosure, a finite plot state machine is introduced as the narrative framework. User interaction events are mapped to state transition conditions based on the finite plot state machine, and state transitions are driven according to these conditions, thereby executing the predetermined plot logic corresponding to the new plot state after the transition. In the solution provided in this disclosure, the originally random narrative process is constrained within a structured narrative graph defined by the finite plot state machine. This maintains the openness of interaction while effectively guiding and controlling the macro-direction of the narrative, ensuring the coherence and logic of the narrative, and effectively solving the problems of uncontrollable plot development and poor logical reliability in interactive narrative processes in related technologies.
[0056] Optionally, in some embodiments, step S250 may specifically include: parsing the plot logic and calling the corresponding modal instructions, and performing multimodal fusion output on the plot logic.
[0057] The plot logic includes at least one of virtual character behavior, dialogue content, and audiovisual effect instructions. For example, the plot logic may include dialogue scripts and behavior instructions for driving virtual characters to perform specific animations, or it may include preset narration text and identifiers of audio and video files to be played, or it may include scheduling rules for multimodal content, or it may include animation sequences for scene transitions, and of course, it may include any combination of the above elements, etc.
[0058] The plot content is the final narrative output that presents the plot logic to the user. It can include multiple modalities such as text, audio, and images to convey narrative information, enabling users to understand and experience the story content, thereby achieving the narrative purpose. Corresponding to different plot logics, for example, the plot content can be the animation of virtual characters, the 3D visualization of historical scenes, or the multimodal presentation of interactive stories, etc.
[0059] Multimodal storytelling can significantly enhance expressiveness, allowing users to have a multi-sensory immersive experience and better participate in the storyline.
[0060] Figure 3 The diagram shown is a flowchart of an AI-based interactive narrative method provided in another embodiment of this disclosure.
[0061] Given the complexity of interactive narrative scenarios and the need for flexible presentation to different users, in practical applications, a user interaction event may simultaneously satisfy multiple state transition conditions within the set of transition conditions. For example, a user asking a question may trigger multiple plot branches simultaneously, a change in user location may simultaneously satisfy multiple scene transition conditions, a change in user emotion may simultaneously satisfy multiple narrative path conditions, and so on.
[0062] In this context, to effectively identify and process user needs and make reasonable state transition decisions, it is necessary to propose solutions that can more deeply and accurately assess user needs, thereby ensuring narrative coherence and user satisfaction.
[0063] In view of this, this public disclosure Figure 3 The method shown is in Figure 2 Improvements based on the illustrated embodiments. Specifically, as... Figure 3 As shown, when the current user interaction event simultaneously satisfies multiple state transition conditions in the transition condition set, Figure 2 Step S240 in the method may specifically include the following steps S310 to S330.
[0064] S310: Read the current global state variable, which records the narrative information generated throughout the current interaction process.
[0065] Global state variables can fully record the narrative information generated during the overall interaction process. The narrative information can be in the form of structured data to express the narrative state and user interaction history, so that the system can make coherent decisions based on historical plot and historical interactions, thereby providing a personalized narrative experience.
[0066] In some embodiments, narrative information may include user background information, user status information, and interaction process information.
[0067] Specifically, user background information can be used to describe a user's basic characteristics and initial state, such as at least one of the following: user age, user knowledge level, language used by the user, and number of users. Based on user background information, the system can design personalized narratives for specific users, thereby providing a narrative experience that matches the user's characteristics.
[0068] User state information can be used to describe a user's current state and immediate reactions. For example, it can include at least one of the following: user emotion information, user intent information, user interest level, user satisfaction, user body language information, and user action information. Based on user state information, the system can dynamically adjust the narrative to provide a narrative experience that matches the user's state.
[0069] In some embodiments, user status information may include emotion data obtained through facial expression recognition, level of interest obtained through voice analysis, body language data obtained through motion capture, and so on.
[0070] Interaction process information can be used to record the process of user interaction with the system. This information may include at least one of the following: number of interactions, user choices during each interaction, plot progress, item list, character relationships, and historical interaction information. Based on this interaction process information, the system can optimize and adjust its narrative, thereby providing a coherent and in-depth narrative experience.
[0071] In some embodiments, the interaction process information may include an interaction log of each selection, a dynamically updated plot progress graph, a network graph recording the relationships between characters / items, and so on.
[0072] In some embodiments, global state variables can record all important plot information across states in the form of key-value pairs.
[0073] S320: Select the target transition condition that matches the current global state variable from among the multiple state transition conditions satisfied by the current user interaction event.
[0074] In this embodiment, the state transition conditions specified in the finite story state machine also include conditions related to global state variables. In this case, user interaction events and global state variables can be considered comprehensively to determine the state transition conditions that simultaneously match the current user interaction event and the current global state variables as the target transition conditions.
[0075] At this point, the target transition condition is a state transition condition selected from multiple state transition conditions satisfied by the current user interaction event based on global state variables. It can provide the best narrative path so that the plot development can be more suitable for the current user and the current situation, thereby further improving the user experience and narrative effect.
[0076] For example, the target transfer condition at this time can be a narrative path selected based on the user's knowledge level, a topic of interest selected based on the number of user interactions, an interaction method selected based on the user's emotional state, or a plot branch selected based on the user's interaction history, etc.
[0077] S330: Move from the current story state to the target story state corresponding to the target transfer condition.
[0078] Based on the target transfer conditions selected in step S320, the corresponding plot state is determined, and the migration action is executed.
[0079] According to the AI-based interactive narrative method provided in this disclosure, by introducing global state variables that can reflect user information and plot history, it is possible to make targeted and reasonable decisions, avoid narrative path confusion or violation of the current situation, provide users with more logical and personalized plot content, and at the same time be applicable to complex plot development and support the maintenance of multi-branch or multi-round narrative processes.
[0080] Optionally, in some embodiments, Figure 3 The method shown may further include updating the current global state variable to record new narrative information generated by this state transition. The current global state variable is the initial global state variable before the start of the current interaction process, and the initial global state variable is empty or has a default value.
[0081] Before initiating an interaction with the current user, the global state variables (i.e., the initial global state variables) can be set to empty or default values. The initial global state variables represent the state of the current global state variables before the start of the current interaction, defining the initial state of the narrative to ensure consistency and repeatability. For example, the user profile in the initial global state variables can be empty, and it may have a default narrative progress value and a default set of system parameters.
[0082] As mentioned earlier, global state variables are used to completely record the narrative information generated during the overall interaction process. Therefore, after completing the transition from the current plot state to the target plot state, the state transition of the current round and the relevant narrative information of the current plot state can be recorded in the global state variables. In other words, updating the global state variables is the process of modifying the content of the global state variables based on the state transition results. Through the update, the newly added narrative information is recorded in the global state variables so that the system can conduct subsequent interactive narrative processes based on the updated state variables, ensuring the coherence and personalization of the narrative.
[0083] Optionally, in some embodiments, the finite story state machine includes multiple state nodes, and the finite story state machine specifies a set of transition conditions and a list of reachable child nodes for each state node. The set of transition conditions includes at least one state transition condition, and the list of reachable child nodes includes at least one reachable child node. Each state transition condition specifies the conditions that must be met to transition from a specific state node to a specific reachable child node in its corresponding list of reachable child nodes.
[0084] Specifically, a finite narrative state machine can consist of multiple state nodes, each representing a corresponding narrative state. As the basic unit of the finite narrative state machine, each state node can have a unique identifier (i.e., node ID) and a description. For example, the description of a state node can record a list of parent nodes and reachable child nodes, forming a narrative graph.
[0085] Reachable child nodes refer to other state nodes that the current state node can reach, for example, nodes that can be pre-determined based on a clear and logical narrative transition path. The list of reachable child nodes includes at least one reachable child node; that is, each state node can include one or more reachable child nodes. Correspondingly, the transition condition set contains the set of conditions that must be satisfied to transition from the current state to the corresponding plot state of all reachable child nodes in the reachable child node list.
[0086] For example, if the current state node is "Museum Entrance Scene", the reachable child node could be "Detailed Explanation of Historical Events"; if the current state node is "Historical Event Explanation Stage", the reachable child node could be "Interactive Dialogue of Virtual Characters"; if the current state node is "Puzzle Solving Task in Progress", the reachable child node could include "Puzzle Solving Task C" and "Animation Informing of Decryption Failure", etc.
[0087] Based on the specific structure of the aforementioned finite plot state machine, the method provided in this disclosure can support non-linear narrative paths, providing users with more flexible and open plots. At the same time, by defining the boundaries of the narrative and possible development paths, it can support fine-grained design for plot performance and effectively ensure that the plot unfolds along the preset main storyline.
[0088] Optionally, in some embodiments, when employing a finite plot state machine with the above architecture, the current plot state may, for example, correspond to a first state node among multiple state nodes, and correspondingly, the target plot state may correspond to the first child node in the reachable child node list of the first state node. In this case, Figure 3 Step S320 in the method shown can be specifically implemented by including the following steps: Input the current user interaction event, the current global state variable, the set of transition conditions corresponding to the first state node, and the list of reachable child nodes as prompt words into the Large Language Model (LLM). Obtain the state transition suggestions output by the large language model based on the prompt words, wherein the state transition suggestions include at least one candidate transition condition selected from the set of transition conditions and the transition probability corresponding to each candidate transition condition; and The candidate transfer condition with the highest transfer probability among at least one candidate transfer condition is determined as the target transfer condition.
[0089] Here, the cue words are contextual information provided to the large language model to describe the decision-making situation, enabling the large language model to understand the current narrative state and possible transition options, thereby providing reasonable state transition suggestions. Exemplarily, the cue words can be text sequences, structured JSON data, multimodal cues, etc., and this disclosure does not limit the specific implementation form of the cue words.
[0090] Large language models are deep learning models with powerful natural language understanding and generation capabilities. Based on cue words, they can understand narrative context and generate reasonable suggestions for state transition decisions. In some embodiments, large language models can be GPT series models, BERT series models, or, in other embodiments, large language models can be models specifically fine-tuned for narrative tasks.
[0091] State transition suggestions are candidate state transition schemes provided by the large language model based on the current narrative context. These include at least one candidate transition condition and a corresponding transition probability evaluated for each candidate condition. The candidate transition condition is a chosen condition from the set of transition conditions that may trigger a state transition, representing a possible direction of narrative development. The transition probability is a probability assessment value assigned by the large language model to each candidate transition condition, reflecting its reasonableness.
[0092] Based on state transition suggestions, the system can select the optimal narrative path, thereby achieving intelligent narrative decision-making. For example, a state transition suggestion can be a list containing multiple candidate transition conditions and their probabilities; alternatively, it can be structured data containing descriptions of multiple candidate transition conditions and their probabilities; or it can be a natural language description containing multiple candidate transition conditions and explanations of the reasons for choosing those conditions.
[0093] In some embodiments, the transition probability can be a value between 0.0 and 1.0; in other embodiments, the transition probability can be a qualitative assessment of high, medium, and low; in still other embodiments, the transition probability can be a comprehensive score calculated based on multiple factors.
[0094] It should be understood that the embodiments disclosed herein do not limit the form of state transition suggestions or the way transition probabilities are expressed, and can be designed according to specific needs.
[0095] According to the AI-based interactive narrative method provided in this disclosure, by introducing a large language model, the semantic understanding capability of the large language model is integrated at the key decision points of state transition, thereby more accurately understanding user needs and the current situation. While significantly improving the controllability of the narrative path, the rigor of the structure and the reliability of the content, it can still ensure a high degree of interactive openness and plot flexibility.
[0096] Figure 4 The diagram shown is a flowchart of an AI-based interactive narrative method provided in another embodiment of this disclosure.
[0097] In the completely open generation method of related technologies, due to the lack of structured review nodes, the system has difficulty in effectively filtering and intervening in the plot, which may lead to the AI model outputting content that does not meet the requirements of the scene (such as historical fact errors or value deviations) or is non-compliant.
[0098] In view of this, in this embodiment, as Figure 4 As shown, in Figure 2 or Figure 3 Based on the illustrated embodiment, the above interactive narrative method further includes the following steps S410~S420.
[0099] S410: Conduct real-time review of plot logic and / or plot content.
[0100] Before generating plot content, the currently determined plot logic can be reviewed; and / or, after generating plot content based on the plot logic but before its presentation, the plot content can be reviewed. Real-time review allows for the timely and effective detection of content in the plot logic and / or plot content that does not conform to the rules.
[0101] In some embodiments, plot logic and / or plot content can be filtered based on keywords; in other embodiments, AI models such as large language models can be used to perform semantic analysis on plot logic and / or plot content; in still other embodiments, a manual review mechanism can be used to review plot logic and / or plot content.
[0102] Preferably, real-time review can be completed in a very short time, enabling the system to seamlessly present the plot content to the user, thus balancing a smooth user experience with content security. For example, real-time review can be an automated check performed immediately after the plot logic is determined and / or the plot content is generated; alternatively, real-time review can employ a multi-stage rapid review process or a distributed review mechanism based on edge computing.
[0103] S420: When it is determined that the plot logic and / or plot content involve content that does not comply with the preset review rules, the plot logic and / or plot content shall be adjusted.
[0104] To achieve effective review, review rules can be pre-defined. Review rules can include standards and guidelines for assessing content compliance, such as, but not limited to: text filtering rules containing sensitive word lists, semantic analysis rules based on specific scenarios, and multi-dimensional comprehensive evaluation standards.
[0105] When it is determined that the plot logic and / or plot content contain content that does not comply with the preset review rules, these contents are adjusted (e.g., including modification, replacement, or supplementation) to make the adjusted content comply with the preset review rules, while enabling the system to seamlessly continue the narrative flow, ensuring the continuity of user experience and the security of content.
[0106] For example, content adjustments could include replacing sensitive words, changing target transfer conditions to transfer to a new target storyline, generating alternative or supplementary content that conforms to the rules, and so on.
[0107] According to the AI-based interactive narrative method provided in this disclosure, by introducing a review process, the compliance, security, and historical accuracy of the generated content are effectively controlled. While ensuring content security, the method also strives to ensure seamless plot transitions, balancing content security and user experience reliability.
[0108] Figure 5 The diagram shows an exemplary narrative engine system for performing interactive narrative methods, as provided in this disclosure.
[0109] To make the inventive concept provided in this disclosure easier to understand, the following will be combined with Figure 5 The following description illustrates a typical implementation environment to illustrate the technical solutions provided in this disclosure. It should be understood that the implementation environment provided herein is merely an example to which the inventive concept of this disclosure applies and is not intended to limit the inventive concept of this disclosure.
[0110] like Figure 5 As shown, this embodiment provides an exemplary narrative engine system, which can be deployed on a server or local computing device, including a perception layer 510, a multimodal interaction interface 520, a narrative inferencer 530, a finite plot state machine 540, a plot logic executor 550, and a rendering layer 560.
[0111] The perception layer 510 receives and parses user input information, such as converting speech to text or analyzing images and videos to capture user actions and expressions, thereby abstracting structured user interaction events. The multimodal interaction interface 520 receives user interaction events from the perception layer 510 and passes them to the narrative inferencer 530. The narrative inferencer 530 may include an event processor and a decision-maker (e.g., a Large Language Model, LLM) to make decisions based on the current state, determine whether state transition conditions are met according to the finite narrative state machine 540, and update the narrative state. The finite narrative state machine 540 serves as the underlying core, storing and managing the current narrative state and transition logic. The narrative logic executor 550 is responsible for executing the specific narrative performance logic associated with the narrative state. It executes the corresponding narrative logic based on the updated narrative state and sends narrative execution instructions to the rendering layer 560 through the multimodal interaction interface 520. The rendering layer 560 generates narrative visual effects and performs spatial rendering according to the instructions to present the narrative content to the user.
[0112] As a complete example, Figure 5 The exemplary narrative engine system shown can specifically execute the interactive narrative method including the steps a to f to achieve the above-mentioned technical effects of this disclosure.
[0113] Step a: Initialize the narrative engine, load and enter the initial plot state.
[0114] This step aims to establish a defined starting point and initial narrative context for the overall interactive narrative process, anchoring the narrative starting point to an initial state defined by a finite state machine, thus laying the foundation for subsequent structured state transitions. As a specific implementation, the system can read a predefined finite plot state machine model from a configuration file or database and set the current plot state as the initial state node specified by that model, such as the state identified as "story beginning." Simultaneously, global state variables can be initialized to empty or default values. Alternatively, the initial state can be dynamically selected based on the scene or user profile when the user first enters the system; for example, a simpler storyline starting point could be chosen for child users.
[0115] Step b: Execute the plot logic associated with the current plot state and present the corresponding plot content to the user.
[0116] By explicitly binding plot logic with state nodes, abstract narrative states are transformed into concrete experiences that users can perceive, ensuring that when the narrative enters a certain stage, a set of expected and controlled presentation content can be triggered, thereby enhancing the stability and direction of the narrative.
[0117] In practice, the plot logic executor can parse the instruction set associated with the current state node. For example, if the instruction is "play the opening animation A and have the virtual character say the welcome message W", the rendering module will load the animation resources and synthesize the speech accordingly. Alternatively, the plot logic can also contain a dialogue template with variables, which is filled with specific content in the current context by the large language model, but the core dialogue framework and intent are still determined by the state node.
[0118] Optionally, to ensure the compliance and security of the output content, a real-time review process is introduced before executing the plot logic / presenting the plot content in the target state. This process reviews the plot logic to be executed and / or the specific plot content generated by it in real time. Review rules can include keyword filtering, sensitive content identification models, fact-checking knowledge bases, etc. When content is found to be inconsistent with preset rules, the system will adjust it, such as replacing sensitive words, refusing to generate the content and reverting to safe backup content, or correcting historical factual errors. Thus, a reliable content security control node is embedded in the open narrative generation process.
[0119] Step c: Wait for and receive input from the user to capture current user interaction events.
[0120] Through the interface that interacts with the user, technologies such as speech recognition, natural language understanding, and computer vision can be used to transform the user's raw input into a structured event description, such as "the user expressed the intention to find the key" or "the user made an affirmative gesture".
[0121] Step d: Based on the finite plot state machine, determine the set of transition conditions corresponding to the current plot state.
[0122] Based on the current stage of the narrative, and using the node relationships and transition condition rules in the finite plot state machine, we determine what possible directions of plot development (i.e., transition conditions) are available for evaluation. By extracting a finite, predefined, or dynamically managed set of transition conditions from the finite plot state machine, the possibilities of narrative development are constrained within a controllable range.
[0123] As one specific implementation, the current state node data structure stores a "transition condition set" field, which the system can directly read. For example, each transition condition in the set can be a rule described in natural language or a Boolean logical expression.
[0124] Step e: From the set of transition conditions, determine the state transition conditions that the current user interaction event satisfies, and drive the state machine to transition from the current story state to the target story state corresponding to the condition.
[0125] This step maps open user input to structured state transitions, allowing the selection of the most suitable path from a limited set of structured possible paths to advance the plot. In practice, the decision-maker iterates through the set of transition conditions for the current state, checking if the predicate of each condition is satisfied by the current user event. If only one condition is satisfied, the corresponding state transition is triggered directly. Alternatively, the decision can be made using a large language model: the user event, the current state description, and all possible transition conditions (or corresponding target state descriptions) are input into the large language model, which then selects the most suitable one.
[0126] Step f: After the state transition is complete, the process returns to step b, executes the plot logic associated with the new target plot state, and thus starts the next round of interaction loop.
[0127] Optionally, to ensure that the global state variable dynamically reflects the narrative progress, it can be updated after each state transition (after step e, before or during step f). The update operation records the new narrative information generated by this state transition. For example, when the state transitions to the "obtained the sword" state, the "item list" field in the global state variable will have a "sword" entry added; when the state transitions to the "learned the king's secret" state, the "known secret" flag will be set to true. This ensures that the "memory" of the finite plot state machine remains timely and accurate, providing effective context for subsequent decisions.
[0128] It is important to emphasize that step d, which determines the finite set of transition conditions based on the finite state machine, provides the premise for controllable decision-making in step e; and the state transition completed in step e, in turn, provides an accurate basis for the execution of the plot logic in step f, which precisely matches the new stage of the narrative. This closed-loop collaboration of "state definition of possibility - event-driven state transition - state-triggered plot presentation" enables the system to both ensure the stability of the macro-narrative framework through the finite state machine and achieve flexible local interaction in response to real-time user input.
[0129] In summary, this embodiment systematically resolves the contradiction between openness and controllability in interactive narratives by sequentially executing the cyclical process from S201 to S206, providing a complete and highly reliable interactive narrative solution.
[0130] In other implementations, the narrative engine system provided in this disclosure can also be composed of multiple intelligent agents, such as: an AI script supervisor intelligent agent as the perception layer, an AI director intelligent agent as the reasoning layer, an AI visual effects artist intelligent agent as the rendering layer, and an AI reviewer intelligent agent as the review layer. Specifically, each intelligent agent can achieve the following functions and effects.
[0131] The AI field recorder agent is the first line of defense between the user and the system, responsible for comprehensively capturing and understanding the user's multimodal input information. For example, it can perform one or more of the following functions: (1) Speech perception: real-time speech recognition, supporting multiple languages such as Mandarin and English; speech emotion analysis to identify the user's emotional state (excitement, calmness, confusion, etc.); capture of paralinguistic information such as tone, speech rate, and pauses.
[0132] (2) Text understanding: Natural language understanding, extracting key information and intent from user input; contextual association, combining historical dialogue to understand current input; entity recognition, recognizing professional terms such as cultural relic names, historical figures, time and place; sentiment analysis, judging user interest and satisfaction with content.
[0133] (3) Visual perception: Computer vision technology captures users’ facial expressions, body movements, gestures, etc.; facial expression recognition judges users’ emotional reactions (surprise, joy, confusion, etc.); body posture recognition understands users’ body language and willingness to interact.
[0134] (4) Spatial perception: User location tracking to identify the user's location and movement trajectory in space; people counting to identify the number of users in the current interactive area; group behavior analysis to understand the pattern of multi-person collaborative interaction.
[0135] (5) Context recording: Integrate all perceptual information into structured context data; establish user profiles and record user behavior characteristics and preferences; generate time-series records to provide complete input for subsequent plot reasoning.
[0136] The AI director agent acts as the "brain" of the entire interactive experience, providing script-guided control within an open interactive environment based on a limited plot state machine and user context information. Specifically, it can perform one or more of the following functions: (1) Plot state management: Maintain the state machine of the current plot, record the plot nodes that have been triggered, user choices, character relationships, etc.; track the progress of multiple plot lines and support complex parallel narratives; manage plot resources, such as dialogues that have been used and cultural relics that have been displayed.
[0137] (2) Personalized reasoning: Based on user profiles and the current context, understand the user's true intentions and interests; adjust the plot rhythm and interaction intensity in combination with the user's emotional state; consider the user's knowledge background and choose appropriate content depth and expression methods; remember the user's historical interactions to avoid repetition and conflict.
[0138] (3) Plot branch selection: Within the preset narrative framework, the most suitable plot branch is dynamically selected; balance openness and controllability, giving users the freedom to explore while ensuring that the plot does not deviate from the main line; handle unexpected situations, such as unexpected user input, sudden interruption, etc.; support multi-user collaboration and coordinate the choices and interactions of different users.
[0139] (4) Strategy optimization: Real-time evaluation of interaction effects and adjustment of strategies based on user feedback; dynamic adjustment of plot difficulty and interaction complexity; optimization of content presentation timing, displaying key information at appropriate times; learning user preferences and gradually improving the quality of personalized experience.
[0140] (5) Multi-agent coordination: Send rendering instructions to the AI visual effects artist agent; submit content to be reviewed to the AI reviewer agent; interact with the AI script recorder agent to obtain the latest user context information; coordinate the work rhythm of each agent to ensure a smooth user experience.
[0141] The AI visual effects agent is responsible for transforming abstract plot reasoning into concrete multimodal content presentation, creating an immersive audiovisual experience. Specifically, it can achieve one or more of the following functions: (1) Virtual character driven: Drive virtual historical figures to perform dialogue, expressions and actions according to the needs of the plot; generate the voice of the characters in real time, supporting the expression of different timbres, tones and emotions; control the facial expressions and body movements of the characters to achieve natural and smooth performance.
[0142] (2) Scene visual effects generation: Retrieve matching background visual effects materials from the multimodal plot library; For scenes that cannot be directly matched, call the diffusion model in real time to generate new visual content; Ensure the historical accuracy and artistic consistency of the generated content; Support visual presentation of various styles, such as realism, ink painting, animation, etc.
[0143] (3) Sound effects design: generate or call background music and environmental sound effects that match the scene atmosphere; control volume, timbre and spatial sound field effects; achieve synchronous coordination between sound effects and visuals.
[0144] (4) Real-time optimization: Monitor rendering performance to ensure smooth frame rate and response speed; dynamically adjust rendering quality according to hardware conditions; cache commonly used materials to reduce the burden of real-time generation; support graceful degradation to ensure basic experience when resources are insufficient.
[0145] The AI-powered content reviewer monitors and reviews the generated content in real time to ensure its compliance and security. Specifically, it can perform one or more of the following functions: (1) Content security review: detect politically sensitive, violent, bloody, vulgar and pornographic content; verify the accuracy of historical facts and avoid spreading misinformation; assess cultural suitability and ensure that it conforms to the museum's value orientation.
[0146] (2) User input filtering: Filter malicious input, offensive language and leading questions from users; protect minors and identify and block inappropriate interactions.
[0147] (3) Real-time intervention: For non-compliant content, block it in time and return safe alternative content; record the review log for manual review and system optimization; in case of serious violation, the interaction can be interrupted and the administrator can be notified.
[0148] Through the intelligent agent collaboration mechanism comprised of the four AI agents mentioned above, collaborative work is achieved based on standardized message interfaces and event-driven mechanisms. In terms of the event-driven architecture, user input, state changes, and content generation all trigger corresponding processing flows as events. Regarding fault tolerance and degradation, when an intelligent agent malfunctions, the system can degrade its operation to ensure basic functionality. In terms of continuous learning, each intelligent agent continuously optimizes its capabilities by recording and analyzing interaction data. Thus, through intelligent design, a leap from simple "question-and-answer interaction" to "immersive narrative experience" is achieved, transforming users from passive information receivers into active participants and creators of the narrative.
[0149] Figure 6 The diagram shown is a structural schematic of an artificial intelligence-based interactive narrative device provided in an embodiment of this disclosure.
[0150] like Figure 6 As shown, the AI-based interactive narrative device 600 provided in this embodiment includes: a perception module 610, used to receive input information from the user and capture the current user interaction event based on the input information; a decision module 620, used to determine the set of transition conditions corresponding to the current plot state based on a finite plot state machine, determine the state transition conditions satisfied by the current user interaction event from the set of transition conditions, and transition from the current plot state to the target plot state corresponding to the state transition conditions; and a plot execution module 630, used to execute the plot logic corresponding to the target plot state to present plot content to the user.
[0151] According to the AI-based interactive narrative device provided in this disclosure, a finite plot state machine is introduced as the narrative framework. User interaction events are mapped to state transition conditions based on the finite plot state machine, and state transitions are driven according to these conditions, thereby executing the predetermined plot logic corresponding to the new plot state after the transition. In the solution provided in this disclosure, the originally random narrative process is constrained within a structured narrative graph defined by the finite plot state machine. This maintains the openness of interaction while effectively guiding and controlling the macro-direction of the narrative, ensuring the coherence and logic of the narrative, and effectively solving the problems of uncontrollable plot development and poor logical reliability in interactive narrative processes in related technologies.
[0152] Optionally, in some embodiments, when the current user interaction event simultaneously satisfies multiple state transition conditions in the set of transition conditions, the decision module 620 may be used to: read the current global state variable, wherein the current global state variable records narrative information generated throughout the current interaction process; select the target transition condition that matches the current global state variable from among the multiple state transition conditions satisfied by the current user interaction event; and migrate from the current plot state to the target plot state corresponding to the target transition condition.
[0153] Optionally, in some embodiments, the finite story state machine includes multiple state nodes, and the finite story state machine specifies a set of transition conditions and a list of reachable child nodes for each state node. The set of transition conditions includes at least one state transition condition, and the list of reachable child nodes includes at least one reachable child node. Each state transition condition is used to specify the conditions that need to be met to transition from a state node to a reachable child node.
[0154] Optionally, in some embodiments, the current plot state corresponds to a first state node among multiple state nodes, and the target plot state corresponds to a first child node among at least one reachable child node. Specifically, the decision module 620 can be used to: input the current user interaction event, the current global state variable, the set of transition conditions corresponding to the first state node, and the list of reachable child nodes as prompt words into the large language model; obtain state transition suggestions output by the large language model based on the prompt words, wherein the state transition suggestions include at least one candidate transition condition selected from the set of transition conditions and the transition probability corresponding to each candidate transition condition; and determine the candidate transition condition with the highest transition probability among the at least one candidate transition condition as the target transition condition.
[0155] Optionally, in some embodiments, the above-described apparatus further includes a maintenance module for updating the current global state variable to record new narrative information generated by the current state transition. The current global state variable is the initial global state variable before the start of the current interaction process, and the initial global state variable is empty or has a default value.
[0156] Optionally, in some embodiments, the narrative information includes user background information, user state information, and interaction process information. Specifically, user background information includes at least one of user age, user knowledge level, user language, and number of users; user state information includes at least one of user emotion information, user intent information, user interest level, user satisfaction, user body language information, and user action information; and interaction process information includes at least one of the number of interactions, user choices in each interaction, plot progress, item list, character relationships, and historical interaction information.
[0157] Optionally, in some embodiments, the above-mentioned device further includes an auditing module, which is used to audit the plot logic and / or plot content in real time before the plot execution module 630 executes the plot logic corresponding to the target plot state; and to adjust the plot logic and / or plot content when it is determined that the plot logic and / or plot content involves content that does not conform to preset auditing rules.
[0158] Optionally, in some embodiments, the plot execution module 630 is specifically used to: parse the plot logic and call the corresponding modal instructions, and perform multimodal fusion output on the plot logic. The plot logic includes at least one of virtual character behavior, dialogue content, and audiovisual effect instructions.
[0159] It should be understood that the AI-based interactive narrative device provided in this disclosure is used to execute the AI-based interactive narrative device provided in the above multiple embodiments. The features, action execution conditions, specific implementation methods and achieved technical effects can all be found in the above method embodiments. To avoid repetition, they will not be repeated here.
[0160] Figure 7 The diagram shown is a structural schematic of an electronic device provided in an embodiment of this disclosure. Figure 7 The illustrated electronic device 700 (which may specifically be a computer device) includes a memory 701, a processor 702, a communication interface 703, and a bus 704. The memory 701, processor 702, and communication interface 703 are interconnected via the bus 704.
[0161] The memory 701 may be a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 701 may store a program, and when the program stored in the memory 701 is executed by the processor 702, the processor 702 and the communication interface 703 are used to execute the various steps of the artificial intelligence-based interactive narrative method of the present disclosure embodiments.
[0162] The processor 702 may be a general-purpose central processing unit (CPU), microprocessor, application specific integrated circuit (ASIC), graphics processing unit (GPU), or one or more integrated circuits, for executing relevant programs to achieve the functions required by the modules / units in the AI-based interactive narrative device of this disclosure embodiment.
[0163] The processor 702 can also be an integrated circuit chip with signal processing capabilities. In implementation, each step of the AI-based interactive narrative method of this disclosure can be completed through integrated logic circuits in the hardware of the processor 702 or through software instructions. The processor 702 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this disclosure can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in the memory 701. The processor 702 reads the information in the memory 701 and, in conjunction with its hardware, performs the functions required by the modules / units included in the AI-based interactive narrative device of this disclosure embodiment, or executes the AI-based interactive narrative method of this disclosure method embodiment.
[0164] The communication interface 703 uses transceiver devices, such as, but not limited to, transceivers, to enable communication between the electronic device 700 and other devices or communication networks. For example, sensor data can be acquired through the communication interface 703.
[0165] Bus 704 may include a pathway for transmitting information between various components of electronic device 700 (e.g., memory 701, processor 702, communication interface 703).
[0166] It should be noted that, although Figure 7 The illustrated electronic device 700 only shows the memory, processor, and communication interface. However, those skilled in the art should understand that in specific implementations, the electronic device 700 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that the electronic device 700 may also include hardware devices for implementing other additional functions. Moreover, those skilled in the art should understand that the electronic device 700 may only include the devices necessary for implementing the embodiments of this disclosure, and may not necessarily include... Figure 7 All the devices shown.
[0167] In addition to the methods, apparatus, and devices described above, embodiments of this disclosure may also be computer program products, including computer program instructions that, when executed by a processor, cause the processor to perform various steps of the artificial intelligence-based interactive narrative methods provided in the various embodiments of this disclosure.
[0168] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of this disclosure. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0169] Furthermore, embodiments of this disclosure may also be storage media (e.g., computer-readable storage media) storing a computer program (or instructions) that, when run by a processor, causes the processor to perform the steps of the AI-based interactive narrative method provided in the various embodiments of this disclosure.
[0170] The storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0171] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this disclosure.
[0172] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0173] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0174] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0175] In addition, the functional units in the various embodiments of this disclosure can be integrated into a similar region segmentation unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0176] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this disclosure. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory, random access memory, magnetic disks, or optical disks.
[0177] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.
Claims
1. An interactive narrative method based on artificial intelligence, characterized in that, include: Receive input information from the user; Capture current user interaction events based on the input information; Determine the set of transition conditions corresponding to the current plot state based on a finite plot state machine; Determine the state transition conditions satisfied by the current user interaction event from the set of transition conditions, and transition from the current story state to the target story state corresponding to the state transition conditions; as well as Execute the plot logic corresponding to the target plot state to present the plot content to the user.
2. The method according to claim 1, characterized in that, When the current user interaction event simultaneously satisfies multiple state transition conditions in the transition condition set, the step of determining the state transition condition satisfied by the current user interaction event from the transition condition set and transitioning from the current story state to the target story state corresponding to the state transition condition includes: Read the current global state variable, which records the narrative information generated throughout the entire current interaction process; Select the target transition condition that matches the current global state variable from among the multiple state transition conditions satisfied by the current user interaction event; and The current storyline state is transitioned to the target storyline state corresponding to the target transfer condition.
3. The method according to claim 2, characterized in that, The finite story state machine includes multiple state nodes, and the finite story state machine specifies a set of transition conditions and a list of reachable child nodes for each state node. The set of transition conditions includes at least one state transition condition, and the list of reachable child nodes includes at least one reachable child node. Each state transition condition is used to specify the conditions that need to be met to transition from the state node to a reachable child node.
4. The method according to claim 3, characterized in that, The current storyline state corresponds to the first state node among the plurality of state nodes, and the target storyline state corresponds to the first child node among the at least one reachable child node. The step of selecting the target transition condition that matches the current global state variable from among the multiple state transition conditions satisfied by the current user interaction event includes: The current user interaction event, the current global state variable, the set of transition conditions corresponding to the first state node, and the list of reachable child nodes are used as prompt words input into the large language model. Obtain the state transition suggestions output by the large language model based on the prompt words, wherein the state transition suggestions include at least one candidate transition condition selected from the set of transition conditions and a transition probability corresponding to each candidate transition condition; and The candidate transfer condition with the highest transfer probability among the at least one candidate transfer condition is determined as the target transfer condition.
5. The method according to any one of claims 2 to 4, characterized in that, Also includes: The current global state variables are updated to record the new narrative information generated by this state transition. The current global state variable is the initial global state variable before the start of the current interaction process, and the initial global state variable is empty or has a default value.
6. The method according to any one of claims 2 to 4, characterized in that, The narrative information includes user background information, user status information, and interaction process information. in, The user background information includes at least one of the following: user age, user knowledge level, user language, and number of users. The user status information includes at least one of the following: user emotion information, user intent information, user interest level, user satisfaction, user body information, and user action information. The interaction process information includes at least one of the following: number of interactions, user selections in each interaction, plot progress, item list, character relationships, and historical interaction information.
7. The method according to claim 1, characterized in that, Before executing the plot logic corresponding to the target plot state to present the plot content to the user, the method further includes: Real-time review of the plot logic and / or plot content; and When it is determined that the plot logic and / or the plot content involve content that does not comply with preset review rules, the plot logic and / or the plot content shall be adjusted.
8. The method according to claim 1, characterized in that, The execution of the plot logic corresponding to the target plot state to present plot content to the user includes: The plot logic is parsed and the corresponding modal instructions are invoked. The plot logic is then multimodally fused and output. The plot logic includes at least one of virtual character behavior, dialogue content, and audiovisual effect instructions.
9. An interactive narrative device based on artificial intelligence, characterized in that, include: The sensing module is used to receive input information from the user and capture current user interaction events based on the input information; The decision module is used to determine the set of transition conditions corresponding to the current plot state based on a finite plot state machine, determine the state transition conditions satisfied by the current user interaction event from the set of transition conditions, and transition from the current plot state to the target plot state corresponding to the state transition conditions. as well as The plot execution module is used to execute the plot logic corresponding to the target plot state in order to present the plot content to the user.
10. A storage medium, characterized in that, The storage medium is used to store a computer program, which, when executed by a processor, implements the artificial intelligence-based interactive narrative method as described in any one of claims 1 to 8.