Method and system for generating multi-threaded plot based on dynamic narrative engine

CN122516610APending Publication Date: 2026-08-07GUANGDONG OCEAN UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610682721.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-18
Publication Date
2026-08-07

AI Technical Summary

Technical Problem

[0004]在文化教育应用层面,现有产品多采用静态图文或视频展示,缺乏有效互动机制,本质是信息单向输出,难以激发青少年探索欲

Benefits of technology

[0058]本发明提出的时空约束机制创新性融合结构化历史数据库与条件判断矩阵,在剧情生成的每一环节均进行史实逻辑校验,无需依赖人工预设分支即可动态判断玩家交互意图的历史可行性,有效解决了现有技术中历史真实性与玩家自由度难以平衡的问题,避免了传统生成式AI易产生历史错位和价值观偏差的缺陷。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122516610A_ABST
    Figure CN122516610A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of digital media, in particular to a multi-line plot generation method and system based on a dynamic narrative engine; the method comprises: obtaining player interaction data, spatiotemporal information of a current plot node and a structured history database; evaluating a player emotional state through an emotional computing model; determining whether the current plot node is a key historical fact node, if yes, locking the plot development and generating a limited interactive plot according to the historical facts, if not, starting parallel history deduction to generate multi-line branch plots; calling a spiritual semantic library to perform value matching verification on the generated plot content; outputting dynamic plot and scene rendering instructions through a dynamic narrative engine; and packaging player decision sequences and personalized plot data to generate a memoir NFT. The present application realizes the organic unification of rigorous historical restoration and deep immersive experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of digital media technology and computer applications, specifically to a method and system for generating multi-line storylines based on a dynamic narrative engine. Background Technology

[0002] With the rapid development of the global digital content industry, the integration of artificial intelligence technology and game narrative has become a key breakthrough. Dynamic narrative engine technology uses algorithms to generate plot content in real time that highly matches player preferences and contextual logic, driving the game experience from the traditional passive reception of plot to active player participation in story construction. In the field of culture and education, the demand for digital transformation is becoming increasingly urgent. Although technologies such as virtual reality and augmented reality provide education with visual and immersive experiences, existing solutions mostly remain at the surface level of scene reproduction, lacking in-depth interactive design that considers the decision-making logic of historical events and the core spirit of characters.

[0003] Current dynamic narrative technologies are mainly divided into two categories: rule-based systems and data-driven generative narratives. Rule-based systems rely on pre-defined branching storylines, and the complexity of the plot is limited by the amount of manual design work. They are essentially pseudo-non-linear and cannot dynamically generate plots based on player behavior data, lacking openness and replay value. Data-driven generative narratives use natural language processing technology to generate open plots, but they lack historical constraints and value guidance, making them prone to historical misalignment and value bias.

[0004] In terms of cultural and educational applications, existing products mostly use static images, text, or videos, lacking effective interactive mechanisms. Essentially, they are one-way information outputs, failing to stimulate teenagers' desire to explore. While some applications incorporate gamification elements, they rely solely on stiff dialogue or simple point rewards, failing to internalize values ​​within gameplay and narrative choices, resulting in superficial values ​​education. Furthermore, current technology struggles to reconcile the conflict between historical accuracy and artistic creation; fabricating key moments weakens the seriousness of education, while excessive adherence to historical facts leads to a rigid narrative.

[0005] At the level of technological integration, general-purpose narrative engines lack semantic constraints on historical context and values, easily generating plots that are inconsistent with or contradict historical background. Simultaneously, existing systems lack dedicated cultural training platforms and fail to effectively collect and analyze player interaction data to optimize models, hindering system self-evolution. The conflict between commercialization and educational goals also impedes the formation of a sustainable new digital ecosystem that combines social and economic benefits.

[0006] In summary, there is an urgent need for a multi-line story generation method and system that can balance historical authenticity with player freedom, achieve in-depth value guidance, and possess automated training and iteration capabilities, in order to promote the technological development of digital cultural dissemination. Summary of the Invention

[0007] To address the aforementioned technical issues, this invention provides a method and system for generating multi-line storylines based on a dynamic narrative engine. It aims to achieve an organic unity between rigorous historical restoration and a deeply immersive experience through the synergistic effect of spatiotemporal constraint mechanisms, a mental semantic database, an emotional computing model, and parallel historical deduction algorithms.

[0008] To achieve the above objectives, the present invention provides the following technical solution:

[0009] On one hand, embodiments of the present invention provide a method for generating multi-line storylines based on a dynamic narrative engine, the method comprising the following steps:

[0010] S100: Acquire player interaction data, spatiotemporal information of the current plot node, structured historical database, mental semantic database, and trained dynamic narrative engine. The dynamic narrative engine includes event triggers, condition judgment matrix, and nonlinear flow controller.

[0011] S200, input the player interaction data into the dynamic narrative engine, analyze the player's interaction intent through the event trigger, calculate the player's operational behavior data within a preset time window through the emotion computing model, and generate an emotion state evaluation result;

[0012] S300: Query the structured historical database through the condition judgment matrix, compare the spatiotemporal information of the current plot node with the player's interaction intention according to historical logic, and determine whether the player's interaction intention conforms to the historical facts under the current time and space. If it does not conform, intercept the player's interaction intention and generate an alternative interaction option that conforms to historical facts. If it does conform, proceed to S400.

[0013] S400, determine whether the current plot node is a key historical node. If so, lock the plot direction through the nonlinear process controller and generate a limited interactive plot based on the structured historical database. Otherwise, start the parallel historical deduction algorithm, calculate the impact of different decision paths on virtual plot parameters based on the player's interaction intention, and generate multi-branch plots.

[0014] S500, call the mental semantic library, calculate the semantic matching degree between the generated limited interactive plot or the multi-branch plot and the preset value tag, adjust the emotional tone and dialogue style of the plot according to the semantic matching degree, and output the target plot after value verification.

[0015] S600, input the target plot and the emotional state evaluation results into the dynamic narrative engine to generate dynamic script text, NPC behavior logic data and scene rendering instructions, and output an immersive scene through the AR / VR rendering module;

[0016] S700 tracks and records the key decision sequences of players during the storyline and the personalized storyline data generated by the dynamic narrative engine. It then packages the key decision sequences and the personalized storyline data and uses blockchain technology to generate a unique memoir NFT.

[0017] Optionally, in S200, the step of calculating the player's operational behavior data within a preset time window using an emotion computing model to generate an emotion state assessment result includes:

[0018] S210, Collect data on the player's mouse click frequency, task dwell time, and dialogue option hesitation time within the preset time window;

[0019] S220, input the mouse click frequency data, the task dwell time data, and the dialogue option hesitation time data into the sentiment calculation model, and calculate the sentiment entropy value through weighted summation;

[0020] S230, compare the emotional entropy value with a preset emotional threshold. If the emotional entropy value exceeds the preset emotional threshold, generate a rhythm adjustment instruction and determine that the player is in an emotional fluctuation state. If the emotional entropy value does not exceed the preset emotional threshold, generate a normal narrative instruction and determine that the player is in a stable state.

[0021] S240, output the rhythm adjustment instruction or the regular narrative instruction and the emotional entropy value as the emotional state assessment result.

[0022] Optionally, in S300, the step of querying the structured historical database through the conditional judgment matrix, comparing the spatiotemporal information of the current plot node with the player's interaction intent using historical logic, and determining whether the player's interaction intent conforms to the historical facts under the current spatiotemporal context, includes:

[0023] S310, extract historical event data, technical condition data, and character relationship graph data corresponding to the spatiotemporal information of the current plot node from the structured historical database;

[0024] S320, the player's interaction intent is parsed into behavior data to be verified, the behavior data to be verified is compared with the historical event data by timestamp, the behavior data to be verified is compared with the technical condition data by technical feasibility, and the behavior data to be verified is compared with the character relationship graph data by logical consistency.

[0025] S330, if the timestamp comparison, the technical feasibility comparison, and the logical consistency comparison all pass, then it is determined that the player's interaction intention conforms to the historical facts under the current time and space, and a plot advancement permission signal is generated;

[0026] S340, if any of the timestamp comparison, the technical feasibility comparison, or the logical consistency comparison fails, it is determined that the player's interaction intention does not conform to the historical facts under the current time and space, an interception signal is generated, and historical behavior data that is similar to the behavior data to be verified and conforms to historical facts is retrieved from the structured historical database to generate the alternative interaction option.

[0027] Optionally, in S400, the activation of the parallel history deduction algorithm, calculating the impact of different decision paths on virtual plot parameters based on the player's interaction intent, and generating multi-branch plot lines, includes:

[0028] S410, mark the current plot node as a non-critical historical node, and extract virtual plot parameters associated with the current plot node from the structured historical database. The virtual plot parameters include morale parameters, resource inventory parameters, and NPC favorability parameters.

[0029] S420, The player's interaction intent is input into the non-linear flow controller. The non-linear flow controller calls the decision tree network, with the current plot node as the root node and the decision options corresponding to the player's interaction intent as branch paths, to construct a parallel historical decision tree.

[0030] S430, along each branch path of the parallel historical decision tree, calculate the numerical impact of the decision option on the morale parameter, the material inventory parameter, and the NPC favorability parameter, and generate multiple virtual plot deduction paths after parameter updates;

[0031] S440, input the multiple virtual plot deduction paths into the pre-trained large language model respectively, generate script text data, NPC dialogue data and scene event data corresponding to each virtual plot deduction path, and combine the script text data, the NPC dialogue data and the scene event data into the multi-branch plot.

[0032] Optionally, in S500, the step of calling the mental semantic database, calculating the semantic matching degree between the generated limited interactive plot or the multi-branch plot and the preset value tags, and adjusting the emotional tone and dialogue style of the plot according to the semantic matching degree includes:

[0033] S510, extract value keyword data, associated historical event data, and quotes from the spiritual semantic database. The value keyword data includes keywords such as dedication, unity, patriotism, and team.

[0034] S520, input the limited interactive plot or the multi-branch plot into the semantic parsing unit to extract entity word data and sentiment word data from the plot text;

[0035] S530, perform event matching between the entity word data and the associated historical event data, and calculate the semantic similarity between the sentiment word data and the value keyword data to generate the semantic matching degree;

[0036] S540, determine whether the semantic matching degree is lower than the preset value threshold. If so, embed the character quote data into the plot text, adjust the emotional tone to an exciting tone or a tragic tone, and call the speech style template corresponding to the value keyword data to replace the original speech style, and generate the target plot after value verification.

[0037] Optionally, in S600, the step of inputting the target plot and the emotional state evaluation result into the dynamic narrative engine to generate dynamic script text, NPC behavior logic data, and scene rendering instructions includes:

[0038] S610, The target plot is input into the script generation unit of the dynamic narrative engine. The script generation unit calls a fine-tuned version of the pre-trained large language model and combines it with the style template data in the mental semantic library to generate the dynamic script text that conforms to the characteristics of the times.

[0039] S620, the emotional state assessment result is input into the rhythm mapping table, which stores the correspondence between the emotional entropy value range and the scene environment parameters, including the light intensity parameter, the weather type parameter, and the sound effect volume parameter.

[0040] S630, based on the emotional entropy value in the emotional state assessment result, query the corresponding scene environment parameters from the rhythm mapping table, generate the scene rendering instruction and send it to the AR / VR rendering module;

[0041] S640, based on the NPC dialogue content in the dynamic script text, retrieve the action sequence data and facial expression sequence data corresponding to the dialogue content from the preset NPC behavior database, and combine them into the NPC behavior logic data.

[0042] Optionally, prior to S700, the method further includes:

[0043] S710, the dynamic narrative engine is deployed to the training platform, which includes a virtual player group simulator and a reinforcement learning model training module;

[0044] S720, Multiple virtual player agents with different behavioral characteristic parameters are generated through the virtual player group simulator. The behavioral characteristic parameters include recklessness parameter, conservative parameter, and historical knowledge level parameter.

[0045] S730, the virtual player agent is used to automatically traverse and interact with the plot branches generated by the dynamic narrative engine, and the branch selection rate data, completion rate data and dead point data of each plot branch are statistically analyzed;

[0046] S740, Construct a dual-direction reward function, which includes a historical fit reward item and a player retention rate reward item. Input the branch selection rate data, the level completion rate data, and the dead point data into the dual-direction reward function to calculate the comprehensive reward value.

[0047] S750, the comprehensive reward value is input into the reinforcement learning model training module, the model parameters of the dynamic narrative engine are optimized through the policy gradient algorithm, the optimized dynamic narrative engine is generated, and the trained dynamic narrative engine is replaced.

[0048] Optionally, in S740, constructing the dual-guided reward function includes:

[0049] S741, Obtain the historical fit reward item from the historical fit evaluation unit. The historical fit reward item is obtained by comparing the event sequence and time node of the plot path generated by the virtual player agent with the standard historical path in the structured historical database.

[0050] S742, Obtain the player retention rate reward item from the user experience evaluation unit. The player retention rate reward item is obtained by statistically analyzing the average dwell time data of the virtual player Agent in the story branches and the story coherence score data.

[0051] S743, multiply the historical fit reward item by the first weighting coefficient, multiply the player retention rate reward item by the second weighting coefficient, add the two product results to generate the comprehensive reward value.

[0052] On the other hand, embodiments of the present invention provide a multi-line plot generation system based on a dynamic narrative engine, including:

[0053] At least one processor;

[0054] At least one memory for storing at least one program;

[0055] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.

[0056] On the other hand, embodiments of the present invention provide a computer-readable storage medium storing a processor-executable program, which, when executed by a processor, is used to perform the above-described method.

[0057] The embodiments of the present invention have the following beneficial effects:

[0058] The spatiotemporal constraint mechanism proposed in this invention innovatively integrates a structured historical database and a conditional judgment matrix. It performs historical logic verification at every stage of plot generation, and can dynamically judge the historical feasibility of the player's interaction intentions without relying on manually preset branches. This effectively solves the problem of balancing historical authenticity and player freedom in existing technologies, and avoids the defects of traditional generative AI that are prone to historical misalignment and value bias.

[0059] The spiritual semantic database designed in this invention constructs a structured semantic network containing value keywords and their associated historical events and character quotes, and uses it as a value constraint layer for plot generation. By calculating the semantic matching degree, the emotional tone and rhetoric style of the plot are dynamically adjusted, realizing implicit guidance of values, enabling players to naturally generate emotional resonance in the interaction, and avoiding rigid preaching.

[0060] The emotional computing model introduced in this invention deeply mines players' operational rhythm, dwell time, hesitation time, and other deep behavioral data to construct an emotional state model in real time. It then controls the scene rendering parameters and narrative rhythm in reverse, achieving a precise match between the narrative rhythm and the player's psychological experience, significantly enhancing the persuasiveness and empathy of education.

[0061] The parallel history deduction algorithm constructed in this invention divides plot nodes into key historical nodes and non-key historical nodes. For the former, a locking mechanism is adopted to ensure the seriousness of education, while for the latter, players can explore the virtual direction of different decisions and calculate the impact on virtual plot parameters in real time. While respecting the main historical line, it enhances the replay value and exploration depth of the plot.

[0062] The training platform provided by this invention introduces a virtual player group simulator for automated sandbox simulation, and combines a dual-guided reward function that includes historical fit and player retention rate for reinforcement learning optimization. This solves the problems of existing systems lacking culturally compatible data and iteration capabilities, and enables the system to achieve low-cost, high-efficiency self-evolution.

[0063] This invention uses blockchain technology to generate memoir NFTs from players' personalized decision-making paths and story data, combining spiritual inheritance with digital asset appreciation, and constructing a sustainable new digital cultural ecosystem that has both social and economic benefits. Attached Figure Description

[0064] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the embodiments will be briefly described below.

[0065] Figure 1 This is a flowchart illustrating the multi-line plot generation method based on a dynamic narrative engine in an embodiment of the present invention.

[0066] Figure 2 This is a schematic diagram of the overall system architecture in an embodiment of the present invention;

[0067] Figure 3 This is a flowchart of the internal logic processing of the dynamic narrative engine in this embodiment of the invention;

[0068] Figure 4 This is a schematic diagram of the training platform and model optimization logic in an embodiment of the present invention. Detailed Implementation

[0069] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the invention, and should not be construed as limiting the invention. Unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0070] refer to Figure 1 ,like Figure 1 The image shows a multi-line plot generation method based on a dynamic narrative engine provided by an embodiment of the present invention. The method includes the following steps:

[0071] S100: Acquire player interaction data, spatiotemporal information of the current plot node, structured historical database, mental semantic database, and trained dynamic narrative engine. The dynamic narrative engine includes event triggers, condition judgment matrix, and nonlinear flow controller.

[0072] S200, input the player interaction data into the dynamic narrative engine, analyze the player's interaction intent through the event trigger, calculate the player's operational behavior data within a preset time window through the emotion computing model, and generate an emotion state evaluation result;

[0073] Specifically, the system first captures the player's current behavior using an emotion computing model, including explicit input (such as selecting "fight" or "negotiate" in a dialog box) and implicit data (such as reaction speed). The system sets a time window (e.g., the last 30 seconds) and calculates the player's average action interval. If the interval is significantly shortened and the click pressure (on pressure-sensitive touch devices) is increased, the system determines that the player is in a "tense / excited" state; if the interval is longer, it is determined to be "contemplative / peaceful".

[0074] S300: Query the structured historical database through the condition judgment matrix, compare the spatiotemporal information of the current plot node with the player's interaction intention according to historical logic, and determine whether the player's interaction intention conforms to the historical facts under the current time and space. If it does not conform, intercept the player's interaction intention and generate an alternative interaction option that conforms to historical facts. If it does conform, proceed to S400.

[0075] Specifically, after receiving the player's intent, the engine does not immediately generate the plot, but first enters the spatiotemporal constraint layer. The system queries the timestamp of the current plot node (e.g., October 1934) and its geographical location (e.g., Ruijin, Jiangxi). In the system's built-in decision tree network, each root node and branch node is bound to a spatiotemporal label. If the player selects an event that is impossible in the current spatiotemporal context (e.g., selecting "send a telegraph message" before the invention of radio), the system will intercept the option through a conditional judgment matrix and prompt or guide the player to an alternative option that conforms to historical logic.

[0076] S400, determine whether the current plot node is a key historical node. If so, lock the plot direction through the nonlinear process controller and generate a limited interactive plot based on the structured historical database. Otherwise, start the parallel historical deduction algorithm, calculate the impact of different decision paths on virtual plot parameters based on the player's interaction intention, and generate multi-branch plots.

[0077] Specifically, this is key to realizing multi-line storylines. After historical verification, the system activates a non-linear flow controller. The controller calls upon the mental semantics library to analyze the value weights of the current branch. For example, when faced with the choice of "whether to divide the family property to support," the system generates two paths based on the player's inclination: Path A (support) triggers a "support" event, increasing the probability of "manpower replenishment" in subsequent storylines; Path B (hesitation) triggers a "moral awareness enhancement" event, generating an NPC persuasion scene about "righteousness." For non-critical historical nodes (such as tactical choices in a small-scale skirmish), the system allows the generation of "parallel histories." The engine instantly calculates the impact of this decision on subsequent virtual storyline parameters (such as morale and resource reserves), thereby generating a unique "virtual historical memoir."

[0078] S500, call the mental semantic library, calculate the semantic matching degree between the generated limited interactive plot or the multi-branch plot and the preset value tag, adjust the emotional tone and dialogue style of the plot according to the semantic matching degree, and output the target plot after value verification.

[0079] Specifically, the system calls upon the mental semantic database in real time. For example, when a player chooses "sacrifice themselves to cover their teammates," the system triggers the high-weight semantic tag "dedication," generating corresponding emotionally uplifting text and stirring background music.

[0080] S600, input the target plot and the emotional state evaluation results into the dynamic narrative engine to generate dynamic script text, NPC behavior logic data and scene rendering instructions, and output an immersive scene through the AR / VR rendering module;

[0081] Specifically, a fine-tuned version of a pre-trained large language model is used, combined with style templates from a semantic database, to generate character dialogues that reflect the characteristics of the era. Simultaneously, scene rendering commands are generated and sent to the AR / VR scene rendering module to dynamically adjust environmental parameters. For example, when the plot tone shifts to "tragic," the rendering module will load rainy weather materials and reduce ambient light saturation.

[0082] S700 tracks and records the key decision sequences of players during the storyline and the personalized storyline data generated by the dynamic narrative engine. It then packages the key decision sequences and the personalized storyline data and uses blockchain technology to generate a unique memoir NFT.

[0083] Specifically, the system records the player's key choices in this round of the story, the unique endings generated, and the virtual historical path. It uses blockchain technology to generate a unique memoir NFT, which is permanently stored as the player's digital asset.

[0084] This invention provides a method and system for generating multi-line storylines based on a dynamic narrative engine. By employing a spatiotemporal constraint mechanism to verify historical logic at every stage of story generation, it effectively solves the problem of balancing historical accuracy and player freedom in existing technologies, avoiding the historical inaccuracies and value biases inherent in traditional generative AI. A mental semantic library dynamically adjusts the emotional tone and dialogue style of the storyline through semantic matching calculations, achieving implicit value guidance. An emotion computing model constructs an emotional state model in real time using deep behavioral data, inversely controlling scene rendering parameters and narrative rhythm, achieving precise matching between narrative rhythm and player psychological experience. A parallel historical deduction algorithm divides story nodes into key historical nodes and non-key historical nodes, enhancing the replay value and exploration depth of the storyline while respecting the main historical line. This invention effectively addresses challenges in existing technologies such as strong rule-based narrative logic, superficial emotion computing, and the contradiction between historical accuracy and creative freedom, providing more reliable technical support for the digital dissemination of culture.

[0085] The key to this embodiment lies in the collaborative architecture between the dynamic narrative engine and the training platform.

[0086] System overall architecture design:

[0087] like Figure 2As shown in the embodiments of the present invention, the plot generation and training platform based on the dynamic narrative engine mainly includes four parts: a data acquisition and preprocessing layer, a dynamic narrative engine layer, a multimodal representation and rendering layer, and a training and optimization platform layer.

[0088] The data acquisition and preprocessing layer comprises a structured historical database, a semantic database, and a multimodal material library. The structured historical database stores historical events, relationship diagrams, and timelines that have been professionally reviewed by historians, forming the cornerstone of the system's historical accuracy. The semantic database is a structured semantic network that stores value keywords such as "dedication," "unity," and "fearlessness," along with their corresponding historical events and quotes. It acts as a "value filter" during plot generation, ensuring that the generated content does not deviate from the correct direction. The multimodal material library includes historical video footage, 3D model data of historical scenes, character voices, and environmental sound effects, providing material support for the audiovisual presentation of the plot.

[0089] The dynamic narrative engine layer is responsible for receiving user input and calculating the plot direction in real time. Internally, it includes event triggers, conditional judgment matrices, and non-linear flow controllers. Relying on a spatiotemporal constraint mechanism, the engine compares with a structured historical database at every stage of generation to ensure that the virtual plot does not deviate from the real historical framework.

[0090] The multimodal presentation and rendering layer includes an AR / VR rendering module and an emotion computing module. The AR / VR rendering module is responsible for dynamically calling resources from the multimodal asset library based on the plot instructions output by the engine, and rendering immersive historical scenes in real time. The emotion computing module monitors the player's operation data in real time, analyzes the player's emotional state, and passes the feedback to the dynamic narrative engine layer to adjust the narrative pace.

[0091] The training and optimization platform layer includes a virtual player simulator and a reinforcement learning model training module. The virtual player simulator uses algorithms to simulate virtual players with different decision-making preferences, stress-testing the generated storyline. The reinforcement learning model training module uses feedback data from both virtual and real players, employing a dual-guided reward function to iteratively optimize the narrative engine's algorithm.

[0092] Internal logic processing flow of the dynamic narrative engine:

[0093] like Figure 3 As shown, the internal logic processing flow of the dynamic narrative engine includes four steps: player behavior monitoring and sentiment analysis, spatiotemporal constraints and historical fact verification, parallel historical deduction calculation, and dynamic script generation and multimodal output.

[0094] In the player behavior monitoring and sentiment analysis step, the system captures the player's current behavior through a sentiment computing model, including explicit input and implicit data. The system sets a time window to calculate the player's average action interval and combines this with data such as click intensity to determine the player's emotional state.

[0095] In the spatiotemporal constraint and historical fact verification steps, after receiving the player's intention, the engine first enters the spatiotemporal constraint layer, queries the timestamp and geographical location of the current plot node, compares the historical logic through the condition judgment matrix, intercepts interactive intentions that do not conform to historical facts, and generates alternative options.

[0096] In the parallel historical deduction calculation step, the system calls the mental semantic library through the nonlinear process controller to analyze the value weight of the current branch, and calculates the impact of different decisions on virtual plot parameters in real time for non-critical historical nodes, generating multi-line branch plots.

[0097] In the dynamic script generation and multimodal output steps, the engine generates specific script text, scene instructions and NPC behavior data, uses a pre-trained large language model to fine-tune a version to generate character dialogues that conform to the characteristics of the times, and generates scene rendering instructions to send to the AR / VR scene rendering module.

[0098] Closed-loop optimization mechanism of the training platform:

[0099] like Figure 4 As shown, the training platform and model optimization logic include four stages: virtual sandbox simulation, logical loophole and value audit, reinforcement learning and model iteration, and real data feedback loop.

[0100] In the virtual sandbox simulation phase, a virtual player group simulator generates tens of thousands of virtual player agents, each assigned different personality parameters (such as recklessness and historical knowledge level). The simulator allows these agents to repeatedly play through the generated storyline, and the system statistically analyzes the success rate, selection rate, and points where players get stuck for each storyline branch.

[0101] In the logic vulnerability and value auditing stage, the system automatically analyzes and infers data to check for logical deadlocks or value deviations. If problems are found, they are marked as nodes to be repaired.

[0102] In the reinforcement learning and model iteration phase, the reinforcement learning model training module receives the audit results and constructs the reward function. .in It is the score of historical fit. It's a user experience score. , These are the corresponding weights. The system optimizes the parameters of the dynamic narrative engine through a policy gradient algorithm, maximizing user retention while ensuring historical accuracy.

[0103] In the closed-loop process of real data feedback, after the system goes online, it collects interaction logs from real players and regularly sends them back to the training platform for small-scale model fine-tuning, so as to achieve continuous evolution of the system.

[0104] Detailed implementation of the sentiment computing model:

[0105] In S200, the specific implementation of generating emotional state assessment results by calculating the player's operational behavior data within a preset time window using an emotion computing model is as follows:

[0106] S210 collects data on the player's mouse click frequency, task dwell time, and dialogue option hesitation time within a preset time window. The system uses tracking technology to record every mouse click event in real time, calculating the number of clicks per unit time to obtain mouse click frequency data; it records the duration from entering the task scene to completing the task or leaving the scene to obtain task dwell time data; and it records the interval between the appearance of a dialogue option and the player making a choice to obtain dialogue option hesitation time data.

[0107] S220: Input mouse click frequency data, task dwell time data, and dialogue option hesitation time data into the sentiment computing model, and calculate the sentiment entropy value through a weighted summation operation. The sentiment computing model assigns a corresponding weight coefficient to each behavioral data dimension, and then multiplies the normalized data of each dimension by the corresponding weight coefficient and sums them to obtain the comprehensive sentiment entropy value.

[0108] S230: Compare the emotional entropy value with a preset emotional threshold. The preset emotional threshold is determined based on statistical analysis of a large amount of player behavior data and is used to distinguish between a player's fluctuating and stable emotional states. If the emotional entropy value exceeds the preset emotional threshold, it indicates that the player's current emotional fluctuation is severe or their attention is distracted. The system generates a rhythm adjustment command and determines that the player is in a fluctuating emotional state. If the emotional entropy value does not exceed the preset emotional threshold, it indicates that the player's current emotional state is stable. The system generates a regular narrative command and determines that the player is in a stable state.

[0109] S240 outputs the rhythm adjustment command or regular narrative command and the emotional entropy value as the emotional state assessment result for subsequent steps to call.

[0110] In this embodiment, by integrating and calculating multi-dimensional data of player operation behavior, the abstract emotional state is transformed into a quantifiable emotional entropy value, avoiding the error caused by single-dimensional judgment. This allows for a more accurate capture of the player's true psychological state, providing reliable data support for the subsequent dynamic adjustment of narrative rhythm and scene rendering parameters. This makes the entire narrative experience more in line with the player's current psychological feelings and enhances the immersive experience.

[0111] Detailed implementation of the conditional judgment matrix:

[0112] In S300, the specific implementation of querying the structured historical database through a conditional judgment matrix to compare the spatiotemporal information of the current plot node with the player's interaction intent using historical logic is as follows:

[0113] S310 extracts historical event data, technological condition data, and character relationship graph data corresponding to the spatiotemporal information of the current plot node from the structured historical database. The structured historical database is indexed and organized according to a timeline and geographical coordinates, and the system quickly locates relevant historical records based on the timestamp and geographical location of the current plot node.

[0114] S320 parses player interaction intent into behavior data to be verified, compares the behavior data with historical event data using timestamps to verify whether the behavior occurred in the corresponding historical period; compares the behavior data with technical condition data for technical feasibility to verify whether the behavior was supported by the technical conditions at the time; and compares the behavior data with character relationship graph data for logical consistency to verify whether the behavior conforms to the character relationships and causal logic of the event at that time.

[0115] S330: If the timestamp comparison, technical feasibility comparison, and logical consistency comparison all pass, it is determined that the player's interaction intention is consistent with the historical facts under the current time and space, and a plot advancement permission signal is generated to allow the plot to continue to generate.

[0116] S340: If any of the timestamp comparison, technical feasibility comparison, or logical consistency comparison fails, the player's interaction intent is determined to be inconsistent with historical facts in the current time and space, and an interception signal is generated. The system retrieves historical behavior data that is similar to the behavior data to be verified from the structured historical database and generates alternative interaction options for the player to choose from.

[0117] In this embodiment, a rigid constraint is formed through multi-dimensional historical logic verification. Interactive choices that do not conform to historical facts are filtered out from three levels: time, technology, and causality. This not only safeguards the bottom line of historical authenticity but also does not completely restrict the player's reasonable exploration space, ensuring that the player's interactive experience always stays within a reasonable range that conforms to the historical framework.

[0118] Detailed implementation of the parallel history deduction algorithm:

[0119] In S400, the parallel history deduction algorithm is activated to calculate the impact of different decision paths on virtual story parameters based on player interaction intentions, generating multi-branch storylines. The specific implementation is as follows:

[0120] S410 marks the current story node as a non-critical historical node and extracts virtual story parameters associated with the current story node from the structured historical database. These virtual story parameters include morale parameters, resource inventory parameters, and NPC affinity parameters. These parameters are used to quantitatively describe the dynamic state of the story world.

[0121] S420 inputs the player's interaction intent into a non-linear flow controller. The non-linear flow controller calls a decision tree network, using the current story node as the root node and the decision options corresponding to the player's interaction intent as branch paths, to construct a parallel historical decision tree. Each node in the decision tree network is bound to a spatiotemporal label and a value weight label.

[0122] S430 calculates the numerical impact of decision options on morale, resource inventory, and NPC favorability parameters along each branch of the parallel historical decision tree. Based on a preset influence rule base, the system assigns corresponding increase / decrease values ​​to each decision option's parameters, generating multiple virtual storyline progression paths with updated parameters.

[0123] S440 inputs multiple virtual plot development paths into a pre-trained large language model, generating script text data, NPC dialogue data, and scene event data corresponding to each virtual plot development path. During the generation process, the large language model incorporates style templates from a semantic database to ensure that the generated content aligns with contemporary characteristics and value orientations. The script text data, NPC dialogue data, and scene event data are then combined to form a multi-branching plot.

[0124] In this embodiment, by dividing non-critical historical nodes, while adhering to the main storyline, a space for deduction is opened up for non-nodes. This not only maintains the rigor of the historical narrative, but also generates a rich variety of branching storylines through parametric deduction, effectively enhancing players' desire to explore and the replay value of the content.

[0125] Detailed implementation of the mental semantic library:

[0126] In S500, the specific implementation of calling the mental semantic library to calculate the semantic matching degree between the generated limited interactive plot or multi-branch plot and the preset value tags is as follows:

[0127] S510 extracts value-related keyword data, associated historical event data, and quotes from historical figures from the spiritual semantic database. The value-related keyword data includes keywords related to dedication, unity, patriotism, and teamwork. Each value-related keyword is associated with corresponding historical event data and quotes from historical figures, forming a structured semantic network.

[0128] S520 inputs the limited interactive plot or multi-branch plot into the semantic parsing unit to extract entity word data and sentiment word data from the plot text. The semantic parsing unit uses named entity recognition technology and sentiment analysis technology to identify entity words such as historical figures, places, and events, as well as sentiment words expressing emotional tendencies from the plot text.

[0129] S530 performs event matching between entity word data and associated historical event data to verify whether the historical events involved in the plot are consistent with the records in the semantic database; it also performs semantic similarity calculation between sentiment word data and value keyword data, and uses word vector similarity calculation method to generate semantic matching degree.

[0130] S540, determine whether the semantic matching degree is lower than the preset value threshold. If so, it indicates that the value orientation of the plot content is insufficient or biased. The system will embed the character's quote data into the plot text, adjust the emotional tone to an exciting or tragic tone, and call the speech style template corresponding to the value keyword data to replace the original speech style, generating the target plot after value verification.

[0131] In this embodiment, semantic similarity matching is used to automatically verify and adjust value orientation. Without the need for manual review of each branch of the plot, the bottom line of values ​​can be maintained while ensuring narrative diversity, so that the dissemination of culture can always maintain positive guidance in interactive scenarios.

[0132] Detailed implementation of dynamic story generation:

[0133] In S600, the specific implementation of inputting the target plot and emotional state evaluation results into the dynamic narrative engine to generate dynamic script text, NPC behavior logic data, and scene rendering instructions is as follows:

[0134] S610 inputs the target plot into the script generation unit of the dynamic narrative engine. The script generation unit calls a fine-tuned version of the pre-trained large language model and combines it with style template data from the semantic database to generate dynamic script text that conforms to the characteristics of the times. The fine-tuned version of the large language model is fine-tuned using vertical domain data such as historical documents and literary works on the basis of the general pre-trained model, so that the generated text has distinct characteristics of the times and correct value orientation.

[0135] S620: The emotional state assessment result is input into the rhythm mapping table. The rhythm mapping table stores the correspondence between emotional entropy value intervals and scene environment parameters, including light intensity parameters, weather type parameters, and sound effect volume parameters. Based on the emotional entropy value in the emotional state assessment result, the system queries the emotional entropy value interval to which it belongs and obtains the corresponding scene environment parameters.

[0136] S630, based on the emotional entropy value in the emotional state assessment result, queries the corresponding scene environment parameters from the rhythm mapping table, generates scene rendering instructions, and sends them to the AR / VR rendering module. The AR / VR rendering module dynamically adjusts the scene's lighting, weather, sound effects, and other environmental parameters according to the scene rendering instructions.

[0137] S640: Based on the NPC dialogue content in the dynamic script text, retrieve action sequence data and facial expression sequence data corresponding to the dialogue content from the preset NPC behavior database, and combine them into NPC behavior logic data. The NPC behavior database pre-stores the standard actions and facial expressions of NPCs in various dialogue scenarios to ensure the consistency and naturalness of NPC behavior.

[0138] In this embodiment, by dynamically adjusting scene environment parameters through emotional entropy mapping, the narrative rhythm can be adjusted in real time according to the player's current emotional state, allowing the player to have a more immersive interactive experience, avoiding the sense of being out of place caused by the mismatch between the narrative rhythm and the player's emotions, and further enhancing the emotional immersion effect in the interaction process.

[0139] Detailed implementation of the training platform:

[0140] Prior to S700, the approach also included deploying the dynamic narrative engine to the training platform for optimization, as detailed below:

[0141] The S710 deploys a dynamic narrative engine to a training platform that includes a virtual player community simulator and a reinforcement learning model training module.

[0142] The S720 generates multiple virtual player agents with different behavioral characteristic parameters through a virtual player group simulator. These parameters include recklessness, conservatism, and historical knowledge level. Based on statistical analysis of real player data, the virtual player group simulator constructs various typical player profiles and assigns corresponding behavioral characteristic parameters to each profile.

[0143] The S730 utilizes a virtual player agent to automatically traverse and interact with the story branches generated by the dynamic narrative engine, and collects data on branch selection rate, completion rate, and points of failure for each story branch. The system records the selection behavior, completion status, and logical blockage locations encountered by each virtual player agent in the story branches.

[0144] S740: Construct a dual-direction reward function, which includes a historical fit reward and a player retention rate reward. Input branch selection rate data, level completion rate data, and stuck point data into the dual-direction reward function to calculate the comprehensive reward value.

[0145] The S750 inputs the comprehensive reward value into the reinforcement learning model training module. It then optimizes the model parameters of the dynamic narrative engine using a policy gradient algorithm, generating an optimized dynamic narrative engine that replaces the trained one. The policy gradient algorithm adjusts the parameters of the event triggers, conditional decision matrices, and nonlinear flow controllers in the dynamic narrative engine based on the gradient direction of the comprehensive reward value, gradually bringing the engine's output closer to the optimal solution.

[0146] In this embodiment, the automated testing and parameter iteration of all story branches are completed through a virtual player group simulator. This not only solves the problem that manual testing is difficult to cover all multi-line branches, but also allows for the early detection of issues such as logical deadlocks and historical inaccuracies. Furthermore, with player retention as the optimization goal, multiple rounds of iterative optimization are completed before the model goes live, effectively improving the actual performance of the system after it goes live.

[0147] In some embodiments, S740, constructing the dual-guided reward function includes:

[0148] S741, obtain the historical fit reward from the historical fit evaluation unit. The historical fit reward is obtained by comparing the event sequence and time nodes of the plot path generated by the virtual player agent with the standard historical path in the structured historical database. The system uses a sequence alignment algorithm to calculate the similarity between the two paths in terms of event sequence and time nodes, which is used as the historical fit reward.

[0149] S742, obtain player retention rate reward items from the user experience evaluation unit. Player retention rate reward items are obtained by statistically analyzing the average dwell time of the virtual player agent in the story branches and the story coherence score data. The story coherence score is automatically evaluated by the virtual player agent based on factors such as the smoothness of the story logic and the rationality of the choices.

[0150] S743 multiplies the historical fit reward by a first weighting coefficient and the player retention rate reward by a second weighting coefficient. The two products are then added together to generate a comprehensive reward value. The first and second weighting coefficients are dynamically adjusted according to the system's optimization goals to maximize user experience while ensuring historical accuracy.

[0151] In this embodiment, through dual-guided weighted calculation, the optimization of the dynamic narrative engine takes into account both historical authenticity and user interaction experience. It neither relaxes the constraints on historical facts for the sake of experience, nor sacrifices the player's exploration fun in order to adhere to historical facts, thus achieving a balance between the seriousness of historical dissemination and interactive fun.

[0152] This invention also provides a multi-line plot generation system based on a dynamic narrative engine, comprising:

[0153] At least one processor;

[0154] At least one memory for storing at least one program;

[0155] When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.

[0156] It is evident that the content of the above method embodiments is applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0157] This invention also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0158] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0159] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0160] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0161] This invention also provides a computer program product, including a computer program or computer instructions, which are stored in a memory. A processor of a computer device reads the computer program or computer instructions from the memory and executes the computer program or computer instructions, causing the computer device to perform the above-described method.

[0162] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0163] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0164] It will be understood by those skilled in the art that all or some of the steps and systems in the methods disclosed above can be implemented as software, firmware, hardware, and suitable combinations thereof. Some or all of the physical components can be implemented as software executed by a processor, such as a central processing unit, digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit. Such software can be distributed on a computer-readable medium, which can include computer storage media (or non-transitory media) and communication media (or transient media). As is known to those skilled in the art, the term computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media includes, but is not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical disc storage, magnetic cartridges, magnetic tape, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and is accessible to a computer. Furthermore, as is known to those skilled in the art, communication media typically include computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

[0165] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

Claims

1. A method for generating multi-line storylines based on a dynamic narrative engine, characterized in that, The method includes the following steps: S100: Acquire player interaction data, spatiotemporal information of the current plot node, structured historical database, mental semantic database, and trained dynamic narrative engine. The dynamic narrative engine includes event triggers, condition judgment matrix, and nonlinear flow controller. S200, input the player interaction data into the dynamic narrative engine, analyze the player's interaction intent through the event trigger, calculate the player's operational behavior data within a preset time window through the emotion computing model, and generate an emotion state evaluation result; S300: Query the structured historical database through the condition judgment matrix, compare the spatiotemporal information of the current plot node with the player's interaction intention according to historical logic, and determine whether the player's interaction intention conforms to the historical facts under the current time and space. If it does not conform, intercept the player's interaction intention and generate an alternative interaction option that conforms to historical facts. If it does conform, proceed to S400. S400, determine whether the current plot node is a key historical node. If so, lock the plot direction through the nonlinear process controller and generate a limited interactive plot based on the structured historical database. Otherwise, start the parallel historical deduction algorithm, calculate the impact of different decision paths on virtual plot parameters based on the player's interaction intention, and generate multi-branch plots. S500, call the mental semantic library, calculate the semantic matching degree between the generated limited interactive plot or the multi-branch plot and the preset value tag, adjust the emotional tone and dialogue style of the plot according to the semantic matching degree, and output the target plot after value verification. S600, input the target plot and the emotional state evaluation results into the dynamic narrative engine to generate dynamic script text, NPC behavior logic data and scene rendering instructions, and output an immersive scene through the AR / VR rendering module; S700 tracks and records the key decision sequences of players during the storyline and the personalized storyline data generated by the dynamic narrative engine. It then packages the key decision sequences and the personalized storyline data and uses blockchain technology to generate a unique memoir NFT.

2. The method according to claim 1, characterized in that, In S200, the step of calculating the player's operational behavior data within a preset time window using an emotion computing model to generate an emotion state assessment result includes: S210, Collect data on the player's mouse click frequency, task dwell time, and dialogue option hesitation time within the preset time window; S220, input the mouse click frequency data, the task dwell time data, and the dialogue option hesitation time data into the sentiment calculation model, and calculate the sentiment entropy value through weighted summation; S230, compare the emotional entropy value with a preset emotional threshold. If the emotional entropy value exceeds the preset emotional threshold, generate a rhythm adjustment instruction and determine that the player is in an emotional fluctuation state. If the emotional entropy value does not exceed the preset emotional threshold, generate a normal narrative instruction and determine that the player is in a stable state. S240, output the rhythm adjustment instruction or the regular narrative instruction and the emotional entropy value as the emotional state assessment result.

3. The method according to claim 1, characterized in that, In S300, the step of querying the structured historical database through the conditional judgment matrix, comparing the spatiotemporal information of the current plot node with the player's interaction intent using historical logic, and determining whether the player's interaction intent conforms to the historical facts of the current spatiotemporal context includes: S310, extract historical event data, technical condition data, and character relationship graph data corresponding to the spatiotemporal information of the current plot node from the structured historical database; S320, the player's interaction intent is parsed into behavior data to be verified, the behavior data to be verified is compared with the historical event data by timestamp, the behavior data to be verified is compared with the technical condition data by technical feasibility, and the behavior data to be verified is compared with the character relationship graph data by logical consistency. S330, if the timestamp comparison, the technical feasibility comparison, and the logical consistency comparison all pass, then it is determined that the player's interaction intention conforms to the historical facts under the current time and space, and a plot advancement permission signal is generated; S340, if any of the timestamp comparison, the technical feasibility comparison, or the logical consistency comparison fails, it is determined that the player's interaction intention does not conform to the historical facts under the current time and space, an interception signal is generated, and historical behavior data that is similar to the behavior data to be verified and conforms to historical facts is retrieved from the structured historical database to generate the alternative interaction option.

4. The method according to claim 1, characterized in that, In S400, the activation of the parallel history deduction algorithm calculates the impact of different decision paths on virtual story parameters based on the player's interaction intent, generating multi-branch storylines, including: S410, mark the current plot node as a non-critical historical node, and extract virtual plot parameters associated with the current plot node from the structured historical database. The virtual plot parameters include morale parameters, resource inventory parameters, and NPC favorability parameters. S420, The player's interaction intent is input into the non-linear flow controller. The non-linear flow controller calls the decision tree network, with the current plot node as the root node and the decision options corresponding to the player's interaction intent as branch paths, to construct a parallel historical decision tree. S430, along each branch path of the parallel historical decision tree, calculate the numerical impact of the decision option on the morale parameter, the material inventory parameter, and the NPC favorability parameter, and generate multiple virtual plot deduction paths after parameter updates; S440, input the multiple virtual plot deduction paths into the pre-trained large language model respectively, generate script text data, NPC dialogue data and scene event data corresponding to each virtual plot deduction path, and combine the script text data, the NPC dialogue data and the scene event data into the multi-branch plot.

5. The method according to claim 1, characterized in that, In S500, the step of calling the mental semantic database, calculating the semantic matching degree between the generated limited interactive plot or the multi-branch plot and the preset value tags, and adjusting the emotional tone and dialogue style of the plot according to the semantic matching degree includes: S510, extract value keyword data, associated historical event data, and quotes from the spiritual semantic database. The value keyword data includes keywords such as dedication, unity, patriotism, and team. S520, input the limited interactive plot or the multi-branch plot into the semantic parsing unit to extract entity word data and sentiment word data from the plot text; S530, perform event matching between the entity word data and the associated historical event data, and calculate the semantic similarity between the sentiment word data and the value keyword data to generate the semantic matching degree; S540, determine whether the semantic matching degree is lower than the preset value threshold. If so, embed the character quote data into the plot text, adjust the emotional tone to an exciting tone or a tragic tone, and call the speech style template corresponding to the value keyword data to replace the original speech style, and generate the target plot after value verification.

6. The method according to claim 1, characterized in that, In S600, the step of inputting the target plot and the emotional state evaluation result into the dynamic narrative engine to generate dynamic script text, NPC behavior logic data, and scene rendering instructions includes: S610, The target plot is input into the script generation unit of the dynamic narrative engine. The script generation unit calls a fine-tuned version of the pre-trained large language model and combines it with the style template data in the mental semantic library to generate the dynamic script text that conforms to the characteristics of the times. S620, the emotional state assessment result is input into the rhythm mapping table, which stores the correspondence between the emotional entropy value range and the scene environment parameters, including the light intensity parameter, the weather type parameter, and the sound effect volume parameter. S630, based on the emotional entropy value in the emotional state assessment result, query the corresponding scene environment parameters from the rhythm mapping table, generate the scene rendering instruction and send it to the AR / VR rendering module; S640, based on the NPC dialogue content in the dynamic script text, retrieve the action sequence data and facial expression sequence data corresponding to the dialogue content from the preset NPC behavior database, and combine them into the NPC behavior logic data.

7. The method according to claim 1, characterized in that, Prior to S700, the method further included: S710, the dynamic narrative engine is deployed to the training platform, which includes a virtual player group simulator and a reinforcement learning model training module; S720, Multiple virtual player agents with different behavioral characteristic parameters are generated through the virtual player group simulator. The behavioral characteristic parameters include recklessness parameter, conservative parameter, and historical knowledge level parameter. S730, the virtual player agent is used to automatically traverse and interact with the plot branches generated by the dynamic narrative engine, and the branch selection rate data, completion rate data and dead point data of each plot branch are statistically analyzed; S740, construct a dual-direction reward function, which includes a historical fit reward item and a player retention rate reward item. Input the branch selection rate data, the level completion rate data, and the dead point data into the dual-direction reward function to calculate the comprehensive reward value. S750, the comprehensive reward value is input into the reinforcement learning model training module, the model parameters of the dynamic narrative engine are optimized through the policy gradient algorithm, the optimized dynamic narrative engine is generated, and the trained dynamic narrative engine is replaced.

8. The method according to claim 7, characterized in that, In S740, the construction of the dual-guided reward function includes: S741, Obtain the historical fit reward item from the historical fit evaluation unit. The historical fit reward item is obtained by comparing the event sequence and time node of the plot path generated by the virtual player agent with the standard historical path in the structured historical database. S742, Obtain the player retention rate reward item from the user experience evaluation unit. The player retention rate reward item is obtained by statistically analyzing the average dwell time data of the virtual player Agent in the story branches and the story coherence score data. S743, multiply the historical fit reward item by the first weighting coefficient, multiply the player retention rate reward item by the second weighting coefficient, add the two product results to generate the comprehensive reward value.

9. A multi-line plot generation system based on a dynamic narrative engine, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method as described in any one of claims 1 to 8.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 8.