CN107080945B - Method and device for testing artificial intelligence behaviors in game and electronic equipment - Google Patents

Method and device for testing artificial intelligence behaviors in game and electronic equipment Download PDF

Info

Publication number
CN107080945B
CN107080945B CN201710328835.3A CN201710328835A CN107080945B CN 107080945 B CN107080945 B CN 107080945B CN 201710328835 A CN201710328835 A CN 201710328835A CN 107080945 B CN107080945 B CN 107080945B
Authority
CN
China
Prior art keywords
tree
game
testing
artificial intelligence
nodes
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710328835.3A
Other languages
Chinese (zh)
Other versions
CN107080945A (en
Inventor
王钞仕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN201710328835.3A priority Critical patent/CN107080945B/en
Publication of CN107080945A publication Critical patent/CN107080945A/en
Application granted granted Critical
Publication of CN107080945B publication Critical patent/CN107080945B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/60Methods for processing data by generating or executing the game program
    • A63F2300/65Methods for processing data by generating or executing the game program for computing the condition of a game character

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a method, a device and electronic equipment for testing artificial intelligence behaviors in games, wherein the method comprises the following steps: modeling an artificial intelligence behavior tree in a configuration file to obtain a tree object; splitting nodes of the tree object to obtain a node set, splitting branches of the tree object to obtain a branch set, and recording execution conditions of the branches in the branch set respectively; the nodes in the node set are loaded into the game for testing, the branches in the branch set are loaded into the game for testing after the recorded execution conditions are set, and the tree objects are loaded into the game for testing after the recorded execution conditions are set, so that the testing efficiency in the aspect of AI behaviors in the game testing can be improved.

Description

Method and device for testing artificial intelligence behaviors in game and electronic equipment
Technical Field
The application relates to the technical field of software testing, in particular to a method and a device for testing artificial intelligent AI behaviors in a game and electronic equipment.
Background
In the current big games, no matter end games or hand games, more or less NPC (neutral point game) and monsters in copy game characters exist, and the game characters have a set of fixed logic to control the game characters so as to simulate real character behaviors, which are generally called AI behaviors. The strangeness of being as small as one copy and the big BOSS of being as big as one copy are controlled by AI behaviors with different degrees of complexity. As monsters and BOSSs increase and the number of AI activities increase in a game, a large game may contain hundreds or thousands of different AI activity logic. In the development of games, an AI behavior is controlled by a text based XML format, similar to the multi-way tree structure commonly found in computers, which organizes the behavior logic of each AI in a tree structure, and each action or behavior exhibited by each AI is a different node on one branch of the AI behavior tree. Each AI behavior tree is as small as a few branches, nodes, and as large as tens, hundreds of branches, or nodes.
For a game, it is an important task to ensure that the AI behavior of a monster is correct. However, in the face of such a huge amount of AI behavior tree files, how to test efficiently and ensure that all AI behaviors are operated according to the logic of game designers or game plans is a very important ring in a game development cycle. During the development process of each game, a plurality of behavior trees are updated and iterated when different versions are met, and when the iterative regression test of each version of the game is carried out, verification and test are carried out manually one by one, so that the efficiency is very low.
At present, in the aspect of AI behavior tree testing, one way is to load an AI behavior tree into a game manually and watch the behavior of a character by naked eyes, but for some aspects related to numerical values, such as range judgment, only one approximate range can exist, accurate numerical values cannot be obtained, manual observation is time-consuming, and efficiency is low.
Another way is a semi-automatic way, in which the tester defines the branches of the tree and then combines the branches into a behavior tree. Although this approach may help the tester to some extent improve the testing efficiency, it has several problems. Firstly, when numerical correlation is involved, results cannot be accurately obtained, and only manual estimation is needed, so that the method is inaccurate and low in efficiency. Second, partial AI behavior tree branches may be missed by self-assembly, resulting in incomplete test coverage. In addition, the test logic of this method is not sound, and it does not start from the most basic single behavior tree combination node and the game basic function node, if there is a subsequent behavior tree branch to the single node with defective function, the execution of this branch fails, and it may mislead the tester to judge the problem of other nodes and conditions of this branch. Moreover, this approach lacks a result collection correlation section, and cannot intuitively give execution of each tree in the face of a large number of AI behavior trees.
Disclosure of Invention
The application discloses a method for testing artificial intelligence behaviors in a game, which aims at improving the testing efficiency of AI behaviors in game testing.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to a first aspect of the present invention, there is provided a method of testing artificial intelligence behaviour in a game, comprising:
modeling an artificial intelligence behavior tree in a configuration file to obtain a tree object;
splitting nodes of the tree object to obtain a node set, splitting branches of the tree object to obtain a branch set, and recording execution conditions of the branches in the branch set respectively;
and respectively loading the nodes in the node set into the game for testing, respectively loading the branches in the branch set into the game after setting the recorded execution conditions, and respectively loading the tree objects into the game after setting the recorded execution conditions for testing.
According to some embodiments, before modeling the artificial intelligence behavior tree in the configuration file to obtain the tree object, the method further comprises:
and acquiring a directory of the artificial intelligence behavior tree to be tested according to the configuration file, and acquiring the artificial intelligence behavior tree according to the directory.
According to some embodiments, the artificial intelligence behavior tree is stored in an extensible markup language file.
According to some embodiments, obtaining the artificial intelligence behavior tree from the catalog comprises: and acquiring an extensible markup language file for storing the artificial intelligence behavior tree according to the directory.
According to some embodiments, the nodes of the tree object include a child node set attribute for recording an underlying child node set;
the node splitting of the tree object to obtain a node set comprises the following steps: and splitting the nodes of the tree object according to the child node set attributes of the nodes of the tree object to obtain a node set.
According to some embodiments, after the nodes in the node set are loaded into the game for testing, the execution conditions of the branches in the branch set are set for testing, and the execution conditions of the tree object are set for testing, respectively, the method further comprises: and summarizing and/or displaying the results obtained by the test.
According to a second aspect of the present invention, there is provided an apparatus for testing artificial intelligence behavior in a game, comprising:
the modeling unit is used for modeling the artificial intelligence behavior tree in the configuration file to obtain a tree object;
the splitting unit is used for splitting the nodes of the tree object to obtain a node set, splitting the branches of the tree object to obtain a branch set, and recording the execution conditions of the branches in the branch set respectively;
the testing unit is used for respectively loading the nodes in the node set into the game for testing, respectively loading the branches in the branch set into the game after setting the recorded execution conditions for testing, and respectively loading the tree objects into the game after setting the recorded execution conditions for testing.
According to some embodiments, the apparatus further includes a behavior tree obtaining unit, configured to, before modeling the artificial intelligence behavior tree in the configuration file to obtain the tree object, obtain a directory of the artificial intelligence behavior tree to be tested according to the configuration file, and obtain the artificial intelligence behavior tree according to the directory.
According to some embodiments, the artificial intelligence behavior tree is stored in an extensible markup language file.
According to some embodiments, the behavior tree acquisition unit is to: and acquiring an extensible markup language file for storing the artificial intelligence behavior tree according to the directory.
According to some embodiments, the nodes of the tree object include a child node set attribute for recording an underlying child node set;
the splitting unit is used for: and splitting the nodes of the tree object according to the child node set attributes of the nodes of the tree object to obtain a node set.
According to some embodiments, the apparatus further includes a result processing unit, configured to assemble and/or display results obtained by the test after the nodes in the node set are loaded into the game respectively for testing, the execution conditions of the branches in the branch set are set respectively and then tested, and the execution conditions of the tree object are set respectively and then tested.
According to a third aspect of the present invention, there is provided an electronic apparatus comprising: a processor; a memory storing instructions for the processor to control the operations according to any of the above first aspects.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
according to the technical scheme, a tree object is obtained by modeling an artificial intelligence behavior tree in a configuration file, a node set is obtained by splitting nodes of the tree object, a branch set is obtained by splitting branches of the tree object, execution conditions of the branches in the branch set are recorded respectively, then the nodes in the node set are loaded into a game for testing, the branches in the branch set are loaded into the game for testing after the recorded execution conditions are set, and the tree object is loaded into the game for testing after the recorded execution conditions are set respectively, so that the testing efficiency of the game for the artificial intelligence behavior is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Drawings
The above and other features and advantages of the present invention will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
FIG. 1 illustrates a method of testing artificial intelligence behavior in a game according to one embodiment of the invention;
FIG. 2 illustrates a method of testing artificial intelligence behavior in a game according to another embodiment of the invention;
FIG. 3 shows a block diagram of an apparatus for testing artificial intelligence behavior in a game, according to an embodiment of the invention;
FIG. 4 shows a block diagram of an apparatus for testing artificial intelligence behavior in a game, according to another embodiment of the invention;
fig. 5 shows an electronic device according to an embodiment of the invention.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The same reference numerals denote the same or similar parts in the drawings, and thus, a repetitive description thereof will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known methods, devices, implementations or operations have not been shown or described in detail to avoid obscuring aspects of the invention.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
Fig. 1 illustrates a method for testing artificial intelligence behaviors in a game according to an embodiment of the present invention, which is applicable to a case where artificial intelligence behaviors in a game are tested, and as shown in fig. 1, the method for testing artificial intelligence behaviors in a game according to the embodiment includes:
in step S110, the artificial intelligence behavior tree in the configuration file is modeled to obtain a tree object.
The artificial intelligence behavior tree can be stored in various ways, for example, in an extensible markup language file. The artificial intelligence behavior tree may obtain a directory of the artificial intelligence behavior tree to be tested according to the configuration file, for example, obtain an extensible markup language file for storing the artificial intelligence behavior tree according to the directory.
The configuration file is used for a tester to specify the directory of the artificial intelligence behavior tree to be tested at present, and can configure a plurality of directories of the artificial intelligence behavior tree at the same time. The behavior tree directory can be freely configured and stored in a plurality of directories, the memory can be configured at the same time, the AI trees of some directories are omitted after manual investigation and free grouping after the directories are multiple, and testers can know the positions of the AI trees tested at present at a glance without independent manual recording.
In step S120, the node splitting is performed on the tree object to obtain a node set, the branch splitting is performed on the tree object to obtain a branch set, and the execution conditions of the branches in the branch set are recorded respectively.
In step S130, the nodes in the node set are loaded into the game for testing, the branches in the branch set are loaded into the game for testing after the recorded execution conditions are set, and the tree objects are loaded into the game for testing after the recorded execution conditions are set.
In addition, the nodes of the tree object may include child node set attributes for recording an underlying child node set, and if the nodes include child node set attributes, the nodes of the tree object may be split according to the child node set attributes of the nodes of the tree object to obtain a node set.
After the above steps are completed, the results obtained by the test can be summarized and/or displayed. For example, the results after each test is executed are summarized and counted, and the execution results are fed back to the tester.
According to the technical scheme, a tree object is obtained by modeling an artificial intelligence behavior tree in a configuration file, a node set is obtained by splitting nodes of the tree object, a branch set is obtained by splitting branches of the tree object, execution conditions of the branches in the branch set are recorded respectively, then the nodes in the node set are loaded into a game for testing, the branches in the branch set are loaded into the game for testing after the recorded execution conditions are set, and the tree object is loaded into the game for testing after the recorded execution conditions are set respectively, so that the testing efficiency of the game for the artificial intelligence behavior is improved.
Fig. 2 shows a method for testing artificial intelligence behavior in a game according to another embodiment of the present invention, and as shown in fig. 2, the method for testing artificial intelligence behavior in a game according to this embodiment includes:
in step S201, the configuration file is read to obtain an AI behavior tree directory to be tested.
The configuration file is used for a tester to specify an AI tree directory to be tested, and can configure a plurality of AI tree directories at the same time.
It should be noted that the configuration file can be freely configured, and can be stored in a plurality of directories and configured at the same time, so that the AI trees of some directories are omitted after manual investigation and free group after a plurality of directories are avoided, testers can know the positions of the currently tested AI trees at a glance, and separate manual recording is avoided.
In step S202, the XML file of a single AI behavior tree is read, parsed, and modeled as an object of one tree.
Traversing the appointed AI directory, selecting an xml file of a first behavior tree, analyzing the xml file, and establishing a tree object, wherein each node of the behavior tree additionally comprises an attribute except some basic attributes of the node: and (4) a child node set. And traversing to the lower layer through the attribute of the child node set to take all nodes on the lower layer of the node.
Through the steps, an xml text can be converted into a multi-branch tree, and each multi-branch tree node comprises a child node set, so that diff calculation aiming at the tree is facilitated.
In step S203, a single AI behavior tree object is read, splitting is started, a single function node is recorded, and execution conditions of each branch and each level are recorded.
For example, reading a modeled tree object, starting depth-first search traversal, splitting, recording non-repetitive functional nodes and combination nodes contained in the tree, simultaneously recording each level node of each branch to form an individual branch, and recording the branch execution condition.
Through the step, the tree nodes formed in one behavior tree can be separated and classified, and the next step can be ensured to test the basic nodes; the condition of each branch is recorded, and the condition can be set by automatically reading the condition when the next branch is tested.
In step S204, a load test and a result of the split single node are obtained.
And respectively loading the various split nodes into the game, executing, and obtaining the return after the single node is executed, for example, if the execution is successful, returning True (True), and if the execution is failed, returning False (False) until all the various split nodes are executed and obtaining the result.
The step firstly tests a single node, records an execution result, and can assist the branch execution result containing the node to eliminate problems.
In step S205, whether a single node is left or not is determined, if yes, the process returns to step S204, otherwise, step S206 is performed.
In step S206, the split branches are read, loaded into the game and executed, and the result is obtained.
Reading a plurality of branches which are just split, respectively setting the conditions recorded before each branch, and executing the branches after the conditions are set to obtain branch return results.
By reading each branch execution condition recorded before and setting each branch for executing the splitting after, each branch can be verified separately, and the problem positioning and troubleshooting can be facilitated after the last whole tree is executed.
In step S207, it is determined whether there is a branch, if yes, the process returns to step S206, otherwise, step S208 is executed.
In step S208, conditions are set according to the branch conditions during splitting, the overall execution of a single AI behavior tree is performed, and the condition of whether each branch is executed is obtained and recorded.
The step is used for integrally executing the whole AI behavior tree, respectively traversing and setting the conditions of each branch once, acquiring an execution result, and checking whether each branch is executed.
The step can ensure that the whole tree can be mapped to different branches given different conditions after being loaded into the game, and each branch can be executed in a covering manner under the given corresponding condition.
In step S209, it is determined whether there is a remainder in the AI behavior tree file, if so, the process returns to step S203, otherwise, step S210 is executed.
In step S210, the summary result is obtained, and the test ends.
And repeating the process to traverse other AI behavior tree directories. And summarizing the results, and giving a result display. Three execution results of each behavior tree before the step of sorting are summarized and displayed, including various single nodes, single branches and the execution result of the whole behavior tree, and are visually displayed to a tester.
According to the technical scheme, a plurality of behavior trees in a game behavior tree directory are subjected to tree modeling by one behavior tree, and the tree is subjected to branch splitting and node splitting. When splitting, recording the basic node, each branch and the execution condition of each level of each branch; after splitting, the node is divided into two types of nodes, namely a basic combined node and a functional node in a game, and the nodes are automatically loaded to the game and tested aiming at the most basic single node; then, automatically loading the branches of each tree into a game, and judging whether the branches are executed successfully or not by obtaining the execution return of executing the tail end nodes of the branches in the game; and finally, loading the whole tree, setting the execution conditions of each branch recorded before one by one, acquiring a final execution result, and checking whether each branch can be executed. Through the automatic splitting, loading and result collecting mode, hundreds of behavior trees in one game can be tested efficiently, and the four defects can be well solved: when the test in the aspect of numerical values is involved, the numerical values can be accurately obtained, for example, a certain action is executed in a certain range, the accuracy test of the numerical values is ensured, the manual inaccuracy is avoided, or the time spent on manually obtaining the accuracy is possibly longer; the problems possibly existing in automatic combination of other schemes in the prior art are solved, such as incomplete test coverage caused by missing part of branches; starting from the most basic single behavior tree combination node and the game basic function node to a single branch and then to the whole tree, the problem positioning method can help the subsequent single branch or the whole tree to position the problem under the condition of problem occurrence; the system has a result collecting and displaying part, and can visually display the execution result condition of a single node and a single branch of a single tree for a tester.
Fig. 3 is a block diagram illustrating an apparatus for testing artificial intelligence activities in a game according to an embodiment of the present invention, and as shown in fig. 3, the apparatus for testing artificial intelligence activities in a game according to the embodiment includes a modeling unit 310, a splitting unit 320, and a testing unit 330.
The modeling unit 310 is configured to model an artificial intelligence behavior tree in a configuration file to obtain a tree object;
the splitting unit 320 is configured to split the node of the tree object to obtain a node set, split the branch of the tree object to obtain a branch set, and record execution conditions of branches in the branch set respectively;
the testing unit 330 is configured to load the nodes in the node set into the game for testing, respectively load the branches in the branch set with the recorded execution conditions into the game for testing, and respectively load the tree object with the recorded execution conditions into the game for testing.
According to some embodiments of the invention, the artificial intelligence behavior tree is stored in an extensible markup language file.
According to some embodiments of the invention, the nodes of the tree object include a child node set attribute for recording an underlying child node set;
the splitting unit 320 is configured to: and splitting the nodes of the tree object according to the child node set attributes of the nodes of the tree object to obtain a node set.
With regard to the apparatus in the above-described embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
The device for testing artificial intelligence behaviors in a game provided by the embodiment can execute the method for testing artificial intelligence behaviors in a game provided by the first embodiment and the second embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 4 is a block diagram illustrating an apparatus for testing artificial intelligence behavior in a game according to another embodiment of the present invention, and as shown in fig. 4, the apparatus for testing artificial intelligence behavior in a game according to the present embodiment includes a behavior tree obtaining unit 410, a modeling unit 420, a splitting unit 430, a testing unit 440, and a result processing unit 450:
the behavior tree obtaining unit 410 is configured to obtain a directory of the artificial intelligence behavior tree to be tested according to the configuration file, and obtain the artificial intelligence behavior tree according to the directory.
The modeling unit 420 is configured to model an artificial intelligence behavior tree in a configuration file to obtain a tree object.
The splitting unit 430 is configured to split the node of the tree object to obtain a node set, split the branch of the tree object to obtain a branch set, and record execution conditions of branches in the branch set respectively.
The testing unit 440 is configured to load the nodes in the node set into the game for testing, respectively load the branches in the branch set with the recorded execution conditions into the game for testing, and respectively load the tree object with the recorded execution conditions into the game for testing.
The result processing unit 450 is configured to assemble and/or display the results obtained by the test after the nodes in the node set are loaded into the game for testing, the execution conditions of the branches in the branch set are set, and the execution conditions of the tree objects are set and then the test is performed.
According to some embodiments of the invention, the artificial intelligence behavior tree is stored in an extensible markup language file.
According to some embodiments of the invention, the behavior tree obtaining unit 410 is configured to: and acquiring an extensible markup language file for storing the artificial intelligence behavior tree according to the directory.
According to some embodiments of the invention, the nodes of the tree object include a child node set attribute for recording an underlying child node set;
the splitting unit 430 is configured to: and splitting the nodes of the tree object according to the child node set attributes of the nodes of the tree object to obtain a node set.
The device for testing the artificial intelligence behavior in the game provided by the embodiment of the invention can execute the method for testing the artificial intelligence behavior in the game provided by the embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
Fig. 5 shows an electronic device according to an embodiment of the invention, and as shown in fig. 5, the electronic device 500 may include a processor 510, a memory 520, a transmitter 530, and a receiver 540.
Memory 520 may store instructions for processor 510 to control the processing of operations. The memory 520 may include a volatile or non-volatile memory, such as a Static Random Access Memory (SRAM), an Electrically Erasable Programmable Read Only Memory (EEPROM), an Erasable Programmable Read Only Memory (EPROM), a Programmable Read Only Memory (PROM), a Read Only Memory (ROM), and the like, which are not limited in this respect.
The processor 510 may call instructions stored in the memory 520 to control related operations. According to an embodiment, memory 520 stores instructions for processor 510 to control the following:
modeling an artificial intelligence behavior tree in a configuration file to obtain a tree object;
splitting nodes of the tree object to obtain a node set, splitting branches of the tree object to obtain a branch set, and recording execution conditions of the branches in the branch set respectively;
and respectively loading the nodes in the node set into the game for testing, respectively loading the branches in the branch set into the game after setting the recorded execution conditions, and respectively loading the tree objects into the game after setting the recorded execution conditions for testing.
It will be readily appreciated that memory 520 may also store instructions for processor 510 to control other operations according to embodiments of the present invention, which will not be described in detail herein.
The processor 510 may also control the transmitter 530 and the receiver 540 to transceive signals, etc.
Those skilled in the art will readily appreciate from the foregoing detailed description that the systems and methods according to embodiments of the present invention have one or more of the following advantages.
According to the embodiment of the invention, before modeling the artificial intelligence behavior tree in the configuration file to obtain the tree object, the method further comprises the following steps: and acquiring a directory of the artificial intelligence behavior tree to be tested according to the configuration file, and acquiring the artificial intelligence behavior tree according to the directory.
According to some embodiments of the invention, the nodes of the tree object include a child node set attribute for recording an underlying child node set; the node splitting of the tree object to obtain a node set comprises the following steps: and splitting the nodes of the tree object according to the child node set attributes of the nodes of the tree object to obtain a node set.
According to an embodiment of the present invention, after the nodes in the node set are loaded into the game for testing, the execution conditions of the branches in the branch set are set for testing, and the execution conditions of the tree object are set for testing, the method further includes: and summarizing and/or displaying the results obtained by the test.
The present invention also provides, according to some embodiments, a non-transitory computer-readable storage medium, such as a memory, including instructions executable by a processor of an apparatus to perform the above-described method. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like. The instructions in the storage medium, when executed by a processor of the terminal, enable the terminal to perform the method of: modeling an artificial intelligence behavior tree in a configuration file to obtain a tree object; splitting nodes of the tree object to obtain a node set, splitting branches of the tree object to obtain a branch set, and recording execution conditions of the branches in the branch set respectively; and respectively loading the nodes in the node set into the game for testing, respectively loading the branches in the branch set into the game after setting the recorded execution conditions, and respectively loading the tree objects into the game after setting the recorded execution conditions for testing.
It will be appreciated by those skilled in the art that the drawings are merely schematic representations of exemplary embodiments, and that the blocks or flow charts in the drawings are not necessarily required to practice the present invention and are, therefore, not intended to limit the scope of the present invention.
Those skilled in the art will appreciate that the modules described above may be distributed in the apparatus according to the description of the embodiments, or may be modified accordingly in one or more apparatuses unique from the embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Exemplary embodiments of the present invention are specifically illustrated and described above. It is to be understood that the invention is not to be limited to the disclosed embodiments, but on the contrary, is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims (10)

1. A method of testing artificial intelligence behavior in a game, comprising:
modeling an artificial intelligence behavior tree in a configuration file to obtain a tree object;
splitting nodes of the tree object to obtain a node set, splitting branches of the tree object to obtain a branch set, and recording execution conditions of the branches in the branch set respectively;
and respectively loading the nodes in the node set into the game for testing, respectively loading the branches in the branch set into the game after setting the recorded execution conditions, and respectively loading the tree objects into the game after setting the recorded execution conditions for testing.
2. The method of claim 1, prior to modeling the artificial intelligence behavior tree in the configuration file to obtain the tree object, further comprising:
and acquiring a directory of the artificial intelligence behavior tree to be tested according to the configuration file, and acquiring the artificial intelligence behavior tree according to the directory.
3. The method of claim 1, wherein the artificial intelligence behavior tree is stored in an extensible markup language file.
4. The method of claim 2, wherein obtaining the artificial intelligence behavior tree from the catalog comprises: and acquiring an extensible markup language file for storing the artificial intelligence behavior tree according to the directory.
5. The method of claim 1, wherein the nodes of the tree object include a child node set attribute for recording a set of lower level child nodes;
the node splitting of the tree object to obtain a node set comprises the following steps: and splitting the nodes of the tree object according to the child node set attributes of the nodes of the tree object to obtain a node set.
6. The method of claim 1, further comprising, after loading the nodes in the node set into the game for testing, respectively, loading the branches in the branch set into the game for testing after setting the recorded execution conditions, respectively, and loading the tree object into the game for testing after setting the recorded execution conditions, respectively: and summarizing and/or displaying the results obtained by the test.
7. An apparatus for testing artificial intelligence behavior in a game, comprising:
the modeling unit is used for modeling the artificial intelligence behavior tree in the configuration file to obtain a tree object;
the splitting unit is used for splitting the nodes of the tree object to obtain a node set, splitting the branches of the tree object to obtain a branch set, and recording the execution conditions of the branches in the branch set respectively;
the testing unit is used for respectively loading the nodes in the node set into the game for testing, respectively loading the branches in the branch set into the game after setting the recorded execution conditions for testing, and respectively loading the tree objects into the game after setting the recorded execution conditions for testing.
8. The apparatus of claim 7, further comprising a behavior tree obtaining unit, configured to obtain a directory of the artificial intelligence behavior tree to be tested according to the configuration file before modeling the artificial intelligence behavior tree in the configuration file to obtain the tree object, and obtain the artificial intelligence behavior tree according to the directory.
9. The apparatus of claim 7, further comprising a result processing unit, configured to aggregate and/or display results obtained by the testing after the nodes in the node set are loaded into the game for testing, the branches in the branch set are loaded into the game for testing after the recorded execution conditions are set, and the tree object is loaded into the game for testing after the recorded execution conditions are set, respectively.
10. An electronic device, comprising: a processor; a memory storing instructions for the processor to control the method of any one of claims 1-6.
CN201710328835.3A 2017-05-11 2017-05-11 Method and device for testing artificial intelligence behaviors in game and electronic equipment Active CN107080945B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710328835.3A CN107080945B (en) 2017-05-11 2017-05-11 Method and device for testing artificial intelligence behaviors in game and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710328835.3A CN107080945B (en) 2017-05-11 2017-05-11 Method and device for testing artificial intelligence behaviors in game and electronic equipment

Publications (2)

Publication Number Publication Date
CN107080945A CN107080945A (en) 2017-08-22
CN107080945B true CN107080945B (en) 2020-12-22

Family

ID=59611629

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710328835.3A Active CN107080945B (en) 2017-05-11 2017-05-11 Method and device for testing artificial intelligence behaviors in game and electronic equipment

Country Status (1)

Country Link
CN (1) CN107080945B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107875632B (en) * 2017-12-06 2021-03-16 广州多益网络股份有限公司 Method and system for realizing artificial intelligence behavior and artificial intelligence behavior editor
CN108664287B (en) * 2018-05-11 2022-04-05 腾讯科技(深圳)有限公司 Method, device, terminal and storage medium for guiding output operation
CN109684217B (en) * 2018-12-25 2022-06-14 网易(杭州)网络有限公司 Game detection method and device, electronic equipment and storage medium
CN110898433B (en) * 2019-11-28 2021-09-03 腾讯科技(深圳)有限公司 Virtual object control method and device, electronic equipment and storage medium
CN112190945B (en) * 2020-10-22 2024-03-15 网易(杭州)网络有限公司 Game data processing method and device, computer readable storage medium and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068929A (en) * 2015-08-06 2015-11-18 网易(杭州)网络有限公司 Test script generation method, test script generation device, testing method, testing device and testing system
CN105183445A (en) * 2015-07-10 2015-12-23 珠海金山网络游戏科技有限公司 Visual design system of artificial intelligence of game on the basis of XML (Extensive Markup Language)
US9405665B1 (en) * 2015-05-22 2016-08-02 Amazon Technologies, Inc. Application testing based on user input captured during a trial period and priority scheme analysis
CN105988934A (en) * 2016-02-01 2016-10-05 腾讯科技(深圳)有限公司 Automatic detecting method for mobile game and automatic detecting device for mobile game
CN106339302A (en) * 2016-08-22 2017-01-18 腾讯科技(深圳)有限公司 Test method and device for client

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9405665B1 (en) * 2015-05-22 2016-08-02 Amazon Technologies, Inc. Application testing based on user input captured during a trial period and priority scheme analysis
CN105183445A (en) * 2015-07-10 2015-12-23 珠海金山网络游戏科技有限公司 Visual design system of artificial intelligence of game on the basis of XML (Extensive Markup Language)
CN105068929A (en) * 2015-08-06 2015-11-18 网易(杭州)网络有限公司 Test script generation method, test script generation device, testing method, testing device and testing system
CN105988934A (en) * 2016-02-01 2016-10-05 腾讯科技(深圳)有限公司 Automatic detecting method for mobile game and automatic detecting device for mobile game
CN106339302A (en) * 2016-08-22 2017-01-18 腾讯科技(深圳)有限公司 Test method and device for client

Also Published As

Publication number Publication date
CN107080945A (en) 2017-08-22

Similar Documents

Publication Publication Date Title
CN107080945B (en) Method and device for testing artificial intelligence behaviors in game and electronic equipment
US7917895B2 (en) Automated software testing and validation system
CN109271326B (en) Cloud database testing method and device, equipment and storage medium thereof
CN108319711B (en) Method and device for testing transaction consistency of database, storage medium and equipment
CN112882930B (en) Automatic test method and device, storage medium and electronic equipment
CN112597028A (en) Method and device for displaying case test result and readable storage medium
CN112035376A (en) Method, device, equipment and storage medium for generating coverage rate report
CN110543420A (en) Software testing method, system, terminal and storage medium
CN112363936A (en) Method and device for testing differential coverage rate, computer equipment and storage medium
CN109669436B (en) Test case generation method and device based on functional requirements of electric automobile
CN113778890B (en) Code testing method and device, electronic equipment and storage medium
CN113535538B (en) Method, device, electronic equipment and storage medium for automatically testing application full link
CN111708712A (en) User behavior test case generation method, flow playback method and electronic equipment
CN112765041B (en) Game automation testing method and device and electronic equipment
CN115576834A (en) Software test multiplexing method, system, terminal and medium for supporting fault recovery
CN115145808A (en) Automatic testing method for airborne embedded software
CN115184674A (en) Insulation test method and device, electronic terminal and storage medium
CN114141302A (en) Test method of solid state disk and electronic equipment
CN113238901A (en) Multi-device automatic testing method and device, storage medium and computer device
CN111061244A (en) Automatic testing method for power distribution master station monitoring system
CN113297058A (en) Case generation method, test method, device and server
CN112087347A (en) Game server testing method and system
CN111309598A (en) Test case execution environment recovery method, system, terminal and storage medium
CN111008150A (en) Test report generation method, device and equipment
CN107102938B (en) Test script updating method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant