Visual script game engineering automatic generation method based on artificial intelligence

By encapsulating the visual script nodes into a self-descriptive MCP tool and utilizing a multi-agent collaborative architecture, the ambiguity and complexity issues of large language models in generating visual script node graphs are resolved. This achieves deterministic and stable node understanding and invocation, improving the correctness and maintainability of the generation logic.

CN122018883APending Publication Date: 2026-05-12JILIN ANIMATION INST +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
JILIN ANIMATION INST
Filing Date
2026-04-08
Publication Date
2026-05-12

AI Technical Summary

Technical Problem

Existing technologies for generating visual script node graphs using large language models suffer from problems such as fuzzy node understanding, limited context windows, and high complexity, leading to inaccurate generation.

Method used

Each visual script node is encapsulated as an independent, self-descriptive node MCP tool, and multiple intelligent agents (requirements analysis, node selection, logic orchestration, engineering specifications, and quality assurance) work together to achieve deterministic and stable node understanding and invocation.

Benefits of technology

It improves the determinism and stability of node understanding, reduces context resource consumption, and enhances the logical correctness and maintainability of generation, making it suitable for handling complex game behaviors and large-scale projects.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122018883A_ABST
    Figure CN122018883A_ABST
Patent Text Reader

Abstract

The invention discloses a visual script game engineering automatic generation method based on artificial intelligence, and relates to the field of animation production, the method comprises the following steps: a demand analysis agent obtains a natural language demand and generates and outputs a structured function specification based on the natural language demand; the node type selection agent calls a retrieval MCP tool to retrieve a node MCP tool conforming to the structured function specification so as to obtain and output a target node MCP tool set; the logic arrangement agent constructs and outputs an original visual script node graph structure according to the structured function specification, the target node MCP tool set and the operation MCP tool; the project specification agent performs standardized adjustment on the original visual script node graph structure to generate and output a standardized visual script project; a large language model (agent) can understand and call nodes in a deterministic and stable mode, and the problems of fuzziness and instability of a traditional interface document overall understanding mode are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of animation production, and in particular to an artificial intelligence-based method for automatically generating visual script game projects. Background Technology

[0002] With the development of game engines and visual scripting technologies (such as node-based blueprints and flowchart-driven components), more and more game logic and level behaviors are being implemented through "visual script node graphs." Large Language Models (LLMs) have demonstrated powerful capabilities in natural language understanding and code generation, and there are also technologies in the industry that attempt to generate visual script node graphs using large language models, but these have significant limitations.

[0003] Specifically, visualization script engines typically contain hundreds to thousands of node types, each with complex input / output ports and attribute definitions. Existing solutions require inputting the entire node library information into a large language model at once, which easily exceeds the context window limitations of the large language model, or can only achieve a fuzzy understanding and cannot accurately use the nodes. Furthermore, additional external rules are needed to explain the relationships between the nodes, further increasing the complexity of understanding and the probability of errors, thus failing to generate an accurate visualization script node graph. Summary of the Invention

[0004] The purpose of this application is to provide an AI-based method for automatically generating visual script game projects. Each visual script node is encapsulated as an independent, self-descriptive node MCP tool, enabling large language models (agents) to understand and invoke nodes in a deterministic and stable manner, thus eliminating the ambiguity and instability problems of traditional interface documentation-based overall understanding methods.

[0005] To achieve the above objectives, this application provides the following solution: In the first aspect, this application provides an automatic generation method for visual script game engineering based on artificial intelligence, which is implemented by multiple intelligent agents, namely, a requirement analysis intelligent agent, a node selection intelligent agent, a logic arrangement intelligent agent, an engineering specification intelligent agent, and a quality assurance intelligent agent; The AI-based method for automatically generating visual script game projects includes: The requirement analysis agent acquires natural language requirements and generates and outputs structured functional specifications based on the natural language requirements; The node selection agent calls the MCP retrieval tool to retrieve node MCP tools that conform to the structured functional specifications in order to obtain and output the target node MCP tool set. The logical orchestration agent constructs and outputs the original visual script node graph structure based on the structured functional specifications, the target node MCP tool set, and the operation MCP tools. The engineering specification intelligent agent standardizes and adjusts the original visualization script node graph structure to generate and output a standardized visualization script project. The quality assurance agent performs quality verification and analysis on the visualization script project to generate a verification report, and generates correction instructions for different agents based on the verification report. The correction instructions are used to guide the corresponding agents to correct their output. The encapsulation steps of the node MCP tool, the operation MCP tool, and the retrieval MCP tool are as follows: obtain the node library of the visualization script engine, encapsulate each node in the node library into an independent node MCP tool, encapsulate each type of node graph operation into an independent operation MCP tool, and encapsulate each type of node retrieval function into an independent retrieval MCP tool.

[0006] Secondly, this application provides an artificial intelligence-based method for automatically generating visual script game projects, including: Obtain the node library for the visualization script engine; Each node in the node library is encapsulated as an independent node MCP tool, each type of node graph operation is encapsulated as an independent operation MCP tool, and each type of node retrieval function is encapsulated as an independent retrieval MCP tool. Obtain natural language requirements and generate and output structured functional specifications based on those requirements; Call the MCP retrieval tool to retrieve node MCP tools that conform to the structured functional specifications to obtain and output the target node MCP tool set; Based on the structured functional specifications, the target node MCP toolset, and the operating MCP tools, construct and output the original visual script node graph structure; The original visualization script node graph structure is standardized and adjusted to generate and output a standardized visualization script project.

[0007] Thirdly, this application provides a visual script game engineering automatic generation system, including an MCP tool-based encapsulation module, an MCP service module, and multiple intelligent agents, wherein the multiple intelligent agents are a requirement analysis intelligent agent, a node selection intelligent agent, a logic orchestration intelligent agent, an engineering specification intelligent agent, and a quality assurance intelligent agent; The requirement analysis agent is used to acquire natural language requirements and generate and output structured functional specifications based on the natural language requirements; The node selection agent is used to call the MCP retrieval tool to retrieve node MCP tools that conform to the structured functional specifications in order to obtain and output the target node MCP tool set. The logical orchestration agent is used to construct and output the original visual script node graph structure based on the structured functional specifications, the target node MCP tool set, and the operation MCP tools. The engineering specification intelligent agent is used to standardize and adjust the original visualization script node graph structure to generate and output a standardized visualization script project. The quality assurance agent is used to perform quality verification and analysis on the visualization script project to generate a verification report, and to generate correction instructions for different agents based on the verification report. The correction instructions are used to guide the corresponding agents to correct their output. The MCP tool encapsulation module is used to: obtain the node library of the visualization script engine, encapsulate each type of node in the node library into an independent node MCP tool, encapsulate each type of node graph operation into an independent operation MCP tool, and encapsulate each type of node retrieval function into an independent retrieval MCP tool. The MCP service module is used to host the MCP tool set generated by the MCP tool encapsulation module and to provide MPC tool invocation services to each agent module.

[0008] Fourthly, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the AI-based visual script game engineering automatic generation method described above.

[0009] Fifthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the artificial intelligence-based visual script game engineering automatic generation method described above.

[0010] Sixthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the artificial intelligence-based visual script game engineering automatic generation method described above.

[0011] According to the specific embodiments provided in this application, the following technical effects are disclosed: This application provides an AI-based method for automatically generating visual script game projects. Each visual script node is encapsulated as an independent, self-descriptive node MCP tool, enabling large language models (agents) to understand and invoke nodes in a deterministic and stable manner, eliminating the ambiguity and instability inherent in traditional interface documentation-based approaches. After MCP tool encapsulation, separate interface documentation is no longer necessary; node descriptions are mapped to the definitions of each MCP tool, allowing agents to correctly use nodes without requiring a comprehensive understanding of the entire document's context. Furthermore, requirements analysis, node selection, logic orchestration, engineering specifications, and quality assurance are assigned to different agent roles, working collaboratively through message protocols. This simulates the division of labor within a real game development team. This multi-agent, specialized architecture is better suited for handling complex game behaviors and large-scale projects, avoiding the limitations of single agents in terms of context and reasoning depth. Additionally, multi-level verification points are set after node selection, connection establishment, layout completion, and before final output, and error attribution and correction instructions direct problems to specific agents for correction. Attached Figure Description

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

[0013] Figure 1 This is a flowchart illustrating an artificial intelligence-based method for automatically generating visual script game projects according to an embodiment of this application. Figure 2 This is a flowchart illustrating an artificial intelligence-based method for automatically generating visual script game projects according to one embodiment of this application. Figure 3 This is an example architecture diagram of a visual script game project automatic generation system according to one embodiment of this application; Figure 4 This is an example of an artificial intelligence-based method for automatically generating visual script game projects in one embodiment of this application; Figure 5 This is Example 2 of an AI-based method for automatically generating visual script game projects, as described in one embodiment of this application. Detailed Implementation

[0014] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0015] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0016] The AI-based visual script game engineering automatic generation method provided in this application embodiment can be executed by a single computer device or multiple computer devices.

[0017] In one embodiment, the AI-based visual script game engineering automatic generation method is implemented by multiple intelligent agents, which can be installed on different computer devices or on the same computer device.

[0018] The multiple intelligent agents are a requirements analysis agent, a node selection agent, a logic orchestration agent, an engineering specification agent, and a quality assurance agent. The AI-based method for automatically generating visual script game engineering projects includes a preprocessing step and steps S110 to S150.

[0019] Preprocessing steps: Obtain the node library of the visualization script engine, encapsulate each type of node in the node library into an independent node MCP tool, encapsulate each type of node graph operation into an independent operation MCP tool, and encapsulate each type of node retrieval function into an independent retrieval MCP tool.

[0020] The preprocessing step is used to generate node MCP tools, operate MCP tools, and retrieve MCP tools.

[0021] The preprocessing step is executed by the computing device where the MCP server resides (typically a game engine server or development tool backend). The input to the preprocessing step is the node library of the visual scripting engine. This node library definition includes port definitions, attribute descriptions, and type constraints for various node types.

[0022] After obtaining the node library of the visualization script engine, different types of nodes are encapsulated into different MCP tools, which are called node MCP tools.

[0023] Each node MCP tool contains complete self-description information: tool name, function description, input parameter definition (corresponding node's input ports and attributes), output result definition (corresponding node's output ports), type constraints, and usage examples.

[0024] Each node's MCP tool is a self-explanatory, independent module containing all the information needed to understand and use the corresponding node, without referencing external rules or documentation.

[0025] Each node in the MCP tool's data structure includes a node identifier (nodeId), a list of properties (including key names, types, and descriptions), a list of control flow outputs (controlOutputs), a list of data flow outputs (valueOutputs), and type constraints (typeConstraints). For example, for a key detection node, the properties define the key code, and the control flow outputs define the key press event.

[0026] After encapsulating each type of node into a different independent node MCP tool, it is also necessary to encapsulate each node retrieval function into an independent retrieval MCP tool, so that the subsequent node selection agent can call different retrieval MCP tools to select different types of nodes.

[0027] For example, the node retrieval function is encapsulated as an MCP tool, including: querying a node list by functional domain, searching for nodes by semantic description, and obtaining detailed node definitions. These MCP tools enable agents to obtain node information on demand, rather than loading the entire node library at once.

[0028] Meanwhile, to facilitate the intelligent construction of node graphs through logical orchestration, node graph operations (such as creating nodes, deleting nodes, creating connections, setting attributes, setting positions, etc.) need to be encapsulated into MCP tools, with clearly defined parameters for each operation tool. For example, the node creation (createNode) MCP tool receives the node type ID and initial position, and returns a unique identifier for the newly created node.

[0029] In summary, the preprocessing step outputs a set of self-descriptive MCP tools, covering functions such as node definition, node query, and node graph operations. By encapsulating nodes as MCP tools, large language models can understand and invoke nodes in a deterministic and stable manner, eliminating the ambiguity and instability issues inherent in traditional interface documentation-based holistic understanding methods.

[0030] Step S110: The requirements analysis agent obtains natural language requirements and generates and outputs structured functional specifications based on the natural language requirements.

[0031] The execution entity for step S110 is the computing device housing the requirements analysis agent. Its input is the game logic requirements described by the user in natural language, such as "Create a character controller for a 2D platformer game...". After obtaining the natural language requirements (which can be in text or speech form), intent recognition is performed to obtain the approximate categories of game functions (such as input processing, movement control, damage handling, etc.). The requirements are functionally decomposed to identify several functional modules and their data dependencies. These different functional modules and their data dependencies constitute a structured functional specification. The data structure of the structured functional specification includes the name, description, parameters, conditions of the functional modules, and the data dependencies between the functional modules.

[0032] In step S120, the node selection agent calls the retrieval MCP tool to retrieve node MCP tools that conform to the structured functional specifications in order to obtain and output the target node MCP tool set.

[0033] Based on the structured functional specifications, the required node type can be determined. Then, the retrieval MCP tool can be called to filter out the corresponding node MCP tools, and finally, the target node MCP tool set is output. The target node MCP tool set is the set of node MCP tools corresponding to the required node type.

[0034] Preferably, a hierarchical retrieval strategy can be adopted to improve retrieval efficiency.

[0035] Specifically, the retrieval MCP tool includes a first sub-retrieval MCP tool, a second sub-retrieval MCP tool, and a third sub-retrieval MCP tool. The first sub-retrieval MCP tool is used to query nodes by functional domain, the second sub-retrieval MCP tool is used to search for nodes by semantic description, and the third sub-retrieval MCP tool is used to obtain the node MCP tool corresponding to the node.

[0036] The process involves using a retrieval MCP tool to retrieve node MCP tools that conform to the structured functional specifications, thereby obtaining and outputting a set of target node MCP tools. Specifically, this includes: obtaining a list of node functional domains, which includes nodes from different functional domains; determining multiple target functional domains based on the structured functional specifications; using a first sub-retrieval MCP tool to filter nodes from the list of node functional domains for each target functional domain; using a second sub-retrieval MCP tool to filter multiple target nodes from the nodes in the multiple target functional domains that conform to the semantic descriptions of the structured functional specifications; using a third sub-retrieval MCP tool to obtain the node MCP tools corresponding to the multiple target nodes, which together constitute the target node MCP tool set; and finally, outputting the target node MCP tool set.

[0037] The above retrieval is divided into three levels: functional domain index layer retrieval, semantic summary layer retrieval, and detailed interface layer on-demand retrieval.

[0038] For example, firstly, the `listNodeCategories` MCP tool is called to obtain a list of node functional domains, such as input processing, physical systems, AI behavior, and UI interaction. Then, based on the functional module descriptions in the structured functional specifications, the `getNodesByCategory` MCP tool (the first sub-retrieval MCP tool) is called to filter out nodes in the relevant functional domains, including brief information about these nodes (node ​​ID + semantic summary). Secondly, the `searchNodesByDescription` MCP tool (the second sub-retrieval MCP tool) is called to calculate the semantic similarity between the semantic summaries of the nodes in the relevant functional domains and the structured functional specifications, selecting nodes with scores exceeding a threshold as target nodes, and generating a sorted list of target nodes. Finally, the `getNodeFullDefinition` MCP tool (the third sub-retrieval MCP tool) is called to obtain the complete MCP tool definition corresponding to the target node, i.e., the corresponding node MCP tool, which includes control flow ports, data flow ports, attribute definitions, type constraints, etc.

[0039] In summary, the node selection agent outputs a set of node MCP tools that meet the functional requirements (target node MCP tool set), along with corresponding semantic information.

[0040] In step S130, the logic orchestration agent constructs and outputs the original visual script node graph structure based on the structured functional specifications, the target node MCP tool set, and the operation MCP tool.

[0041] The execution subject of step S130 is the computer device where the logic orchestration agent is located, and its input is the structured functional specification and the target node MCP tool set.

[0042] Specifically, the tools for operating MCP include the node creation MCP tool and the connection creation MCP tool.

[0043] Based on the structured functional specifications, the target node MCP toolkit, and the operation MCP toolkit, the original visual script node graph structure is constructed and output. Specifically, this includes: dividing the structured functional specifications into several semantic subgraphs, each corresponding to a function; for each semantic subgraph, calling the node creation MCP toolkit to create the nodes required for the semantic subgraph based on the target node MCP toolkit, calling the connection creation MCP toolkit to create connections between nodes based on the control flow and data flow relationships between nodes, marking the external exposed ports of the semantic subgraph, including input ports and output ports; calling the connection creation MCP toolkit to create connections between the external exposed ports of different semantic subgraphs to form the original visual script node graph structure; and outputting the original visual script node graph structure.

[0044] First, based on the different functional modules in the structured functional specification, the overall functionality is divided into several semantic subgraphs. Each semantic subgraph corresponds to a specific functional responsibility, such as "input processing," "ground detection," and "damage handling." The data structure of each semantic subgraph includes: a unique identifier (id), a semantic label (e.g., "InputProcessing"), a description of the functional purpose (purpose), a list of nodes (nodes, including node type, location, and attributes), a list of internal connections (internalConnections), and externally exposed input ports (exposedInputs) and output ports (exposedOutputs).

[0045] Then, within each semantic subgraph, the `createNode` MCP tool is invoked according to the module's function to create the required nodes. Since the target node MCP tool set contains the required different types of node MCP tools, and each node MCP tool contains all the usage information for its corresponding type of node, the `createNode` MCP tool can directly create the corresponding nodes at different positions within the semantic subgraph based on the target node MCP tool set, without requiring additional documentation or rules. Additionally, the `createConnection` MCP tool is invoked to create connections between nodes according to control flow and data flow relationships, and to mark the input and output ports exposed by the semantic subgraph.

[0046] Finally, based on the data dependencies between functional modules in the structured functional specification, the createConnection MCP tool is called to connect the exposed ports of different semantic subgraphs, forming the overall visualization script logic. The final output is the original visualization script node graph structure, including subgraph partitioning, node list, connection relationships, etc.

[0047] Step S140: The engineering specification agent performs standardization adjustments on the original visualization script node graph structure to generate and output a standardized visualization script project.

[0048] The execution subject of step S140 is the computer device where the engineering specification intelligent agent is located, and its input is the original visual script node graph structure.

[0049] Specifically, the standardization adjustments include layout standardization, naming standardization, and annotation generation.

[0050] Layout standardization includes adjusting the positions of nodes in the original visual script node graph structure according to preset layout rules. For example, the execution flow direction is from left to right, the horizontal and vertical spacing between nodes is uniform, and a certain amount of inner margin is left at the boundaries of subgraphs.

[0051] Naming standardization includes: unifying the naming of nodes and semantic subgraphs in the original visual script node graph structure according to functional semantics and engineering naming conventions (such as camelCase naming, prefixes to indicate functional modules, etc.).

[0052] Annotation generation includes generating annotations for each semantic subgraph in the original visual script node graph structure. Specifically, it generates a brief functional description and input / output summary for each semantic subgraph, and adds Chinese annotations to the semantic subgraph to improve readability.

[0053] After the above standardization adjustments, the final output is a standardized visual script project, including standardized layout, naming, and comments.

[0054] In step S150, the quality assurance agent performs quality verification and analysis on the visual script project to generate a verification report. Based on the verification report, it generates correction instructions for different agents, which are used to guide the corresponding agents to correct their outputs.

[0055] The execution entity of step S150 is the computer device where the quality assurance agent is located, and its input is a standardized visual script project.

[0056] Specifically, quality verification and analysis include interface compatibility verification, logical integrity verification, and static runtime problem analysis.

[0057] Interface compatibility verification includes: checking whether the data types of the source port and the target port match in each connection; and checking whether all control flow ports are properly connected.

[0058] Logical integrity verification includes detecting the presence of unconnected required input ports, dangling control branches, and potentially dead code branches.

[0059] Static runtime problem analysis includes: predicting possible runtime errors (such as null references, uninitialized data, unhandled events, etc.) based on static analysis.

[0060] The final output is a verification report. For example, the verification report includes pass / fail flags, error locations, error types, recommended remediation suggestions, etc.

[0061] If the verification report shows that it has passed, a visual script project can be directly output, and an optional manual review process can be triggered according to the configuration.

[0062] If the verification report shows a failure or provides optimization suggestions, the quality assurance agent will perform an attribution analysis on the error, locate the error to a specific semantic subgraph, node, or connection, and provide the error type.

[0063] Based on the verification report, correction instructions are generated for different agents. Specifically, this includes: determining the error type based on the verification report, which includes errors such as improper understanding of requirements, incorrect node selection, connection logic errors, and layout / naming errors; if there are errors in improper understanding of requirements, correction instructions are generated for the requirements analysis agent; if there are errors in node selection, correction instructions are generated for the logic orchestration agent; if there are errors in connection logic, correction instructions are generated for the logic orchestration agent; and if there are layout / naming errors, correction instructions are generated for the engineering specification agent.

[0064] The determination of error types based on the verification report is achieved through the semantic reasoning capabilities of the large language model. Specifically, in addition to basic connection-level verification, a deep review based on the chain-of-thought is also performed: the structured functional specifications are used as the "benchmark truth," the generated visual script engineering is described as the "object to be tested," and the quality assurance agent is guided to perform multi-dimensional semantic alignment analysis.

[0065] For example, the agent reflects: "The user requirement is 'apply upward force when jumping.' Although the current graph structure has an 'AddForce' node, its trigger condition is only connected to 'Update' instead of 'JumpInput'," thus deducing that this is a "logical connection error" rather than a simple "missing node." Similarly, if the generated node is named "Node_1" instead of "PlayerController," the agent judges based on the engineering specification knowledge base that this reduces readability, thus classifying it as a "layout / naming error."

[0066] After each agent receives its own correction instruction, it makes the corresponding correction and updates its output. Through multiple iterations, the visual script project continues until it meets the requirements of logical correctness and maintainability.

[0067] It should be noted that for scenarios requiring human intervention, a review request can be sent to the developer to collect human ratings, a list of issues, and improvement suggestions. The human editing operations can be recorded as preference information for subsequent generation and optimization.

[0068] The overall process of the AI-based visual script game engineering automatic generation method in this embodiment is as follows: Figure 2 As shown.

[0069] In summary, the AI-based method for automatically generating visual script game projects in this embodiment has the following characteristics: 1. MCP tool-based encapsulation mechanism for visual nodes: Each visualization script node is encapsulated as an independent, self-descriptional MCP tool, with each tool containing a complete functional description, input / output definitions, and type constraints. This enables large language models to understand and invoke nodes in a deterministic and stable manner, eliminating the ambiguity and instability inherent in traditional holistic understanding of interface documentation. With MCP tool-based encapsulation, separate interface documentation is no longer necessary; node descriptions are embedded within the definitions of individual MCP tools, allowing agents to correctly use nodes without requiring a comprehensive understanding of the entire document.

[0070] 2. Multi-level semantic node retrieval mechanism: A three-tiered structure—functional domain indexing, semantic summary retrieval, and on-demand access to detailed interfaces—solves the usability problem of large-scale node libraries under the contextual constraints of large language models. Combined with the tool-based encapsulation of MCP, it enables on-demand loading of node information, significantly saving resources and improving call efficiency.

[0071] 3. Semantic subgraph-driven maintainability generation strategy: By introducing the concept of "semantic subgraphs", complex logic is broken down into semantic subgraphs with clearly defined functions. Layout rules, naming rules, and annotation generation rules are defined at the semantic subgraph level to ensure maintainability from the source.

[0072] 4. Multi-agent professional division of labor and cooperation architecture: The roles of requirements analysis, node selection, logic orchestration, engineering specifications, and quality assurance are divided into different intelligent agent roles, which work together through message protocols to simulate the division of labor in a real game development team.

[0073] 5. Embedded quality closed loop and precise directional correction mechanism: After node selection, connection establishment, layout completion, and before final output, multiple verification points are set, and the problem is directed to a specific agent for correction through error attribution and correction instructions.

[0074] 6. Human-machine collaborative feedback integration mechanism: Human evaluations and editing behaviors of semantic subgraphs and the overall script are recorded as structured feedback and converted into correction instructions and preference models that can be used by the agent. Specifically, a "self-reflection" mechanism is employed. When a human developer modifies the generated node graph, the system automatically calls a large language model to analyze the "semantic differences before and after the modification" and the "underlying intention of the human modification" (e.g., a human replaces the 'Update' event with 'FixedUpdate' to fix physical jitter). The system converts this intention into a "rule of thumb" or "few-shot examples" in natural language form and stores it in a vector database. When generating similar physical logic in the future, the agent automatically recalls this experience through Retrieval Augmentation Generative Patterns (RAG), thereby avoiding repeating the same mistakes and truly becoming "smarter with use."

[0075] Compared with the prior art, the present invention can produce at least the following beneficial technical effects: 1. The determinism and stability of node understanding are significantly improved: By encapsulating each visualization node as a self-explanatory MCP tool, large language models can directly understand the node's functionality based on the tool definition, without needing to understand the entire interface documentation. It eliminates the ambiguity and probabilistic nature of document understanding in large language models in traditional methods, and significantly improves the accuracy of node invocation; After the MCP tool is encapsulated, the node descriptions correspond one-to-one with the tool definitions, eliminating the need for additional external rule references and reducing the probability of misunderstanding.

[0076] 2. Context resource consumption is significantly reduced: Through multi-level semantic retrieval, the complete interface definition of a node is obtained only when it is needed, reducing the amount of information used for describing the node library. Theoretically, this can reduce context consumption by more than 80%. MCP's tool-based encapsulation makes each node's information independent, allowing individual nodes to be used correctly without loading the complete node library.

[0077] 3. Significantly improved maintainability: Semantic subgraph partitioning, unified layout rules, and naming conventions make the generated script structure clear, easy to read, and easy to maintain. Human developers can quickly locate the semantic subgraph corresponding to a certain function and make local modifications and extensions.

[0078] 4. Improved stability of generated quality: By leveraging interface compatibility verification, logical integrity verification, and static analysis mechanisms, the initial logical correctness rate is significantly higher than that of traditional end-to-end generation solutions. After multiple rounds of iterative corrections, the logical accuracy can approach the level of manual development.

[0079] 5. Supports complex logic and large-scale projects: The multi-agent specialized architecture is more suitable for handling complex game behaviors and large-scale projects, avoiding the limitations of single agents in terms of context and reasoning depth.

[0080] 6. Improved efficiency of human-machine collaboration: Human developers no longer need to write node graphs from scratch, but instead review and make local adjustments to the results generated by large language models; Through feedback integration mechanisms, human preferences will gradually solidify into the system's default norms, and the quality of subsequent generation will continue to improve.

[0081] The following is an implementation example of an AI-based visual script game project auto-generation method.

[0082] Example 1: Generating a character controller for a 2D platforming game.

[0083] User requirements: "Create a character controller for a 2D platforming game that supports WASD for movement and spacebar for jumping. The character can jump when it hits the ground and will take damage when it hits an enemy."

[0084] Reference Figure 4 The implementation process is as follows: 1. The structured functional specifications output by the requirements analysis module include: Module 1: Input Processing (Handling WASD and Spacebar); Module 2: Movement Control (Horizontal speed is set based on input); Module 3: Jump Control (Applies an upward force when the character is on the ground and the spacebar is pressed); Module 4: Ground Detection (Detecting whether a character is on the ground); Module 5: Damage Handling (Health is reduced upon collision with an enemy); Data dependency: The horizontal input of the input processing output is used for movement control; the ground detection output, indicating whether the device is on the ground, is used for jump control, etc.

[0085] 2. The node selection module selects nodes through multi-level retrieval: Functional Domain 1: Input → Obtain horizontal input nodes and key event nodes; Functional Domain 2: Physics → Rigid body velocity setting, force application, ray detection, and other nodes; Functional Domain 3: Collision → Collision Events and Label Detection Nodes; For each candidate node, calculate the semantic similarity and select the node with the higher score, then obtain detailed interface information.

[0086] 3. The logical orchestration module constructs semantic subgraphs: The "Input Processing" subgraph contains nodes for acquiring horizontal input and space bar press events, and exposes horizontal input values ​​and jump press signals to the outside world. The "Ground Detection" subgraph determines whether a character is on the ground through nodes such as ray detection, and outputs a Boolean value indicating whether the character is exposed to the outside world. "Motion Control" subgraph: Multiply the horizontal input value by the velocity coefficient to set the horizontal velocity of the rigid body; The "Jump Control" subgraph performs a logical AND operation between the jump press signal and whether the ground is on the ground. If the condition is met, the node that applies upward force is called. The "Damage Handling" subgraph determines whether the collision object's label is "enemy" during a collision event; if so, it calls the life deduction node.

[0087] 4. Layout and naming conventions for the engineering specifications module: Arrange the semantic subgraphs from left to right according to the data flow, and unify the node spacing; Name the semantic subgraphs with Chinese or mixed Chinese and English names such as "InputProcessing" or "GroundDetection"; Add Chinese annotations to each semantic subgraph to explain its function and input / output.

[0088] 5. The quality assurance module is verified: Verify that all required input ports are connected and of the correct type; Check the control flow path for completeness and avoid dead branches; Static analysis suggests adding a "jump cooldown" to prevent excessive consecutive jumps.

[0089] Example of bug fix: If a missing transition condition (error type INCOMPLETE_STATE_TRANSITION) is detected in the AttackBehavior subgraph when switching back from "Attack State" to "Patrol State", the quality assurance module will generate a fix instruction for the logic orchestration agent. Upon receiving the instruction, the logic orchestration agent automatically inserts an OnTargetLost event node into the attack subgraph and connects it to the patrol state entry point, thereby fixing the logic vulnerability.

[0090] 6. Human Developer Review and Feedback: Based on the suggestions, the developers added a cooldown timer node to the "Jump Control" subgraph; The system records this manual editing operation, so that the jump control mode with a cooling mechanism will be given priority in subsequent similar requirements.

[0091] Example 2: Generation and iterative correction of AI behavior for patrolling, pursuing, and attacking enemies.

[0092] User requirement: "Create an enemy AI behavior of patrol-pursuit-attack. When the enemy spots the player in its field of vision, it will pursue, attack, and return to patrol after losing sight of the target."

[0093] Reference Figure 5 The implementation process is as follows: 1. Initial generation: The requirements analysis module divides the behavior into three state modules: "patrol state", "pursuit state" and "attack state", and defines the state transition conditions; The node selection and logic orchestration module constructs the corresponding behavior tree or state pattern visualization diagram.

[0094] 2. Quality Assurance Module Testing Issues: Static analysis revealed that the transition condition from "attack state" to "patrol state" was missing, meaning that the target failed to return to patrol after being completely lost. The quality assurance module attributed the problem to the logic orchestration stage and generated a correction instruction: add a "target lost" condition and the corresponding state transition connection to the attack subgraph.

[0095] 3. Second round of revisions: Based on the correction instructions, the logic orchestration module adds a "target loss event" node to the attack subgraph and connects it to the patrol status entry.

[0096] 4. Verify again: The quality assurance module confirms that all state transition paths are complete and that there are no dead ends in the control flow, and outputs a verification report indicating that the process has passed.

[0097] 5. Human Developer Review: If the developer believes that "the pursuit state should return to patrol even after timeout", a timeout transition can be manually added to the "pursuit state" subgraph; The system records this preference to provide a reference for generating similar AI behaviors in the future.

[0098] The above is an embodiment of an AI-based visual script game engineering automatic generation method implemented through multiple intelligent agents. These intelligent agents can reside on the same computer device or on the same computer device. When they reside on the same computer device, the AI-based visual script game engineering automatic generation method is executed by a single computer device. Exemplarily, in another embodiment, the AI-based visual script game engineering automatic generation method is executed by a single computer device, which includes steps S210 to S260.

[0099] Step S210: Obtain the node library of the visualization script engine.

[0100] Step S220: Each node in the node library is encapsulated as an independent node MCP tool, each type of node graph operation is encapsulated as an independent operation MCP tool, and each type of node retrieval function is encapsulated as an independent retrieval MCP tool.

[0101] Step S230: Obtain natural language requirements and generate and output structured functional specifications based on natural language requirements; Step S240: Call the MCP retrieval tool to retrieve node MCP tools that conform to the structured functional specifications in order to obtain and output the target node MCP tool set.

[0102] Step S250: Construct and output the original visual script node graph structure based on the structured functional specifications, the target node MCP tool set, and the operation MCP tool.

[0103] Step S260: Standardize and adjust the original visualization script node graph structure to generate and output a standardized visualization script project.

[0104] It should be noted that the specific description of each step of the AI-based visual script game engineering automatic generation method in this embodiment can be found in the previous embodiment, and will not be repeated here.

[0105] In another embodiment, a visual script game engineering automatic generation system is also provided, which can be deployed on a server, cloud platform, or local development environment. (See also...) Figure 3 The visual script game engineering automatic generation system includes an MCP tool-based encapsulation module, an MCP service module (preprocessing layer), and multiple intelligent agents (generation processing layer). The multiple intelligent agents are a requirements analysis intelligent agent, a node selection intelligent agent, a logic orchestration intelligent agent, an engineering specification intelligent agent, and a quality assurance intelligent agent.

[0106] The requirements analysis agent is used to obtain natural language requirements and generate and output structured functional specifications based on the natural language requirements.

[0107] The node selection agent is used to call the retrieval MCP tool to retrieve node MCP tools that conform to the structured functional specifications in order to obtain and output the target node MCP tool set.

[0108] The logic orchestration agent is used to construct and output the original visual script node graph structure based on the structured functional specifications, the target node MCP tool set, and the operation MCP tools.

[0109] The engineering specification intelligent agent is used to standardize and adjust the original visualization script node graph structure to generate and output a standardized visualization script project.

[0110] The quality assurance agent is used to perform quality verification and analysis on the visual script project to generate a verification report. Based on the verification report, it generates correction instructions for different agents, which are used to guide the corresponding agents to correct their output.

[0111] The MCP toolkit encapsulation module is used to: obtain the node library of the visualization script engine, encapsulate each type of node in the node library into an independent node MCP tool, encapsulate each type of node graph operation into an independent operation MCP tool, and encapsulate each type of node retrieval function into an independent retrieval MCP tool.

[0112] The MCP service module hosts the MCP toolkit generated by the MCP toolkit encapsulation module and provides MCP tool invocation services to various agent modules. Simultaneously, the MCP service module exposes node operation interfaces to external visual script editors or engines, including node creation, connection, attribute setting, and verification invocation.

[0113] In one exemplary embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0114] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0115] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0116] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0117] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0118] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0119] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0120] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for automatically generating visual script game projects based on artificial intelligence, characterized in that, It is implemented by multiple intelligent agents, namely, a demand analysis intelligent agent, a node selection intelligent agent, a logic orchestration intelligent agent, an engineering specification intelligent agent, and a quality assurance intelligent agent; The AI-based method for automatically generating visual script game projects includes: The requirement analysis agent acquires natural language requirements and generates and outputs structured functional specifications based on the natural language requirements; The node selection agent calls the MCP retrieval tool to retrieve node MCP tools that conform to the structured functional specifications in order to obtain and output the target node MCP tool set. The logical orchestration agent constructs and outputs the original visual script node graph structure based on the structured functional specifications, the target node MCP tool set, and the operation MCP tools. The engineering specification intelligent agent standardizes and adjusts the original visualization script node graph structure to generate and output a standardized visualization script project. The quality assurance agent performs quality verification and analysis on the visualization script project to generate a verification report, and generates correction instructions for different agents based on the verification report. The correction instructions are used to guide the corresponding agents to correct their output. The encapsulation steps of the node MCP tool, the operation MCP tool, and the retrieval MCP tool are as follows: obtain the node library of the visualization script engine, encapsulate each node in the node library into an independent node MCP tool, encapsulate each type of node graph operation into an independent operation MCP tool, and encapsulate each type of node retrieval function into an independent retrieval MCP tool.

2. The method for automatically generating visual script game projects based on artificial intelligence according to claim 1, characterized in that, The data structure of each node MCP tool includes a node identifier, an attribute list, a control flow output list, a data flow output list, and type constraints.

3. The method for automatically generating visual script game projects based on artificial intelligence according to claim 1, characterized in that, The retrieval MCP tool includes a first sub-retrieval MCP tool, a second sub-retrieval MCP tool, and a third sub-retrieval MCP tool. The first sub-retrieval MCP tool is used to query nodes by functional domain, the second sub-retrieval MCP tool is used to search nodes by semantic description, and the third sub-retrieval MCP tool is used to obtain the node MCP tool corresponding to the node. The MCP retrieval tool is invoked to retrieve node MCP tools that conform to the structured functional specifications, thereby obtaining and outputting the target node MCP tool set, specifically including: Obtain a list of node functional domains, which includes nodes with different functional domains; Based on the structured functional specifications, multiple target functional domains are determined, and the first sub-retrieval MCP tool is invoked to filter out nodes of multiple target functional domains from the list of node functional domains; The second sub-retrieval MCP tool is invoked to filter out multiple target nodes that conform to the semantic description of the structured functional specification from the nodes of multiple target functional domains; The third sub-retrieval MCP tool is invoked to obtain multiple node MCP tools corresponding to the target nodes, and the multiple node MCP tools corresponding to the target nodes constitute the target node MCP tool set. Output the target node MCP toolkit.

4. The method for automatically generating visual script game projects based on artificial intelligence according to claim 1, characterized in that, The second MCP tool includes a node creation MCP tool and a connection creation MCP tool; Based on the structured functional specifications, the target node MCP toolset, and the operational MCP tools, the original visual script node graph structure is constructed and output, specifically including: The structured functional specification is divided into several semantic subgraphs, each of which corresponds to a function; For each semantic subgraph, the node creation MCP tool is invoked to create the nodes required for the semantic subgraph based on the target node MCP tool set. The connection creation MCP tool is invoked to create connections between nodes based on the control flow and data flow relationships between nodes. The exposed ports of the semantic subgraph are marked, including input ports and output ports. The connection creation MCP tool is invoked to create connections between the exposed ports of different semantic subgraphs to form the original visual script node graph structure; Output the original visualization script node graph structure.

5. The method for automatically generating visual script game projects based on artificial intelligence according to claim 4, characterized in that, The standardization adjustments include layout standardization, naming standardization, and annotation generation; The layout standardization includes: adjusting the positions of nodes in the original visual script node graph structure according to preset layout rules; The naming standardization includes: uniformly naming the nodes and semantic subgraphs in the original visual script node graph structure according to functional semantics and engineering naming conventions; The annotation generation includes generating annotations for each semantic subgraph in the original visualization script node graph structure.

6. The method for automatically generating visual script game projects based on artificial intelligence according to claim 5, characterized in that, The quality verification and analysis include interface compatibility verification, logical integrity verification, and static runtime problem analysis.

7. The method for automatically generating visual script game projects based on artificial intelligence according to claim 5, characterized in that, Based on the verification report, correction instructions are generated for different intelligent agents, specifically including: The error types are determined based on the verification report, and these error types include errors due to improper understanding of requirements, errors in node selection, errors in connection logic, and errors in layout / naming. If there is an error in the understanding of the requirements, a correction instruction will be generated for the intelligent agent analyzing the requirements. If there is an error in the node selection, a correction instruction for the logical orchestration agent will be generated. If the connection logic error exists, a correction instruction for the logic orchestration agent is generated. If the layout / naming errors exist, a correction instruction for the engineering specification agent is generated.

8. A method for automatically generating visual script game projects based on artificial intelligence, characterized in that, include: Obtain the node library for the visualization script engine; Each node in the node library is encapsulated as an independent node MCP tool, each type of node graph operation is encapsulated as an independent operation MCP tool, and each type of node retrieval function is encapsulated as an independent retrieval MCP tool. Obtain natural language requirements and generate and output structured functional specifications based on those requirements; Call the MCP retrieval tool to retrieve node MCP tools that conform to the structured functional specifications to obtain and output the target node MCP tool set; Based on the structured functional specifications, the target node MCP toolset, and the operating MCP tools, construct and output the original visual script node graph structure; The original visualization script node graph structure is standardized and adjusted to generate and output a standardized visualization script project.

9. A visual script game project automatic generation system, characterized in that, It includes an MCP tool encapsulation module, an MCP service module, and multiple intelligent agents, namely a demand analysis intelligent agent, a node selection intelligent agent, a logic orchestration intelligent agent, an engineering specification intelligent agent, and a quality assurance intelligent agent; The requirement analysis agent is used to acquire natural language requirements and generate and output structured functional specifications based on the natural language requirements; The node selection agent is used to call the MCP retrieval tool to retrieve node MCP tools that conform to the structured functional specifications in order to obtain and output the target node MCP tool set. The logical orchestration agent is used to construct and output the original visual script node graph structure based on the structured functional specifications, the target node MCP tool set, and the operation MCP tools. The engineering specification intelligent agent is used to standardize and adjust the original visualization script node graph structure to generate and output a standardized visualization script project. The quality assurance agent is used to perform quality verification and analysis on the visualization script project to generate a verification report, and to generate correction instructions for different agents based on the verification report. The correction instructions are used to guide the corresponding agents to correct their output. The MCP tool encapsulation module is used to: obtain the node library of the visualization script engine, encapsulate each type of node in the node library into an independent node MCP tool, encapsulate each type of node graph operation into an independent operation MCP tool, and encapsulate each type of node retrieval function into an independent retrieval MCP tool. The MCP service module is used to host the MCP tool set generated by the MCP tool encapsulation module and provide MPC tool invocation services to each agent module.

10. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that the processor executes the computer program to implement the AI-based visual script game engineering automatic generation method according to any one of claims 1-8.