A virtual role-based game testing method and system, and a storage medium

By acquiring the visual range and scene function data of virtual characters, generating simulated operation paths that match the viewpoint, and comparing them with preset results, the problems of low coverage and high cost in traditional game testing are solved, achieving efficient automated testing and quality assurance.

CN122309349APending Publication Date: 2026-06-30FUJIAN TQ ONLINE INTERACTIVE INC

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
FUJIAN TQ ONLINE INTERACTIVE INC
Filing Date
2026-02-14
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Traditional game testing methods cannot fully cover the player's real perspective, making it difficult to discover hidden defects. In addition, manual testing is costly and inefficient, and cannot guarantee consistent quality across multiple platforms and language versions.

Method used

By acquiring the current visible range of the virtual character under test, reading scene function data, generating a simulated operation path that matches the viewpoint, and comparing it with the preset results, panoramic automated verification is achieved.

Benefits of technology

This improved test coverage, shortened the testing cycle, reduced labor costs, and ensured consistent quality across multiple platforms and languages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122309349A_ABST
    Figure CN122309349A_ABST
Patent Text Reader

Abstract

This application provides a game testing method, system, and storage medium based on virtual characters. Starting from the first-person perspective of the virtual character under test, it first acquires the game scene currently visible to the player through the visible range, and then obtains scene function data, such as interactive items, NPCs, and quest points. Subsequently, this function data is combined with the virtual character's own information, and a series of simulated operation paths are generated using a behavior planning algorithm. Each path represents a series of actions the player might perform from that perspective, with the expected result pre-set for each step. Finally, each path is executed step-by-step in the game, and the actual results are compared with the preset results to obtain the pass / fail information for each path. In this way, by automatically generating a complete operation sequence matching the player's perspective, it helps to trigger hidden vulnerabilities, thereby improving test coverage and defect discovery efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of game testing, and in particular to a game testing method, system, and storage medium based on virtual characters. Background Technology

[0002] With the rapid development of online games and virtual reality applications, the complexity of game content is increasing exponentially. Traditional game testing mainly relies on manual scripts or keyboard macros to simulate player operations. However, these scripts are often based on pre-defined paths and cannot cover all possible interaction combinations.

[0003] Furthermore, traditional methods cannot delve into the game's internal state (such as memory data and NPC script logic) for verification, making it difficult to detect hidden defects (such as tampered transactions, stuck tasks, and abnormal NPC reactions) in a timely manner. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a game testing method, system and storage medium based on virtual characters, which can improve test coverage and defect discovery efficiency.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows: A game testing method based on virtual characters includes: Obtain the current visible range of the virtual character under test, and read the scene function data of the corresponding visible scene based on the current visible range; Based on all the scene function data and the information of the virtual character under test, a simulated operation path for the virtual character under test is generated, and a preset operation result for each simulated operation path is configured. Execute each of the simulated operation paths, compare the execution results with the corresponding preset operation results, and obtain the test results for each simulated operation path.

[0006] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A game testing system based on virtual characters includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the aforementioned game testing method based on virtual characters.

[0007] To solve the above-mentioned technical problems, another technical solution adopted by the present invention is as follows: A computer storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned game testing method based on virtual characters.

[0008] The beneficial effects of this invention are as follows: Starting from the first-person perspective of the virtual character under test, the system first acquires the game scene currently visible to the player through the visible range, and then obtains scene function data, such as interactive props, NPCs, and quest points. Subsequently, this function data is combined with the virtual character's own information, and a series of simulated operation paths are generated using a behavior planning algorithm. Each path represents a series of actions the player might perform from that perspective, with the expected result of each step pre-set. Finally, each path is executed step-by-step in the game, and the actual results are compared with the preset results to obtain the pass / fail information for each path. In this way, by automatically generating a complete operation sequence matching the player's perspective, it helps to trigger hidden vulnerabilities, thereby improving test coverage and defect discovery efficiency. Attached Figure Description

[0009] Figure 1 This is a flowchart of a game testing method based on virtual characters according to an embodiment of the present invention; Figure 2 A flowchart illustrating the AI ​​extended data type in an embodiment of the present invention; Figure 3 This is a schematic diagram of a game testing system based on virtual characters according to an embodiment of the present invention. Detailed Implementation

[0010] Definitions:

[0011] To explain in detail the technical content, objectives, and effects of the present invention, the following description is provided in conjunction with the embodiments and accompanying drawings.

[0012] Currently, the gaming industry commonly employs manual testing methods based on scripts or keyboard macros, or uses memory injection / debugging tools for internal simulation. However, these techniques are often limited to known paths and lack coverage of the player's actual perspective, resulting in a large number of hidden defects going undiscovered. This is especially true in MMOs, shooters, or role-playing games, where player interaction paths are complex and varied, making it difficult for a single script to cover all possible equipment trading, quest execution, or multiplayer cooperative scenarios. Meanwhile, manual testing is costly, inefficient, and easily influenced by the tester's experience and fixed mindset, making it impossible to systematically evaluate the game's stability and security under different scenarios and character configurations.

[0013] In real-world applications, game companies need to achieve consistent quality assurance across multiple platforms (PC, mobile, VR) and language versions. Testing teams often need to repeatedly execute the same test scripts on different operating systems, with different hardware configurations, and under different network conditions, and they also need to handle massive amounts of logs and screenshots. The lack of unified first-person perspective mapping and automated path generation tools leads to long testing times and high defect rates.

[0014] To at least address the aforementioned issues, this invention provides a game testing method based on virtual characters. This method directly utilizes the player's field of vision to construct a test scenario, automatically generates operation paths that match the viewpoint, and achieves panoramic automated verification through preset result comparison. In this way, test coverage can be improved, the test cycle can be shortened, and labor costs can be reduced.

[0015] The following details a game testing method based on virtual characters according to the present invention. Please refer to [link / reference]. Figure 1 This includes steps 101 to 103.

[0016] Step 101: Obtain the current visible range of the virtual character to be tested, and read the scene function data of the corresponding visible scene based on the current visible range.

[0017] Specifically, the system first obtains the camera parameters of the virtual character under test from the game engine, including the viewpoint angle, near plane, far plane, and the character's current position and orientation. These parameters are then used to calculate the volume of the view frustum in 3D space, and a set of objects located within the view frustum is selected. Subsequently, the system reads the scene function data of these objects, i.e., the interactive elements defined in the data table or script, along with their attributes, positions, and behavioral descriptions. This process is applicable to large maps in MMOs, VR headset perspectives, or the real-time field of view in shooting games, ensuring that subsequent steps can generate simulated operation paths based on the elements actually visible to the player corresponding to the virtual character under test.

[0018] Step 102: Generate a simulated operation path for the virtual character under test based on all the scene function data and the information of the virtual character under test, and configure the preset operation result for each simulated operation path.

[0019] Specifically, firstly, the scene function data (NPCs, props, triggers, event scripts, etc.) of the visual scene obtained in step 101 are sorted according to spatial location, interaction type, and priority; then, using the information of the virtual character (skills, equipment, status, target list), a path planning algorithm (such as A) is employed. A series of executable simulated operation paths are generated (or behavior tree sequences), ensuring that each step of the simulated operation path is within the visible range and meets the prerequisites. Finally, expected operation results (such as NPC dialogue text, item acquisition, and task completion markers) are preset in the test database for each simulated operation path. These preset results are automatically generated based on game rules and script settings.

[0020] Step 103: Execute each of the simulated operation paths, compare the execution results with the corresponding preset operation results, and obtain the test results for each simulated operation path.

[0021] Specifically, each simulated operation path (consisting of a series of key or mouse events) generated in step 102 is sequentially fed into the game engine's automated execution framework. During execution, the operations in the path are applied to game objects by simulating real player input (using virtual input devices or directly injecting events), and changes in the game state are captured in real time. The captured content includes, but is not limited to, character position, animation state, interaction results (such as picking up items, completing tasks), UI feedback, and log output. Subsequently, these real-time captured data are compared field by field with the preset operation results in step 102, and the success or failure of the path is determined based on the matching degree, and the difference information is recorded. The entire process is executed sequentially in a single-threaded or multi-threaded environment to ensure that the test results of each path are consistent with expectations, and finally, a test report that can be used for defect localization is generated.

[0022] As described above, by first obtaining the virtual character's current visible range and reading the corresponding functional data of the visible scene, the test subject is precisely limited within the player's real field of vision, avoiding hidden defects that traditional testing cannot cover. Then, based on complete functional data and character information, simulated operation paths are generated, and expected operation results are preset for each path, ensuring test coverage and repeatability. Finally, the simulated operation paths are executed and compared with the preset results to quickly locate logic and interaction errors.

[0023] In one embodiment of this application, step 101 includes steps 1011 to 1012.

[0024] Step 1011: Extract the location information and skill information of the virtual character to be tested from the character database; calculate the simulated actions of the virtual character to be tested using a behavior algorithm based on the location information and the skill information, encapsulate the simulated actions into behavior nodes and store them in the character behavior tree.

[0025] Specifically, the game engine or backend service first calls the character database interface to obtain the current position (x, y, z) of the virtual character under test, as well as its available skill set and attributes. Then, a preset behavior algorithm (such as A) is used... The path planning and behavior tree node decision model parse this information to generate a series of executable simulated action sequences (such as moving, blocking, and using skills). Each action is encapsulated as an independent behavior node, which includes execution conditions, execution scripts, and return effects. Finally, these behavior nodes are organized into a complete character behavior tree according to priority and preconditions, and cached locally or in memory for subsequent steps.

[0026] Step 1012: Convert the scene function data into scene function nodes; store the scene function nodes in the scene function tree.

[0027] Specifically, the process begins by extracting all scene functional entities (NPCs, items, triggers, event scripts, etc.) within the currently visible area from the game data layer (such as database tables, script files, or binary resources), and generating a corresponding functional node for each entity. Each functional node encapsulates the entity's interactive attributes (such as interaction type, executable behavior, related goals, and state conditions) as well as its location and attribute values. These functional nodes are then organized into a tree structure—the scene functional tree—based on spatial hierarchy (such as grids or hierarchical partitions) or logical grouping (such as a single event system). The root node of the tree represents the entire visible scene, and child nodes establish parent-child relationships based on functional priority or trigger conditions, forming a structure that can be retrieved and linked by the subsequent behavior tree.

[0028] Step 1013: Establish a character function dataset by combining the character behavior tree and the scene function tree. Specifically, obtain the behavior nodes from the character behavior tree and the scene function nodes from the scene function tree; combine the behavior nodes and the scene function nodes into character function combination nodes; and store all the character function combination nodes in the character function dataset.

[0029] Specifically, taking the character behavior tree and scene function tree as input, the system first traverses both trees to obtain the character behavior nodes and scene function nodes. Then, based on preset association rules (such as "the character is within the interaction distance of the scene function node," the behavior node type and function node interaction type are compatible, and preconditions are met), these two sets of nodes are matched to generate corresponding character function combination nodes. Each combination node maps the character's specific actions (such as using skills, picking up items) to the scene function's attributes (location, interaction effect, triggering conditions), generating a complete interaction path information internally. All generated combination nodes are uniformly stored in the character function dataset and indexed (e.g., by location, action type, or status) to accelerate subsequent path planning and test execution. In this way, the character function dataset constitutes an executable model of character-scene interaction, providing basic data for subsequent simulation operation path generation and result comparison.

[0030] As described above, the character behavior tree generated in step 1011 converts the character's position and skill information into executable action node groups, achieving a complete model of the character's possible interactive behaviors from any perspective. The scene function tree constructed in step 1012 transforms all interactive entities such as NPCs, props, and triggers within the visible range into structured function nodes, covering their position, attributes, and behavioral interfaces. In step 1013, the leaf nodes of the two trees are matched according to interaction rules to form character function combination nodes, which are then aggregated into the character function dataset. This three-step collaborative implementation ensures that the interaction between each visible scene and the character's state is accurately mapped into executable and measurable units. This dataset can be used by AI to automatically generate richer derivative types and provides complete input for subsequent simulated path planning and result comparison, thereby achieving high coverage and reproducible game testing across scenes.

[0031] In one embodiment of this application, please refer to Figure 2 The role function dataset established in step 1013 further includes: extracting the original data type of the data field in each role function combination node, generating the corresponding derived type according to the original data type; storing the original data type and the corresponding derived type in the derived node, and storing the derived node in the role function dataset.

[0032] This involves extracting the original data type from the role function dataset, and if it is necessary to expand the data type, using AI to expand the data type, storing and marking it in the derived node, so that the node can be directly called and executed when testing in other scenarios.

[0033] Specifically, the generated character function combination nodes already contain the correspondence between character actions and scene functions, but the data fields of each node are still the original game types. Therefore, when constructing the character function dataset, the system first traverses all character function combination nodes, extracting all their original data types (such as int type). Then, relying on a pre-trained artificial intelligence model (which can be based on rules, probability, or deep learning), it performs reasoning and inference on each original type (such as expanding it to long type). This supports cross-scene and cross-character similarity retrieval and anomaly detection.

[0034] Each pair of original types and their corresponding derived types is encapsulated as a derived node. All derived nodes are then uniformly stored in the character function dataset (which can use a binary tree or graph database structure), and are stored in the same data layer alongside the original character function combination nodes. In this way, the dataset retains both the original definition of the game and the multi-dimensional extended types generated by AI, providing a complete and scalable foundation for subsequent simulation path planning, vulnerability discovery, and result comparison.

[0035] As described above, merging the original data type and the AI-derived types into the same node creates a multi-layered functional data structure, improving test coverage and flexibility. The derived nodes provide finer-grained interactive information, facilitating rapid AI exploration of hidden paths and timely identification of potential vulnerabilities, thereby enhancing the accuracy and efficiency of security assessments.

[0036] In one embodiment of this application, step 102 includes steps 1021 to 1022.

[0037] Step 1021: Construct a behavior tree based on the role function dataset.

[0038] Specifically, the role function dataset obtained in step 1013 (which already contains function combination nodes of original and derived types) is first transformed into behavior tree nodes through mapping rules. Each function combination node becomes a leaf or subtree root in the behavior tree, encapsulating the action execution logic, preconditions, and postconditions (such as coordinates and interaction distance, skill cooldown, and task status). Then, a parent-child hierarchy is constructed based on behavior priority, trigger probability, and state dependency: if operation A can only be triggered after operation B occurs, then B becomes the parent node of A and appears as a condition node. The tree also needs to contain selection nodes and parallel nodes to realize the parallelism and alternatives of different interaction paths. The generated behavior tree is persisted in memory, and the expected end state of each path is marked, serving as the basis for the simulation path generation in the subsequent step 1022.

[0039] Step 1022: Generate the simulated operation path of the virtual character to be tested based on each path of the behavior tree.

[0040] Specifically, based on the complete behavior tree obtained in step 1021, the system recursively expands from the root node to the leaf nodes through a depth-first or breadth-first traversal of the tree, recording each action node (such as movement, interaction, and skill use) and its corresponding input event sequence along the way. For each reachable path, the system replaces the specific parameters required by the node (character's current position, target coordinates, skill cooldown, etc.) with measured or randomly generated values, and packages them sequentially into a simulated operation path. If there are selection nodes in the tree, the system will generate multiple alternative paths according to preset probabilities or AI decisions; if there are parallel nodes, they are split into concurrent paths according to parallel execution logic and recorded synchronously. Finally, each path is saved as a series of executable event scripts, with expected interaction results (such as dialogue text, item acquisition, and status updates), for subsequent execution and comparison.

[0041] As described above, by transforming the role function dataset into an executable behavior tree in step 1021, the system achieves structured modeling of the interaction between the role and the scene, fully reflecting the preconditions and parallel / selection logic. Then, step 1022 expands multiple complete simulated operation paths based on the tree, automatically generating key / event sequences and expected results. In this way, the comprehensiveness and reproducibility of test coverage are ensured, execution efficiency and the accuracy of vulnerability discovery are improved, and the shortcomings of traditional macro-command testing in hidden interactions and dynamic state capture are made up for.

[0042] In some embodiments, the behavior tree and the role function dataset are stored in a template library.

[0043] Specifically, after constructing the behavior tree and role function dataset, the system serializes them into a unified data format (such as JSON, ProtoBuf, or a custom binary). This serialized object is then packaged into a "template" resource via the engine's asset management module and stored in a dedicated template library. The template library employs a hierarchical directory and indexing mechanism, enabling rapid retrieval based on scene type, role attributes, or function category. Simultaneously, the template's metadata (creation time, version number, dependencies, AI-derived tags) is recorded in a database index table, ensuring that subsequent test scripts can promptly load the required templates for reuse or combination, thereby achieving shareability, scalability, and reproducibility of behavior paths and functional nodes.

[0044] In one embodiment of this application, step 101 further includes: calculating the simulated operation scenario of the virtual character under test using a behavior algorithm based on the location data and skill data of the virtual character under test; Determine whether the simulated operation scenario is the same as the current visible range. If not, then use the simulated operation scenario as the visible scenario of the current visible range.

[0045] Specifically, by first inputting the location information and skill set of the character to be tested into a behavior planning algorithm (such as A... (Or behavior tree) Generates an interaction path starting from the current position and unfolding based on skill prerequisites and the target position. The spatial block corresponding to this path is regarded as the simulated operation scene, and its boundary is determined by the starting and ending points of the path and the field of view radius required by the skill. The system then performs a geometric intersection determination between this simulated scene and the camera's view frustum at the current perspective; if the two do not overlap in space, that is, the simulated scene is not within the current visible range, the system automatically replaces this simulated scene with a new visible scene, thereby ensuring that subsequent functional data collection only focuses on the area that the character can actually see.

[0046] As described above, this addition ensures that the generated simulated operation scene strictly matches the player's current actual visible range. If the initially calculated simulated scene is not within the view, the system automatically maps it to the visible scene, allowing all subsequent actions to directly correspond to visible objects. This improves the practicality and accuracy of testing, avoids false alarms or invalid interactions caused by view mismatch, and increases coverage and the probability of discovering hidden defects.

[0047] Please refer to Figure 3 The present invention also provides a game testing system based on virtual characters, including a memory 301, a processor 302, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the various steps of the aforementioned game testing method based on virtual characters.

[0048] The present invention also provides a computer storage medium storing a computer program thereon, which, when executed by a processor, implements the various steps of the above-described game testing method based on virtual characters.

[0049] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent modifications made based on the content of the present invention specification and drawings, or direct or indirect applications in related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A game testing method based on virtual characters, characterized in that, include: Obtain the current visible range of the virtual character under test, and read the scene function data of the corresponding visible scene based on the current visible range; Based on all the scene function data and the information of the virtual character under test, a simulated operation path for the virtual character under test is generated, and a preset operation result for each simulated operation path is configured. Execute each of the simulated operation paths, compare the execution results with the corresponding preset operation results, and obtain the test results for each simulated operation path.

2. The method according to claim 1, characterized in that, Also includes: Extract the location and skill information of the virtual character to be tested from the character database; Based on the location information and the skill information, a behavior algorithm is used to calculate the simulated actions of the virtual character under test, and the simulated actions are encapsulated into behavior nodes and stored in the character behavior tree.

3. The method according to claim 2, characterized in that, Based on the current visible range, the method for reading scene function data corresponding to the visible scene also includes: Convert the scene function data into scene function nodes; Store the scene function nodes in the scene function tree; A character function dataset is established by combining the character behavior tree and the scene function tree.

4. The method according to claim 3, characterized in that, A character function dataset is established by combining the character behavior tree and the scene function tree, including: Obtain the behavior nodes of the character behavior tree and the scene function nodes of the scene function tree; The behavior node and the scene function node are combined into a role function combination node; Store all the aforementioned role function combination nodes in the role function dataset.

5. The method according to claim 4, characterized in that, Storing all the aforementioned role function combination nodes into the role function dataset also includes: Extract the original data type of the data field in each of the role function combination nodes, and generate the corresponding derived type based on the original data type; The original data type and its corresponding derived type are stored in the derived node, and the derived node is stored in the role function dataset.

6. The method according to claim 4 or 5, characterized in that, Based on all the scene function data and the information of the virtual character under test, a simulated operation path for the virtual character under test is generated, including: Construct a behavior tree based on the aforementioned role function dataset; The simulated operation path of the virtual character under test is generated based on each path of the behavior tree.

7. The method according to claim 6, characterized in that, Also includes: Store the behavior tree and the role function dataset in the template library.

8. The method according to claim 2, characterized in that, The process includes obtaining the current visible range of the virtual character under test, and obtaining scene function data of the corresponding visible scene based on the current visible range. It also includes: Based on the location and skill data of the virtual character under test, a behavioral algorithm is used to calculate the simulated operation scenario of the virtual character under test. Determine whether the simulated operation scenario is the same as the current visible range. If not, then use the simulated operation scenario as the visible scenario of the current visible range.

9. A game testing system based on virtual characters, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements each step of the game testing method based on virtual characters as described in any one of claims 1 to 8.

10. A computer storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the game testing method based on virtual characters as described in any one of claims 1 to 8.