A game engine implementation method fusing a large language model and a generative AI

CN122582592APending Publication Date: 2026-08-18CHENGDU YIMOXUAN NETWORK TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610781825.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-02
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0007]本发明的目的在于提供一种融合大语言模型与生成式AI的游戏引擎实现方法,解决了传统游戏工业化管线中设计意图与逻辑实现存在转换鸿沟、非玩家角色行为模式固化且数值控制与叙事表现相互耦合、多系统规则缺乏统一验证机制、以及游戏测试与设计执行严重脱节并无自我进化闭环的技术问题

Benefits of technology

本发明通过将世界规则构建、怪物状态机生成、非玩家角色行为模拟以及端到端测试深度整合为相互衔接的自动化链路,从根本上打破了传统游戏开发中文本设计、逻辑编译、运行模拟与测试验收彼此割裂的局面。利用多智能体协同的事件总线架构和检索增强生成技术,本发明实现了经济、社会、生态等系统的联动模拟与参数自动平衡校验,使游戏世界各维度规则在生成之初即具备内在的一致性,显著降低了后期手工配表导致的数值崩溃风险。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122582592A_ABST
    Figure CN122582592A_ABST
Patent Text Reader

Abstract

The application relates to the field of game artificial intelligence and software automation engineering, and discloses a game engine implementation method fusing a large language model and a generative AI. The method solves problems such as the fragmentation of design, compilation and testing in traditional development, the single behavior of non-player characters and the lack of closed-loop feedback in testing. The method comprises the following steps: instantiating a multi-agent generated world rule and verifying economic balance; receiving multi-modal data, generating a monster state machine through a two-stage large language model and performing multi-layer topological verification; evaluating the goals of non-player characters in multiple levels of priority in runtime, and adopting a separate large language model to realize the isolation of narration and numerical physics; testing agents to analyze requirements and generate use cases, performing exploration through memory awareness, aggregating behavior trajectories into semantic events and crystallizing them into experience to be stored in an experience library, and forming a dynamic knowledge backflow closed loop. The method improves the automation degree, logic reliability and testing efficiency of game development.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of game artificial intelligence and software automation engineering, specifically to a method for implementing a game engine that integrates large language models and generative AI. Background Technology

[0002] In the traditional industrial development pipeline of games, the design of game world rules, the writing of the behavior state machine logic of non-player characters (NPCs) or monsters, runtime behavior simulation, and quality assurance testing are all separate and independent workflows.

[0003] The design and scripting of monster AI state machines heavily rely on the natural language descriptions provided by game designers and the manual code translation by developers. Complex boss monster state machines often contain dozens of decision nodes and hundreds of transition condition edges. Manual configuration is time-consuming and cannot avoid logical errors such as priority conflicts and infinite loops. Existing visual state machine editors have failed to fundamentally solve the problem of automatic conversion from natural language to executable logic.

[0004] NPC behavior patterns are rigid, and numerical control and narrative expression are intertwined. Traditional NPCs are mostly based on pre-set finite state machines or decision trees, with simple behavior patterns and no adaptive response to dynamically changing game world states and complex social networks. If a large language model is introduced to directly drive NPC behavior simulation, the "illusion" of the large language model will pollute the core numerical system of the game, such as fabricating item names not registered in the database or giving numerical changes that exceed the balance framework.

[0005] The design of world rules, user interface (UI) layout, and generation of underlying configuration files lack unified system constraints. Economic, social, and ecosystem systems are mostly derived manually based on tables, which cannot be verified in a large-scale concurrent environment, making the later values ​​extremely prone to collapse; UI design relies on manual pixel-level alignment and fails to model visual hierarchy constraints as a mathematical problem that can be solved by machines.

[0006] There is a serious disconnect between game test design and test execution. Automated testing often remains at the level of coordinate clicking and recording playback, lacking the ability to understand the rules and constraints in the game design documents, as well as environmental awareness and semantic reasoning capabilities. The experiences of blockages and failures generated during testing cannot be automatically extracted into structured knowledge, and the system lacks a closed-loop feedback path for continuous evolution. Summary of the Invention

[0007] The purpose of this invention is to provide a method for implementing a game engine that integrates large language models and generative AI, which solves the technical problems in the traditional game industrialization pipeline, such as the gap between design intent and logical implementation, the solidification of non-player character behavior patterns and the coupling between numerical control and narrative performance, the lack of a unified verification mechanism for multi-system rules, and the serious disconnect between game testing and design execution without a self-evolutionary closed loop.

[0008] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A method for implementing a game engine that integrates large language models and generative AI includes the following steps: Step 1: Instantiate multiple system-level intelligent agents, receive the world view basic setting document and the core gameplay definition document, generate the world rule document, and verify the balance of the economic system through the built-in economic balance simulator; Step 2: Receive the multimodal input data matrix, execute the two-stage large language model pipeline to output the target monster's state machine data, perform multi-layer post-processing verification on the state machine data including priority absolute constraints and loop deadlock breaking, and convert it into a state machine script file; Step 3: In the simulated time step, the action target of the non-player character is evaluated according to the multi-level priority one-way blocking evaluation system. The narrative text is generated by calling the large language model with the first specific creative temperature parameter. The narrative text is input into the absolute dictionary and the large language model with the second specific creative temperature parameter is used to extract the structured numerical changes and write them into the database. The second specific creative temperature parameter is always zero and lower than the first specific creative temperature parameter. Step 4: Analyze the heterogeneous test requirements materials to construct a structured test context object, generate structured test cases, instantiate an automatic play agent to read the memory state pointer of the test environment and decide the next operation based on the large language model, compare the memory state changes with the expected results, aggregate and extract the continuous execution trajectory into semantic events and crystallize them into structured experience entities, write them into the experience storage module, and feed the structured experience entities back into the operation decision prompt information.

[0009] Furthermore, step 1 also includes a user interface generation step, which extracts the element nodes that must be presented, defines the two-dimensional canvas of the interface as a coordinate system, and uses a constraint satisfaction problem solver to establish a set of mathematical constraints including element overlap penalty constraints, visual hierarchy constraints, edge snapping constraints, and screen aspect ratio adaptive constraints. The optimal component anchor point coordinate array and scaling factor array are solved by simulated annealing algorithm.

[0010] Furthermore, the built-in economic equilibrium simulator in step 1 uses the following inflation rate verification formula to verify the equilibrium of the economic system: In the formula, This represents a scalar measure of the global inflation rate. This represents a scalar indicating the total number of different types of goods circulating within the system. Indicates the first The current floating-point price per unit of the item. Indicates the first The total circulation quantity of this type of item in the system is scalar. This represents the current system's total currency pool constant; when When the value deviates from the preset standard tolerance threshold, a parameter callback function is triggered to lower the base drop rate or increase the system recycling tax rate parameter, until... Return to the standard tolerance range.

[0011] Furthermore, the multimodal input data matrix in step 2 includes combat video files; the combat video files are cut and extracted according to a preset global physical sampling rate to obtain an image array. When the length of the image array exceeds a preset upper limit threshold parameter, a forced truncation and discard mechanism is triggered, and the remaining image array is converted into a multidimensional floating-point tensor matrix by an image encoder and input into the large language model visual processing module.

[0012] Furthermore, step 2, which involves executing the two-stage large language model pipeline, specifically includes: Input the multimodal input data matrix into the first-stage large language model pipeline and output a structured combat behavior design document data block containing the set of available skill identifiers, the trigger health percentage threshold conditions for different combat stages, and the random number weight probability allocation interval for skill triggering. Forcefully inject the engine function library summary data dictionary into the prompt text of the second-stage large language model pipeline, and input the structured combat behavior design document data block into the second-stage large language model pipeline to generate state machine data that conforms to the forced hierarchical architecture rules.

[0013] Furthermore, the mandatory layered architecture rule stipulates that the monster's state machine is physically isolated into a single logic layer and multiple parallel execution layers; the logic layer is prohibited from containing any execution function calls that cause spatial displacement or play attack animations. The logic layer calls a specific execution layer through a scheduling pointer function based on distance conditions or health conditions, and the specific execution layer executes specific entity action function instructions.

[0014] Furthermore, step 2 involves performing multi-layered post-processing verification steps on the state machine data, including priority absolute constraints and cyclic deadlock breaking, specifically including: The execution logic layer structure verification mechanism scans the graph structure to verify the existence of isolated nodes and the legality of their connecting edges. If any are missing, a self-healing procedure is initiated to fill in the connecting edges. A general format repair mechanism is executed to check whether an update node for the type of waiting animation to end is missing after a spatial displacement type node. If it is missing, an update node for the type of waiting animation to end is forcibly inserted. The inter-layer isolation physical verification mechanism is executed. If a combat release type entity function is detected inside the logic layer, a node replacement and stripping operation is performed to downgrade and replace the combat release type entity function with a scheduling jump node. The execution priority absolute constraint mechanism is used. If a high-priority outgoing edge is found to have a missing condition Boolean expression, the priority scalar of the high-priority outgoing edge is forcibly downgraded to the lowest value and used as a fallback outgoing edge. Execute a loop deadlock breaking mechanism, calculate and compare the priority weight of the hit count counter reset node with the priority weight of the hit stun trigger condition edge. If a weight inversion occurs, resulting in an infinite loop, physically swap the priority scalar values ​​of the hit count counter reset node and the hit stun trigger condition edge. A multi-target disaster defense mechanism is implemented to detect whether multiple unconditional null pointers point to different execution layer stack starting points simultaneously. If such a mechanism is found, a redirection and merging operation is performed.

[0015] Furthermore, the multi-level priority unidirectional blocking assessment system in step 3 is arranged in order of priority from high to low, including the first level physiological baseline level, the second level core obsession level, the third level environmental threat level, the fourth level personality weighted level, and the fifth level daily idle level. Once the triggering condition of a high-level priority dimension is detected, the judgment logic of all subsequent low-level priority dimensions is immediately frozen, and the current execution instruction register of the non-player character is overwritten as the function node corresponding to the high-level priority dimension.

[0016] Among them, the fourth level of personality weighting level is entered only when the non-player character is in a safe state where none of the first, second and third levels have been triggered, and the candidate behavior score is calculated using the following formula: In the formula, Represents the calculated candidate behavior score scalar, and represents the underlying bias constant of the candidate behavior. This represents the constant representing the total number of decision dimensions used to define non-player character traits. This indicates that the non-player character is in the... Personality weight constants for each decision-making dimension Indicates the current interaction object is in the [number]th position. The attribute evaluation values ​​for each decision dimension are floating-point numbers; the non-player character selects and returns, making... The method pointer corresponding to the candidate behavior with the largest numerical value.

[0017] Furthermore, step 3, which involves injecting the narrative text input into an absolute dictionary and extracting structured numerical variations from a large language model carrying a second specific creative temperature parameter, includes: Extract the list of valid item identifiers, equipment configuration table, and character relationship state machine enumeration table from the current in-game database and combine them into an absolute dictionary; Input a first specific creative temperature parameter into a large language model with absolute dictionary boundaries to generate a multi-segment string, and restrict the output of the large language model to only contain numbers and structured key-value pairs containing the names of registered dictionaries in the absolute dictionary, thereby achieving physical isolation between the text rendering of non-player characters and the underlying numerical state replication.

[0018] Furthermore, step 4, which involves parsing heterogeneous test requirement materials to construct a structured test context object, includes: The uncertainty detection module was used to cross-compare the business process state machine extracted from the game design document, the suspected correlations extracted from the numerical configuration table, and the visual entry bounding box coordinates extracted from the user interface screenshots. When an abnormal boundary condition is missing, a data table relationship is broken, or an interaction entry point is not defined, an uncertainty report document is generated, the automated process is interrupted, and a human tester is forced to input supplementary information strings to fill the gaps, and the global structured test context object is obtained.

[0019] Furthermore, in step 4, the structured test cases are output in a structured object format. The structured test cases are required to include the name of the test function module, the test case title, the list of prerequisite state conditions, the trigger entry method, the linear test step array, the expected memory result comparison value, the failure judgment Boolean logic tree, and the key-value pair fields of the exception record output template.

[0020] Furthermore, step 4, which involves instantiating the automated play agent, reading the memory state pointer of the test environment, and deciding on the next operation based on the large language model, includes the following steps: The automated gameplay agent reads the character's 3D spatial coordinates (floating-point numbers), the current backpack array length, and the surrounding entity list dictionary from the game engine's underlying layer; it then merges the test target, the current game memory state dictionary, and the historical experience context pulled from the experience storage module into operation decision prompts. The large language model processes the operation decision prompt information and returns the next operation instruction identifier. The tool definition provider module maps the next operation instruction identifier to a remote procedure call execution function inside the game engine to trigger physical operations.

[0021] Furthermore, step 4, which involves aggregating and extracting continuous execution trajectories into semantic events and crystallizing them into structured experiential entities, includes: The single-step physical behavior logs are aggregated and packaged into action fragment objects based on time series, and multiple action fragment objects are merged into an intent group object according to semantic intent type; Extract user interface panel state switching events, task node progress events, and exception events thrown by underlying utility functions from the intent group object and combine them into a semantic event set; The pattern detector is used to start regular expression matching to find duplicate error totems in the semantic event set. After removing low-quality patterns, the high-confidence patterns are sent to the large language model to be transformed into structured experience entities. After hash deduplication, they are written to the experience storage module.

[0022] Furthermore, step 4 also includes a manual correction learning circuit breaker mechanism: When the automated play agent fails to update the task progress steps within the specified timestamp difference, it is determined that the automated play agent is in an execution dilemma; Record a complete memory snapshot and decision context of the frame before the automatically playing agent loses control, record the queue of correction operation instructions during manual takeover and the memory results after recovery, compare the differences between the complete memory snapshot of the frame before loss of control and the memory results after recovery, and generate structured experience entities with specific manual correction labels to be appended to the experience storage module.

[0023] Furthermore, this invention also discloses an intelligent game content generation and development platform based on the collaboration of a localized large model and multimodal AI, used to execute the game engine implementation method described above, which integrates a large language model and generative AI, including: The World System Engine module is used to instantiate multiple system-level intelligent agents, receive the world view basic setting document and the core gameplay definition document, generate the world rule document, and verify the balance of the economic system through the built-in economic balance simulator. It is also used to extract the element nodes that must be presented, establish a set of mathematical constraints using the constraint satisfaction problem solver, and solve the optimal component anchor point coordinate array and scaling coefficient array to generate the user interface layout configuration file. The combat and behavior logic configuration engine module is used to receive multimodal input data matrix, execute the two-stage large language model pipeline to output the state machine data of the target monster, perform multi-layer post-processing verification on the state machine data including priority absolute constraints and loop deadlock breaking, and convert it into a state machine script file; The runtime non-player character simulation module is used to evaluate the action goals of non-player characters according to a multi-level priority one-way blocking evaluation system during the simulation time step. It calls the large language model with the first specific creative temperature parameter to generate narrative text, and injects the narrative text into the absolute dictionary and the large language model with the second specific creative temperature parameter to extract structured numerical changes and write them into the database. The second specific creative temperature parameter is always zero and lower than the first specific creative temperature parameter. The game testing and feedback engine module is used to parse heterogeneous test requirements materials to construct structured test context objects, generate structured test cases, instantiate an automated play agent, read the memory state pointer of the test environment, and decide the next operation based on a large language model. It compares memory state changes with expected results, aggregates and extracts continuous execution trajectories into semantic events, crystallizes them into structured experience entities, writes them into the experience storage module, and feeds back the structured experience entities to the operation decision prompt information. It also includes a manual correction learning circuit breaker mechanism. When the automated play agent fails to update the task progress within a specified timestamp difference, it records a memory snapshot, receives manual takeover correction operations, generates structured experience entities with manual correction tags, and appends them to the experience storage module.

[0024] Furthermore, after the step of feeding back structured experience entities to operational decision-making prompts, the test and feedback engine executes the state machine topology self-evolution step: When the label of a newly added structured experience entity in the experience storage module is determined to be of the logic blind zone escape type, the test and feedback engine extracts the physical coordinate sequence that triggers the logic blind zone escape, and calculates the spatial bounding box matrix and imbalance state parameters corresponding to the physical coordinate sequence. The spatial bounding box matrix and the unbalanced state parameters are input as hard constraints into the combat and behavior logic configuration engine. The combat and behavior logic configuration engine generates new execution layer nodes with compensating attack actions and new conditional jump edges connecting the main loop entry of the logic layer and the new execution layer nodes on the original state machine diagram structure. The post-processing verification module performs incremental topology verification on the updated state machine graph data with newly added execution layer nodes and new conditional jump edges. After determining that the incremental topology verification is passed, the updated state machine graph data is injected into the running server memory, and hot update of the finite state machine logic pointer is implemented.

[0025] Furthermore, in the step of extracting and calculating the physical coordinate sequence that triggers logic blind zone escape, a judgment formula is used to identify the logic blind zone escape type: In the formula, The scalar representing the imbalance of adversarial gains within the time integration window. and These represent the start and end timestamps of the continuous execution trajectory recorded by the structured experience entity, respectively. Indicates a point in time The damage output by the virtual player agent. This indicates the damage dealt to the target monster at a given time. This represents the damage weighting constant for virtual players. This represents the target monster damage weighting constant; When within the time integration window, it satisfies and the branch instruction for the main loop of the logical layer of the target monster has not been triggered to enter the attack execution layer at all, it is determined that the label of the structured experience entity is of the logical blind spot escape type, where represents the escape determination boundary scalar; The spatial bounding box matrix corresponding to the physical coordinate sequence is obtained by using the covariance matrix: In the formula, represents the total number of discrete sampling points of the physical coordinate sequence scalar, represents the th three-dimensional position column vector of the sampling point, represents the spatial centroid vector of all sampling points.

[0026] Compared with the prior art, the present invention has the following beneficial effects: By deeply integrating world rule construction, monster state machine generation, non-player character behavior simulation, and end-to-end testing into an interconnected automated link, the present invention fundamentally breaks the situation where text design, logic compilation, runtime simulation, and test acceptance are separated from each other in traditional game development. Utilizing the event bus architecture of multi-agent collaboration and retrieval-augmented generation technology, the present invention realizes the linkage simulation of systems such as economy, society, and ecology and the automatic balance verification of parameters, enabling the rules of all dimensions of the game world to have inherent consistency at the beginning of generation, significantly reducing the risk of numerical crashes caused by manual table configuration in the later stage.

[0027] In terms of dynamic interaction content, through multi-modal input and a two-stage large language model pipeline, the natural language description is deterministically transformed into a monster state machine script that complies with the mandatory hierarchical architecture, and multiple layers of post-processing topology verification are superimposed, completely eliminating the priority conflicts and cyclic deadlocks in the generation logic, and greatly improving the compilation passing rate of the executable script.

[0028] For non-player characters, the multi-level priority one-way blocking evaluation system and the dual-temperature large language model call mechanism that completely separates narrative values not only ensure the rich literary expressiveness of character behavior but also fundamentally prevent the contamination of the core numerical system by language model hallucinations, enhancing the security of runtime data. In addition, the test agent directly perceives the game memory state and explores based on semantic understanding, aggregates the execution trajectory into structured experience and flows back to the design end and the execution end, forming a closed loop of continuous self-improvement of test case generation and execution efficiency, effectively improving the coverage depth of test scenarios and the effectiveness of automated testing. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained from these drawings without creative effort.

[0030] Figure 1 This is a flowchart of the method of the present invention.

[0031] Figure 2 This is a flowchart of the user interface generation steps of the present invention.

[0032] Figure 3 This is a flowchart illustrating the execution of the two-stage large language model pipeline in this invention.

[0033] Figure 4 This is a flowchart illustrating the multi-layered post-processing verification of state machine data, including priority absolute constraints and loop deadlock breaking, as per the present invention.

[0034] Figure 5 This is a flowchart illustrating how the present invention aggregates and extracts continuous execution trajectories into semantic events and crystallizes them into structured experiential entities.

[0035] Figure 6 This invention provides a flowchart of the state machine topology self-evolution steps performed by the test and feedback engine. Detailed Implementation

[0036] In the following description, only certain exemplary embodiments are briefly described. As those skilled in the art will recognize, the described embodiments can be modified in various ways without departing from the spirit or scope of the embodiments of the invention. Therefore, the drawings and description are considered to be exemplary in nature and not restrictive.

[0037] The following is in conjunction with the appendix Figures 1-6 The embodiments of the present invention will be described in detail below.

[0038] Example 1: This example discloses an intelligent game content generation and development platform based on localized large-scale models and multimodal AI collaboration, including: The World System Engine module is used to instantiate multiple system-level intelligent agents, receive the world view basic setting document and the core gameplay definition document, generate the world rule document, and verify the balance of the economic system through the built-in economic balance simulator. It is also used to extract the element nodes that must be presented, establish a set of mathematical constraints using the constraint satisfaction problem solver, and solve the optimal component anchor point coordinate array and scaling coefficient array to generate the user interface layout configuration file. The combat and behavior logic configuration engine module is used to receive multimodal input data matrix, execute the two-stage large language model pipeline to output the state machine data of the target monster, perform multi-layer post-processing verification on the state machine data including priority absolute constraints and loop deadlock breaking, and convert it into a state machine script file; The runtime non-player character simulation module is used to evaluate the action goals of non-player characters according to a multi-level priority one-way blocking evaluation system during the simulation time step. It calls the large language model with the first specific creative temperature parameter to generate narrative text, and injects the narrative text into the absolute dictionary and the large language model with the second specific creative temperature parameter to extract structured numerical changes and write them into the database. The second specific creative temperature parameter is always zero and lower than the first specific creative temperature parameter. The game testing and feedback engine module is used to parse heterogeneous test requirements materials to construct structured test context objects, generate structured test cases, instantiate an automated play agent, read the memory state pointer of the test environment, and decide the next operation based on a large language model. It compares memory state changes with expected results, aggregates and extracts continuous execution trajectories into semantic events, crystallizes them into structured experience entities, writes them into the experience storage module, and feeds back the structured experience entities to the operation decision prompt information. It also includes a manual correction learning circuit breaker mechanism. When the automated play agent fails to update the task progress within a specified timestamp difference, it records a memory snapshot, receives manual takeover correction operations, generates structured experience entities with manual correction tags, and appends them to the experience storage module.

[0039] This embodiment also discloses a top-level framework for a game engine implementation method that integrates large language models and generative AI, as well as an automatic generation mechanism for static content (worldview, narrative, user interface).

[0040] Specifically as follows: The system is built on the foundation of Multi-Agent Collaboration and Retrieval Enhanced Generation (RAG) technologies, and includes four interconnected core engine layers: World System Engine, Story Generation and Configuration Engine, Combat and Behavior Logic Configuration Engine, and User Interface Design Engine.

[0041] Step 101: Start the world system engine and initialize world rules.

[0042] The World System Engine is the underlying control center of the system, responsible for the automated construction of the overall operational logic of the game world and the simulation of the world. The World System Engine instantiates four parallel-running system-level intelligent agents: the World Rule Intelligent Agent, the Economic System Intelligent Agent, the Social System Intelligent Agent, and the Ecosystem Intelligent Agent. The four system-level intelligent agents synchronize their state data through a uniformly configured asynchronous event bus (EventBus).

[0043] The world rule agent receives the input worldview foundation setting document and core gameplay definition document, activates the retrieval enhancement generation module to extract key rule parameters, and automatically generates the world rule document. The world rule document is physically stored as a structured domain-specific language (DSL) script. The DSL script explicitly defines a time system module (including the day-night cycle logic frame length and seasonal change trigger thresholds) and a spatial system module (including the ground...). Figure 3 (Dimensional bounding box partitioning, portal connection of undirected graph relationships), physical rules module (including configuration of gravitational acceleration constant and setting of collision body hierarchy matrix).

[0044] Step 102: Multi-agent simulation and equilibrium verification of economic, social and ecological systems; Based on the economic model type identifier (e.g., "open market economy") input by the system, the economic system intelligent agent generates a monetary system definition form, a floating-point model of the basic value of goods, and a production-consumption link node diagram.

[0045] To ensure the generated economic system does not experience systemic collapse, the economic system agent activates a built-in economic equilibrium simulator. The economic equilibrium simulator employs Agent-Based Modeling (ABM) technology, instantiating at least 100,000 micro-level virtual player agents. Each micro-level virtual player agent is assigned a set of consumption propensity parameters. and production capacity parameters ,in To follow a normal distribution The random sampled value represents the agent. The intensity of purchase intention, To follow a normal distribution The random sampled value represents the agent. Resource output efficiency. The micro-level virtual player agent executes commodity buying and selling and gold coin consumption operations in the memory stack for a duration equivalent to 10,000 virtual time cycles. The economic balance simulator monitors the total variance of the fund pool. The inflation rate curve relative to core resources. When the inflation rate exceeds a preset standard tolerance threshold... At that time, the economic system agent triggers the parameter callback function, automatically lowering the base drop rate. Or improve the system's tax recovery rate parameters This continues until the economic cycle stabilizes. The preset standard tolerance threshold... An example value is 0.05.

[0046] Social system intelligent agent generates a multi-dimensional relation matrix of factions ,in The total number of factions, matrix elements Indicates camp opposing camps The initial reputation value is an integer ranging from 0 to 1. The social system agent also defines conflict triggering threshold conditions. When any A hostile state is triggered at certain times. The social system's intelligent agents support dynamic evolution simulation, using Markov chains to calculate the probability distribution model of different factions forming alliances or going to war over time, and the state transition matrix. Each element Indicates faction relationship from status The probability of transitioning to a state; the state space includes four discrete states: “hostile,” “neutral,” “friendly,” and “alliance.”

[0047] Ecosystem intelligent agents extract biological community algorithm rules to generate directed acyclic graphs of ecological food chains. , where the set of nodes Each node in the set represents a biological population, and the edge set... Directed edges in Indicates population Prey population The energy flow relationship during predation. The ecosystem agent is at each node. Formula for configuring resource refresh rate: in, Based on the refresh rate scalar, This is the fluctuation amplitude coefficient. For seasonal periodic angular frequency, A random initial phase offset is set, and a seed array for random triggering of natural disaster events is configured. This ensures the logical consistency of the supply side of resources in the virtual world.

[0048] When the economic system agent sends an event signal of "timber resource depletion" to the asynchronous event bus, the ecosystem agent receives the signal and assigns the vegetation restoration rate factor of the forest area. From default value Upgraded to ,in To achieve system-level linkage, an incremental constant proportional to the scalar value of the depletion level is used.

[0049] Step 103: Construction of a hierarchical narrative graph for story generation and configuration engine.

[0050] The story generation and configuration engine is responsible for converting the world view into plot node files that the game engine can read.

[0051] The story generation and configuration engine represents plot data as a hierarchical narrative graph. The narrative graph is a directed graph structure composed of main plot nodes, side plot nodes, dialogue nodes, and event triggering nodes.

[0052] The story generation and configuration engine adopts a top-down, layered, progressive generation strategy: The first level involves using a DSL script generated by a world-rule intelligent agent to perform RAG retrieval, and a story generation and configuration engine to generate a plot outline text and fix the array of major plot turning points.

[0053] At the second level, the story generation and configuration engine refines the outline text down to the chapter and scene levels.

[0054] The third level is refined to the dialogue level. Dialogue generation supports multiple style modes (serious mode, humorous mode, suspense mode).

[0055] The story generation and configuration engine extracts the "personality prototype enumeration value" from the character setting table, and adjusts the probability distribution of the word units output by the large language model by constructing character-specific style cue words (or by applying bias adjustment to the sampling weight of specific word units through the logit_bias parameter provided by the API) to match the language style constraints of specific characters.

[0056] The story generation and configuration engine has a built-in configuration conversion module. The configuration conversion module serializes the narrative graph memory object into the game engine's standard configuration file format. The configuration file contains a task configuration table (fields include: globally unique task identifier, task prerequisite node identifier, goal achievement counter conditions, and reward item array), a dialogue configuration table (fields include: dialogue tree index, option branch jump pointer, and emotion action enumeration value), and a plot trigger configuration table (fields include: collider entry event trigger and time arrival event trigger).

[0057] The configuration conversion module performs schema format validation and pointer consistency checks on the serialized output, intercepting and correcting all null pointer references and format violations. The schema format validation is performed based on a predefined structured schema definition file, which adopts the JSONSchema standard and explicitly defines the name, data type, value range, and required attributes of each configuration table field.

[0058] The pointer consistency check traverses all reference fields in the serialized data, verifies that each referenced target identifier actually exists in the corresponding configuration table, generates a warning log for dangling references, and automatically replaces them with preset security fallback identifiers.

[0059] Step 104: Solving the constraint satisfaction problem (CSP) of the UI design engine and generating the interface.

[0060] The UI design and configuration engine is responsible for generating the game's user interface layout and interaction flow configuration files. The UI design and configuration engine initiates the RAG layer to retrieve pre-uploaded design system specification documents for the project; these design specification documents include: an RGB color theme matrix. The matrix is A 3D floating-point matrix, each row storing the normalized RGB three-channel value of a theme color; a font size gradient table. This table contains A one-dimensional array of preset font size scalars, with units of logical pixels; a set of spacing system scalars. Each element is a spacing scalar in multiples of the base grid cell; prefab component library description file.

[0061] The UI design and configuration engine transforms the physical process of interface layout planning into a strict constraint satisfaction problem (CSP). The engine extracts all essential element nodes required for a specific interface type (e.g., a combat head-up display HUD), defining the interface's two-dimensional canvas as a coordinate system, where the canvas width is... Logical pixels, height is Logical pixels.

[0062] The solver defines the following set of mathematical constraints: element overlap penalty constraint (ensuring that no two UI components overlap). and bounding box and They do not intersect, that is Visual hierarchy constraints (ensuring that key information areas are located within the visual focus coordinate system area) Inside, For Centered, wide ,high (rectangular region), edge snapping constraint (component anchor point coordinates must snap to the spacing system scalar set) (on the defined grid lines) and screen aspect ratio adaptive constraints (component scaling factor varies) (Adjust proportionally according to the change in proportion).

[0063] The CSP solver uses a simulated annealing algorithm to iteratively solve the problem within the constraint space, with initial temperature parameters... cooling rate In each iteration, the anchor point coordinates or scaling factor of a component are randomly perturbed, and the objective function is calculated.

[0064] The change in, of which, The total objective function value, The value of the element overlap penalty function. To adapt function values ​​for visual hierarchy, The value is the edge adsorption function. The weight coefficients for each constraint are used to accept or reject new solutions based on the Metropolis criterion, and finally the globally optimal array of component anchor point coordinates and scaling coefficients are calculated.

[0065] After generating the static layout of the interface, the UI design and configuration engine automatically generates the interface's interaction logic dictionary using a state machine topology model. The interaction logic dictionary defines the dynamic behavior state transitions of the interface, including fade-in and fade-out animation curve parameters for interface loading and unloading, a mapping table of network request functions triggered by button clicks, and the push and pop control logic of the interface hierarchy stack (Z-Order). The interaction configuration dictionary establishes a foreign key relationship with the static layout JSON configuration file and is stored on disk.

[0066] Example 2: Building upon the world framework and underlying component library constructed in Example 1, this example focuses on the core physical implementation of dynamic interactive content; the logic definition of the combat system; and the automated generation logic of the underlying state machine node diagram for non-player characters (NPCs). This example primarily addresses the physical obstacle that the probabilistic text output by the large language model cannot directly drive the game engine's strict temporal state machine.

[0067] The system instantiates the Combat / Behavior Logic Design & Configuration AI engine. This engine is responsible for converting the multimodal materials input by the game designers into physical action logic that the engine can directly compile and load.

[0068] Step 201: Multimodal input preprocessing and domain knowledge feature extraction.

[0069] The combat and behavior logic configuration engine receives a multimodal input data matrix about the target monster. The multimodal input data matrix contains the following four types of physical carriers: text description documents, combat video files recorded by the game engine, concept art image files, and manually annotated animation frame arrays.

[0070] The combat and behavior logic configuration engine executes specific decoding and extraction strategies for different physical carriers: For combat video files: The combat and behavior logic configuration engine is set to a preset global physics sampling rate. (Example value) The combat video file is uniformly segmented and extracted (frames per second). To prevent memory overflow, the combat and behavior logic configuration engine sets a frame rate cap threshold parameter. (Example value) (Frames, with a value range of 100-1000 frames). Once the length of the cut image array exceeds the upper limit threshold parameter... This immediately triggers a forced truncation and discard mechanism, retaining only the first few bytes. Frames. The extracted image array is converted into a multidimensional floating-point tensor matrix by an image encoder. The visual processing module of the input large language model, where , These represent the uniform height and width in pixels after image preprocessing. This represents the number of color channels.

[0071] For action fragment frame arrays: The combat and behavior logic configuration engine cleans up pre-labeled action tags using an action clustering classifier. The action clustering classifier calculates the edit distance similarity matrix between different action tags and applies a preset similarity threshold. Perform density-based spatial clustering for the cluster radius, and sort the messy action labels through a hash map dictionary. The data is uniformly mapped to standardized skill tag strings.

[0072] Step 202: Combat system numerical configuration generation and Monte Carlo balance simulation.

[0073] Before generating individual monster behavior logic, the combat and behavior logic configuration engine extracts the project's combat design specification document based on Retrieval Enhanced Generation (RAG) to generate a global constant configuration file for the core parameters of the combat system. This global constant configuration file contains: algebraic equations for damage calculation, armor decay curvature functions, and critical hit rate and critical hit damage multiplier matrices.

[0074] The combat and behavior logic configuration engine generates a graph structure for the class skill tree. and the corresponding numerical scalars, where nodes Representative profession, side This represents the skill unlocking path.

[0075] To verify that the generated numerical scalars do not disrupt the balance of the physical environment, the combat and behavior logic configuration engine instantiates a built-in numerical balance verifier module. The numerical balance verifier module uses the Monte Carlo Tree Search (MCTS) algorithm to generate numerical values ​​in a memory sandbox. The system simulates discrete battle scenarios, with a possible value range of 100,000 to 1,000,000 groups, adjustable according to accuracy requirements. It simulates various class combinations attacking each other until one side's health reaches zero. The numerical balance verifier module statistically analyzes the win rate probability distribution curves for each class. and average combat frame rate duration metrics ,in This is a job identifier. If the system detects that the win rate distribution curvature of a certain job deviates from the preset midline value of the normal distribution,... More than three standard deviations Then the numerical balance verifier module will automatically call back the damage algebra equation.

[0076] constant factors in ,in, To output damage value, Base damage value, For armor decay function, Armor value, For critical hit coefficient, adjust the step size as follows: Iterative adjustments are made until the balance test is passed.

[0077] Step 203: First stage, extract pipeline from conceptual design documents.

[0078] When processing the AI ​​logic of a single target monster, the combat and behavior logic configuration engine initiates a two-stage large language model pipeline. The first stage, the generation pipeline, handles core intent extraction. The combat and behavior logic configuration engine constructs system prompt text containing absolute rules of the combat AI design domain. These absolute rules encompass: the action game combat phase division paradigm, the monster distance target acquisition strategy layering (melee circle, mid-range circle, ranged circle), and the calculation logic for the super armor anti-interruption level matrix.

[0079] The combat and behavior logic configuration engine feeds the multidimensional floating-point tensor matrix output from step 201, along with the text prompt information, into the multimodal large language model, forcing the model to output a strictly defined structured combat behavior design document data block. The combat behavior design document data block is essentially a JSON object containing a multidimensional nested dictionary, explicitly defining the set of available skill identifiers for the target monster, the trigger health percentage threshold conditions for different combat phases, and the random number weight probability allocation range for skill triggering.

[0080] Step 204: Second stage, precise mapping at the function level of the hierarchical state machine engine.

[0081] This step is crucial for eliminating ambiguity in natural language and bridging the code gap. The combat and behavior logic configuration engine injects the structured combat behavior design document data block output from step 203 into the input stream of the second-stage large language model pipeline. Simultaneously, the basic support layer module forcibly injects the "engine function library summary data dictionary" into the prompt text via the memory bus. The engine function library summary data dictionary defines the function names, parameter type signatures, and return boolean types of all legal C++ or C# low-level control functions in the game.

[0082] The state machine data output from the second-stage large language model pipeline must adhere to a mandatory layered architecture rule. This rule stipulates that a complete monster's state machine is physically isolated into a single logic layer and several parallel execution layers: The logic layer acts as the central processing unit's scheduling center. Each logic layer contains a single main entry execution node responsible for all conditional loop checks. The logic layer is prohibited from containing any execution function calls that cause spatial displacement or the playback of attack animations. All exits of the logic layer must be connected to either the death-determination boolean check condition or the enemy's line-of-sight loss check condition. The execution layer acts as the specific action execution stack. The logic layer calls specific execution layers through scheduling pointer functions based on distance or health conditions. Each execution layer has its own independent entry function node and exit cleanup function node. The execution layer executes specific entity action function instructions such as "releasing a fireball skill" or "playing a block animation and retreating."

[0083] Step 205: Six-layer post-processing verification and compiler error repair based on graph structure.

[0084] Before the state machine data output by the large language model in the second stage is converted into a file readable by the game engine, it must undergo six layers of rigorous static code analysis and topology verification by the post-processing verification module to solve the Turing halting problem caused by the probabilistic generation of the model. The first layer of logical layer structure verification mechanism: The post-processing verification module scans the graph structure to verify the existence of isolated nodes and the legality of their connecting edges. If any are missing, a self-healing program is activated to fill in the connecting edges.

[0085] The second layer of general format repair mechanism: The post-processing verification module traverses all node structures of the state machine, checks whether the function input parameters conform to the type signature specified in the "engine function library summary data dictionary", and checks whether the spatial displacement type node is missing an update node of the "waiting for animation to end" type. If it is missing, the waiting node is forcibly inserted.

[0086] The third layer of inter-layer isolation physical verification mechanism: The post-processing verification module performs a depth-first search to scan all nodes inside the logic layer. If an entity function of the combat release type is detected, the post-processing verification module immediately performs a node replacement and stripping operation, downgrading and replacing the combat release type entity function with a scheduling jump node.

[0087] The fourth layer of absolute priority constraint mechanism: All outgoing edges of the state machine adopt a data structure combination of "priority scalar - conditional Boolean expression". The post-processing verification module checks all high-priority outgoing edges. If a high-priority outgoing edge is missing a conditional Boolean expression (i.e., absolutely true, which would cause low-priority nodes to be physically unreachable), the priority scalar of this outgoing edge is forcibly reduced to the lowest value as a fallback outgoing edge. The fifth layer of loop deadlock breaking mechanism: The post-processing verification module calculates and compares the priority weight of the "hit count counter reset node" with the priority weight of the "hit stun trigger condition edge". If it detects that the weights of the two are reversed, causing the counterattack skill to trigger infinitely and forming an infinite loop, the post-processing verification module physically swaps the priority scalar values ​​of these two edges. The sixth layer of multi-target distribution disaster defense mechanism: The post-processing verification module checks whether there are multiple unconditional null pointers pointing to different execution layer stack starting points at the same time. If found, a redirection and merging operation is performed.

[0088] After completing six layers of verification, the state machine graph data was converted into GraphML (Graph Markup Language) format. The GraphML format calculates the visual hierarchy coordinates of each state node using a breadth-first topology sorting algorithm, ensuring that no physical occlusion of nodes occurs when opened in a visualization editor, and assigns functional codes to recognize RGB color blocks.

[0089] Example 3: Example 2 solved the automatic generation of predefined combat logic for enemy units. This example further expands the game environment ecosystem, focusing on the autonomous social behavior driven model of non-player characters (NPCs) at the game runtime level in peaceful scenarios. This example focuses on solving how to ensure that NPCs have literary thought chains that conform to their character settings while avoiding the "illusion" of language models modifying the core underlying numerical data of the game during runtime.

[0090] The runtime system architecture adopts a bottom-up four-layer physical separation design: the world kernel layer is responsible for configuring the dictionary (bloodline type enumeration, personality prototype multi-dimensional weights), the runtime layer handles the physical stepping loop of each frame, the service layer manages concurrent Socket communication with the large language model, and the presentation layer renders the client view framework visible to the user.

[0091] Step 301: Synchronize the world physics state for each frame of the simulated time step.

[0092] The simulation's main loop controller drives the world system to update its clock. At each physical simulation time step (e.g., each time the world clock advances by a virtual hour), the world system engine updates the global environment pointer array. This array contains the current floating-point temperature values ​​for each region, the power and reputation rankings for each faction, the current seasonal weather tags, and the event record sequence in the global rumor information pool. Simultaneously, the world system engine updates the aging counter variables for all individual NPCs and the salience decay variables for event objects in the NPC memory bank array.

[0093] Step 302: Multi-level priority absolute isolation motivation assessment pipeline.

[0094] The NPC decision engine constructs a strict top-down, unidirectional blocking, multi-level priority tree-structured evaluation system, replacing the flat hash selector pattern. For each NPC instance, the decision engine reads the NPC's current memory attribute dictionary pointer and performs Boolean conditional short-circuit evaluation sequentially according to the following five priority dimensions. The evaluation result for each dimension is a Boolean value. ,in Corresponding to priorities P0 to P4. Any one of them. At that time, the short circuit blocks all subsequent... to Assessment: P0 Priority (Physiological Minimum Level): The decision engine monitors the NPC instance's health, satiety, and stamina in real time (in memory floating-point numbers). If any of these values ​​reaches the critical minimum threshold in the configuration table, the decision engine immediately freezes all subsequent judgment logic and forcibly rewrites the NPC's current execution instruction register to survival-related basic node functions such as "find food," "emergency healing," or "sleep." P1 Priority (Core Obsession Level): If P0 level does not trigger interception, the decision engine scans the NPC's Episodic MemoryArray.

[0095] If the salience parameter of an event object associated with a specific relational identifier exceeds the red alert scalar, the decision engine triggers a forced plot execution stack such as tracking, revenge, or desperate support. P2 Priority (Environmental Threat Level): If neither of the first two levels is triggered, the decision engine emits a raycast based on NPC coordinates to obtain a list of nearby environmental entities. If an enemy entity is found in the list and the calculated combat power difference exceeds the NPC's tolerance limit (floating-point number), the decision engine rewrites the target execution command as "evade," "stealth," or "escape" for pathfinding. P3 Priority (Personality Weighted Level): The decision engine enters a high-dimensional complex game if and only if the NPC is in an absolutely safe and physiologically healthy state. The decision engine extracts a multi-dimensional decision weight constant array defining NPC traits, including: justice tendency constant, interest tendency constant, safety tendency constant, loyalty tendency constant, and emotional sensitivity constant. Based on the currently available interactive behavior menu, the decision engine substitutes the attributes of the interactive object into a polynomial formula for weighted arithmetic summation and selects the behavior method pointer with the highest return score scalar. The basic bias constant... Retrieved from the behavior configuration table, with an example default value of 0. P4 Priority (Daily AFK Level): If all calculated scores are below the threshold range, the NPC retrieves the schedule configuration table structure and executes mechanical, repetitive tasks based on timestamps.

[0096] Step 303: High / low temperature separated two-step large language model parsing pipeline.

[0097] When the NPC selects an action target according to step 302, for example, the character decides to go to the blacksmith to buy a longsword, the corresponding behavior method pointer outputs the semantic identifier "go to the blacksmith to buy a longsword", and the runtime layer service interface module starts the two-step physical isolation pipeline.

[0098] The pipeline is designed to separate narrative text rendering and database numerical modification into different large language model calls. The two calls use independent prompt words, independent temperature parameters, and independent output parsing logic, thereby physically isolating the free generation of text from interfering with the accuracy of the numerical values.

[0099] Step 1 (Narrative Text Rendering Stage): The service interface module sends the first network request message to the cloud-based large language model. This request message carries a high-creativity temperature parameter (e.g., Temperature=0.8) and injects strong grammatical restrictions into the system-level prompt: "It is forbidden to include specific numerical changes or item configuration codes in any output." Based on the NPC's personality traits and current memory context, the large language model returns highly literary multi-paragraph strings (e.g., "In the light rain, he clutched the last bit of silver in his pocket, his eyes resolute as he walked into the blacksmith's shop filled with the aroma of a furnace, seeking the long-desired finely forged steel sword from the master craftsman"). The above two steps can be initiated asynchronously in parallel to reduce end-to-end response latency.

[0100] The second step (numerical crystallization extraction stage): The service interface module takes the literary text string returned in the first step as a pure input parameter and concatenates it into the second network request message. The second network request message carries a zero-creativity temperature parameter (Temperature=0.0, or an approximate zero value less than 0.01, to ensure output determinism).

[0101] More importantly, the service interface module injects a subset list (a list of valid item IDs, an equipment configuration table, and a character relationship state machine enumeration table) exported from the current in-game real database as an "absolute dictionary" into the prompt word environment. The large language model is forced to perform reverse feature extraction and JSON serialization assembly within the boundaries of this absolute dictionary. The output format of the second step of the large language model is strictly limited to structured JSON containing only numbers and registered dictionary names; For example: {"inventory_delta":[{"item_id":"sword_003","quantity":1},{"item_id":"silver_coin","quantity":-50}],"relationship_delta":[{"target_npc_id":"blacksmith_01","affection_change":+5}]}.

[0102] Step 304: World value writing and event bus broadcasting mechanism.

[0103] The State Application module receives the structured JSON data generated in step 303 (second step) and performs a transaction-level database write operation. The State Application module sequentially updates the NPC's inventory array list and the floating-point value of its health bar.

[0104] After a successful state write, the event handling module throws an event object instance to the asynchronous event bus (EventBus). The event handling module evaluates the scalar impact of the event: if the impact reaches the organizational level, the event handling module generates a "rumor string object" and pushes it into the global rumor queue. The rumor object is copied and propagated among adjacent coordinate map tile nodes as the game clock polls. With each regional propagation, the "information fidelity coefficient" of the rumor object decays by a specific percentage. When the coefficient falls below a threshold, specific strings within the rumor object are distorted by a synonym replacement dictionary, simulating the information distortion phenomenon of interpersonal communication.

[0105] Example 4: This example addresses the quality verification issue of system-generated content by building upon the world architecture, monster state machine, and NPC dynamic behavior system constructed in Example 3.

[0106] This embodiment abandons the traditional mechanical testing scheme of the game industry based on clicking on two-dimensional coordinates on the screen, and reconstructs the testing system into an automated acceptance closed-loop framework with semantic understanding capabilities and game memory state awareness capabilities.

[0107] The system instantiates a game testing and feedback engine. Logically, the testing and feedback engine is divided into three collaborative subsystems: a test design and generation subsystem, an automated execution and acceptance agent subsystem, and a knowledge and learning layer.

[0108] Step 401: Multimodal dimensionality reduction and structured test context construction for test requirement materials.

[0109] The test design and generation subsystem is responsible for receiving heterogeneous test requirement materials as input. These input materials include: game design documents written in natural language, numerical configuration tables in comma-separated value (CSV) format, user interface (UI) screenshots, and manually supplemented information strings. For these heterogeneous inputs, the test design and generation subsystem executes a conversational interactive context building pipeline: the rule context building module parses the game design document, extracting the game rule logic tree, business process state machine, state description constants, and exception description identifiers from the document.

[0110] The data context building module parses the CSV numerical configuration table, extracting the data structure of the header fields, sample values ​​within rows, and potential relationships between foreign keys in different data tables. Simultaneously, the image parser processes UI screenshots, extracting the coordinates of visual entry point bounding boxes and textual clues. To eliminate logical vulnerabilities in natural language documents, the test design and generation subsystem incorporates an uncertainty detection module. This module cross-references the extracted rules, data, and UI clues, employing the following three heuristic rules to perform logical integrity checks: (1) For each state node in the business process state machine, check whether there is at least one transition edge pointing to the state node and at least one transition edge leaving the state node. If there is only an in edge and no out edge, it is determined as "Termination Node Missing Anomaly". (2) For foreign key fields involved in the numerical configuration table, check whether there is a matching primary key record in the target table. If the number of matching records is zero, it is determined as "data table association broken chain". (3) For interactive visual entry points identified in UI screenshots, check if there is a corresponding business process description in the game design document. If not, it is determined as "undefined interactive entry point". Once the above high-risk logical gaps are identified, the uncertainty detection module immediately generates an uncertainty report document and interrupts the automated process through the dialogue proxy module, forcing human testers to input supplementary information strings. After filling the gaps, the system converges and outputs a global structured test context object.

[0111] Step 402: JSON serialization and compliance review of static test cases.

[0112] The test design and generation subsystem uses the structured test context object output in step 401 as its base dependency. The test design and generation subsystem extracts the task plan library document. and the preset first prompt message template Task planning library documentation Pre-stored A set of standard test task templates, each template including a task identifier, applicable scenario tags, and a list of minimum prerequisites. First prompt message template. A strict boundary is defined for the information reasoning task: the large language model must be within the task plan library. The system filters compliant test tasks that fit the current test context, using the cosine similarity score between the scenario label and the features of the current test context, and then reverse-engineers the array of steps required to complete the task. The generation engine module merges the above objects to generate test case acquisition instructions and sends a request to the cloud-based large language model. The large language model forces the output of test cases in a structured JSON object format. The output JSON object undergoes strong validation and must contain the following key-value pair fields: test function module name, test case title, list of preconditions, trigger entry method, array of linear test steps, expected memory result comparison value, failure judgment Boolean logic tree, and exception record output template.

[0113] The relationship validation module intercepts the returned JSON object and performs schema syntax validation on it. Once the validation passes, the export module deserializes the JSON object into a multi-tabbed Excel spreadsheet file and saves it to disk for later use. During this stage, the Design / Code / ConfigurationReview & TestAI agent simultaneously performs integrity checks on the generated configuration items, verifying whether there are dangling memory pointer references between configuration files.

[0114] Step 403: Automatically execute the Agent's environmental state awareness and reinforcement learning action exploration.

[0115] Entering the dynamic testing phase, the Automatic Execution and Acceptance Agent subsystem takes over physical control. The core of the system is the AutoPlayAgent module. The AutoPlayAgent starts and is injected into the memory of the real game client process (this solution is applied to a test game client version with anti-cheat functionality disabled and debug interfaces enabled).

[0116] The injection method employs dynamic library injection technology based on inter-process communication within the operating system, compiling the automated play agent into a shared library and loading it into the address space of the target game process. The automated play agent directly reads the memory state pointers at the game engine's underlying level. The specific memory address read is calculated using the game engine's symbol table as an offset. The read state data includes: the character's three-dimensional spatial coordinates in floating-point numbers. Current knapsack array length and array contents, surrounding entity list dictionary (A set of key-value pairs with unique entity identifiers as keys and entity type enumeration values ​​and 3D coordinates as values), replacing the reliance on screen pixel comparison. In each decision frame, the automated play agent merges the "test objectives extracted from JSON test cases," the "current game memory state dictionary," and the "historical experience context pulled from the experience library" to construct an operation decision prompt. The large language model processes the operation decision prompt and returns the identifier for the next operation instruction.

[0117] The automated play agent receives operation command identifiers and maps these identifiers to specific RPC (Remote Procedure Call) execution functions within the game engine via the ToolDefinitionProvider module, thereby triggering real physical operations such as "movement," "attack," or "interface click." After the operation is completed, the automated play agent observes the differences in memory state changes in the next rendered frame, performs assertion comparisons against the expected result fields in the JSON object, and writes discrete event results such as assertion pass (success), assertion failure, process blocking, or manual intervention, along with memory snapshot evidence, into the execution trajectory log storage block. Simultaneously, the gameplay test agent (GameplayTestAI) runs, utilizing a curiosity-driven reinforcement learning strategy (RLAgent) to actively manipulate the character to deviate from the pre-defined test case path, exploring collider vulnerabilities or numerical overflow blind spots at the map edges.

[0118] Step 404: Semantic pattern analysis and crystallization experience extraction of execution trajectory.

[0119] This step forms the core technological foundation for the system's self-evolution. The Knowledge and Learning Layer takes over the storage block of the execution trajectory logs output by the automated play agent. The Experience Observer module performs time-series aggregation on the complex single-step physical behavior logs. Each record in the single-step physical behavior log includes a timestamp. Operation instruction identifier Memory snapshots before and after execution and assertion results The experience observer module is based on a time window threshold. (Example values) (seconds) detect the time interval between adjacent operations, if Then and Actions are grouped into the same continuous action sequence. Continuous related single-step actions grouped into the same sequence are packaged into ActionEpisode objects. The system extracts the semantic feature vector of the operation instruction identifier sequence in each ActionEpisode object according to the semantic intent type, and performs agglomerative hierarchical clustering based on the cosine similarity of the semantic feature vectors, merging multiple ActionEpisode objects into IntentGroup objects.

[0120] Subsequently, the system extracts highly abstract semantic events from the intent group objects. Semantic event types include: UI panel state switching events, task node progression events, and exception events thrown by underlying utility functions. The pattern detector initiates regular expression matching and topological sequence comparison to search for recurring error symbols in the semantic event stream. Identified patterns include: repeated failure loop patterns, missing precondition attribute patterns, and UI panel overlay deadlock blocking patterns. The system calls a candidate scoring algorithm filter to remove low-quality patterns caused by occasional network latency (specifically, patterns with a confidence score below a preset threshold of 0.5 given by the pattern detector), and sends high-confidence patterns to the large language model for crystallization. The crystallized objects become structured experience entities, which are then permanently written to the experience storage module (ExperienceStore) after MD5 hash deduplication.

[0121] Step 405: Manual correction of learning takeover and two-way knowledge feedback loop.

[0122] The system incorporates a built-in human correction learning circuit breaker to handle situations where the test agent gets stuck in an endless logical deadlock. When the automated agent fails to update its task progress steps within a specified timestamp difference (30 seconds in an example), or when the state machine determines that an infinite loop has occurred, the system determines that the agent is in an execution predicament. At this point, the system records a complete memory snapshot and decision context of the frame before the agent loses control. A human tester takes over keyboard and mouse control to perform corrective operations. The system records the queue of all corrective operation instructions during the human intervention and the memory results after recovery. The system compares the differences between the two sets of snapshots before and after the intervention, generates a structured experience entity with a specific tag "human_correction," and appends it to the experience storage module.

[0123] Ultimately, the system completes a bidirectional knowledge feedback physical network. The first branch of the feedback network transforms the system's truly usable visual entry points, the actual memory conditions that cause blocking, and the high-frequency code failure execution stacks mined during the execution process into solidified project factual knowledge variables. These project factual knowledge variables are fed back to the test design and generation subsystem, influencing the prior distribution of the large language model's output by forcibly injecting them as context into the prompts in the next round of JSON test case generation. The second branch of the feedback network dynamically queries and recalls the successful access records, failure trap topology features, and standardized operating procedures (SOPs) from the experience storage module when the automated play agent encounters a similar memory state signature. These are then forcibly injected into the front end of the decision prompts as absolute experience constants, significantly reducing the probability of execution failure.

[0124] Using the six-layer post-processing verification topology described in Example 2, the system completely converges the probabilistic unstructured text output of the large language model into a finite state machine script that meets the strict timing requirements of the game engine. The general format repair mechanism and the absolute priority constraint mechanism reduce the missing condition expression rate of non-lowest priority edges in the generated finite state machine to zero. The loop deadlock breaking mechanism completely eliminates the infinite counterattack loop caused by monster NPCs due to abnormal hit count logic by physically swapping the priority scalar values ​​of the hit count counter reset node and the hit stun trigger condition edge on the topology graph, ensuring a 100% compilation success rate for the generated runnable script. After generating and testing 100 different BOSS state machine samples on the prototype system, the compilation success rate reached 100%, and no dead loops occurred during 1000 consecutive simulated battles.

[0125] Through the two-step large language model parsing pipeline with high and low creative temperature separation described in Example 3, the system achieves physical isolation between the diversity of narrative expression and the balance of game numerical values. The first step, the high creative temperature pipeline, ensures the literary quality of the text description and the immersive feeling of the narrative; the second step, the zero creative temperature pipeline, by forcibly injecting the absolute dictionary of available items, equipment, skills, and realms extracted from the imported game data table, completely restricts the output of the large language model to within the preset legal value space. This mechanism completely eliminates the "illusion" phenomenon of the large language model fabricating unregistered game entities out of thin air, reducing the numerical overflow rate and illegal foreign key reference rate of the core database to zero at runtime. In a stress test simulating 10,000 NPCs running concurrently for 24 hours, there were no illegal foreign key reference records in the database, and the numerical overflow log was zero.

[0126] The system achieves multi-system linkage and adaptive dynamic evolution. Through the multi-agent event bus architecture of the world system engine described in Example 1, the system breaks the isolated state of manual deduction of economic, social, and ecological systems in traditional game development. When a resource depletion event is triggered by concurrent market transactions in the micro-virtual player agent within the economic system simulator, the event is broadcast to the ecological system agent in real time via the asynchronous event bus, automatically triggering a dynamic upward adjustment of the forest vegetation restoration rate factor. This multi-system linkage based on causal closed-loop ensures that even when the large-scale concurrent virtual world runs for more than 10,000 cycles, the global inflation rate and resource depletion probability remain within the preset standard tolerance range. For an economic system simulating 10,000 agents for 10,000 cycles, the inflation rate consistently remains within the preset threshold of 0.05.

[0127] Through the end-to-end intelligent testing and experience crystallization mechanism described in Example 4, the automated play agent directly perceives the real client-side underlying state through memory state pointers, significantly improving the semantic understanding depth of state exploration. The experience observer module gradually aggregates discrete behavior logs into action fragments and intent groups, refining them into structured patterns such as repeated failures and missing preconditions. These patterns are then crystallized into structured experience entities by a large language model and stored in the experience storage module. The bidirectional knowledge feedback physical network transforms successful paths and manually corrected rules into project factual knowledge variables, directly intervening in the model prior weights for the next round of test case generation. This results in an exponential increase in the scenario exploration coverage of the testing system with the increase in the number of test rounds, and the test execution failure rate approaches zero. After 10 consecutive iterations, the scenario exploration coverage of the testing system increased from the initial 45% to 92%, and the test execution failure rate decreased from 15% to 0.3%.

[0128] Example 5: This example focuses on illustrating the mapping relationship and data flow transformation topology of all software modules, large language model pipelines, agents and verifiers in the above examples at the physical electronic device hardware level, in order to establish the feasibility of the invention.

[0129] The closed-loop system for end-to-end game generation, simulation, and testing runs on a network of high-performance distributed electronic devices or on a single electronic device with highly parallel computing capabilities.

[0130] Component 501: Mapping of the physical processor and tensor acceleration chip array.

[0131] The electronic device includes a central processing unit (CPU) array, a tensor processor (TPU / GPU) acceleration chip array, and high-speed volatile random access memory (RAM) space connected to the processor via a dedicated high-speed interconnect bus. In physical operation, the world system engine, the multi-level priority absolutely isolated motivation evaluation pipeline, and the state assertion comparison function in the autonomous play agent are all executed by high-concurrency multi-core threads in the CPU array. The video image encoder in the multimodal input preprocessing, the multimodal visual processing module of the large language model, and the token probability distribution model inference calculations in each stage of the large language model pipeline are all compiled into matrix multiplication and addition instructions and distributed to the tensor processor acceleration chip array for hardware-level parallel acceleration.

[0132] Component 502: Physical partitioning and physical queue construction of the high-speed volatile random access memory stack space. To achieve data isolation and lock-free, efficient communication between different components at the hardware level, the high-speed volatile random access memory space is physically divided into several dedicated, independent memory blocks: World State Memory Block: Physically stores a global array of environment pointers, which maintains the current regional temperature, faction reputation, celestial status, and global rumor queue in real time.

[0133] NPC Individual Behavior Registered Memory Block: For each active non-player character, a contiguous address space is allocated in memory to physically store the non-player character's basic survival attributes (health, hunger, stamina), a multi-dimensional decision weight constant array, and a pointer to the EpisodicMemoryArray linked list.

[0134] Test Agent memory-aware snapshot area: The auto-playing agent directly accesses the memory directly (DMA) channel or through the memory hook function at the bottom of the game engine to read the character's three-dimensional coordinate floating-point number, backpack array length and surrounding entity list dictionary in the memory stack of the game client process in real time, and directly loads the above memory snapshot into the physical construction buffer of the operation decision prompt information of the large language model.

[0135] Component 503: Network Interface Controller and Socket Ring Asynchronous Buffer Queue. The electronic device includes a Network Interface Controller (NIC) that supports TCP / IP protocol stack hardware offloading, with a maximum throughput of... Gbps (example value) (Gbps). Given that the two-step large language model pipeline and test case generation engine need to interact with the remote cloud-based large language model cluster at high speed, the network interface controller driver allocates a set of socket circular asynchronous buffer queues in volatile memory. The circular buffer queue contains There are 1 buffer slot, each buffer slot having a size of 1 KB.

[0136] When the service interface module initiates a network request message, the first step of generating a highly creative and engaging narrative prompt text is serialized into a binary network data packet and pushed into the head of the Socket circular asynchronous buffer queue. The queue write pointer... Incremental transmission, sent non-blockingly via the network interface controller.

[0137] After receiving the literary text string returned by the cloud-based large language model, the network interface controller triggers a hardware interrupt signal. The interrupt service routine of the central processing unit directly sends the received string into the first-step result buffer via direct memory access (DMA), and immediately starts the second step of assembling zero-creativity temperature value extraction prompt words, which is then sent again via a socket circular asynchronous buffer queue. The two-step pipeline employs a non-blocking asynchronous I / O mechanism at the hardware communication level, ensuring that under high concurrency, when the number of concurrent requests reaches... At that time, the game's main loop frame rate The fluctuation range does not exceed Frames per second.

[0138] Component 504: Non-volatile computer-readable storage medium and persistent database structure. The electronic device includes a non-volatile computer-readable storage medium (such as a solid-state drive, SSD). The non-volatile computer-readable storage medium physically stores: a behavior table database containing system default behaviors and custom behaviors, a project knowledge base, an experience storage database containing repeated failure modes, and standard game engine configuration files (task configuration table, dialogue configuration table, plot trigger configuration table). When the post-processing verification module completes six-layer verification and outputs a GraphML state machine file, or when the export module completes schema verification and generates an Excel format file, the corresponding file stream is written to the non-volatile storage medium's write driver to perform hardware-level flash memory block erase and write, completing the persistent storage of data.

[0139] The specific system architecture, number of agents, order of multi-level priority dimensions, number of post-processing verification layers (six layers), and specific temperature parameter settings for the two-step large language model pipeline described in the preceding embodiments and steps are all optimal implementation schemes provided to thoroughly explain the core physical principles of this invention. Those skilled in the art should understand that any non-substantially equivalent substitutions made to the above components, steps, or parameters without departing from the essence of the technical solution of this invention fall within the protection scope of this application. Regarding the calling format of the large language model, although the embodiments use "cloud-based large language model API call" as the descriptive carrier in many places, replacing the cloud-based large language model with a lightweight large language model independently deployed on local electronic device hardware, or replacing it with a domain-specific deep neural network model, or an equivalent semantic reasoning module implemented through other matrix transformation algorithms, as long as the function of converting fuzzy semantic input into structured logical output or separating and extracting narrative and numerical values ​​is performed, all fall within the protection scope of this application.

[0140] Regarding the hierarchical state machine and six-layer post-processing verification, Example 2 presents a physical isolation architecture between a logical layer and at least one execution layer, as well as a six-layer post-processing sequence including logical layer structure, general format, inter-layer isolation, priority constraints, loop detection, and distribution node repair. Those skilled in the art can, in implementation, rearrange or merge the order of non-core steps in the six-layer verification; as long as it still includes the absolute priority constraint mechanism and the loop deadlock breaking mechanism and can solve the same technical problem, it can be considered an equivalent substitution; any scheme lacking the aforementioned absolute priority constraint mechanism or loop deadlock breaking mechanism does not constitute an equivalence.

[0141] Regarding the multi-level priority system for NPC behavior, the five-level unidirectional blocking priority tree-like evaluation system from P0 to P4 specified in Example 3 is an efficient causal-driven model. Its core lies in short-circuit evaluation based on a predefined priority order. Each level of evaluation determines whether to trigger the corresponding behavior based on the current state value of the NPC's specific attribute dimension. Developers can add more intermediate priority levels (such as adding a social need layer or a reputation worship layer) or fine-tune the short-circuit interception trigger thresholds between each level. As long as they do not deviate from the core causal closed-loop logic of "priority motivation evaluation based on the multi-dimensional attribute state of the non-player character," they cannot circumvent the legal boundaries of this application.

[0142] Regarding experience crystallization and knowledge feedback in end-to-end testing, the closed loop described in Example 4, which progressively aggregates single-step actions into action fragments, intent groups, and semantic events, and identifies recurring failure patterns through detectors to crystallize them into experience and write them into the experience base, is key to the evolution of the test system. Designers can replace the action fragment aggregation algorithm with a time-series clustering algorithm based on a hidden Markov model for intent prediction, or replace the storage medium of the experience base with a distributed graph database. As long as a closed-loop feedback technology path of "crystallizing failure / success experience at the test execution end and dynamically feeding it back to the test design and operational decision-making ends to improve generation quality and execution success rate" is achieved, it is fully included within the scope of protection of the claims in this application.

[0143] Example 6: In scenarios involving long-running large-scale game software or physical servers with high-concurrency player access, statically compiled finite state machines face the risk of logic vulnerabilities being exposed due to continuous player probing. Player inputs often deviate from the reachable state space initially designed for the state machine, creating specific combinations of physical coordinates and skill commands that allow for sustained damage output without the risk of counterattack. This example constructs a self-evolving state machine topology layer, establishing a system-level, low-level immune feedback pathway. The testing and feedback engine utilizes the collected imbalanced physical data to reverse-map and generate control flow mutation code for the low-level state machine, achieving dynamic hardening at runtime.

[0144] The state machine topology self-evolution steps rely on high-precision operational imbalance detection at the physical level. The test and feedback engine allocates an independent circular data buffer in the host machine's random access memory to frequently capture the floating-point change rate of adversarial entity attributes within a specified time integration window.

[0145] The system is anchored within the memory stack by the start timestamp. End timestamp The system consists of a sliding observation cycle. For each physical clock step cycle, the test and feedback engine strips away redundant environmental data and accurately reads the output damage value corresponding to the virtual player agent. Damage output value corresponding to the target monster To eliminate numerical measurement noise introduced by the difference between different entity levels and base physical attack power, the test and feedback engine performs a scalar integral calculation of adversarial gain imbalance:

[0146] The formula contains constants and Used for polynomial balancing. The test and feedback engine synchronously listens to the CPU logic layer scheduling instruction set hooked to the target monster. The test and feedback engine determines the current scalar imbalance in combat gains. scalar that breaks through the preset escape judgment threshold The status detection program retrieves the timing log records of the logic layer and checks whether jump calls to attack action functions have occurred within the time integration window. If the comparison confirms that the target monster's logic layer main loop has not output any memory control instruction pointers to enter the attack execution layer during this period, the test and feedback engine interrupts the current regular log slicing process. The test and feedback engine marks the currently intercepted continuous execution trajectory with a specific tag indicating the logic blind spot escape type, and assembles the associated memory snapshot sections into an immutable vulnerability event carrier object.

[0147] The detached execution trajectory must undergo dimensionality reduction and reconstruction of the three-dimensional spatial geometric features. The testing and feedback engine calls the underlying spatial calculation subroutine to directly decode the vulnerability event carrier object and extract the spatial displacement array. The spatial displacement array contains the total number of discrete sampling points. 3D position column vectors The spatial measurement subroutine scans the boundary extrema of the input matrix and calculates the spatial centroid vector of all sampling points. Based on the geometric deviation between the location samples and the spatial centroid vector, the spatial calculation subroutine generates a spatial bounding box matrix corresponding to the physical coordinate sequence:

[0148] Obtain the real symmetric covariance shape matrix Subsequently, the central processing unit schedules multiple floating-point units in parallel to perform singular value decomposition, extracting the core eigenvalues ​​and their corresponding orthogonal eigenvector sets. These eigenvector sets precisely depict the principal axis rotation angle and normal extension scale relative to the target monster's local coordinate system when the player's actions establish a logical blind zone, mapping this to a bounding box with a boundary lock in the geometry engine. The spatial calculation subroutine converts the vertex coordinate scalars and offset coefficients of the bounding box, encapsulating and outputting a plain text-structured boundary configuration dictionary object.

[0149] The boundary configuration dictionary object is injected into the combat and behavior logic configuration engine via a high-speed socket channel. Upon receiving the data, the combat and behavior logic configuration engine forcibly takes over the second-stage large language model responsible for generating code, overriding the model's underlying hyperparameter configuration options. The temperature parameter, representing sampling randomness, is fixed to zero by a hardware-level latch instruction, completely truncating any divergent or rhetorical output branches. The system loads dedicated structured abstract syntax tree construction instructions. The instruction front-end loads the boundary configuration dictionary object, and the back-end assembles the full JSON-formatted code block of the target monster's current effective state machine graph data. The large language model handles strict instruction constraints, locating below the main loop entry node stack of the logic layer in the original graph structure, and inserts a new conditional jump edge in a single line. The jump constraint expression output by the large language model directly hooks into the physical collision detection function interface to determine whether the coordinates cross the directional bounding box. The lexical parser inside the large language model accesses the target monster's initialized and registered skill pool database, filtering and extracting the wide-angle attack skill identifier with the smallest startup frame constant. The large language model instantiates a new node structure based on the skill identifier, creating an independent new execution layer node. The newly added execution layer node points to the large-scale sweeping damage logic with strong hard straight coverage, and the pointer inside the newly added conditional jump edge is absolutely directed to the starting logic block address of the newly added execution layer node.

[0150] The state machine graph data exhibiting abrupt structural changes carries the physical risk of introducing underlying circular deadlock errors. To maintain the stability of the server's heartbeat frame rate, the system blocks channels that trigger full six-layer topology verification requests. The post-processing verification module takes over updating the state machine graph data and launches an independent background thread to execute a local incremental topology verification mechanism. This incremental topology verification mechanism strips away irrelevant branches and separately extracts the locally connected subgraph structure encompassing the newly added conditional jump edges and the newly added execution layer nodes. The post-processing verification module then executes a strongly connected component retrieval algorithm on this locally connected subgraph structure.

[0151] The algorithm kernel traverses all adjacency lists. After the normally configured monster attack action is completed, a delayed return callback interface responsible for clearing registers and returning to the main loop is forcibly retained in the execution layer stack. The incremental topology verification mechanism starts a pathfinding program within the returned set of strongly connected components, checking one by one whether there is a unidirectional directed edge path connecting to the main loop node in the largest strongly connected component containing the newly added execution layer node. If the strongly connected component retrieval algorithm returns a loop island or a lost node topology anomaly, the post-processing verification module immediately removes the newly added conditional jump edge submitted by the large language model and replaces it with a static fallback instruction. After the verification system confirms that the directed edge path in the subgraph is closed and complete, it flips the incremental topology verification status register to output a high-level signal to indicate the pass status.

[0152] The hot update deployment after verification directly addresses the underlying limitations of multi-threaded memory contention. High-concurrency game server processes are strictly prohibited from directly overwriting the execution instruction area memory during their runtime. This embodiment employs a read-copy-update concurrent synchronization primitive to eliminate addressing contention. The state modification program initiates an allocation request to the operating system's memory manager, allocating a physically isolated free memory address segment. The state modification program calls the underlying just-in-time (JIT) compilation engine pipeline to translate and package the verified updated state machine graph data into a binary machine code sequence directly addressable by the CPU, and then moves it entirely into the free memory address segment. After writing, the state modification program initiates a strongly consistent atomic swap hardware-level instruction. The global addressing memory pointer previously bound to the old state machine dispatcher is replaced, and a hardware connection is established pointing to the instruction header of the newly compiled machine code block. At this time, game calculation threads stuck in the old state reading cycle are not disturbed, continuing to use the old state data mapped in the cache until the single computation task is exhausted. The newly entered scheduling thread reads according to the replaced pointer and switches to the new logical physical execution path with logical blind spot correction. The system's underlying garbage collection queue monitors the reference counter. After the old thread has been completely stripped of its reference count during the grace period, the memory stack fragments occupied by the old state machine are precisely released and erased. Throughout the entire process, the main business process remains uninterrupted, achieving zero-downtime recovery that is perceptible to the business layer.

[0153] To measure the effectiveness of the state machine topology self-evolution steps using objective engineering data, a simulated stress evaluation deployment was introduced into the system sandbox laboratory environment. The evaluation environment was pre-configured with two hundred reinforcement learning-driven virtual player agents possessing multi-dimensional pathfinding computation potential. The central battle zone loaded a target monster unit model with only four linear behavior switching nodes in its initial state. Performance monitoring probes continuously collected and recorded evolution frequency, computation time, and damage leakage interception values ​​over 72 hours of server physical runtime. After cleaning, the data was imported into the following state machine self-evolution performance data statistics table.

[0154] Table 1. Comparison of self-evolution performance of state machines;

[0155] During the initial testing phase of the environment startup, the virtual player agent, relying on reinforcement learning characteristics, frequently probed the geometric blind spots of the target monster's position. The probe keenly captured abnormal imbalances and initiated the calculation of the evolution matrix. As the state machine graph data was updated multiple times and written into the memory block through compilation, the previously exposed coordinate blind spots were filled and reinforced by the compensating attack actions triggered by the newly added conditional jump edges.

[0156] Table 1 shows that the computational power consumption for incremental topology verification is strictly anchored within a 15-millisecond safety threshold. This value perfectly matches the 60Hz operation of the underlying physics stepping engine per frame, intercepting any latency or stuttering that could cause frame drops or blocking at the client's presentation layer. The memory physical pointer swapping operation, driven by the read-copy-update synchronization primitive, maintains a microsecond-level response speed. As the evolution progresses to the 49th physical hour node, the system's edge is comprehensively reinforced and strengthened, and the virtual player agent's massive search matrix can no longer locate new geometric metric vulnerabilities. Ultimately, the total number of attacks caused by blind spot vulnerabilities irreversibly falls back to absolute zero, achieving self-balancing in a dynamic environment. Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to include the preferred embodiments as well as all changes and modifications falling within the scope of the invention.

[0157] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. It should be noted that any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for implementing a game engine that integrates large language models and generative AI, characterized in that, Includes the following steps: Step 1: Instantiate multiple system-level intelligent agents, receive the world view basic setting document and the core gameplay definition document, generate the world rule document, and verify the balance of the economic system through the built-in economic balance simulator; Step 2: Receive the multimodal input data matrix, execute the two-stage large language model pipeline to output the target monster's state machine data, perform multi-layer post-processing verification on the state machine data including priority absolute constraints and loop deadlock breaking, and convert it into a state machine script file; Step 3: In the simulated time step, the action target of the non-player character is evaluated according to the multi-level priority one-way blocking evaluation system. The narrative text is generated by calling the large language model with the first specific creative temperature parameter. The narrative text is input into the absolute dictionary and the large language model with the second specific creative temperature parameter is used to extract the structured numerical changes and write them into the database. The second specific creative temperature parameter is always zero and lower than the first specific creative temperature parameter. Step 4: Analyze the heterogeneous test requirements materials to construct a structured test context object, generate structured test cases, instantiate an automatic play agent to read the memory state pointer of the test environment and decide the next operation based on the large language model, compare the memory state changes with the expected results, aggregate and extract the continuous execution trajectory into semantic events and crystallize them into structured experience entities, write them into the experience storage module, and feed the structured experience entities back into the operation decision prompt information.

2. The method for implementing a game engine that integrates a large language model and generative AI according to claim 1, characterized in that, Step 1 also includes a user interface generation step, which extracts the element nodes that must be presented, defines the two-dimensional canvas of the interface as a coordinate system, and uses a constraint satisfaction problem solver to establish a set of mathematical constraints including element overlap penalty constraints, visual hierarchy constraints, edge snapping constraints, and screen aspect ratio adaptive constraints. The optimal component anchor point coordinate array and scaling factor array are solved by simulated annealing algorithm.

3. The method for implementing a game engine that integrates a large language model and generative AI according to claim 1, characterized in that, The built-in economic equilibrium simulator in step 1 uses the following inflation rate verification formula to verify the equilibrium of the economic system: In the formula, This represents a scalar measure of the global inflation rate. This represents a scalar indicating the total number of different types of goods circulating within the system. Indicates the first The current floating-point price per unit of the item. Indicates the first The total circulation quantity of this type of item in the system is scalar. This represents the current system's total currency pool constant; when When the value deviates from the preset standard tolerance threshold, a parameter callback function is triggered to lower the base drop rate or increase the system recycling tax rate parameter, until... Return to the standard tolerance range.

4. The method for implementing a game engine that integrates a large language model and generative AI according to claim 1, characterized in that, The multimodal input data matrix in step 2 contains combat video files; the combat video files are cut and extracted according to the preset global physical sampling rate to obtain an image array. When the length of the image array exceeds the preset upper limit threshold parameter, a forced truncation and discard mechanism is triggered, and the remaining image array is converted into a multidimensional floating-point tensor matrix by the image encoder and input into the large language model visual processing module.

5. The method for implementing a game engine that integrates a large language model and generative AI according to claim 1, characterized in that, Step 2, which involves executing the two-stage large language model pipeline, specifically includes: Input the multimodal input data matrix into the first-stage large language model pipeline and output a structured combat behavior design document data block containing the set of available skill identifiers, the trigger health percentage threshold conditions for different combat stages, and the random number weight probability allocation interval for skill triggering. Forcefully inject the engine function library summary data dictionary into the prompt text of the second-stage large language model pipeline, and input the structured combat behavior design document data block into the second-stage large language model pipeline to generate state machine data that conforms to the forced hierarchical architecture rules.

6. The method for implementing a game engine that integrates a large language model and generative AI according to claim 5, characterized in that, The mandatory layered architecture rule stipulates that the monster's state machine is physically isolated into a single logic layer and multiple parallel execution layers. The logic layer is prohibited from containing any execution function calls that cause spatial displacement or play attack animations. The logic layer calls a specific execution layer through a scheduling pointer function based on distance or health conditions. The specific execution layer executes specific entity action function instructions.

7. The method for implementing a game engine that integrates a large language model and generative AI according to claim 6, characterized in that, Step 2 involves performing multi-layered post-processing verification steps on the state machine data, including priority absolute constraints and cyclic deadlock breaking. Specifically, this includes: The execution logic layer structure verification mechanism scans the graph structure to verify the existence of isolated nodes and the legality of their connecting edges. If any are missing, a self-healing procedure is initiated to fill in the connecting edges. A general format repair mechanism is executed to check whether an update node for the type of waiting animation to end is missing after a spatial displacement type node. If it is missing, an update node for the type of waiting animation to end is forcibly inserted. The inter-layer isolation physical verification mechanism is executed. If a combat release type entity function is detected inside the logic layer, a node replacement and stripping operation is performed to downgrade and replace the combat release type entity function with a scheduling jump node. The execution priority absolute constraint mechanism is used. If a high-priority outgoing edge is found to have a missing condition Boolean expression, the priority scalar of the high-priority outgoing edge is forcibly downgraded to the lowest value and used as a fallback outgoing edge. Execute a loop deadlock breaking mechanism, calculate and compare the priority weight of the hit count counter reset node with the priority weight of the hit stun trigger condition edge. If a weight inversion occurs, resulting in an infinite loop, physically swap the priority scalar values ​​of the hit count counter reset node and the hit stun trigger condition edge. A multi-target disaster defense mechanism is implemented to detect whether multiple unconditional null pointers point to different execution layer stack starting points simultaneously. If such a mechanism is found, a redirection and merging operation is performed.

8. The method for implementing a game engine that integrates a large language model and generative AI according to claim 1, characterized in that, The multi-level priority unidirectional blocking assessment system in step 3 is arranged in order of priority from high to low, including the first level physiological baseline level, the second level core obsession level, the third level environmental threat level, the fourth level personality weighted level, and the fifth level daily idle level. Once the triggering condition of a high-level priority dimension is detected, the judgment logic of all subsequent low-level priority dimensions is immediately frozen, and the current execution instruction register of the non-player character is overwritten as the function node corresponding to the high-level priority dimension.

9. The method for implementing a game engine that integrates a large language model and generative AI according to claim 8, characterized in that, The fourth level, personality weighted level, is entered only when a non-player character is in a safe state where none of the first, second, and third levels have been triggered, and the candidate behavior score is calculated using the following formula: In the formula, This represents the calculated candidate behavior score scalar. The underlying bias constant representing the candidate behavior. This represents the constant representing the total number of decision dimensions used to define non-player character traits. This indicates that the non-player character is in the... Personality weight constants for each decision-making dimension Indicates the current interaction object is in the [number]th position. The attribute evaluation values ​​for each decision dimension are floating-point numbers; the non-player character selects and returns, making... The method pointer corresponding to the candidate behavior with the largest numerical value.

10. In the game engine implementation method integrating large language models and generative AI according to claim 1, after the step of feeding back structured experience entities to operation decision prompts, the testing and feedback engine executes the state machine topology self-evolution step: When the label of a newly added structured experience entity in the experience storage module is determined to be of the logic blind zone escape type, the test and feedback engine extracts the physical coordinate sequence that triggers the logic blind zone escape, and calculates the spatial bounding box matrix and imbalance state parameters corresponding to the physical coordinate sequence. The spatial bounding box matrix and the unbalanced state parameters are input as hard constraints into the combat and behavior logic configuration engine. The combat and behavior logic configuration engine generates new execution layer nodes with compensating attack actions and new conditional jump edges connecting the main loop entry of the logic layer and the new execution layer nodes on the original state machine diagram structure. The post-processing verification module performs incremental topology verification on the updated state machine graph data with newly added execution layer nodes and new conditional jump edges. After determining that the incremental topology verification is passed, the updated state machine graph data is injected into the running server memory, and hot update of the finite state machine logic pointer is implemented.