A game automation method and related device
By obtaining and using the position and movement operation data in the recorded sample data, the problem of virtual elements randomly appearing in the game scene is solved, the implementation effect of the game AI is improved, and the virtual character can be accurately moved to the virtual element.
Patent Information
- Application Number
- CN202111512230.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-07
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2041-12-07
AI Technical Summary
Traditional game AI based on recording and playback of the game process is difficult to apply to situations where virtual elements appear randomly in game scenes, resulting in poor game AI implementation.
By obtaining the recorded sample data, the position and movement operation data of the reference virtual character in the game scene map are recorded, and the target virtual character is controlled to move to the virtual element during the game according to the position of the virtual element and the recorded sample data.
It improves the implementation effect of game AI and can intelligently and automatically control virtual characters to go to any virtual element position that needs to be dealt with, enhancing the automation capabilities of the game.
Smart Images

Figure CN114130013B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a game automation method and related devices. Background Art
[0002] Artificial Intelligence (AI) in gaming is a technology that automatically controls virtual characters in games without human intervention. It is the basic technology for realizing functions such as game automation and game companionship.
[0003] Traditional solutions for implementing game AI include: solutions based on imitation learning algorithms, solutions based on reinforcement learning algorithms, and solutions based on behavior tree models. These solutions generally have the disadvantages of high difficulty and high cost. In order to reduce the difficulty and cost of implementing game AI, a solution for implementing game AI based on recording and playback of the game process has emerged; the implementation of this solution is divided into a recording stage and a playback stage. In the recording stage, the position and action of the controlled virtual character in each frame of the game screen are recorded. In the playback stage, according to the position and action of the virtual character recorded in the recording stage, the virtual character is automatically controlled to be in the corresponding position and perform the corresponding action.
[0004] However, this solution of implementing game AI based on recording and playback of the game process is usually difficult to be well applied to games in which virtual elements that virtual characters need to deal with appear randomly in the game scene. For example, for games in which opponent virtual characters appear randomly in the game scene and the position deviation of the opponent virtual characters' random appearance is large, since the opponent virtual characters appear randomly and the positions of their appearance are not fixed, the game environments in which the virtual characters are located in the recording stage and the playback stage may be quite different, that is, the positions of the opponent virtual characters that the virtual characters need to deal with in the recording stage and the playback stage may be completely different. If the virtual character is controlled in the playback stage based only on the position and action of the virtual character recorded in the recording stage, it will be difficult to move the virtual character to the opponent virtual character that it needs to deal with, which will lead to poor implementation of game AI. Summary of the invention
[0005] The embodiments of the present application provide a game automation method and related devices. For games in which virtual elements appear randomly in the game scene, the method can effectively control the virtual character to move to the position of each virtual element that needs to be responded to, thereby improving the implementation effect of game AI.
[0006] In view of this, the first aspect of the present application provides a game automation method, the method comprising:
[0007] Acquire recorded sample data; the recorded sample data is generated by recording a reference game process, in which a reference virtual character is controlled to traverse a movement path to reach each candidate appearance position of each virtual element; the recorded sample data includes feature data corresponding to each frame of a game screen in the reference game process, the feature data at least including the position of the reference virtual character in a game scene map, and movement operation data of the reference virtual character;
[0008] Based on the recorded sample data, controlling the target virtual character to participate in the target game process;
[0009] During the target game process, if the appearance of a target virtual element is detected, the target virtual character is controlled to move toward the target virtual element based on the positions of the target virtual character and the target virtual element in the game scene map and the feature data corresponding to each frame of the game screen in the recorded sample data.
[0010] A second aspect of the present application provides a game automation device, the device comprising:
[0011] An acquisition module is used to acquire recorded sample data; the recorded sample data is generated by recording a reference game process, in which a reference virtual character is controlled to traverse a movement path to reach each candidate appearance position of each virtual element; the recorded sample data includes feature data corresponding to each frame of a game screen in the reference game process, and the feature data includes at least the position of the reference virtual character in a game scene map and movement operation data of the reference virtual character;
[0012] A control module is used to control a target virtual character to participate in a target game process based on the recorded sample data; during the target game process, if the appearance of a target virtual element is detected, the target virtual character is controlled to move toward the target virtual element according to the respective positions of the target virtual character and the target virtual element in the game scene map and the feature data corresponding to each frame of the game screen in the recorded sample data.
[0013] A third aspect of the present application provides an electronic device, the device comprising a processor and a memory:
[0014] The memory is used to store computer programs;
[0015] The processor is used to execute the steps of the game automation method as described in the first aspect according to the computer program.
[0016] A fourth aspect of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and the computer program is used to execute the steps of the game automation method described in the first aspect above.
[0017] In a fifth aspect, the present application provides a computer program product or a computer program, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the steps of the game automation method described in the first aspect above.
[0018] It can be seen from the above technical solutions that the embodiments of the present application have the following advantages:
[0019] The embodiment of the present application provides a game automation method, which controls the reference virtual character to traverse the moving path of each virtual element candidate appearance position in the game scene map during the stage of recording the reference game process, so that the feature data corresponding to each frame of the game screen recorded in the recording stage can cover the position data on the moving path to the candidate appearance position of each virtual element, as well as the related mobile operation data. Accordingly, in the playback stage, that is, in the stage of controlling the target virtual character to participate in the target game process, when the target virtual element to be dealt with appears in the game scene map, the feature data for guiding the target virtual character to move to the target virtual element can be selected from the feature data recorded in the recording stage according to the respective positions of the target virtual character and the target virtual element in the game scene map, and the target virtual character can be controlled to move to the target virtual element accordingly based on the selected feature data. In this way, for games in which virtual elements appear randomly in the game scene map, the virtual character can be intelligently and automatically controlled to go to the position of any virtual element to be dealt with, thereby improving the implementation effect of the game AI. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A schematic diagram of an application scenario of the game automation method provided in an embodiment of the present application;
[0021] Figure 2 A flowchart of a game automation method provided in an embodiment of the present application;
[0022] Figure 3 A schematic diagram of a game scene map provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of a game scene provided in an embodiment of the present application;
[0024] Figure 5A schematic diagram of an implementation method for selecting target feature data provided in an embodiment of the present application;
[0025] Figure 6 A flowchart of a game automation method provided in an embodiment of the present application;
[0026] Figure 7 A schematic diagram of the structure of a first game automation device provided in an embodiment of the present application;
[0027] Figure 8 A schematic diagram of the structure of a second game automation device provided in an embodiment of the present application;
[0028] Fig. 9 A schematic diagram of the structure of a third game automation device provided in an embodiment of the present application;
[0029] Fig.10 A schematic diagram of the structure of a fourth game automation device provided in an embodiment of the present application;
[0030] Fig.11 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;
[0031] Fig.12 A schematic diagram of the structure of a server provided in an embodiment of the present application. DETAILED DESCRIPTION
[0032] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0033] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0034] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0035] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, mechatronics and other technologies. Artificial intelligence software technologies mainly include computer vision technology, speech processing technology, natural language processing technology, as well as machine learning / deep learning, autonomous driving, smart transportation and other major directions.
[0036] The solution provided in the embodiments of the present application involves artificial intelligence technology, which is specifically described by the following embodiments:
[0037] In the related art, the solution for implementing game AI based on recording and playback of the game process only controls the virtual character to perform corresponding actions based on the actual situation in the game process during the recording stage, which makes it difficult for the solution to be well applied to games where virtual elements (which require the virtual character to perform corresponding response operations) appear randomly in the game scene map. The reason is that in such games, the appearance positions of virtual elements in the recording stage and the playback stage may be completely different, and even the appearance positions in the game scene map may be very different. The movement operations recorded in the recording stage are usually only applicable to controlling the virtual character to move to the position of the virtual element that appeared in the recording stage. If the position of the virtual element that appears in the playback stage is far different from that of the virtual element that appears in the recording stage, the movement operations recorded in the recording stage will not be able to control the virtual character to move to the virtual element that appears.
[0038] In order to solve the problems existing in the above-mentioned related technologies, an embodiment of the present application provides a game automation method. For games in which virtual elements appear randomly in the game scene map, the method can better control the virtual characters to move to the corresponding virtual elements, thereby improving the implementation effect of game AI.
[0039] Specifically, in the game automation method provided in the embodiment of the present application, firstly, the recorded sample data generated by recording the reference game process is obtained; in the reference game process, the reference virtual character is controlled to traverse the movement path to reach the candidate appearance position of each virtual element; the recorded sample data includes the feature data corresponding to each frame of the game screen in the reference game process, and the feature data at least includes the position of the reference virtual character in the game scene map, and the movement operation data of the reference virtual character. Then, based on the obtained recorded sample data, the target virtual character is controlled to participate in the target game process; in the target game process, if the appearance of the target virtual element is detected, the target virtual character can be controlled to move toward the target virtual element according to the respective positions of the target virtual character and the target virtual element in the game scene map, and the feature data in the obtained recorded sample data.
[0040] The above-mentioned game automation method, in the stage of recording the reference game process, controls the reference virtual character to traverse the moving path of each virtual element candidate appearance position in the game scene map, so that the feature data corresponding to each frame of the game screen recorded in the recording stage can cover the position data on the moving path to the virtual element candidate appearance position, and the related mobile operation data. Correspondingly, in the playback stage, that is, in the stage of controlling the target virtual character to participate in the target game process, when the target virtual element to be dealt with appears in the game scene map, the feature data for guiding the target virtual character to move to the target virtual element can be selected from the feature data recorded in the recording stage according to the respective positions of the target virtual character and the target virtual element in the game scene map, and the target virtual character is controlled to move to the target virtual element accordingly based on the selected feature data. In this way, for games in which virtual elements appear randomly in the game scene map, the virtual character can be intelligently and automatically controlled to go to the position of any virtual element to be dealt with, thereby improving the implementation effect of the game AI.
[0041] It should be understood that the game automation method provided in the embodiment of the present application can be executed by an electronic device with data processing capabilities, which can be a terminal device or a server. Among them, the terminal device can be a computer, a smart phone, a tablet computer, a personal digital assistant (PDA), etc.; the server can be an application server or a Web server. In actual deployment, it can be an independent server, or a cluster server or cloud server composed of multiple physical servers. The recorded sample data involved in the embodiment of the present application can be stored on the blockchain.
[0042] In order to facilitate understanding of the game automation method provided in the embodiment of the present application, the application scenario of the game automation method is exemplarily introduced below by taking the execution subject of the game automation method as a server as an example.
[0043] See also Figure 1 , Figure 1 Schematic diagram of application scenarios of the game automation method provided in the embodiment of the present application. Figure 1 As shown, the application scenario includes a terminal device 110, a server 120 and a database 130; the terminal device 110 and the server 120 can communicate through a network; the server 120 can retrieve data from the database 130. Among them, a game application to be tested runs on the terminal device 110; the server 120 is used to execute the game automation method provided in the embodiment of the present application to automatically control the virtual character in the game during the game process through the game application on the terminal device 110; the database 130 is used to store the recorded sample data recorded in the game process recording stage.
[0044] In actual applications, when the game application running on the terminal device 110 is automatically tested, the server 120 can be made to control the virtual character to refer to the game process provided by the game application. For example, assuming that the game application running on the terminal device 110 is a level duel game, during the game process, it is necessary to control the virtual character to move toward the end of the level, and during the moving process, it is necessary to control the virtual character to deal with virtual elements (such as enemies, monsters, bonus equipment, etc.) that appear randomly in the game scene; when the game application is automatically tested, the server 120 can be made to control the virtual character to reach the end of the level during the game. Of course, in actual applications, the game application to be tested can also be other types of game applications, and this application does not make any limitation on the game application.
[0045] Before the server 120 controls the virtual character to participate in the game process provided by the game application to be tested, it is necessary to first obtain recorded sample data, for example, the recorded sample data can be obtained from the database 130. The recorded sample data is generated by recording a reference game process, where the reference game process can be, for example, a game process provided by the game application in which a reference virtual character is controlled by a relevant technician to participate; in the above-mentioned reference game process, the reference virtual character is controlled to traverse the moving path in the game scene map to reach each virtual element candidate appearance position, where the virtual element candidate appearance position refers to the position where the virtual element may appear in the game scene. The recorded sample data generated by recording the reference game process includes the feature data corresponding to each frame of the game screen in the reference game process, and the feature data at least includes the position of the reference virtual character in the game scene map and the movement operation data of the reference virtual character.
[0046] Furthermore, based on the acquired recorded sample data, the server 120 can control the virtual character to participate in the game process provided by the game application running on the terminal device 110. Here, the virtual character controlled by the server 120 can be regarded as the target virtual character, and the game process in which the target virtual character is controlled to participate can be regarded as the target game process.
[0047] During the target game process, if a target virtual element that needs to be dealt with by the target virtual character is detected in the game scene map, the target virtual character can be controlled to move toward the target virtual element according to the current positions of the target virtual character and the target virtual element in the game scene map, and the characteristic data in the previously acquired recorded sample data. Since the reference virtual character has been controlled to traverse the moving path to reach the candidate positions of each virtual element during the reference game process, the recorded sample data generated by recording the reference game process can accordingly cover the position data on the moving path to the candidate positions of each virtual element and the related moving operation data; accordingly, during the target game process, no matter where the target virtual element appears in the game scene map, the server 120 can find the characteristic data for guiding the target virtual character to move toward the target virtual element from the recorded sample data according to the respective positions of the target virtual character and the target virtual element, and control the target virtual character to move toward the target virtual element accordingly based on the found characteristic data.
[0048] It should be understood that when the server 120 specifically controls the movement of the target virtual character, it needs to generate a corresponding control instruction according to the movement operation data determined by it for controlling the movement of the target virtual character, and send the control instruction to the terminal device 110. Accordingly, after receiving the control instruction, the terminal device 110 can control the target virtual character to perform the movement operation based on the control instruction.
[0049] It should be understood that Figure 1 The application scenarios shown are only examples. In actual applications, the game automation method provided in the embodiment of the present application can also be applied to other scenarios. For example, the server 120 can control the target virtual character to realize the game companion function. In addition, the game automation method provided in the embodiment of the present application can also be independently executed by the terminal device 110. No limitation is made here to the application scenarios to which the game automation method provided in the embodiment of the present application is applicable.
[0050] The game automation method provided by the present application is described in detail below through a method embodiment.
[0051] See also Figure 2 , Figure 2The flowchart of the game automation method provided in the embodiment of the present application is shown in FIG. For the convenience of description, the following embodiment is still introduced by taking the execution subject of the game automation method as a server as an example. Figure 2 As shown, the game automation method includes the following steps:
[0052] Step 201: Obtain recorded sample data; the recorded sample data is generated by recording a reference game process, in which a reference virtual character is controlled to traverse a moving path to reach each candidate appearance position of each virtual element; the recorded sample data includes feature data corresponding to each frame of the game screen in the reference game process, and the feature data includes at least the position of the reference virtual character in the game scene map and the movement operation data of the reference virtual character.
[0053] In actual applications, when the server implements game AI based on the recording and playback of the game process, it is necessary to first obtain the recorded sample data recorded during the recording phase of the game process. The recorded sample data will be used as the basis for controlling the actions of the virtual character during the playback phase of the game process.
[0054] It should be noted that the solution for implementing game AI based on recording and playback of the game process mainly includes two implementation stages, namely the game process recording stage and the game process playback stage. Among them, the game process recording stage is used to record the reference game process in which the reference virtual character is manipulated by relevant technical personnel, and correspondingly record the feature data of each frame of the game screen in the reference game process, so as to construct the recording sample data based on the recorded feature data. The game process playback stage is used to automatically control the target virtual character to perform corresponding operations in the target game process according to the recording sample data constructed in the game process recording stage.
[0055] The following first introduces the relevant concepts involved in the game process recording stage. The relevant concepts involved in the game process playback stage will be introduced in the description of step 202 and step 203 later.
[0056] During the game process recording stage, the relevant technicians need to control the reference virtual character to participate in the reference game process. The reference virtual character here refers to the virtual character controlled by the relevant technicians during the game process recording stage, and the reference virtual character can be any virtual character that can participate in the game process. The reference game process here refers to the game process participated in during the game process recording stage.
[0057] In the embodiment of the present application, during the reference game process, it is necessary to control the reference virtual character to traverse the moving path of each virtual element candidate appearance position in the game scene map; in other words, during the reference game process, it is necessary to control the reference virtual character to traverse each position in the game scene map to ensure that the reference virtual character traverses the moving path from any position to any virtual element candidate appearance position in the game scene map. The virtual element candidate appearance position here refers to the position where the virtual element may appear in the game scene map; in actual application, according to actual needs, some positions in the game scene map can be set as the position for the appearance of virtual elements, and accordingly, this part of the position is the virtual element candidate appearance position; or it can be set that virtual elements can appear in each position in the game scene map, and accordingly, all positions in the game scene map belong to the virtual element candidate appearance position; this application does not make any restrictions on the number of virtual element candidate appearance positions and the specific deployment positions. The virtual element here refers to the virtual element that the virtual character needs to deal with, and the virtual element can be, for example, an enemy, a monster, a reward element (such as a reward equipment, a reward life), etc., and this application does not make any restrictions on the virtual element here.
[0058] In the game process recording stage, it is necessary to record the feature data corresponding to each frame of the game screen during the reference game process, and then, according to the appearance sequence of each frame of the game screen, the recorded feature data corresponding to each frame of the game screen is used to form the recording sample data. The feature data corresponding to the game screen here is used to characterize the game environment where the reference virtual character is located in the game screen, and the action performed by the reference virtual character. The feature data corresponding to the game screen can be read from the game interface during the reference game process. In an embodiment of the present application, the feature data corresponding to the game screen includes at least the position of the reference virtual character in the game scene map, and the movement operation data of the reference virtual character; wherein, the position data of the reference virtual character in the game scene map can be represented by the coordinate value in the game scene map coordinate system; the movement operation data of the reference virtual character is the operation data used to control the movement of the reference virtual character in the game scene map, and the movement operation data may include, for example, operation data for controlling the movement of the reference virtual character (such as controlling the movement of the reference virtual character by a joystick), operation data for controlling the jumping of the reference virtual character (such as controlling the jumping of the reference virtual character by a jumping control), etc.; of course, in actual applications, the movement operation data may also include other types of operation data for controlling the movement of virtual characters, and the present application does not impose any limitation on the movement operation data.
[0059] In a possible implementation, the reference virtual character can be controlled to participate in the reference game process in the following manner, thereby generating corresponding recorded sample data. In the reference game process, for each candidate appearance position of a virtual element in the game scene map, the reference virtual character is controlled to move from the target starting position to the candidate appearance position of the virtual element, and then return from the candidate appearance position of the virtual element to the target starting position. Accordingly, in the above-mentioned reference game process, the position of the reference virtual character in the game scene map in each frame of the game screen, and the movement operation data of the reference virtual character are collected as feature data corresponding to the game screen; and according to the appearance sequence of each frame of the game screen in the reference game process, the feature data corresponding to each frame of the game screen are arranged to form the recorded sample data.
[0060] During the recording phase of the game process, in order to ensure that the controlled reference virtual character can traverse the moving path to reach each virtual element candidate appearance position in the game scene map, in the reference game process, the embodiment of the present application controls the reference virtual character to start from the target starting position when going to each virtual element candidate appearance position, and controls the reference virtual character to return to the target starting position after reaching the virtual element candidate appearance position. That is, during the reference game process, the reference virtual character is controlled to go from the target starting position to a certain virtual element candidate appearance position, arrive at the virtual element candidate appearance position and then return to the target starting position, and then control the reference virtual character from the target starting position to another virtual element candidate appearance position, and then return from the virtual element candidate appearance position to the target starting position, and so on, so that the reference virtual character moves back and forth between the target starting position and each virtual element candidate appearance position. In this way, during the recording stage of the game process, it is ensured that the reference virtual character traverses the moving path to reach the candidate appearance positions of each virtual element; accordingly, during the playback stage of the game process, no matter where the target virtual character is in the game scene map, or where the target virtual element that the target virtual character needs to respond to is in the game scene map, the corresponding path to the target virtual element can be found by first controlling the target virtual character to go to the target starting position.
[0061] It should be noted that the reason why the game scene map is used as the basis for controlling the movement of the reference virtual character in the reference game process, rather than the game scene interface, is that the game background service usually deploys the virtual elements that the virtual character needs to deal with based on the game scene map, controls the reference virtual character in the game scene map, and records the position of the reference virtual character in the game scene map accordingly, which is conducive to accurately controlling the target virtual character to move to the target virtual element based on the recorded position of the reference virtual character in the game scene map in the subsequent game process playback stage. On the contrary, if the reference virtual character is controlled based on the game scene interface in the game process recording stage, and the position of the reference virtual character in the game scene interface is recorded, it will be difficult to accurately control the target virtual character to move to the target virtual element in the subsequent game process playback stage; specifically, the game background service deploys the target virtual element based on the game scene map, and the server controls the movement of the target virtual character based on the game scene interface, which will make the measurement of the position of the target virtual character and the target virtual element based on different coordinate systems. In this case, it is difficult to accurately control the target virtual character to move to the target virtual element.
[0062] In order to facilitate the understanding of the above implementation principle, the following Figure 3 The schematic diagram of the game scene map shown in FIG. 1 introduces the movement strategy of the above-mentioned reference virtual character. Figure 3 As shown, it is assumed that A, B, C, D, and E in the game scene map are candidate locations for virtual elements, and C in the game scene map is the target starting location. If only the reference virtual character is controlled to simply traverse the candidate locations for virtual elements during the recording phase of the game process, some moving paths to the candidate locations for virtual elements may be missed; for example, assuming that the reference virtual character is controlled to traverse the game scene map along the route of A->B->C->D->E, then when the virtual character is at B and the virtual element that the virtual character needs to deal with is at A, it will be difficult to find the moving path of B->A from the above moving route. If the reference virtual character is controlled to travel back and forth between the target starting location and the candidate locations for virtual elements in the manner described above, a moving route such as C->A->C->B->C->D->C->E can be generated. In this case, when the virtual character is at B and the virtual element that the virtual character needs to deal with is at A, based on the moving route, the virtual character can be controlled to move to C first according to B->C, and then the virtual character can be controlled to move to A according to C->A.
[0063] It should be understood that the above-mentioned target starting position can be set according to actual needs. For example, the position where the reference virtual character is born in the game scene map can be set as the target starting position. For another example, the center position of the game scene map can be set as the target starting position. This application does not make any limitation on the specific deployment position of the target starting position.
[0064] It should be understood that in actual applications, in addition to controlling the reference virtual character's movement path to traverse and reach each candidate appearance position of the virtual element in the above-mentioned manner during the reference game, the reference virtual character's movement path to traverse and reach each candidate appearance position of the virtual element can also be controlled in other ways. For example, a game scene pathfinding algorithm can be used to control the reference virtual character's movement path to traverse and reach each candidate appearance position of the virtual element. The present application does not impose any limitation on the method of controlling the movement of the reference virtual character during the reference game.
[0065] In the above-mentioned reference game process, the server can read the position of the reference virtual character in the game scene map and the movement operation data of the reference virtual character in each frame of the game screen through the game interface at a preset frame rate (such as 30 frames per second) as the feature data corresponding to the frame of the game screen. Figure 4 The game scene shown in the figure can read the x coordinate p of the reference virtual character in the game scene map coordinate system. x and the y coordinate p y ; Read the joystick control data generated in the joystick control area, the joystick control data may include, for example, the joystick control state S move (It is used to indicate whether the joystick is controlled, S move When it is equal to 1, it indicates that the joystick is controlled. move When it is equal to 0, it indicates that the joystick is not controlled), joystick movement data j x and j y (respectively representing the movement of the joystick in the x-axis and y-axis directions); reading the jump control data implemented by the jump control, which may include, for example, the jump control state S jump (It is used to indicate whether to control the reference virtual character to jump, S jump When it is equal to 1, it indicates that the reference virtual character jumps, S move When it is equal to 0, it indicates that the reference virtual character has no jump). Then, according to the appearance sequence of each frame of the game screen in the reference game process, such as according to the frame sequence number corresponding to each frame of the game screen, the feature data corresponding to each frame of the game screen is arranged accordingly to obtain the recorded sample data.
[0066] In addition, in order to enable the target virtual character to intelligently respond to the target virtual elements that appear during the game process playback stage, during the game process recording and playback stage, in addition to obtaining the position of the reference virtual character in the game scene map and the movement operation data of the reference virtual character in the game screen as corresponding feature data, data related to the reference virtual character's response to the reference virtual element can also be obtained as feature data corresponding to the game screen. That is, during the reference game process, the skill usage data of the reference virtual character in each frame of the game screen, the type of reference virtual element that the reference virtual character responds to, and the position of the reference virtual element in the game scene map can be collected, and these data are also used as feature data corresponding to the game screen.
[0067] Specifically, during the reference game process, the server can read the skill usage data of the reference virtual character, the type of reference virtual element that the reference virtual character needs to deal with, and the position of the reference virtual element in the game scene map in each frame of the game screen through the game interface at a preset frame rate, and then use the position of the reference virtual character in the game scene map, the movement operation data of the reference virtual character, the skill usage data of the reference virtual character, the type of reference virtual element, and the position of the reference virtual element in the game scene map as feature data corresponding to the game screen. Figure 4 Taking the game scene shown in FIG. 1 as an example, the skill usage data of the reference virtual character can be read. The skill usage data can include, for example, the usage status S of common skills (such as shooting, etc.). shoot (It is used to indicate whether to control the reference virtual character to use ordinary skills, S shoot When it is equal to 1, it indicates that the reference virtual character has used ordinary skills. shoot When it is equal to 0, it indicates that the reference virtual character does not use ordinary skills) and special skills (such as defense, powerful attack, etc.) are used. skill (It is used to indicate whether to control the reference virtual character to use special skills, S skill When it is equal to 1, it indicates that the reference virtual character has used special skills. skill When it is equal to 0, it indicates that the reference virtual character does not use special skills), and the identifier of the special skills used. id ; Read the type of reference virtual element, such as the type of enemy character to be dealt with t enemy , and the x coordinate p of the reference virtual element in the game scene map coordinate system enemyX and the y coordinate p enemyY By combining the skill usage data of the reference virtual character, the type of the reference virtual element, the position of the reference virtual element in the game scene map, the position of the reference virtual character in the game scene map, and the movement operation data of the reference virtual character, the following feature data corresponding to the game screen can be obtained:
[0068] f=[S jump ,S shoot ,S skill ,S move ,p x ,p y ,j x ,j y ,skill id ,t enemy ,p enemyX ,p enemyY ]
[0069] It should be understood that the above-mentioned feature data corresponding to the game screen is only an example. In actual applications, the feature data can also be expressed in other data formats. In addition, the feature data can include other types of data in addition to the above-mentioned data. This application does not make any restrictions on the data types included in the feature data.
[0070] Thus, the recorded sample data is constructed in the above manner, so that the constructed recorded sample data includes both data for controlling the movement of the virtual character and data for controlling the release of skills of the virtual character. In the game process playback stage, the virtual character is controlled to participate in the game process based on the recorded sample data, so that the virtual character can move intelligently in the game scene map during the game process, and the virtual character can release skills intelligently for the virtual elements appearing in the game scene.
[0071] Step 202: Based on the recorded sample data, control the target virtual character to participate in the target game process.
[0072] Step 203: During the target game process, if the target virtual element is detected to appear, the target virtual character is controlled to move toward the target virtual element according to the respective positions of the target virtual character and the target virtual element in the game scene map and the feature data corresponding to each frame of the game screen in the recorded sample data.
[0073] Since step 202 and step 203 are closely related, the specific implementation process of step 202 and step 203 is introduced as a whole below. After the server obtains the recorded sample data generated in the game process recording stage, it can enter the game process playback stage; it should be noted that the game process playback here refers to controlling the target virtual character to replay the action performed by the reference virtual character in the game process recording stage according to the recorded sample data recorded in the game process recording stage; this game process playback is different from the traditional game process playback, which is intended to control the virtual character to replay the action generated in the game process recording stage, while the traditional game process playback is intended to replay the recorded game video. In the game process playback stage, the server can control the target virtual character to perform the action indicated by the feature data in the recorded sample data in the target game process according to each feature data in the acquired recorded sample data; for example, control the target virtual character to reach the position in the feature data and perform the moving action indicated by the moving action data in the feature data; for another example, control the target virtual character to perform the skill release action indicated by the skill use data in the feature data, and so on.
[0074] During the target game process, if a target virtual element that needs to be responded to by the target virtual character is detected in the game scene map, the server can read the current position of the target virtual character in the game scene map, and the current position of the target virtual element in the game scene map, and then, according to the respective positions of the target virtual character and the target virtual element in the game scene map, find the feature data used to guide the target virtual character to move toward the target virtual element from the feature data corresponding to each frame of the game screen included in the recorded sample data, and based on the found feature data, control the target virtual character to move toward the target virtual element accordingly.
[0075] The following is an introduction to the relevant concepts involved in the game playback phase.
[0076] During the game process playback phase, the server or terminal device can automatically control the target virtual character to participate in the target game process and perform corresponding operations in the target game process based on the recorded sample data generated during the game process recording phase. The target virtual character here refers to the virtual character automatically controlled by the server or terminal device during the game process playback phase. The target virtual character can be any virtual character that can participate in the game process. The target virtual character can be the same as or different from the reference virtual character in the game process recording phase. The target game process here refers to the game process participated in during the game process playback phase.
[0077] During the target game, a target virtual element may randomly appear at any candidate virtual element appearance position in the game scene map, and the target virtual character needs to deal with the target virtual element that appears; the target virtual element may be any virtual element that the target virtual character needs to deal with during the target game, such as an enemy, a monster, a reward element (such as reward equipment, reward life), etc. Assuming that the target virtual element that randomly appears during the target game is an enemy, in this case, the target virtual character needs to be controlled to move to the enemy's position and defeat the enemy by releasing skills to the enemy.
[0078] In a possible implementation, the server can control the target virtual character to move directly toward the target virtual element. That is, the server can use the position of the target virtual character in the game scene map as the starting position and the position of the target virtual element in the game scene map as the ending position; then, according to the starting position, the ending position, and each feature data in the recorded sample data, determine the target movement path and target movement operation data from the starting position to the ending position; and based on the target movement operation data, control the target virtual character to move along the target movement path.
[0079] Specifically, when the server controls the target virtual character to move directly to the target virtual element, the current positions of the target virtual character and the target virtual element in the game scene map can be used as the starting position and the ending position, respectively. Then, based on the recorded sample data generated during the game process recording phase, the feature data generated when the reference virtual character is controlled to move from the starting position to the ending position during the game process recording phase is searched, and each position data in the feature data thus found will constitute a target moving path from the starting position to the ending position, and each moving operation data in the feature data thus found will be regarded as target moving operation data for controlling the virtual character to move from the starting position to the ending position. Furthermore, based on the target moving operation data in the found feature data, the target virtual character in the target game process is controlled accordingly, so that the target virtual character moves from the starting position to the ending position, that is, from its current position to the position of the target virtual element.
[0080] It should be noted that the above-mentioned method of controlling the movement of the target virtual character is usually more suitable for controlling the movement of the reference virtual character based on the game scene pathfinding algorithm during the game process recording stage; that is, if during the game process recording stage, the reference virtual character is controlled to traverse the movement path to reach the candidate appearance positions of each virtual element based on the game scene pathfinding algorithm, then during the game process playback stage, when the target virtual element appears in the target game process, the target virtual character can be controlled to move directly from its current position to the position of the target virtual element.
[0081] Thus, by controlling the movement of the target virtual character in the above manner, the target virtual character can be quickly moved from its current position to the position of the target virtual element, thereby improving the movement efficiency of the target virtual character and making the movement control of the target virtual character more intelligent.
[0082] In another possible implementation, if during the recording phase of the game process, the reference virtual character is controlled to move back and forth between the target starting position and the candidate positions of each virtual element, so that the reference virtual character traverses the movement path in the game scene map to reach the candidate positions of each virtual element, then during the playback phase of the game process, the target virtual character can also be similarly controlled to go to the target starting position, and then go from the target starting position to the position of the target virtual element. In this implementation, before controlling the movement of the target virtual character, it is possible to first determine whether the current position of the target virtual character in the game scene map is the target starting position, and then execute different movement control strategies based on the determination result.
[0083] When the current position of the target virtual character in the game scene map is determined to be the target starting position, the server can use the target starting position as the starting position and the position of the target virtual element in the game scene map as the ending position. Then, based on the starting position, the ending position, and each feature data in the recorded sample data, the target moving path and target moving operation data from the starting position to the ending position are determined; and based on the target moving operation data, the target virtual character is controlled to move along the target moving path from the target starting position to the position of the target virtual element.
[0084] When it is determined that the current position of the target virtual character in the game scene map is not the target starting position, the server can use the current position of the target virtual character in the game scene map as the starting position and the target starting position as the ending position. Then, according to the starting position, the ending position, and each feature data in the recorded sample data, the target moving path and target moving operation data from the starting position to the ending position are determined; based on the target moving operation data, the target virtual character is controlled to move along the target moving path from its current position to the target starting position. After the target virtual character moves to the target starting position through the above-mentioned moving operation, the server can update the starting position to the target starting position and update the ending position to the position of the target virtual element in the game scene map. Furthermore, according to the updated starting position, the updated ending position, and each feature data in the recorded sample, the target moving path and target moving operation data from the updated starting position to the updated ending position are determined; based on the target moving operation data, the target virtual character is controlled to move along the target moving path from the target starting position to the position where the target virtual element is located.
[0085] It should be understood that for the two situations where the position of the target virtual character is the target starting position and the position of the target virtual character is not the target starting position, the method adopted by the server to control the movement of the target virtual character is basically the same. The only difference is that, when the position of the target virtual character is the target starting position, the server can control the target virtual character to move directly from the target starting position to the position of the target virtual element, while when the position of the target virtual character is not the target starting position, the server needs to first control the target virtual character to move from its current position to the target starting position, and then control the target virtual character to move from the target starting position to the position of the target virtual element.
[0086] When specifically controlling the movement of the target virtual character, the server needs to set the starting position and the ending position of the moving path; for the case where the position of the target virtual character is the target starting position, the server only needs to determine one moving path, and the starting position and the ending position of the moving path are the target starting position and the position of the target virtual element respectively; for the case where the position of the target virtual character is not the target starting position, the server needs to determine two moving paths, and the starting position and the ending position of the first moving path are the position of the target virtual character and the target starting position respectively, and the starting position and the ending position of the first moving path are the target starting position and the position of the target virtual element respectively.
[0087] After the server determines the starting position and the ending position of the moving path, it can search for the feature data generated when the reference virtual character is controlled to move from the starting position to the ending position during the recording phase of the game process based on the recorded sample data generated during the recording phase of the game process. Each position data in the feature data thus found will constitute the target moving path moving from the starting position to the ending position, and each moving operation data in the feature data thus found can be used as the target moving operation data for controlling the virtual character to move from the starting position to the ending position. Furthermore, based on the target moving operation data in the found feature data, the target virtual character in the target game process is controlled accordingly, so that the target virtual character moves from the starting position to the ending position, completing the determined moving path.
[0088] Thus, by controlling the movement of the target virtual character in the above manner, it can be ensured that the target virtual character can reach the position where it needs to deal with the target virtual element, that is, the reliability of the movement control operation of the target virtual character is guaranteed.
[0089] The two methods of controlling the movement of the target virtual character introduced above both mention that when controlling the target virtual character to move toward the target virtual element, the starting position and the ending position of the movement are first determined (the starting position and the ending position determined in the two methods are different); then, according to the determined starting position, the ending position and each feature data in the recorded sample data, the target movement path and the target movement operation data are determined, and based on the target movement operation data, the target virtual character is controlled to move along the target movement path. The following introduces the specific implementation method of determining the target movement path and the target movement operation data, and controlling the target virtual character to move along the target movement path based on the target movement operation data.
[0090] Specifically, the server can first search for target feature data in the recorded sample data according to the starting position, the ending position, and each feature data in the recorded sample data, and use the found target feature data to form a target feature data set. Then, according to the appearance timing of the game screen corresponding to each target feature data in the target feature data set, the positions included in each target feature data are arranged to obtain the target moving path. Based on the appearance timing of the game screen corresponding to each target feature data in the target feature data set, according to the movement operation data included in each target feature data, the target virtual character is controlled to move along the target moving path.
[0091] That is, the server can search for the feature data generated when the reference virtual character is controlled to move from the starting position to the ending position in the recording sample data during the recording phase of the game process according to the determined starting position and ending position, and the feature data found can be regarded as the target feature data; using the target feature data found, a target feature data set can be formed. According to the appearance sequence of the game screen corresponding to each target feature data in the target feature data set, the position data included in each target feature data is connected to obtain the target moving path from the starting position to the ending position. According to the appearance sequence of the game screen corresponding to each target feature data in the target feature data set, the movement operation data included in each target feature data is used to control the movement of the target virtual character accordingly, so that the target virtual character can move along the target moving path from the starting position to the ending position.
[0092] As an example, the server can search for target feature data in the recorded sample data in the following manner: for each feature data in the recorded sample data, determine the distance between the position in the feature data and the starting position as the starting distance corresponding to the feature data; if the starting distance corresponding to the feature data is less than the first preset distance threshold, the feature data can be used as the starting feature data; for each feature data in the recorded sample data, determine the distance between the position in the feature data and the ending position as the ending distance corresponding to the feature data; if the ending distance corresponding to the feature data is less than the second preset distance threshold, the feature data can be used as the ending feature data. Furthermore, the target feature data is selected from the recorded sample data according to the frame numbers of the game screen corresponding to each starting feature data and the frame numbers of the game screen corresponding to each ending feature data.
[0093] It should be understood that the first preset distance threshold is a distance threshold used to measure whether certain feature data can be used as starting feature data, and the second preset distance threshold is a distance threshold used to measure whether certain feature data can be used as ending feature data. The first preset distance threshold and the second preset distance threshold can be set according to actual needs. In actual applications, the first preset distance threshold and the second preset distance threshold can be the same or different. This application does not specifically limit the first preset distance threshold and the second preset distance threshold.
[0094] Exemplarily, for each feature data in the recorded sample data, the server can calculate the distance between the position in the feature data and the starting position (i.e., the starting distance corresponding to the feature data), and calculate the distance between the position in the feature data and the ending position (i.e., the ending distance corresponding to the feature data) by the following formula (1):
[0095]
[0096] When calculating the starting distance corresponding to the feature data, x1 and y1 are the x-coordinate and y-coordinate of the starting position, respectively, and x2 and y2 are the x-coordinate and y-coordinate of the position in the feature data, respectively; when calculating the ending distance corresponding to the feature data, x1 and y1 are the x-coordinate and y-coordinate of the ending position, respectively, and x2 and y2 are the x-coordinate and y-coordinate of the position in the feature data, respectively.
[0097] For each feature data in the recorded sample data, it can be determined whether the starting distance corresponding to the feature data is less than a first preset distance threshold (for example, it can be set to the distance of a virtual character in the game scene, such as 1). If so, the feature data can be used as the starting feature data and added to set A. For each feature data in the recorded sample data, it can also be determined whether the ending distance corresponding to the feature data is less than a second preset distance threshold (for example, it can be set to the distance of a virtual character in the game scene, such as 1). If so, the feature data can be used as the ending feature data and added to set B.
[0098] Furthermore, the server can select target feature data from the feature data included in the recorded sample data according to the frame numbers of the game screens corresponding to the respective starting feature data included in set A and the frame numbers of the game screens corresponding to the respective ending feature data included in set B. It should be understood that the frame numbers of the game screens are determined according to the timing of the game screens appearing in the reference game process. Generally, the earlier the timing of the game screens appearing, the smaller the frame number of the game screens, and the later the timing of the game screens appearing, the larger the frame number of the game screens.
[0099] When the server selects the target feature data, it can select a starting feature data from set A as the target starting feature data, and select a target ending feature data from set B, and ensure that the frame number of the game screen corresponding to the target ending feature data is greater than the frame number of the game screen corresponding to the target starting feature data, that is, ensure that the game screen corresponding to the target ending feature data appears after the game screen corresponding to the target starting feature data. The server can use the frame number of the game screen corresponding to the target starting feature data as the starting frame number, and the frame number of the game screen corresponding to the target ending feature data as the ending frame number; then, select the feature data corresponding to the game screen whose frame number is between the starting frame number and the ending frame number from the recorded sample data, and use the selected feature data and the above-mentioned target starting feature data and target ending feature data together as the target feature data.
[0100] Optionally, in order to make the moving path of the target virtual character from the starting position to the ending position as short as possible and improve the moving efficiency of the target virtual character, the server can select the target feature data from the recorded sample data according to the frame number of the game screen corresponding to each starting feature data and the frame number of the game screen corresponding to each ending feature data in the following manner:
[0101] For each starting feature data, according to the frame number of the game screen corresponding to the starting feature data and the frame number of the game screen corresponding to each of the ending feature data, the adjacent ending feature data corresponding to the starting feature data is determined in each of the ending feature data; and the difference between the frame number of the game screen corresponding to the adjacent ending feature data and the frame number corresponding to the starting feature data is determined as the frame spacing corresponding to the starting feature data. Then, according to the frame spacing corresponding to each of the starting feature data, the target starting feature data is selected from each of the starting feature data. Furthermore, the target starting feature data, the adjacent ending feature data corresponding to the target starting feature data, and the feature data between the two in the recorded sample data are determined as the target feature data.
[0102] Exemplarily, for each starting feature data, the server can select the adjacent termination feature data corresponding to the starting feature data from each termination feature data; the appearance timing of the game screen corresponding to the adjacent termination feature data needs to be after the game screen corresponding to the starting feature data, that is, the frame number of the game screen corresponding to the adjacent termination feature data is greater than the frame number of the game screen corresponding to the starting feature data; and the difference between the frame number of the game screen corresponding to the adjacent termination feature data and the frame number of the game screen corresponding to the starting feature data is less than the difference between the frame number of the game screen corresponding to other termination feature data and the frame number of the game screen corresponding to the starting feature data. After determining the corresponding adjacent termination feature data for each starting feature data, the server can determine the difference between the frame number of the game screen corresponding to the adjacent termination feature data and the frame number of the game screen corresponding to the starting feature data as the frame spacing corresponding to the starting feature data.
[0103] Figure 5 FIG. 1 is a schematic diagram of an implementation method for selecting target feature data provided by an embodiment of the present application. Figure 5 As shown, assuming that the set A used to carry the starting feature data includes feature data A1, feature data A2, feature data A3 and feature data A4, and the set B used to carry the ending feature data includes feature data B1, feature data B2, feature data B3 and feature data B4, the appearance timing of the game screen corresponding to the feature data A1, feature data A2, feature data A3, feature data A4, feature data B1, feature data B2, feature data B3 and feature data B4 is as follows Figure 5 As shown in the timeline, according to Figure 5It can be seen from the time axis shown that the adjacent termination feature data corresponding to feature data A1 is feature data B1, the adjacent termination feature data corresponding to feature data A2 is feature data B2, the adjacent termination feature data corresponding to feature data A3 is feature data B3, and feature data A4 does not have corresponding adjacent termination feature data. The frame spacing between each starting feature data and its corresponding adjacent termination feature data is the interval between the corresponding occurrence timings of two feature data on the time axis.
[0104] Furthermore, the server can select the starting feature data with the smallest corresponding frame spacing as the target starting feature data according to the frame spacing corresponding to each starting feature data, and correspondingly use the adjacent ending feature data corresponding to the target starting feature data as the target ending feature data. Figure 5 As shown in the example, since the interval between feature data A2 and feature data B2 is the shortest, feature data A2 can be used as the target start feature data, and feature data B2 can be used as the target end feature data. Furthermore, the target start feature data, the target end feature data, and the feature data between the target start feature data and the target end feature data in the recorded sample data are used as target feature data; it should be understood that each feature data in the recorded sample data is usually arranged according to the appearance sequence of the corresponding game screens, therefore, selecting the feature data between the target start feature data and the target end feature data in the recorded sample data is essentially selecting the feature data corresponding to each frame of the game screen that appears between the game screen corresponding to the target start feature data and the game screen corresponding to the target end feature data.
[0105] In this way, by selecting the target feature data in the above manner, it can be ensured that the target movement path indicated by the position data in each selected target feature data is the shortest. By controlling the target virtual character based on the movement operation data in the target feature data, the target virtual character can be moved from the starting position to the ending position at the fastest speed, thereby improving the movement efficiency of the target virtual character.
[0106] As an example, after the server finds each target feature data in the recorded sample data, it can control the movement of the target virtual character based on the found target feature data in the following manner: according to the appearance timing of the game screen corresponding to each target feature data in the target feature data set, control the target virtual character to execute the movement operation data in each target feature data in sequence; and before controlling the target virtual character to execute the movement operation data in the target feature data, it can first determine the deviation between the position of the target virtual character in the game scene map and the position included in the target feature data, and judge whether the deviation is less than a preset deviation threshold; if so, control the target virtual character to execute the movement operation data in the target feature data; if not, control the target virtual character to move to the position in the target feature data.
[0107] Specifically, after the server obtains the target feature data set, it can use each target feature data in the target feature data set according to the appearance timing of the game screen corresponding to each target feature data in the target feature data set, and control the target virtual character to execute the movement operation data in the target feature data in turn, so that the target virtual character can move from the starting position to the ending position in the process of executing the movement operation data in each target feature data.
[0108] In order to avoid deviations in the process of controlling the movement of the target virtual character, resulting in the actual movement path of the target virtual character not being consistent with the expected target movement path, the server can first determine the deviation between the current position of the target virtual character in the game scene map and the position included in the target feature data before controlling the target virtual character to execute the movement operation data in the target feature data each time, and determine whether the deviation is less than a preset deviation threshold (for example, it can be set to the distance of half the virtual character's body position in the game scene, such as 0.5); if the deviation is less than the preset deviation threshold, it means that the movement of the target virtual character will continue to be controlled according to the movement operation data in the target feature data, and there will be no deviation. The actual moving path of the target virtual character will produce an unacceptable deviation from the expected target moving path, so the target virtual character can continue to be controlled to execute the moving operation data in the target feature data; if the deviation is not less than the preset deviation threshold, it means that continuing to control the movement of the target virtual character according to the moving operation data in the target feature data will most likely cause the actual moving path of the target virtual character to produce an unacceptable deviation from the expected target moving path. Therefore, it is necessary to correct the position of the target virtual character first, that is, control the target virtual character to move to the position in the target feature data, and then control the target virtual character to execute the moving operation data in the target feature data.
[0109] In this way, by controlling the movement of the target virtual character in the above manner, it can be ensured that the actual movement path of the target virtual character is consistent with the expected target movement path, thereby ensuring that the target virtual character can smoothly reach the position of the target virtual element and ensuring a better game AI effect.
[0110] As mentioned above, during the recording stage of the game process, in addition to using the position of the reference virtual character in the game scene map and the movement operation data of the reference virtual character as feature data corresponding to the game screen, the skill usage data of the reference virtual character, the type of reference virtual element that the reference virtual character needs to deal with and its position in the game scene map can also be used as feature data corresponding to the game screen. In this case, after the server controls the target virtual character to reach the position of the target virtual element, it can further control the target virtual character to release the corresponding skill to the target virtual element based on the feature data in the recorded sample data.
[0111] Specifically, the server can search for the response feature data in the recorded sample data according to the type of the target virtual element; the type of the reference virtual element included in the response feature data is the same as the type of the target virtual element. Then, according to the skill usage data in the response feature data, the target virtual character is controlled to release the target skill for the target virtual element.
[0112] Exemplarily, the server can determine the type of the target virtual element that appears in the target game process, and then search the recorded sample data for the feature data of the reference virtual element that is the same type as the target virtual element as the response feature data; that is, the server uses the feature data generated when responding to the same type of virtual element during the game process recording phase as the response feature data. Furthermore, the server can control the target virtual character to release the corresponding skill for the target virtual element according to the skill usage data in the response feature data; for example, assuming that the target virtual element is an enemy, the server can control the target virtual character to execute the skill indicated by the skill usage data in the response feature data to defeat the enemy.
[0113] In some cases, the server may find multiple response feature data in the above manner, that is, there may be multiple feature data of the type including the target virtual element in the recorded sample data. In this case, for each response feature data, the server can determine the position difference between the reference virtual character and the reference virtual element according to their respective positions in the game scene map, as the position difference corresponding to the response feature data; and determine the position difference between the target virtual character and the target virtual element according to their respective positions in the game scene map, as the target position difference. Furthermore, among the multiple response feature data, the response feature data whose corresponding position difference best matches the target position difference is selected as the target response feature data; and according to the skill usage data in the target response feature data, the target virtual character is controlled to release the target skill for the target virtual element.
[0114] Specifically, for each response feature data found, the server can determine the position difference between the reference virtual character and the reference virtual element according to the positions of the reference virtual character and the reference virtual element in the game scene map, as the position difference corresponding to the response feature data, and the position difference may include, for example, a direction difference and a distance difference. At the same time, for the target virtual character and the target virtual element, the server also needs to determine the position difference between the target virtual character and the target virtual element according to the positions of the target virtual character and the target virtual element in the game scene map, as the target position difference. Then, select the response feature data whose corresponding position difference is most matched with the target position difference as the target feature data; for example, select the response feature data whose corresponding direction difference is the smallest in the direction difference and the target position difference, and / or the corresponding distance difference is the smallest in the distance difference and the target position difference as the target response feature data; and control the target virtual character to perform the skill indicated by the skill usage data in the target response feature data.
[0115] In this way, after the target virtual character moves to the target virtual element, the target virtual character can be further controlled in the above manner to execute corresponding countermeasures against the target virtual element, such as attack measures can be executed against enemies, monsters, etc., and storage measures can be executed against reward elements, thereby making the target virtual character perform more intelligently during the target game process and improving the implementation effect of game AI.
[0116] The above-mentioned game automation method, in the stage of recording the reference game process, controls the reference virtual character to traverse the moving path of each virtual element candidate appearance position in the game scene map, so that the feature data corresponding to each frame of the game screen recorded in the recording stage can cover the position data on the moving path to the virtual element candidate appearance position, and the related mobile operation data. Correspondingly, in the playback stage, that is, in the stage of controlling the target virtual character to participate in the target game process, when the target virtual element to be dealt with appears in the game scene map, the feature data for guiding the target virtual character to move to the target virtual element can be selected from the feature data recorded in the recording stage according to the respective positions of the target virtual character and the target virtual element in the game scene map, and the target virtual character is controlled to move to the target virtual element accordingly based on the selected feature data. In this way, for games in which virtual elements appear randomly in the game scene map, the virtual character can be intelligently and automatically controlled to go to the position of any virtual element to be dealt with, thereby improving the implementation effect of the game AI.
[0117] In order to further understand the game automation method provided in the embodiment of the present application, Figure 6 The flowchart shown in the figure takes the virtual elements that the virtual character needs to deal with during the game as enemies that appear randomly in the game scene as an example to provide an overall exemplary introduction to the above-mentioned game automation method.
[0118] like Figure 6 As shown, the implementation process of the game automation method provided by the embodiment of the present application mainly includes recording a reference game process, constructing feature data, controlling the target virtual character to reach the target starting position, controlling the target virtual character to move to the enemy's area, and attacking the enemy according to the enemy type; wherein, recording the reference game process and constructing feature data are implemented in the game process recording stage, and controlling the target virtual character to reach the target starting position, controlling the target virtual character to move to the enemy's area, and attacking the enemy according to the enemy type are implemented in the game process playback stage. The five parts of the implementation process are introduced below.
[0119] During the recording of the reference game process, the target starting position can be set, and the reference virtual character can be controlled to move back and forth between the target starting position and each enemy candidate appearance position (i.e., the virtual element candidate appearance position mentioned above). Figure 3Taking the game scene map shown as an example, assuming that A, B, D, and E in the game scene map are all positions where enemies may appear, set C in the game scene map as the target starting position. Accordingly, in the reference game process, the target virtual character can be controlled to move along a moving route such as C->A->C->B->C->D->C->E; in this way, no matter where the enemy appears among A, B, D, and E, the virtual character can be controlled to return to the target starting position C, and then the moving path of the virtual character to the position where the enemy appears can be further determined, so as to conveniently and quickly find the route to control the virtual character to the enemy.
[0120] In the stage of constructing feature data, when recording the reference game process, the position of the reference virtual character in each frame of the game screen and the player's control operation on the reference virtual character can be read through the game interface. The player's control operation can include, for example, controlling the reference virtual character to jump, controlling the reference virtual character to move through a joystick, controlling whether the reference virtual character has a skill, etc. Exemplarily, the feature data recorded for each frame of the game screen can be expressed as follows:
[0121] f=[S jump ,S shoot ,S skill ,S move ,p x ,p y ,j x ,j y ,skill id ,t enemy ,p enemyX ,p enemyY ]
[0122] Among them, S jump , S shoot , S skill , S move They are used to represent the states of jumping, normal attack skills, special attack skills, and joystick movement; if the corresponding value is 1, it means that the corresponding action is used in the game screen, and if the corresponding value is 0, it means that the corresponding action is not used in the game screen. x and p y Refers to the x- and y-coordinates of the virtual character in the game scene map. x and j y Represents the movement of the joystick on the x-axis and y-axis respectively. id The identifier of the special skill used. enemy To refer to the type of enemy that the virtual character attacks in the game screen, p enemyX and p enemyYIt is the x-coordinate and y-coordinate of the attacked enemy in the game scene map. When recording the reference game process, the feature data corresponding to the game screen can be recorded based on the set frame rate (such as 30 frames per second).
[0123] In the stage of controlling the target virtual character to reach the target starting position, the feature data corresponding to each frame of the game screen recorded in the game process recording stage can be read first, and the position of the target virtual character in the game scene map can be obtained in real time through the game interface. When an enemy that the target virtual character needs to attack appears in the game scene map, the server can find the feature data used to guide the target virtual character to move from its position to the enemy's position from the feature data recorded in the recording stage.
[0124] Specifically, the server may calculate the distance between the position included in each feature data and the position of the target virtual character, and calculate the distance between the position included in each feature data and the target starting position. The specific calculation formula is as follows:
[0125]
[0126] When calculating the distance between the position included in the feature data and the position of the target virtual character, x1 and y1 are the x-coordinate and y-coordinate of the position of the target virtual character, and x2 and y2 are the x-coordinate and y-coordinate of the position in the feature data; when calculating the distance between the position included in each feature data and the target starting position, x1 and y1 are the x-coordinate and y-coordinate of the target starting position, and x2 and y2 are the x-coordinate and y-coordinate of the position in the feature data.
[0127] The feature data whose distance between the included position and the position of the target virtual character is less than a preset distance threshold (for example, it can be set to the distance of a virtual character in the game scene, such as 1) is put into set A; the feature data whose distance between the included position and the target starting position is less than the preset distance threshold is put into set B. For each feature data in set A, the adjacent feature data corresponding to the feature data is found in set B, and the difference between the adjacent feature data and the frame number of the game screen corresponding to each of the feature data is determined as the frame spacing corresponding to the feature data; the frame number of the game screen corresponding to the adjacent feature data is greater than the frame number of the game screen corresponding to the feature data; and the difference between the frame number of the game screen corresponding to the adjacent feature data and the frame number of the game screen corresponding to the feature data is less than the difference between the frame number of the game screen corresponding to other feature data in set B and the frame number of the game screen corresponding to the feature data. After obtaining the adjacent feature data and frame spacing corresponding to each feature data in set A, the feature data with the smallest frame spacing can be determined as the target starting feature data, and the adjacent feature data corresponding to the target starting feature data can be determined as the target ending feature data. Furthermore, the target starting feature data, the target ending feature data, and the feature data of the corresponding game screen that appears between the game screen corresponding to the target starting feature data and the game screen corresponding to the target ending feature data are collectively used as target feature data, and the target feature data can guide the target virtual character to move from its current position to the target starting position.
[0128] Then, according to the appearance sequence of the game screens corresponding to the target feature data, the target virtual character is controlled one by one using the movement operation data in each target feature data, that is, the target virtual character is controlled to move to the target starting position according to the jump data and joystick control data in each target feature data. Before controlling the movement of the target virtual character based on the movement operation data in a certain target feature data, it can be determined whether the deviation between the current position of the target virtual character and the position included in the target feature data is less than 0.5. If so, the target virtual character can continue to be controlled to execute the movement operation data in the target feature data.
[0129] In the stage of controlling the target virtual character to move to the enemy's area, the server may control the target virtual character to move from the target starting position to the enemy's position in a manner similar to the manner of controlling the target virtual character to reach the target starting position described above. That is, the target starting position is used to replace the position of the target virtual character in the stage of controlling the target virtual character to reach the target starting position, and the enemy's position is used to replace the target starting position in the stage of controlling the target virtual character to reach the target starting position.
[0130] In the stage of attacking the enemy according to the enemy type, the server can read the enemy type that needs to be dealt with currently through the game interface, and then find the feature data including the enemy type in the recorded feature data. Then, the position difference between the position of the target virtual character and the position of the enemy is calculated as the target position difference; and for each feature data found, the position difference between the position of the reference virtual character and the position of the enemy is calculated as the position difference corresponding to the feature data. Then, the feature data whose corresponding position difference best matches the target position difference is found, and the target virtual character is controlled to attack the enemy based on the skill usage data in the feature data.
[0131] With respect to the game automation method described above, the present application also provides a corresponding game automation device so that the game automation method can be applied and implemented in practice.
[0132] See also Figure 7 , Figure 7 It is the same as above Figure 2 The structure diagram of a game automation device 700 corresponding to the game automation method shown in FIG. Figure 7 As shown, the game automation device 700 includes:
[0133] The acquisition module 701 is used to acquire recorded sample data; the recorded sample data is generated by recording a reference game process, in which the reference virtual character is controlled to traverse a movement path to reach each candidate appearance position of each virtual element; the recorded sample data includes feature data corresponding to each frame of the game screen in the reference game process, and the feature data at least includes the position of the reference virtual character in the game scene map and the movement operation data of the reference virtual character;
[0134] The control module 702 is used to control the target virtual character to participate in the target game process based on the recorded sample data; during the target game process, if the target virtual element is detected to appear, the target virtual character is controlled to move toward the target virtual element according to the respective positions of the target virtual character and the target virtual element in the game scene map and the feature data corresponding to each frame of the game screen in the recorded sample data.
[0135] Optional, in Figure 7 Based on the game automation device shown, see Figure 8 , Figure 8 FIG. 8 is a schematic diagram of another game automation device 800 provided in an embodiment of the present application. Figure 8 As shown, the device further includes a recording module 801; the recording module 801 is used to:
[0136] In the reference game process, for each candidate appearance position of the virtual element in the game scene map, the reference virtual character is controlled to move from a target starting position to the candidate appearance position of the virtual element, and then return from the candidate appearance position of the virtual element to the target starting position;
[0137] In the reference game process, the position of the reference virtual character in the game scene map and the movement operation data of the reference virtual character in each frame of the game screen are collected as feature data corresponding to the game screen;
[0138] According to the appearance timing of each frame of the game screen during the reference game process, the feature data corresponding to each frame of the game screen are arranged to form the recorded sample data.
[0139] exist Figure 8 Based on the game automation device shown, the recording module 801 is also used for:
[0140] During the reference game process, skill usage data of the reference virtual character in each frame of the game screen, the type of reference virtual elements that the reference virtual character responds to, and the position of the reference virtual elements in the game scene map are collected as feature data corresponding to the game screen.
[0141] Optional, in Figure 7 Based on the game automation device shown, the control module 702 is specifically used for:
[0142] The position of the target virtual character in the game scene map is used as the starting position, and the position of the target virtual element in the game scene map is used as the ending position;
[0143] According to the starting position, the ending position, and each feature data in the recorded sample data, a target movement path and target movement operation data from the starting position to the ending position are determined; based on the target movement operation data, the target virtual character is controlled to move along the target movement path.
[0144] Optional, in Figure 8 Based on the game automation device shown, the control module 702 is specifically used for:
[0145] When the position of the target virtual character in the game scene map is the target starting position, the target starting position is used as the starting position, and the position of the target virtual element in the game scene map is used as the ending position;
[0146] According to the starting position, the ending position, and each feature data in the recorded sample data, a target movement path and target movement operation data from the starting position to the ending position are determined; based on the target movement operation data, the target virtual character is controlled to move along the target movement path.
[0147] Optional, in Figure 8 Based on the game automation device shown, the control module 702 is specifically used for:
[0148] When the position of the target virtual character in the game scene map is not the target starting position, the position of the target virtual character in the game scene map is used as the starting position, and the target starting position is used as the ending position; according to the starting position, the ending position, and each feature data in the recorded sample data, a target movement path and target movement operation data from the starting position to the ending position are determined; based on the target movement operation data, the target virtual character is controlled to move along the target movement path;
[0149] After the target virtual character moves to the target starting position, the starting position is updated to the target starting position, and the ending position is updated to the position of the target virtual element in the game scene map; based on the starting position, the ending position, and each feature data in the recorded sample, the target movement path and target movement operation data from the starting position to the ending position are determined; based on the target movement operation data, the target virtual character is controlled to move along the target movement path.
[0150] Optional, in Figure 7 or Figure 8 Based on the game automation device shown, see Fig. 9 , Fig. 9 FIG. 9 is a schematic diagram of another game automation device 900 provided in an embodiment of the present application. Fig. 9 As shown, the control module 702 includes:
[0151] The feature data search submodule 901 is used to search for target feature data in the recorded sample data according to the starting position, the ending position, and each feature data in the recorded sample data, and use the searched target feature data to form a target feature data set;
[0152] A path determination submodule 902 is used to arrange the positions of each target feature data according to the appearance timing of the game screen corresponding to each target feature data in the target feature data set to obtain the target moving path;
[0153] The movement control submodule 903 is used to control the target virtual character to move along the target movement path based on the appearance timing of the game screen corresponding to each target feature data in the target feature data set and the movement operation data included in each target feature data.
[0154] Optional, in Fig. 9 Based on the game automation device shown, the feature data search submodule 901 is specifically used for:
[0155] For each feature data in the recorded sample data, determine the distance between the position in the feature data and the starting position as the starting distance corresponding to the feature data; if the starting distance corresponding to the feature data is less than a first preset distance threshold, use the feature data as the starting feature data;
[0156] For each feature data in the recorded sample data, determining the distance between the position in the feature data and the end position as the end distance corresponding to the feature data; if the end distance corresponding to the feature data is less than a second preset distance threshold, taking the feature data as the end feature data;
[0157] The target feature data is selected from the recorded sample data according to the frame numbers of the game screen corresponding to each of the starting feature data and the frame numbers of the game screen corresponding to each of the ending feature data.
[0158] Optional, in Fig. 9 Based on the game automation device shown, the feature data search submodule 901 is specifically used for:
[0159] For each of the starting feature data, according to the frame number of the game screen corresponding to the starting feature data and the frame number of the game screen corresponding to each of the ending feature data, determine the adjacent ending feature data corresponding to the starting feature data in each of the ending feature data; determine the difference between the frame number of the game screen corresponding to the adjacent ending feature data and the frame number corresponding to the starting feature data as the frame spacing corresponding to the starting feature data;
[0160] Selecting target starting feature data from each of the starting feature data according to the frame spacings corresponding to each of the starting feature data;
[0161] The target start feature data, the adjacent end feature data corresponding to the target start feature data, and the feature data between the two in the recorded sample data are determined as the target feature data.
[0162] Optional, in Fig. 9Based on the game automation device shown, the mobile control submodule 903 is specifically used for:
[0163] According to the appearance timing of the game screens corresponding to the target feature data in the target feature data set, the target virtual character is controlled to sequentially execute the movement operation data in the target feature data;
[0164] Before controlling the target virtual character to execute the movement operation data in the target feature data, determine the deviation between the position of the target virtual character in the game scene map and the position included in the target feature data, and judge whether the deviation is less than a preset deviation threshold; if so, control the target virtual character to execute the movement operation data in the target feature data; if not, control the target virtual character to move to the position in the target feature data.
[0165] Optional, in Figure 8 Based on the game automation device shown, see Fig.10 , Fig.10 FIG. 1 is a schematic diagram of another game automation device 1000 provided in an embodiment of the present application. Fig.10 As shown, the device further includes: a skill release module 1001; the skill release module 1001 is used to:
[0166] According to the type of the target virtual element, searching for the corresponding feature data in the recorded sample data; the type of the reference virtual element included in the corresponding feature data is the same as the type of the target virtual element;
[0167] According to the skill usage data in the response feature data, the target virtual character is controlled to release a target skill for the target virtual element.
[0168] Optional, in Fig.10 Based on the game automation device shown, the skill release module 1001 is specifically used for:
[0169] In the case that the response feature data found includes multiple ones, for each of the response feature data, according to the respective positions of the reference virtual character and the reference virtual element in the game scene map, determining the position difference between the reference virtual character and the reference virtual element as the position difference corresponding to the response feature data;
[0170] Determining, according to the respective positions of the target virtual character and the target virtual element in the game scene map, a position difference between the target virtual character and the target virtual element as a target position difference;
[0171] Among the multiple response feature data, the response feature data whose corresponding position difference best matches the target position difference is selected as the target response feature data; according to the skill usage data in the target response feature data, the target virtual character is controlled to release the target skill for the target virtual element.
[0172] The above-mentioned game automation device, in the stage of recording the reference game process, controls the reference virtual character to traverse the moving path of each virtual element candidate appearance position in the game scene map, so that the feature data corresponding to each frame of the game screen recorded in the recording stage can cover the position data on the moving path to each virtual element candidate appearance position, and the relevant movement operation data. Correspondingly, in the playback stage, that is, in the stage of controlling the target virtual character to participate in the target game process, when the target virtual element to be dealt with appears in the game scene map, the feature data for guiding the target virtual character to move to the target virtual element can be selected from the feature data recorded in the recording stage according to the respective positions of the target virtual character and the target virtual element in the game scene map, and the target virtual character can be controlled to move to the target virtual element accordingly based on the selected feature data. In this way, for games in which virtual elements appear randomly in the game scene map, the virtual character can be intelligently and automatically controlled to go to the position of any virtual element to be dealt with, thereby improving the implementation effect of the game AI.
[0173] The embodiment of the present application also provides an electronic device for realizing game automation, which electronic device may specifically be a terminal device or a server. The terminal device and server provided in the embodiment of the present application will be introduced from the perspective of hardware entity below.
[0174] See also Fig.11 , Fig.11 Schematic diagram of the structure of the terminal device provided in the embodiment of the present application. Fig.11 For the sake of convenience, only the parts related to the embodiments of the present application are shown. For specific technical details not disclosed, please refer to the method part of the embodiments of the present application. The terminal can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant, a point of sales (POS), a car computer, etc., taking the terminal as a computer as an example:
[0175] Fig.11 FIG. 1 is a block diagram showing a partial structure of a computer related to a terminal provided in an embodiment of the present application. Fig.11The computer includes: a radio frequency (RF) circuit 1110, a memory 1120, an input unit 1130 (including a touch panel 1131 and other input devices 1132), a display unit 1140 (including a display panel 1141), a sensor 1150, an audio circuit 1160 which can be connected to a speaker 1161 and a microphone 1162), a wireless fidelity (WiFi) module 1170, a processor 1180, and a power supply 1190. Those skilled in the art can understand that Fig.11 The computer structure shown in the figure does not constitute a limitation of the computer, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0176] The memory 1120 can be used to store software programs and modules. The processor 1180 executes various functional applications and data processing of the computer by running the software programs and modules stored in the memory 1120. The memory 1120 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the computer (such as audio data, a phone book, etc.), etc. In addition, the memory 1120 can include a high-speed random access memory, and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0177] The processor 1180 is the control center of the computer. It uses various interfaces and lines to connect various parts of the entire computer. It executes various functions of the computer and processes data by running or executing software programs and / or modules stored in the memory 1120 and calling data stored in the memory 1120. Optionally, the processor 1180 may include one or more processing units; preferably, the processor 1180 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 1180.
[0178] In the embodiment of the present application, the processor 1180 included in the terminal also has the following functions:
[0179] Acquire recorded sample data; the recorded sample data is generated by recording a reference game process, in which a reference virtual character is controlled to traverse a movement path to reach each candidate appearance position of each virtual element; the recorded sample data includes feature data corresponding to each frame of a game screen in the reference game process, the feature data at least including the position of the reference virtual character in a game scene map, and movement operation data of the reference virtual character;
[0180] Based on the recorded sample data, controlling the target virtual character to participate in the target game process;
[0181] During the target game process, if the appearance of a target virtual element is detected, the target virtual character is controlled to move toward the target virtual element based on the positions of the target virtual character and the target virtual element in the game scene map and the feature data corresponding to each frame of the game screen in the recorded sample data.
[0182] Optionally, the processor 1180 is also used to execute the steps of any implementation method of the game automation method provided in the embodiments of the present application.
[0183] See also Fig.12 , Fig.12 A schematic diagram of the structure of a server 1200 provided for an embodiment of the present application. The server 1200 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1222 (for example, one or more processors) and a memory 1232, and one or more storage media 1230 (for example, one or more mass storage devices) storing application programs 1242 or data 1244. Among them, the memory 1232 and the storage medium 1230 may be temporary storage or permanent storage. The program stored in the storage medium 1230 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Furthermore, the central processing unit 1222 may be configured to communicate with the storage medium 1230 to execute a series of instruction operations in the storage medium 1230 on the server 1200.
[0184] The server 1200 may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input and output interfaces 1258, and / or one or more operating systems, such as Windows Server 2000. TM , Mac OS X TM , Unix TM ,Linux TM, FreeBSD TM etc.
[0185] The steps performed by the server in the above embodiment can be based on the Fig.12 The server structure shown.
[0186] The CPU 1222 is used to execute the following steps:
[0187] Acquire recorded sample data; the recorded sample data is generated by recording a reference game process, in which a reference virtual character is controlled to traverse a movement path to reach each candidate appearance position of each virtual element; the recorded sample data includes feature data corresponding to each frame of a game screen in the reference game process, the feature data at least including the position of the reference virtual character in a game scene map, and movement operation data of the reference virtual character;
[0188] Based on the recorded sample data, controlling the target virtual character to participate in the target game process;
[0189] During the target game process, if the appearance of a target virtual element is detected, the target virtual character is controlled to move toward the target virtual element based on the positions of the target virtual character and the target virtual element in the game scene map and the feature data corresponding to each frame of the game screen in the recorded sample data.
[0190] Optionally, CPU 1222 may also be used to execute steps of any implementation of the game automation method provided in the embodiments of the present application.
[0191] An embodiment of the present application also provides a computer-readable storage medium for storing a computer program, wherein the computer program is used to execute any one of the implementations of a game automation method described in the aforementioned embodiments.
[0192] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes any one of the implementations of the game automation method described in the above embodiments.
[0193] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0194] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0195] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0196] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0197] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store computer programs.
[0198] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0199] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A game automation method, characterized in that: The method comprises: Acquire recorded sample data; the recorded sample data is generated by recording a reference game process, in which a reference virtual character is controlled to traverse a moving path to each candidate appearance position of a virtual element, wherein in the reference game process, for each candidate appearance position of the virtual element in a game scene map, the reference virtual character is controlled to move from a target starting position to the candidate appearance position of the virtual element, and then return from the candidate appearance position of the virtual element to the target starting position; the recorded sample data includes feature data corresponding to each frame of a game screen in the reference game process, and the feature data includes at least the position of the reference virtual character in the game scene map, and movement operation data of the reference virtual character; Based on the recorded sample data, controlling the target virtual character to participate in the target game process; During the target game process, if the appearance of a target virtual element is detected, then according to the respective positions of the target virtual character and the target virtual element in the game scene map, feature data for guiding the target virtual character to move toward the target virtual element is searched from the feature data corresponding to each frame of the game screen in the recorded sample data, and based on the found feature data, the target virtual character is controlled to move toward the target virtual element.
2. The method according to claim 1, characterized in that The method further comprises: In the reference game process, the position of the reference virtual character in the game scene map and the movement operation data of the reference virtual character in each frame of the game screen are collected as feature data corresponding to the game screen; According to the appearance timing of each frame of the game screen during the reference game process, the feature data corresponding to each frame of the game screen are arranged to form the recorded sample data.
3. The method according to claim 2, characterized in that The method further comprises: During the reference game process, skill usage data of the reference virtual character in each frame of the game screen, the type of reference virtual elements that the reference virtual character responds to, and the position of the reference virtual elements in the game scene map are collected as feature data corresponding to the game screen.
4. The method according to claim 1, characterized in that: The step of searching, according to the respective positions of the target virtual character and the target virtual element in the game scene map, feature data for guiding the target virtual character to move toward the target virtual element from feature data corresponding to each frame of the game screen in the recorded sample data, and controlling the target virtual character to move toward the target virtual element based on the found feature data, includes: The position of the target virtual character in the game scene map is used as the starting position, and the position of the target virtual element in the game scene map is used as the ending position; According to the starting position, the ending position, and each feature data in the recorded sample data, a target movement path and target movement operation data from the starting position to the ending position are determined; based on the target movement operation data, the target virtual character is controlled to move along the target movement path.
5. The method according to claim 2, characterized in that: The step of searching, according to the respective positions of the target virtual character and the target virtual element in the game scene map, feature data for guiding the target virtual character to move toward the target virtual element from feature data corresponding to each frame of the game screen in the recorded sample data, and controlling the target virtual character to move toward the target virtual element based on the found feature data, includes: When the position of the target virtual character in the game scene map is the target starting position, the target starting position is used as the starting position, and the position of the target virtual element in the game scene map is used as the ending position; According to the starting position, the ending position, and each feature data in the recorded sample data, a target movement path and target movement operation data from the starting position to the ending position are determined; based on the target movement operation data, the target virtual character is controlled to move along the target movement path.
6. The method according to claim 2, characterized in that The step of searching, according to the respective positions of the target virtual character and the target virtual element in the game scene map, feature data for guiding the target virtual character to move toward the target virtual element from feature data corresponding to each frame of the game screen in the recorded sample data, and controlling the target virtual character to move toward the target virtual element based on the found feature data, includes: When the position of the target virtual character in the game scene map is not the target starting position, the position of the target virtual character in the game scene map is used as the starting position, and the target starting position is used as the ending position; according to the starting position, the ending position, and each feature data in the recorded sample data, a target movement path and target movement operation data from the starting position to the ending position are determined; based on the target movement operation data, the target virtual character is controlled to move along the target movement path; After the target virtual character moves to the target starting position, the starting position is updated to the target starting position, and the ending position is updated to the position of the target virtual element in the game scene map; based on the starting position, the ending position, and each feature data in the recorded sample, the target movement path and target movement operation data from the starting position to the ending position are determined; based on the target movement operation data, the target virtual character is controlled to move along the target movement path.
7. The method according to any one of claims 4 to 6, characterized in that: Determining a target movement path and target movement operation data from the starting position to the ending position according to the starting position, the ending position, and each feature data in the recorded sample data; Based on the target movement operation data, controlling the target virtual character to move along the target movement path includes: According to the starting position, the ending position, and each feature data in the recorded sample data, searching for target feature data in the recorded sample data, and using the found target feature data to form a target feature data set; Arrange the positions of the target feature data respectively according to the appearance timing of the game screens corresponding to the target feature data in the target feature data set to obtain the target moving path; Based on the appearance timing of the game screens corresponding to the target feature data in the target feature data set, and according to the movement operation data included in each target feature data, the target virtual character is controlled to move along the target movement path.
8. The method according to claim 7, characterized in that The searching target feature data in the recorded sample data according to the starting position, the ending position, and each feature data in the recorded sample data comprises: For each feature data in the recorded sample data, determine the distance between the position in the feature data and the starting position as the starting distance corresponding to the feature data; if the starting distance corresponding to the feature data is less than a first preset distance threshold, use the feature data as the starting feature data; For each feature data in the recorded sample data, determining the distance between the position in the feature data and the end position as the end distance corresponding to the feature data; if the end distance corresponding to the feature data is less than a second preset distance threshold, taking the feature data as the end feature data; The target feature data is selected from the recorded sample data according to the frame numbers of the game screen corresponding to each of the starting feature data and the frame numbers of the game screen corresponding to each of the ending feature data.
9. The method according to claim 8, characterized in that The step of selecting the target feature data from the recorded sample data according to the frame numbers of the game screens corresponding to the respective starting feature data and the frame numbers of the game screens corresponding to the respective ending feature data comprises: For each of the starting feature data, according to the frame number of the game screen corresponding to the starting feature data and the frame number of the game screen corresponding to each of the ending feature data, determine the adjacent ending feature data corresponding to the starting feature data in each of the ending feature data; determine the difference between the frame number of the game screen corresponding to the adjacent ending feature data and the frame number corresponding to the starting feature data as the frame spacing corresponding to the starting feature data; Selecting target starting feature data from each of the starting feature data according to the frame spacings corresponding to each of the starting feature data; The target start feature data, the adjacent end feature data corresponding to the target start feature data, and the feature data between the two in the recorded sample data are determined as the target feature data.
10. The method according to claim 7, characterized in that The method of controlling the target virtual character to move along the target moving path based on the appearance timing of the game screens corresponding to the target feature data in the target feature data set and the movement operation data included in each target feature data comprises: According to the appearance timing of the game screens corresponding to the target feature data in the target feature data set, the target virtual character is controlled to sequentially execute the movement operation data in the target feature data; Before controlling the target virtual character to execute the movement operation data in the target feature data, determine the deviation between the position of the target virtual character in the game scene map and the position included in the target feature data, and judge whether the deviation is less than a preset deviation threshold; if so, control the target virtual character to execute the movement operation data in the target feature data; if not, control the target virtual character to move to the position in the target feature data.
11. The method according to claim 3, characterized in that The method further comprises: According to the type of the target virtual element, searching for the corresponding feature data in the recorded sample data; the type of the reference virtual element included in the corresponding feature data is the same as the type of the target virtual element; According to the skill usage data in the response feature data, the target virtual character is controlled to release the target skill for the target virtual element.
12. The method according to claim 11, characterized in that In the case that the found response feature data includes a plurality of pieces, controlling the target virtual character to release a target skill for the target virtual element according to the skill usage data in the response feature data includes: For each of the response feature data, according to the respective positions of the reference virtual character and the reference virtual element in the game scene map, determining a position difference between the reference virtual character and the reference virtual element as the position difference corresponding to the response feature data; Determining, according to the respective positions of the target virtual character and the target virtual element in the game scene map, a position difference between the target virtual character and the target virtual element as a target position difference; Among the multiple response feature data, the response feature data whose corresponding position difference best matches the target position difference is selected as the target response feature data; according to the skill usage data in the target response feature data, the target virtual character is controlled to release the target skill for the target virtual element.
13. A game automation device, characterized in that: The device comprises: An acquisition module is used to acquire recorded sample data; the recorded sample data is generated by recording a reference game process, in which a reference virtual character is controlled to traverse a moving path to each candidate appearance position of a virtual element, wherein in the reference game process, for each candidate appearance position of the virtual element in a game scene map, the reference virtual character is controlled to move from a target starting position to the candidate appearance position of the virtual element, and then return from the candidate appearance position of the virtual element to the target starting position; the recorded sample data includes feature data corresponding to each frame of a game screen in the reference game process, and the feature data includes at least the position of the reference virtual character in the game scene map and the movement operation data of the reference virtual character; A control module is used to control a target virtual character to participate in a target game process based on the recorded sample data; during the target game process, if the appearance of a target virtual element is detected, then according to the respective positions of the target virtual character and the target virtual element in the game scene map, from the feature data corresponding to each frame of the game screen in the recorded sample data, feature data for guiding the target virtual character to move toward the target virtual element is searched, and based on the found feature data, the target virtual character is controlled to move toward the target virtual element.
14. An electronic device, characterized in that: The device includes a processor and a memory; The memory is used to store computer programs; The processor is configured to execute the game automation method according to any one of claims 1 to 12 according to the computer program.
15. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store a computer program, and the computer program is used to execute the game automation method according to any one of claims 1 to 12.
16. A computer program product, comprising a computer program or instructions, characterized in that: When the computer program or the instruction is executed by a processor, the game automation method according to any one of claims 1 to 12 is implemented.
