Artificial intelligence object control method, system, device and equipment and storage medium
By obtaining multiple types of state data according to different frequencies in virtual battle games and using action prediction models, the lag caused by excessive synchronization of state data in virtual battles is solved, and the game fluency and the behavioral authenticity of artificial intelligence objects are improved.
Patent Information
- Application Number
- CN202411314961.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-01-10
AI Technical Summary
In the battle games where multiple players participate, excessive synchronization of the status data of virtual games leads to excessive server communication load, causing game stuttering.
By obtaining multiple types of state data according to different acquisition frequencies in virtual games, and using action prediction models to predict the action information of artificial intelligence objects, the communication load of the server is reduced and the lag is avoided.
It reduces the communication load of the server, improves the smoothness of the game and the player's operating experience, and ensures the authenticity of the behavior and combat quality of artificial intelligence objects.
Smart Images

Figure CN119280790A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence (AI) technology, and in particular to a control method, system, device, equipment and storage medium for an artificial intelligence object. Background Art
[0002] With the development of artificial intelligence technology, in multiplayer battle games, a PVE (Player VS Environment) battle mode is often provided to enable players to control virtual objects and artificial intelligence objects to play games, thereby improving their own operating level.
[0003] In the related art, the number of game logic frames is generally 10-20 frames per second. That is, the game server used to manage the virtual game needs to obtain the state data of the virtual game from the virtual game 10-20 times per second, and synchronize the state data of the virtual game to the action prediction model that controls the artificial intelligence object each time to predict the next action of the artificial intelligence object, so as to control it.
[0004] However, in the above technical solution, all status data in the virtual game need to be synchronized every time, which will bring about the problem of obtaining too much status data, making the server communication load too high, thereby causing game lag. Summary of the invention
[0005] The embodiments of the present application provide a control method, system, device, equipment and storage medium for an artificial intelligence object, which can reduce the communication load of a server and avoid jamming caused by excessive communication load. The technical solution is as follows:
[0006] In one aspect, a control method for an artificial intelligence object is provided, which is applied to a management server, and the method comprises:
[0007] In the case where a virtual game is started, determining at least one artificial intelligence object in the virtual game based on object information sent by a game server, the game server being used to manage each participating object in the virtual game, the object information including an identifier of the artificial intelligence object in the virtual game;
[0008] During the game process of the virtual game, multiple types of status data of the virtual game are respectively obtained from the game server according to different acquisition frequencies, and the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game;
[0009] Based on the multiple types of status data of the virtual game, an action prediction model is called to obtain action information of at least one artificial intelligence object, where the action information is used to indicate the next action to be performed by the at least one artificial intelligence object.
[0010] On the other hand, a control method of an artificial intelligence object is provided, which is applied to a game server, and the method comprises:
[0011] When a virtual game is started, controlling at least one artificial intelligence object to participate in the virtual game;
[0012] During the virtual game, multiple types of status data of the virtual game are obtained from the virtual game, where the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game;
[0013] According to different acquisition frequencies, the multiple types of state data of the virtual game are respectively sent to the management server, and the management server is used to obtain the action information of the at least one artificial intelligence object based on the multiple types of state data used in the current prediction, and the action information is used to indicate the action to be performed by the at least one artificial intelligence object next;
[0014] Based on the action information of the at least one artificial intelligence object returned by the management server, the at least one artificial intelligence object is controlled to perform the action indicated by the action information.
[0015] On the other hand, a control method for an artificial intelligence object is provided, which is applied to an object server, and the method comprises:
[0016] During the virtual game, receiving multiple types of status data used for the current prediction sent by the management server, wherein the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game, and the multiple types of status data of the virtual game are obtained by the management server based on different acquisition frequencies;
[0017] Based on the multiple types of state data used in this prediction, calling the action prediction model to predict the action information of at least one artificial intelligence object, the action information is used to indicate the action to be performed by the at least one artificial intelligence object next;
[0018] Returning action information of the at least one artificial intelligence object to the management server.
[0019] In some embodiments, the action prediction model is trained based on reinforcement learning;
[0020] The step of calling the action prediction model to predict the action information of at least one artificial intelligence object based on the multiple types of state data used in the current prediction includes:
[0021] For any artificial intelligence object controlled by the object server, inputting the multiple types of state data used in this prediction into the action prediction model of the artificial intelligence object;
[0022] The action prediction model is used to process the multiple types of state data used in this prediction, and the action information of the artificial intelligence object is output.
[0023] In some embodiments, the object server stores model files of motion prediction models of multiple artificial intelligence objects;
[0024] The method further comprises:
[0025] When the virtual game is started, receiving control task information sent by the management server, wherein the control task information is used to indicate at least one artificial intelligence object to be controlled by the object server;
[0026] Based on the control task information and the model files of the multiple artificial intelligence objects, load the action prediction model of at least one artificial intelligence object to be controlled.
[0027] In some embodiments, the method further comprises:
[0028] For any artificial intelligence object in the virtual game, when the artificial intelligence object dies, receiving a destruction instruction sent by the management server;
[0029] In response to the destruction instruction, the load resources occupied by the action prediction model of the artificial intelligence object are released.
[0030] In another aspect, a control system for an artificial intelligence object is provided, the system comprising a game server, a management server, and a plurality of object servers, wherein the game server and the plurality of object servers are communicatively connected via the management server;
[0031] The game server is used to control at least one artificial intelligence object to participate in the virtual game when the virtual game is started, and to obtain multiple types of status data of the virtual game from the virtual game during the game process of the virtual game, and to send the multiple types of status data of the virtual game to the management server respectively according to different acquisition frequencies, wherein the multiple types of status data of the virtual game are used to indicate the status of each participating object in the virtual game;
[0032] The management server is used to receive multiple types of status data of the virtual game at different acquisition frequencies, and send the multiple types of status data used for the current prediction to at least one object server used to control at least one artificial intelligence object in the virtual game;
[0033] The at least one object server is used to predict action information of at least one artificial intelligence object in the virtual game based on the multiple types of state data used in the current prediction, wherein the action information is used to indicate the action to be performed next by the at least one artificial intelligence object;
[0034] The management server is further configured to send the action information returned by the at least one object server to the counterpart server;
[0035] The game server is also used to control at least one artificial intelligence object in the virtual game to perform the action indicated by the action information.
[0036] On the other hand, a control device for an artificial intelligence object is provided, which is deployed on a management server, and the device includes:
[0037] A first determination module is used to determine at least one artificial intelligence object in the virtual game based on object information sent by a game server when the virtual game is started, wherein the game server is used to manage each participating object in the virtual game, and the object information includes an identifier of the artificial intelligence object in the virtual game;
[0038] A first acquisition module is used to respectively acquire, during the game process of the virtual game, multiple types of status data of the virtual game from the game server according to different acquisition frequencies, wherein the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game;
[0039] The second acquisition module is used to call the action prediction model to obtain the action information of the at least one artificial intelligence object based on the multiple types of state data of the virtual game, and the action information is used to indicate the next action to be performed by the at least one artificial intelligence object.
[0040] In some embodiments, the first type of status data among the multiple types of status data is acquired most frequently;
[0041] The second acquisition module includes:
[0042] A processing unit, configured to combine the multiple types of state data used for this prediction based on the first type of state data acquired at the target time and the most recent other types of state data acquired before the target time;
[0043] A prediction unit, configured to send the multiple types of state data used in the current prediction to the action prediction model to predict the action information of the at least one artificial intelligence object;
[0044] The first-category status data acquired at the target time is the latest acquired first-category status data, and the other-category status data is data among the multiple-category status data except the first-category status data.
[0045] In some embodiments, the apparatus further comprises:
[0046] The cache module is used to update and cache the second type of status data in the other types of status data after the second type of status data is acquired each time.
[0047] In some embodiments, the device further includes: a second determination module, configured to determine a frequency of obtaining the first type of state data based on the performance of the action prediction model corresponding to the at least one artificial intelligence object, wherein the performance is used to represent a rate at which the action prediction model predicts action information, and the frequency of obtaining the first type of state data is positively correlated with the performance of the action prediction model; or
[0048] The second determination module is used to determine the frequency of obtaining the first type of status data based on attribute information of the virtual game, the attribute information including at least one of the number of logical frames of the virtual game, the difficulty level of the virtual game and the display frame rate of the virtual game, and the number of logical frames is used to represent the number of times the state of the artificial intelligence object is updated per unit time in the virtual game.
[0049] In some embodiments, the prediction unit is used to send, for any artificial intelligence object in the virtual game, multiple types of state data used for the current prediction to an object server used to control the artificial intelligence object, wherein an action prediction model of the artificial intelligence object is running on the object server, and the action prediction model is trained based on reinforcement learning; and receive the action information of the artificial intelligence object returned by the object server.
[0050] In some embodiments, the object server for controlling the artificial intelligence object is at least one of the following:
[0051] After the virtual game is started, the object server that has completed loading the action prediction model of the artificial intelligence object; or
[0052] After other virtual games are started and before the virtual game is started, the object server that completes the action prediction model of the artificial intelligence object is loaded, the other virtual games have been started before the virtual game is started and have not ended when the virtual game is started, and the artificial intelligence object also exists in the other virtual games.
[0053] In some embodiments, the apparatus further comprises:
[0054] a sending module, configured to send control task information to at least one of the plurality of object servers based on at least one artificial intelligence object in the virtual game when the virtual game is started, wherein the control task information of each object server is used to instruct the object server to load the action prediction model of each artificial intelligence object to be controlled;
[0055] The third determination module is used to determine, for the target artificial intelligence object in the virtual game, the communication connection between the target object server and the game server based on the communication address of the target object server, the identifier of the target artificial intelligence object and the game identifier of the virtual game, when the target object server in the at least one object server has loaded the action prediction model of the target artificial intelligence object, the game server is used to provide multiple categories of status data of the virtual game, and the communication connection is used to instruct to send the multiple categories of status data of the virtual game to the object server.
[0056] In some embodiments, the sending module is used to send first control task information to a first object server among the multiple object servers, where the first object server is any object server among the multiple object servers, and the first control task information is used to instruct the first object server to load the action prediction models of multiple artificial intelligence objects in the virtual game; in the process of the first object server loading the action prediction models of the multiple artificial intelligence objects, if the remaining load resources of the first object server are lower than the target load resources, then send second control task information to a second object server among the multiple object servers, where the target load resources are the resources required to load the action prediction models of the remaining artificial intelligence objects, and the second control task information is used to instruct the second object server to load the action prediction models of the remaining artificial intelligence objects.
[0057] In some embodiments, the apparatus further comprises:
[0058] A scheduling module is used to send third control task information to a fourth object server among the multiple object servers for any artificial intelligence object in the virtual game when a third object server controlling the artificial intelligence object fails, wherein the third control task information is used to instruct the fourth object server to load the action prediction model of the artificial intelligence object; after the fourth object server has loaded the action prediction model of the artificial intelligence object, send multiple types of status data of the virtual game to the fourth object server, and receive action information predicted by the fourth object server based on the action prediction model of the artificial intelligence object and the multiple types of status data.
[0059] In some embodiments, the apparatus further comprises:
[0060] A sending module is used to send a destruction instruction to an object server used to control any artificial intelligence object in the virtual game in response to the death of the artificial intelligence object, wherein the destruction instruction is used to instruct the object server to release the load resources occupied by the action prediction model of the artificial intelligence object.
[0061] In another aspect, a control device for an artificial intelligence object is provided, which is deployed on a game server, and the device includes:
[0062] A control module, used for controlling at least one artificial intelligence object to participate in the virtual game when the virtual game is started;
[0063] an acquisition module, configured to acquire, during the game process of the virtual game, multiple types of status data of the virtual game from the virtual game, wherein the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game;
[0064] A sending module, used for sending the multiple types of status data of the virtual game to the management server respectively according to different acquisition frequencies, and the management server is used to obtain the action information of the at least one artificial intelligence object based on the multiple types of status data used in the current prediction, and the action information is used to indicate the action to be performed by the at least one artificial intelligence object next;
[0065] The control module is also used to control the at least one artificial intelligence object to perform the action indicated by the action information based on the action information of the at least one artificial intelligence object returned by the management server.
[0066] In some embodiments, the sending module is used to perform at least one of the following:
[0067] Automatically sending multiple types of status data of the virtual game to the management server according to different acquisition frequencies;
[0068] When receiving the acquisition request sent by the management server at different acquisition frequencies, the multiple types of status data of the virtual game are sent to the management server respectively.
[0069] In another aspect, a control device for an artificial intelligence object is provided, which is deployed on an object server, and the device comprises:
[0070] A receiving module, used for receiving, during the virtual game, a plurality of status data used for the current prediction sent by the management server, wherein the plurality of status data of the virtual game is used to indicate the status of each participant in the virtual game, and the plurality of status data of the virtual game is obtained by the management server based on different acquisition frequencies;
[0071] A prediction module, used to call an action prediction model to predict action information of at least one artificial intelligence object based on the multiple types of state data used in this prediction, wherein the action information is used to indicate the action to be performed next by the at least one artificial intelligence object;
[0072] A sending module is used to return the action information of the at least one artificial intelligence object to the management server.
[0073] In some embodiments, the action prediction model is trained based on reinforcement learning;
[0074] The prediction module is used to input the multiple types of state data used in the current prediction into the action prediction model of any artificial intelligence object controlled by the object server; through the action prediction model, the multiple types of state data used in the current prediction are processed to output the action information of the artificial intelligence object.
[0075] In some embodiments, the object server stores model files of motion prediction models of multiple artificial intelligence objects;
[0076] The receiving module is further used to receive control task information sent by the management server when the virtual game is started, wherein the control task information is used to indicate at least one artificial intelligence object to be controlled by the object server;
[0077] The device also includes:
[0078] A loading module is used to load the motion prediction model of at least one artificial intelligence object to be controlled based on the control task information and the model files of the multiple artificial intelligence objects.
[0079] In some embodiments, the receiving module is further configured to receive a destruction instruction sent by the management server for any artificial intelligence object in the virtual game when the artificial intelligence object dies;
[0080] The device also includes:
[0081] A processing module is used to release the load resources occupied by the action prediction model of the artificial intelligence object in response to the destruction instruction.
[0082] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory is used to store at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the control method of the artificial intelligence object in the embodiment of the present application.
[0083] On the other hand, a computer-readable storage medium is provided, in which at least one computer program is stored. The at least one computer program is loaded and executed by a processor to implement a control method for an artificial intelligence object as in an embodiment of the present application.
[0084] On the other hand, a computer program product is provided, including a computer program, which is stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the control method of an artificial intelligence object provided in the above-mentioned various aspects or various optional implementations of various aspects.
[0085] An embodiment of the present application provides a control method for an artificial intelligence object. During a virtual game, different acquisition frequencies are used to synchronize multiple types of status data of participating objects in the virtual game from a game server to a management server. In each synchronization process, it is not necessary to provide all the status data in the virtual game. The management server only needs to obtain part of the status data. Then, based on the currently obtained partial status data and other previously obtained status data, the action information of at least one artificial intelligence object in the virtual game can be predicted through an action prediction model. This not only reduces the number of status data acquired by the management server at a single time, reduces the communication load between the game server and the management server, and avoids game freezes due to excessive communication loads; and the action information of the artificial intelligence object is based on the multiple types of status data of the virtual game, which also ensures the accuracy of the action information, making the behavior of the artificial intelligence object more realistic and more in line with real-life combat situations.
[0086] Moreover, since the virtual game can be avoided as much as possible, the smoothness of the virtual game and the player's operating experience can be guaranteed; and the actions of the artificial intelligence object are more accurate, which ensures the quality of the battle between the artificial intelligence object and the virtual object controlled by the real object, that is, the quality of the virtual game is guaranteed, which is conducive to improving the game experience and operating level of the real object. BRIEF DESCRIPTION OF THE DRAWINGS
[0087] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0088] Figure 1 is a structural diagram of a control system of an artificial intelligence object provided according to an embodiment of the present application;
[0089] Figure 2 is an interactive flow chart of a control method of an artificial intelligence object provided according to an embodiment of the present application;
[0090] Figure 3 is a schematic diagram of obtaining action information of an artificial intelligence object according to an embodiment of the present application;
[0091] Figure 4 is an interactive flow chart of another control method of an artificial intelligence object provided according to an embodiment of the present application;
[0092] Figure 5 is a schematic diagram of allocating control tasks according to an embodiment of the present application;
[0093] Figure 6 is a block diagram of a control device for an artificial intelligence object provided according to an embodiment of the present application;
[0094] Figure 7 is a block diagram of another control device for an artificial intelligence object provided according to an embodiment of the present application;
[0095] Figure 8 is a block diagram of another control device for an artificial intelligence object provided according to an embodiment of the present application;
[0096] Fig. 9 It is a structural diagram of a server provided according to an embodiment of the present application. DETAILED DESCRIPTION
[0097] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.
[0098] In this application, the terms "first", "second", etc. are used to distinguish identical or similar items with basically the same effects and functions. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor is there any limitation on quantity and execution order.
[0099] In the present application, the term "at least one" means one or more, and the term "plurality" means two or more.
[0100] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions. For example, the various types of status data in the virtual game involved in this application are all obtained with full authorization.
[0101] The control method of the artificial intelligence object provided in the embodiment of the present application can be executed by a computer device. In some embodiments, the computer device is a terminal or a server. The following takes the computer device as an example of a server to introduce the implementation environment of the control method of the artificial intelligence object provided in the embodiment of the present application. The control method of the artificial intelligence object is applied to the control system of the artificial intelligence object. Figure 1 is a structural diagram of a control system of an artificial intelligence object provided according to an embodiment of the present application. Figure 1 The control system includes a terminal 101, a game server 102, a management server 103, and multiple object servers 104. The terminal 101, the game server 102, the management server 103, and the multiple object servers 104 can be directly or indirectly connected through wired or wireless communication, and this application does not limit this.
[0102] In some embodiments, the terminal 101 is a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, an intelligent voice interaction device, a smart home appliance, a vehicle-mounted terminal, etc., but is not limited thereto. The terminal 101 installs and runs an application that supports a virtual environment. The application can be any one of a first-person shooter game (First-Person Shooting game, FPS), a third-person shooter game, a multiplayer online tactical competitive game (Multiplayer Online Battle Arena games, MOBA), a virtual reality application, a three-dimensional map program, a multiplayer gun battle survival game, a social application, and an interactive entertainment application.
[0103] Among them, the above-mentioned virtual environment is the scene displayed (or provided) when the client of any of the above-mentioned types of applications (such as game applications) is running on the terminal device. The virtual environment refers to the scene created for virtual objects to carry out activities (such as game competitions), such as virtual houses, virtual islands, virtual maps, etc. The virtual environment can be a simulation environment of the real world, a semi-simulated and semi-fictitious environment, or a purely fictitious environment. The virtual environment can be a two-dimensional virtual environment, a 2.5-dimensional virtual environment, or a three-dimensional virtual environment, which is not limited in the embodiments of the present application.
[0104] The above-mentioned virtual objects include virtual objects controlled by real objects and artificial intelligence objects. Among them, the virtual objects controlled by real objects refer to virtual characters, virtual vehicles, virtual items, etc. controlled by the real object's account in any of the above-mentioned types of applications, and this application does not limit this. Schematically, terminal 101 is a terminal used by the real object, and the real object uses terminal 101 to operate the virtual object in the virtual environment to perform activities, and the activities may include but are not limited to: adjusting body posture, crawling, walking, running, riding, jumping, driving, picking up, shooting, attacking, and throwing. At least one of the above. Schematically, the virtual object is a virtual character, such as a simulated character or an anime character. The real object can control the virtual object through terminal 101 to play against at least one artificial intelligence object in the virtual environment.
[0105] The above-mentioned artificial intelligence objects refer to virtual characters, virtual vehicles, virtual items, etc. controlled by the server in the virtual environment of any of the above-mentioned types of applications, and this application does not limit this. In the process of virtual games between artificial intelligence objects and virtual objects controlled by real objects, the game server 102 is used to manage the various participating objects in the virtual game. The management server 103 is used to assign the control tasks of artificial intelligence objects in the virtual game to at least one object server 104. Each object server 104 is used to predict the actions of the controlled artificial intelligence objects. That is, the artificial intelligence objects in this application are jointly controlled by the game server 102, the management server 103 and the object server 104. Please refer to the following process for details.
[0106] When a real object starts a virtual game on the terminal 101, the game server 102 can control at least one artificial intelligence object to participate in the virtual game. Then, the object server 102 can send object information to the management server 103 to notify the management server 103 of the artificial intelligence objects in the virtual game. After determining at least one artificial intelligence object in the virtual game, the management server 103 can assign the control task of the at least one artificial intelligence object to at least one object server 104, so that in the subsequent game process of the virtual game, at least one object server 104 can predict the action of at least one artificial intelligence object to achieve control of at least one artificial intelligence object in the virtual game.
[0107] In the process of assigning control tasks, the management server 103 can send control task information to at least one of the multiple object servers 104 based on at least one artificial intelligence object in the virtual game when the virtual game is started. The control task information of each object server 104 is used to instruct the object server 104 to load the action prediction model of each artificial intelligence object to be controlled. For the target artificial intelligence object in the virtual game, when the target object server 104 in at least one object server 104 has completed loading the action prediction model of the target artificial intelligence object, the management server 103 determines the communication connection between the target object server 104 and the game server 102 based on the communication address of the target object server, the identifier of the target artificial intelligence object and the game identifier of the virtual game. That is, in the process of assigning control tasks, the management server 103 can establish a communication connection between the game server 104 and the assigned at least one object server 104, so as to subsequently control the action of at least one artificial intelligence object in the virtual game.
[0108] In the case where any object server 104 has loaded the action prediction model of any artificial intelligence object, the object server 104 is the object server for controlling the artificial intelligence object, and can send a loading completion notification to the management server 103. Then, the management server 103 can record the correspondence between the communication address of the object server 104, the identifier of the artificial intelligence object, and the game identifier of the virtual game in which the artificial intelligence object is located, and use this as the communication connection between the object server 104 and the game server 102 (artificial intelligence object), so that the state data of the virtual game can be forwarded to the corresponding object server 104 according to the correspondence, and the action predicted by the object server 104 is returned to the game server 102 to control the artificial intelligence object to perform the next action.
[0109] In some embodiments, there are multiple artificial intelligence objects in the virtual game. In other words, the game server 102 needs to control the activities of multiple artificial intelligence objects at the same time. The load resources of each object server are limited, and it may not be possible to load the action prediction models of all artificial intelligence objects. In this case, the management server 103 can assign the control tasks of multiple artificial intelligence objects to multiple object servers. Accordingly, in the process of sending control task information to at least one object server respectively, the management server 103 sends the first control task information to the first object server 104 among the multiple object servers. The first object server 104 is any object server 104 among the multiple object servers 104. The first control task information is used to instruct the first object server to load the action prediction models of multiple artificial intelligence objects in the virtual game. In the process of the first object server 104 loading the action prediction models of multiple artificial intelligence objects, if the remaining load resources of the first object server 104 are lower than the target load resources, the management server 103 sends the second control task information to the second object server 104 among the multiple object servers 104. The target load resources are the resources required to load the action prediction models of the remaining artificial intelligence objects. The second control task information is used to instruct the second object server 104 to load the action prediction models of the remaining artificial intelligence objects.
[0110] In other words, in the process of assigning the control tasks of multiple artificial intelligence objects in the virtual game to multiple object servers 104, the management server 103 can randomly select an object server 104 from the multiple object servers 104, assign the control tasks of the multiple artificial intelligence objects to the object server 104, so that the object server 104 loads the motion prediction models of each artificial intelligence object in sequence. As the loading process proceeds, the remaining load resources in the object server 104 become less and less. When the remaining load resources are insufficient to load the motion prediction model of the next artificial intelligence object, the object server 104 can send a remaining task notification to the management server 103 so as to return the tasks of the remaining artificial intelligence objects to the management server 103. Then, the management server 103 can select another object server 104 from the remaining object servers 104, and assign the control tasks of the remaining artificial intelligence objects to the object server 104, until the motion prediction models of the multiple artificial intelligence objects in the virtual game are all loaded, thereby achieving the control tasks of the multiple artificial intelligence objects in the virtual game. Assigned to multiple object servers 104.
[0111] The solution provided by the embodiment of the present application allocates the control tasks of multiple artificial intelligence objects in a virtual game to multiple object servers according to the load resources of the object servers and the load resources occupied by the action prediction models of the artificial intelligence objects. This not only ensures the accurate control of multiple artificial intelligence objects by multiple object servers, but also avoids the problem of the entire system being unavailable due to overload or failure of a single object server, thereby improving the reliability and availability of the system, and by dispersing the load, reducing the pressure on each object server, improving the response speed and throughput of the system, and enhancing the overall performance of the system, thereby improving the control efficiency of the artificial intelligence objects.
[0112] After the control tasks are assigned, the game server 102, the management server 103 and at least one object server 104 can jointly control at least one artificial intelligence object to act in the virtual game. The game server 102 is used to provide multiple types of status data of the virtual game. The communication connection established above is used to instruct the management server 103 to send the multiple types of status data of the virtual game to the object server 104. Specifically, during the game process of the virtual game, the terminal 101 can upload the multiple types of status data of the virtual game to the game server 102 to notify the status of each participating object in the virtual game. Then, the game server 102 can send the multiple types of status data of the virtual game to the management server 103 according to different acquisition frequencies. For example, the first type of status data (such as position data, health data) is sent at acquisition frequency 1, and the second type of status data (such as skill status) is sent at acquisition frequency 2. Then, the management server 103 summarizes the multiple types of status data required for this prediction, and sends the multiple types of status data to at least one object server 104 used to control the artificial intelligence object in the virtual game. Then, each object server 104 can call the action prediction model to predict the action information of the controlled artificial intelligence object according to the multiple types of state data of the virtual game, and return the action information to the management server 103. Then, the management server 103 can send the action information of at least one artificial intelligence object in the virtual game to the game server 102, so that the game server 102 controls at least one artificial intelligence object in the virtual game on the terminal 101 to perform the action indicated by the action information.
[0113] Those skilled in the art will appreciate that the number of the above-mentioned terminals may be more or less. For example, the above-mentioned terminal may be only one, or the above-mentioned terminal may be dozens or hundreds, or a greater number. That is, multiple real objects may respectively start their own virtual games on their respective terminals 101. Accordingly, the game server 102 may simultaneously manage the participating objects in each virtual game; the management server 103 may assign the control tasks of the artificial intelligence objects in multiple virtual games to at least one object server 104, so that each object server 104 predicts the actions of the controlled artificial intelligence objects, which will not be repeated here. The embodiments of the present application do not limit the number of terminals and device types.
[0114] In some embodiments, for any server among the game server 102, the management server 103 and the object server 104, the server may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), big data and artificial intelligence platforms. The server is used to provide background services for applications that support virtual environments.
[0115] The above-mentioned AI object action prediction model can be deployed in the management server, so that after the management server obtains multiple types of status data, it can directly predict the action of the AI object locally without transmitting it to other devices. Figure 2 , Figure 2 is an interactive flow chart of a control method of an artificial intelligence object provided according to an embodiment of the present application, which shows Figure 1 The process of controlling an artificial intelligence object by a game server and a management server. The control method of the artificial intelligence object comprises the following steps:
[0116] 201. In response to a virtual game start operation, a terminal sends game start information to a game server, where the game start information is used to notify the game server that the virtual game has been started.
[0117] In an embodiment of the present application, a real object can select a game mode that supports human-computer battles, such as a PVE mode, at a terminal so as to be able to fight with an artificial intelligence object controlled by a device. That is, the virtual game in the present application is a game in which a virtual object controlled by a real object (player) and an artificial intelligence object jointly participate. The game server is responsible for the battle logic in the virtual game and can be used to manage each participating object in the virtual game. When the virtual game is started, the terminal can send a game start information to the game server to notify the game server that the virtual game has been started and can be managed.
[0118] Among them, the virtual game can be a game in the human-computer battle mode in a battle game. The artificial intelligence object in the virtual game can imitate the virtual object controlled by the real object and fight with the virtual object controlled by the real object, so as to give the real object the experience of playing against other real objects. Alternatively, the virtual game can also be an ordinary level in a map-brushing game, and the artificial intelligence object in the virtual game can be an NPC (Non-Player Character) in the game level. The virtual object that can be controlled by the real object fights with the artificial intelligence object to pass the game level.
[0119] 202. When the virtual game is started, the game server controls at least one artificial intelligence object to participate in the virtual game; and sends object information to the management server, where the object information includes an identifier of the artificial intelligence object in the virtual game.
[0120] In the embodiment of the present application, when the virtual game is started, the game server controls at least one artificial intelligence object to participate in the virtual game. The embodiment of the present application does not limit the number of artificial intelligence objects participating in the virtual game. The artificial intelligence object in the virtual game can be an object specified by a real object at the terminal, or an object pre-assigned for the virtual game. The embodiment of the present application does not limit this. Then, the game server sends object information to the object server to notify the management server of the artificial intelligence object in the virtual game.
[0121] 203. The management server determines at least one artificial intelligence object in the virtual game based on the object information sent by the game server; and loads an action prediction model of at least one artificial intelligence object.
[0122] In an embodiment of the present application, the management server determines at least one artificial intelligence object in the virtual game according to the object identifier in the object information. Then, the management server loads the action prediction model of at least one artificial intelligence object so as to subsequently predict the action of the corresponding artificial intelligence object based on the prediction model of each artificial intelligence object.
[0123] The management server may store model files of multiple action prediction models of artificial intelligence objects. In the process of loading the action prediction model of each artificial intelligence object, the management server loads the model file of the artificial intelligence object, builds a model instance of the action prediction model of the artificial intelligence object, and allocates load resources such as CPU and memory to the model instance, so as to subsequently predict the action of the artificial intelligence object based on the model instance.
[0124] The model structures of the action prediction models of different artificial intelligence objects can be the same, but the model parameters are different. That is, the calculation logic of the actions of different types of artificial intelligence objects is different. The model structures of artificial intelligence objects of the same type (i.e., the same identifier) but different levels can be the same, but the model parameters are different. That is, the calculation logic of the actions of artificial intelligence objects of the same type at different levels is also different. The embodiments of the present application do not limit the model structure and model parameters of the action prediction model of the artificial intelligence object.
[0125] 204. During the virtual game, the terminal sends multiple types of status data of the virtual game to the game server, where the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game.
[0126] In an embodiment of the present application, during the game process of the virtual game, the game server can control at least one artificial intelligence object in the virtual game to perform an activity. During the process of controlling at least one artificial intelligence object to perform an activity, the game server can obtain multiple types of state data of the virtual game from the virtual game of the terminal, so as to subsequently determine the next action to be performed by at least one artificial intelligence object.
[0127] Among them, the multiple types of status data of the virtual game include status data of each participating object in the virtual game, which are used to indicate the status of each participating object in the virtual game.
[0128] Among them, participating objects refer to objects that appear in the virtual game. Participating objects include virtual objects controlled by real objects and artificial intelligence objects controlled based on action prediction models. The management server can control artificial intelligence objects to fight with virtual objects controlled by real objects through action prediction models. For artificial intelligence objects and virtual objects controlled by real objects, state data includes but is not limited to position data, health value data, attack value data, defense value data, action data being executed, skill status, etc., which are not limited in the embodiments of the present application.
[0129] Optionally, the participating objects may include static environment resources in addition to virtual objects controlled by real objects and artificial intelligence objects controlled by the game server used for combat. The static environment resources herein are considered to be other objects that appear in the virtual game except for virtual objects controlled by real objects and artificial intelligence objects. Optionally, the static environment resources may be inactive objects in the virtual game. The inactive objects may be at least one of virtual buildings, virtual plants, and virtual terrain. For static environment resources, state data include but are not limited to position data, appearance data, etc., which are not limited in the embodiments of the present application.
[0130] The state data of static environment resources may also change as the game progresses. Take a multiplayer online tactical competitive game as an example. The real object controls the virtual object to use skill 1 towards the artificial intelligence object. The artificial intelligence object dodges. Skill 1 eventually acts on the virtual building in the virtual game and knocks down the wall of the virtual building. At this time, the state data of the virtual building as a static environment resource changes.
[0131] In an embodiment of the present application, during the game process of the virtual game, the terminal can upload multiple types of status data of the virtual game to the game server, so that the game server can know the status of each participant in the virtual game.
[0132] 205. The game server sends multiple types of status data of the virtual game to the management server according to different acquisition frequencies.
[0133] In an embodiment of the present application, for any type of status data, the game server can periodically send (synchronize) the type of status data to the management server according to the acquisition frequency of the type of status data. That is, during the game process of the virtual game, the management server can obtain multiple types of status data of the virtual game from the game server according to different acquisition frequencies. Among them, the acquisition frequency of multiple types of status data can be configured in advance for the virtual game by the developer, can be customized by the real object, and can also be determined according to the attributes of the virtual game, and the embodiment of the present application does not limit this.
[0134] In the embodiment of the present application, the acquisition frequencies of different status data may be different from each other; or, the acquisition frequencies of multiple types of status data may not be completely the same, and the embodiment of the present application does not limit this. For example, the game server may divide the multiple types of status data into multiple levels according to the update frequencies of the multiple types of status data, and the acquisition frequencies of different levels of status data may be different.
[0135] For example, the position data, health value data, attack value data, defense value data and other status data of the participants in the virtual game are updated frequently, and the game server sends (synchronizes) to the management server 5 times per second. The skill status data of the participants in the virtual game are updated slowly, and the game server sends (synchronizes) to the management server 2 times per second.
[0136] Among them, the game server can automatically provide multiple types of status data of the virtual game to the management server; or it can provide multiple types of status data of the virtual game after the management server sends a request. That is, the game server can automatically send multiple types of status data of the virtual game to the management server according to different acquisition frequencies; or, the game server can also send multiple types of status data of the virtual game to the management server when receiving acquisition requests sent by the management server according to different acquisition frequencies. The embodiment of the present application does not limit the way in which the game server provides status data.
[0137] 206. The management server calls the action prediction model to obtain action information of at least one artificial intelligence object based on the multiple types of status data of the virtual game; and returns the action information of at least one artificial intelligence object to the game server.
[0138] In an embodiment of the present application, at least one action prediction model of an artificial intelligence object is already running in the management server. After receiving multiple types of status data of the virtual game, the management server inputs the multiple types of status data of the virtual game into the action prediction model of each artificial intelligence object respectively to predict the action information of each artificial intelligence object in the virtual game. The action information can be used to instruct the artificial intelligence object to move in a certain direction or to launch a certain skill, etc., which is not limited in the embodiment of the present application. Then, the management server sends the action information of at least one artificial intelligence object to the game server.
[0139] 207. Based on the action information of at least one artificial intelligence object returned by the management server, the game server controls at least one artificial intelligence object to execute the action indicated by the action information; and sends the action execution result of at least one artificial intelligence object to the terminal.
[0140] In the embodiment of the present application, for any artificial intelligence object, the game server controls the artificial intelligence object to perform the action indicated by the action information in the virtual game based on the action information of the artificial intelligence object, and obtains the action execution result of the artificial intelligence object. Then, the game server sends the action execution result of the artificial intelligence object to the terminal.
[0141] 208. The terminal updates the status data of each participating object in the virtual game based on the action execution result of at least one artificial intelligence object, and uploads the data to the game server.
[0142] In the embodiment of the present application, for any artificial intelligence object, the terminal displays the corresponding action of the artificial intelligence object based on the action execution result of the artificial intelligence object. After the artificial intelligence object performs the action, in addition to the change in the state data of the artificial intelligence object, the state data of other participating objects in the virtual game may also change. The terminal re-determines the state data of each participating object in the virtual game, and synchronizes the state data of each participating object to the game server again.
[0143] An embodiment of the present application provides a control method for an artificial intelligence object. During a virtual game, different acquisition frequencies are used to synchronize multiple types of status data of participating objects in the virtual game from a game server to a management server. In each synchronization process, it is not necessary to provide all the status data in the virtual game. The management server only needs to obtain part of the status data. Then, based on the currently obtained partial status data and other previously obtained status data, the action information of at least one artificial intelligence object in the virtual game can be predicted through an action prediction model. This not only reduces the number of status data acquired by the management server at a single time, reduces the communication load between the game server and the management server, and avoids game freezes due to excessive communication loads; and the action information of the artificial intelligence object is based on the multiple types of status data of the virtual game, which also ensures the accuracy of the action information, making the behavior of the artificial intelligence object more realistic and more in line with real-life combat situations.
[0144] Moreover, since the virtual game can be avoided as much as possible, the smoothness of the virtual game and the operation experience of the real object can be guaranteed; and the actions of the artificial intelligence object are more accurate, which ensures the quality of the battle between the artificial intelligence object and the virtual object controlled by the real object, that is, the quality of the virtual game is guaranteed, which is conducive to improving the game experience and operation level of the real object.
[0145] The above steps executed by the counterpart server can be independently implemented as an embodiment of the counterpart server side; the steps executed by the management server can be independently implemented as an embodiment of the management server side.
[0146] Since the action prediction model of each artificial intelligence object is based on complete state data (multiple types of state data) for prediction, the management server needs to provide the action prediction model with complete state data before each prediction. After obtaining multiple types of state data based on different acquisition frequencies, the management server can summarize the multiple types of state data to combine the complete state data used for this prediction. The following is a detailed description of the process in which the management server obtains the action information of at least one artificial intelligence object based on multiple types of state data in step 206. Figure 3 , Figure 31 is a schematic diagram of obtaining action information of an artificial intelligence object according to an embodiment of the present application. The process of obtaining action information of at least one artificial intelligence object includes the following steps:
[0147] 301. The management server 31 combines multiple types of status data used for this prediction based on the first type of status data obtained at the target time and the most recent other types of status data obtained before the target time. The first type of status data among the multiple types of status data is obtained most frequently.
[0148] In the embodiment of the present application, other types of state data are data other than the first type of state data in the multiple types of state data. The management server 31 can obtain the action information of at least one artificial intelligence object according to the highest acquisition frequency. That is, whenever the first type of state data is obtained, the management server 31 can combine the multiple types of state data used for this prediction based on the first type of state data obtained at the target time (current time) and the most recent other type of state data obtained previously. The first type of state data obtained at the target time is the most recently obtained first type of state data.
[0149] Among them, for other types of state data with a lower acquisition frequency, the management server 31 can cache the other types of state data, so that when the first type of state data is obtained, the other types of state data can be directly obtained from the cache space, and the complete state data can be provided to the action prediction model. Correspondingly, for the second type of state data in other types of state data, the management server 31 updates and caches the second type of state data each time the second type of state data is obtained. The second type of state data can be any type of state data in other types of state data. In other words, the first type of state data in the multiple types of state data used in this prediction is equivalent to real-time data, and the other types of state data are data in the cache, that is, Figure 3 The first type of status data belongs to the data obtained quickly, and the other types of status data belong to the data obtained slowly.
[0150] Among them, the first type of status data may include at least one of position data, health value data, attack value data, and other types of status data may include at least one of defense value data, action data being executed, and skill status. The embodiments of the present application do not limit this.
[0151] The solution provided in the embodiment of the present application is that the management server 31 can cache other types of status data that are less frequently obtained, so that when the latest first type of status data is obtained, the action information of at least one artificial intelligence object can be directly obtained based on the latest first type of status data and other types of status data in the cache, without the need to obtain other types of status data from the game server 32. This can improve the efficiency of obtaining action information and reduce the number of other types of status data obtained, thereby reducing the communication load of the game server 32 and the management server 31, and avoiding game freezes due to excessive communication load.
[0152] In addition, obtaining action information based on the highest acquisition frequency ensures the timeliness of the action information. The AI object can be controlled to perform new actions through the latest action information at the highest acquisition frequency, making the action smoother for the AI object, thereby improving the game experience of the real object.
[0153] It should be noted that when acquiring state data for the first time, the management server 31 can simultaneously acquire multiple types of state data of the virtual game to predict the actions of the artificial intelligence object; then, starting from the time point when the state data was first acquired, the management server 31 acquires multiple types of state data of the virtual game at different acquisition frequencies. This ensures that each time the first type of state data is acquired, other types of state data can also be obtained to combine the multiple types of state data used for this prediction to perform prediction.
[0154] In the embodiments of the present application, the acquisition frequency of each state data can be manually set, or can be determined based on at least one of the performance of the action prediction model of the artificial intelligence object, the attribute information of the virtual game, the distance between the virtual object controlled by the real object in the virtual game and the artificial intelligence object, and the game time, etc. The embodiments of the present application do not limit the method for determining the acquisition frequency. The following mainly takes the acquisition frequency of the first type of state data as an example to introduce various methods for determining the acquisition frequency.
[0155] The first is that the frequency of acquiring state data is determined based on the performance of the action prediction model. Accordingly, the management server 31 determines the frequency of acquiring the first type of state data based on the performance of the action prediction model corresponding to at least one artificial intelligence object. Performance is used to represent the rate at which the action prediction model predicts action information. The frequency of acquiring the first type of state data is positively correlated with the performance of the action prediction model. That is, the faster the rate at which the action prediction model predicts action information, the higher the frequency of acquiring (first type) state data; the slower the rate at which the action prediction model predicts action information, the lower the frequency of acquiring (first type) state data.
[0156] For example, the acquisition frequency of the first type of state data is equal to the rate at which the action prediction model predicts the action information. If the action prediction model can calculate the action information 5 times per second (unit time length), the acquisition frequency of the first type of state data is 5 times / second.
[0157] The solution provided in the embodiment of the present application takes into account the performance of the action prediction model of the artificial intelligence object. When the performance of the action prediction model of the artificial intelligence object is good enough to support frequent prediction of action information, the frequency of obtaining state data is also increased accordingly. That is, when the performance of the action prediction model permits, state data can be obtained as frequently as possible, so that the action of the artificial intelligence object can be predicted as frequently as possible through the action prediction model, thereby ensuring the smoothness of the action of the artificial intelligence object.
[0158] Second, the frequency of obtaining the status data is determined based on the attribute information of the virtual game. Accordingly, the management server 31 determines the frequency of obtaining the first type of status data based on the attribute information of the virtual game. The attribute information includes at least one of the number of logical frames of the virtual game, the difficulty level of the virtual game, and the display frame rate of the virtual game. The number of logical frames is used to indicate the number of times the state of the artificial intelligence object is updated per unit time in the virtual game. That is, the management server 31 can determine the frequency of obtaining the first type of status data based on at least one of the number of logical frames, the difficulty level, and the display frame rate of the virtual game.
[0159] Optionally, the acquisition frequency of the first type of state data is equal to the number of logical frames of the virtual game. For example, the number of logical frames of the virtual game is 5, that is, the state of the artificial intelligence object is updated 5 times per second in the virtual game. In other words, the action of the artificial intelligence object is predicted 5 times per second in the virtual game. Then the acquisition frequency of the first type of state data is 5 times / second.
[0160] Optionally, there is a correspondence between the acquisition frequency of the first type of status data and the difficulty level of the virtual game. Based on the correspondence, the management server 31 can determine the acquisition frequency corresponding to the difficulty level of the current virtual game as the acquisition frequency of the first type of status data. For example, the correspondence includes three pairs of relationships such as "simple difficulty-acquisition frequency is 5 times / second", "medium difficulty-acquisition frequency is 8 times / second", and "difficult difficulty-acquisition frequency is 10 times / second". If the difficulty level of the virtual game is simple difficulty, the acquisition frequency of the first type of status data is 5 times / second.
[0161] Optionally, the acquisition frequency of the first type of status data is equal to the display frame rate of the virtual game. For example, the display frame rate of the virtual game is 10 frames per second, that is, 10 frames are displayed per second in the virtual game; then the acquisition frequency of the first type of status data is 10 times per second.
[0162] Optionally, for at least two of the above-mentioned logical frame number, difficulty level, and display frame rate, the management server 31 can use the above-mentioned method to determine an acquisition frequency based on each item, and then perform weighted summation on the at least two acquisition frequencies obtained to determine the acquisition frequency of the first category of status data. The weights used in the weighted summation process are used to indicate the importance of each item to the virtual game, and the embodiments of the present application are not limited to this. For example, if the number of logical frames of the virtual game is 5, and the display frame rate of the virtual game is 10 frames / second, the importance of the logical frame number to the virtual game is 60%, and the importance of the display frame rate to the virtual game is 40%; then the acquisition frequency of the first category of status data is 5*60%+10*40%=7 times / second.
[0163] The solution provided in the embodiment of the present application determines the frequency of obtaining (first type) status data based on the attribute information of the virtual game, so that the frequency of obtaining status data can meet the basic conditions such as the logical frame number, difficulty level and display frequency of the virtual game, ensures the situation of predicting actions based on the status data of artificial intelligence objects, meets the basic requirements of the virtual game, and is conducive to improving the player's operating experience.
[0164] The third type is that the frequency of obtaining the state data is determined based on the distance between the virtual object controlled by the real object and the artificial intelligence object. Accordingly, the management server 31 obtains the distance between the virtual object controlled by the real object and the artificial intelligence object in the virtual game. Then, the management server 31 determines the frequency of obtaining the first type of state data based on the distance. The frequency of obtaining the first type of state data is negatively correlated with the above distance. That is, the closer the distance between the virtual object controlled by the real object and the artificial intelligence object, the higher the frequency of obtaining the first type of state data; the farther the distance between the virtual object controlled by the real object and the artificial intelligence object, the lower the frequency of obtaining the first type of state data.
[0165] According to the solution provided by the embodiment of the present application, when the virtual object controlled by the real object is far away from the artificial intelligence object, the probability of a battle between the virtual object controlled by the real object and the artificial intelligence object is low, and the state of the artificial intelligence object does not need to be changed frequently, that is, there is no need to frequently obtain the state data of the virtual game. In this case, the acquisition frequency of the determined state data is low. On the basis of ensuring the smooth progress of the game, the amount of state data obtained is reduced, the communication load of the server is reduced, and the game jam due to excessive communication load is avoided. When the virtual object controlled by the real object is close to the artificial intelligence object, the probability of a battle between the virtual object controlled by the real object and the artificial intelligence object is high, and the state update frequency of the artificial intelligence object needs to be increased, that is, it is necessary to obtain the state data of the virtual game multiple times. In this case, the acquisition frequency of the determined state data is high, which is conducive to ensuring the smooth progress of the battle between the artificial intelligence object and the virtual object controlled by the real object.
[0166] For example, when the virtual object controlled by the real object is 50 meters away from the artificial intelligence object, the frequency of acquiring the first type of status data is 1 time / second; when the virtual object controlled by the real object is within 10 meters away from the artificial intelligence object, the frequency of acquiring the first type of status data is 5 times / second.
[0167] Fourthly, the acquisition frequency of the status data is determined based on the duration of the virtual game. Accordingly, the management server 31 acquires the duration of the virtual game. When the duration of the game does not exceed the duration threshold, the management server 31 determines the acquisition frequency of the first type of status data to be the first frequency; when the duration of the game exceeds the duration threshold, the management server 31 determines the acquisition frequency of the first type of status data to be the second frequency. The second frequency is higher than the first frequency.
[0168] According to the solution provided by the embodiment of the present application, when the duration of the virtual game is short, the probability of a battle between the virtual object controlled by the real object and the artificial intelligence object is low, and the state of the artificial intelligence object does not need to be changed frequently, that is, there is no need to frequently obtain the state data of the virtual game. In this case, the acquisition frequency of the determined state data is low. On the basis of ensuring the smooth progress of the game, the amount of state data obtained is reduced, the communication load of the server is reduced, and the game jam due to excessive communication load is avoided. When the duration of the virtual game is long, the probability of a battle between the virtual object controlled by the real object and the artificial intelligence object is high, and the state update frequency of the artificial intelligence object needs to be increased, that is, it is necessary to obtain the state data of the virtual game multiple times. In this case, the acquisition frequency of the determined state data is high, which is conducive to ensuring the smooth progress of the battle between the artificial intelligence object and the virtual object controlled by the real object.
[0169] For example, within the first 5 minutes after the virtual game starts, the real object usually does not control the virtual object to fight with the artificial intelligence object, but controls the virtual object to obtain virtual props to improve the combat effectiveness of the controlled virtual object. The first 5 minutes are called the development stage of the virtual object. During this stage, the state of the artificial intelligence object in the virtual game remains basically unchanged. In this case, the acquisition frequency of the first type of state data is 1 time / second. After 5 minutes, the combat effectiveness of the virtual object has been improved to the needs of the real object, and then the real object will control the virtual object to fight with the artificial intelligence object. The state of the artificial intelligence object in the virtual game will change frequently. In this case, the acquisition frequency of the first type of state data can be increased to 5 times / second.
[0170] The above-mentioned methods may also be combined with each other to determine the acquisition frequency of the first type of status data, which is not limited in this embodiment of the present application.
[0171] For any type of status data in other types of status data, the management server 31 can determine each status frequency in other types of status frequencies based on the acquisition frequency of the first type of status data. Among them, the management server 31 can reduce a certain difference on the basis of the acquisition frequency of the first type of status data to obtain the acquisition frequency of other types of status data. Optionally, for any type of status data in other types of status data, the management server 31 can reduce the difference corresponding to this type of status data on the basis of the acquisition frequency of the first type of status data to obtain the acquisition frequency of this type of status data. Among them, the difference corresponding to each type of status data in other types of status data can be pre-set or determined based on the correlation between this type of status data and the first type of status data, and the embodiments of the present application are not limited to this.
[0172] Alternatively, the acquisition frequency of the first category of status data is a multiple of the acquisition frequency of any other category of status data. The multiple may be an integer multiple or a non-integer multiple, and the embodiments of the present application do not limit this. Optionally, for any category of status data in other categories of status data, the management server 31 may divide the acquisition frequency of the first category of status data by the multiple corresponding to the category of status data to obtain the acquisition frequency of the category of status data. Among them, the multiple corresponding to each category of status data in other categories of status data may be pre-set or determined based on the degree of association between the category of status data and the first category of status data, and the embodiments of the present application do not limit this.
[0173] In the embodiment of the present application, the method for determining the acquisition frequency of any one of the above-mentioned first-category status data is only explained by taking the first-category status data as an example. The management server 31 can adopt any determination method to determine the acquisition frequency of any type of status data, and then use the acquisition frequency of this type of status data to determine the acquisition frequency of other types of status data. The principle is similar to the above content and will not be repeated here.
[0174] In addition to being determined by the management server 31, the acquisition frequency of the above-mentioned multiple types of status data can also be determined by the counterpart server using any of the above-mentioned methods. The embodiment of the present application does not limit the execution entity that determines the acquisition frequency.
[0175] 302. The management server 31 sends the multiple types of state data used in this prediction to the action prediction model to predict the action information of at least one artificial intelligence object.
[0176] In the embodiment of the present application, for any artificial intelligence object, the management server 31 inputs the multiple types of state data used in this prediction into the action prediction model of the artificial intelligence object, processes the multiple types of state data of the virtual game through the action prediction model, and outputs the action information of the artificial intelligence object. That is, the management server 31 is used to obtain the action information of at least one artificial intelligence object based on the multiple types of state data used in this prediction.
[0177] Among them, the management server 31 can input multiple types of state data into the action prediction model according to the prediction frequency to predict the action of the artificial intelligence object.
[0178] In some embodiments, the predicted frequency is determined based on the acquisition frequencies of the multiple types of status data. Optionally, the predicted frequency is equal to the highest acquisition frequency among the multiple types of status data.
[0179] In other embodiments, the prediction frequency itself is dynamically determined. Optionally, the management server 31 can determine the prediction frequency of the action information based on at least one of the performance of the action prediction model (such as prediction rate, model complexity, etc.), attribute information of the virtual game, the distance between the virtual object controlled by the real object and the artificial intelligence object in the virtual game, and the game time. That is, the prediction frequency is determined separately and may be independent of the acquisition frequency of the state data. The principle of the determination process of the prediction frequency is similar to that of the above-mentioned determination process of the acquisition frequency, and will not be repeated here.
[0180] The solution provided in the embodiment of the present application can directly obtain the action information of at least one artificial intelligence object based on the latest first-category status data and the most recent other-category status data obtained before, for the first-category status data with the highest acquisition frequency, whenever the latest first-category status data is obtained. This not only reduces the number of other-category status data obtained, and reduces the communication load of the game server 32 and the management server 31, thus avoiding game freezes due to excessive communication load; the action information of the artificial intelligence object is based on multiple categories of status data of the virtual game, which also ensures the accuracy of the action information, making the behavior of the artificial intelligence object more realistic and more in line with real-life combat situations.
[0181] Furthermore, the frequency at which the management server 31 acquires action information is equal to the maximum acquisition frequency, thereby ensuring the smoothness of the virtual game and the operating experience of the real object as much as possible; and the actions of the artificial intelligence object are more accurate, ensuring the quality of the battle between the artificial intelligence object and the virtual object controlled by the real object, that is, ensuring the quality of the virtual game, which is conducive to improving the game experience and operating level of the real object.
[0182] The above-mentioned AI object action prediction model can be deployed in multiple object servers, so that the management server can distribute the control tasks of the AI objects in the virtual game to multiple object servers to reduce the burden of the management server. Figure 4 , Figure 4 is an interactive flow chart of another control method of an artificial intelligence object provided according to an embodiment of the present application, which shows that Figure 1 The process of controlling an artificial intelligence object by a game server, a management server, and multiple object servers. The control method of the artificial intelligence object includes the following steps:
[0183] 401. In response to a virtual game start operation, a terminal sends game start information to a game server, where the game start information is used to notify the game server that the virtual game has been started.
[0184] 402. When the virtual game is started, the game server controls at least one artificial intelligence object to participate in the virtual game; and sends object information to the management server, where the object information includes an identifier of the artificial intelligence object in the virtual game.
[0185] In the embodiment of the present application, the process from step 401 to step 402 is the same as the process from step 201 to step 202, and will not be repeated here.
[0186] 403. The management server determines at least one artificial intelligence object in the virtual game based on the object information sent by the game server; and assigns the control task of the at least one artificial intelligence object to at least one object server among the multiple object servers.
[0187] In an embodiment of the present application, the management server determines at least one artificial intelligence object in the virtual game according to the object identifier in the object information. Then, the management server assigns the control task of at least one artificial intelligence object to at least one object server among the multiple object servers. For any object server, the object server may be assigned the control task of one artificial intelligence object, or may be assigned the control task of two or more artificial intelligence objects. The embodiment of the present application does not limit the number of artificial intelligence objects that each object server can control.
[0188] Each object server stores model files of action prediction models of multiple artificial intelligence objects. When a virtual game is started, any object server may receive control task information sent by the management server. The control task information is used to indicate at least one artificial intelligence object to be controlled by the object server. Then, based on the control task information and the model files of multiple artificial intelligence objects, the object server loads the action prediction model of at least one artificial intelligence object to be controlled. That is, the object server loads the model file of the artificial intelligence object to be controlled, constructs a model instance of the action prediction model of the artificial intelligence object, and allocates load resources such as CPU and memory to the model instance, so as to subsequently predict the action of the artificial intelligence object based on the model instance.
[0189] In the process of assigning control tasks, each object server can load the motion prediction model of at least one assigned artificial intelligence object. Only when the object server has completed loading the motion prediction model of any artificial intelligence object, the control task of the artificial intelligence object is considered to be successfully assigned to the object server. Then, the management server can determine the communication connection between the object server and the game server based on the communication address of the object server, the identifier of the artificial intelligence object, and the game identifier of the virtual game.
[0190] Since the management server and multiple object servers can simultaneously control the activities of artificial intelligence objects in multiple virtual games, any artificial intelligence object may exist in multiple virtual games. Therefore, before allocating any artificial intelligence object to any object server, the management server can detect whether there is an object server among the multiple object servers that has loaded the action prediction model of the artificial intelligence object. If there is an object server that has loaded the action prediction model of the artificial intelligence object, the management server can assign the control task of the artificial intelligence object to the object server. If there is no object server that has loaded the action prediction model of the artificial intelligence object, the management server sends control task information to at least one object server among the multiple object servers to assign the control task of the artificial intelligence object.
[0191] Accordingly, for any artificial intelligence object, the management server queries the corresponding relationship used to represent the communication connection (the corresponding relationship between the communication address of the object server, the identification of the artificial intelligence object, and the game identification of the virtual game) based on the identification of the artificial intelligence object. In the case where the identification of the artificial intelligence object exists in the corresponding relationship used to represent the communication connection, the management server determines the object server used to control the artificial intelligence object in the current virtual game based on the communication address corresponding to the identification of the artificial intelligence object. Then, the management server can determine the communication connection between the object server and the game server (the artificial intelligence object in the virtual game) based on the communication address of the object server, the identification of the artificial intelligence object, and the game identification of the current virtual game. In the case where the identification of the artificial intelligence object does not exist in the corresponding relationship used to represent the communication connection, the management server sends control task information to at least one object server among the multiple object servers, so as to load the action prediction model of the artificial intelligence object through any object server to realize the allocation of the control task of the artificial intelligence object.
[0192] The solution provided by the embodiment of the present application is that since the object server used to control the artificial intelligence object has already loaded the action prediction model of the artificial intelligence object when other virtual games are started, when the current virtual game is started, the action prediction model of the artificial intelligence object that has been loaded can be reused, without requiring other object servers to repeatedly load the action prediction model of the artificial intelligence object, thereby improving the control efficiency of the artificial intelligence object.
[0193] For example, Figure 5 is a schematic diagram of allocating control tasks according to an embodiment of the present application. Figure 5, there are artificial intelligence object 1 and artificial intelligence object 2 in the current virtual game. The management server 51 needs to distribute the control tasks of artificial intelligence object 1 and artificial intelligence object 2 to multiple object servers. The action prediction model of artificial intelligence object 2 and the action prediction model of artificial intelligence object 3 have been loaded in the first object server 521. The action prediction model of artificial intelligence object 4 has been loaded in the second object server 522. The action prediction model of any artificial intelligence object is not loaded in other object servers. In the process of allocating the control tasks of artificial intelligence object 1 and artificial intelligence object 2, the management server 51 determines that the action prediction model of artificial intelligence object 2 has been loaded in the first object server by querying the pre-stored corresponding relationship used to represent the communication connection. Then, based on the identifier of the first object server, the identifier of artificial intelligence object 2 and the identifier of the current virtual game, the management server determines the communication connection between the first object server 521 and the game server (artificial intelligence object 2 in the current virtual game), so that the multiple types of status data of the current virtual game can be directly sent to the first object server to predict the action of artificial intelligence object 2.
[0194] Furthermore, the management server 51 determines that the action prediction model of the artificial intelligence object 1 that has been loaded does not exist in the multiple object servers by querying the pre-stored corresponding relationship for indicating the communication connection. In this case, the management server 51 can send the control task information of the artificial intelligence object 1 to any object server to load the action prediction model of the artificial intelligence object 1. For example, the management server 51 sends the control task information of the artificial intelligence object 1 to the first object server 521, but the remaining load resources of the first object server 521 are insufficient to load the action prediction model of the artificial intelligence object 1. In this case, the management server 51 can receive the task return information returned by the first object server to notify that the loading cannot be completed. Then, the management server 51 sends the control task information of the artificial intelligence object 1 to the second object server. The second object server 522 has sufficient load resources to load the action prediction model of the artificial intelligence object 1. When the loading is completed, the second object server 522 returns the loading completion notification to the management server 51. Then, the management server 51 determines the communication connection between the second object server 522 and the artificial intelligence object 1 in the current virtual game.
[0195] Among them, the management server can also directly send control task information to the object server without a communication connection (i.e., not assigned a control task), which can increase the probability of successful single task assignment, thereby helping to improve the control efficiency of the artificial intelligence object.
[0196] During the virtual game, each object server assigned to the control task can predict the actions of the controlled artificial intelligence object based on the status data of each participating object in the virtual game. For details, please refer to the subsequent steps.
[0197] 404. During the virtual game, the terminal sends multiple types of status data of the virtual game to the game server, where the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game.
[0198] 405. The game server sends multiple types of status data of the virtual game to the management server according to different acquisition frequencies.
[0199] In the embodiment of the present application, the process from step 404 to step 405 is the same as the process from step 204 to step 205, and will not be repeated here.
[0200] 406. The management server sends multiple types of status data to at least one object server used to control at least one artificial intelligence object in the virtual game.
[0201] In an embodiment of the present application, for any artificial intelligence object in the virtual game, the management server sends multiple types of state data used for this prediction to the object server used to control the artificial intelligence object. The object server runs an action prediction model of the artificial intelligence object. The action prediction model is trained based on reinforcement learning. Then, the management server receives the action information of the artificial intelligence object returned by the object server.
[0202] Among them, the management server can store the correspondence between the virtual game, the artificial intelligence object and the object server, so that after receiving multiple types of status data of the virtual game, the multiple types of status data can be sent to the object server used to control the artificial intelligence objects in the game based on the above correspondence.
[0203] Among them, the object server corresponding to each artificial intelligence object can be an object server that has loaded the action prediction model of the artificial intelligence object after the virtual game is started. Alternatively, the object server can also be an object server that has loaded the action prediction model of the artificial intelligence object after other virtual games are started and before the virtual games are started. Other virtual games have been started before the virtual games are started, and have not ended when the virtual games are started, and there are artificial intelligence objects in other virtual games. In other words, the object server used to control each artificial intelligence object can be an object server assigned to the artificial intelligence object by the management server after the current virtual game is started. Alternatively, the object server used to control each artificial intelligence object can also be an object server assigned to the artificial intelligence object in other virtual games before the current virtual game is started. Since the object server used to control the artificial intelligence object has loaded the action prediction model of the artificial intelligence object when other virtual games are started, the action prediction model of the artificial intelligence object that has been loaded can be reused when the current virtual game is started, without requiring other object servers to repeatedly load the action prediction model of the artificial intelligence object, which can improve the control efficiency of the artificial intelligence object.
[0204] 407. At least one object server predicts action information of at least one artificial intelligence object in the virtual game based on multiple types of status data of the virtual game, and returns the action information of at least one artificial intelligence object to the management server.
[0205] In an embodiment of the present application, during a virtual game, each object server receives multiple types of status data used for this prediction sent by the management server, and then, based on the multiple types of status data used for this prediction, calls the action prediction model to predict the action information of at least one artificial intelligence object, so as to subsequently return the action information of at least one artificial intelligence object to the management server.
[0206] For any artificial intelligence object controlled by the object server, the object server inputs multiple types of state data used in this prediction to the action prediction model of the artificial intelligence object; then, the action prediction model processes the multiple types of state data used in this prediction and outputs the action information of the artificial intelligence object. Then, the object server sends the action information of at least one artificial intelligence object controlled by it to the management server.
[0207] 408. The management server returns action information of at least one artificial intelligence object to the game server.
[0208] 409. Based on the action information of at least one artificial intelligence object returned by the management server, the game server controls at least one artificial intelligence object to execute the action indicated by the action information, and sends the action execution result of the at least one artificial intelligence object to the terminal.
[0209] 410. The terminal updates the status data of each participating object in the virtual game based on the action execution result of at least one artificial intelligence object, and uploads the data to the game server.
[0210] In the embodiment of the present application, the process from step 408 to step 410 is the same as the process from step 206 to step 208, and will not be repeated here.
[0211] In some embodiments, for any artificial intelligence object in a virtual game, when a third object server controlling the artificial intelligence object fails, the management server sends a third control task information to a fourth object server among multiple object servers. The third control task information is used to instruct the fourth object server to load the action prediction model of the artificial intelligence object. After the fourth object server loads the action prediction model of the artificial intelligence object, the management server sends multiple types of status data of the virtual game to the fourth object server, and receives the action information predicted by the fourth object server based on the action prediction model of the artificial intelligence object and the multiple types of status data. In the solution provided by the embodiment of the present application, when an object server controlling any artificial intelligence object fails, the management server can assign the control task of the artificial intelligence object to other object servers, which will be controlled by other object servers, thereby ensuring the stability of the virtual game.
[0212] In other embodiments, for any artificial intelligence object in the virtual game, in response to the death of the artificial intelligence object, the management server sends a destruction instruction to the object server that controls the artificial intelligence object. The destruction instruction is used to instruct the object server to release the resources occupied by the action prediction model of the artificial intelligence object. The management server disconnects the communication connection between the object server and the game server. That is, the management server deletes the association between the communication address of the object server and the object identifier of the corresponding artificial intelligence object, so as to no longer transmit status data to the object server.
[0213] An embodiment of the present application provides a control method for an artificial intelligence object. During a virtual game, different acquisition frequencies are used to synchronize multiple types of status data of participating objects in the virtual game from a game server to a management server. In each synchronization process, it is not necessary to provide all the status data in the virtual game. The management server only needs to obtain part of the status data. Then, based on the currently obtained partial status data and other previously obtained status data, the action information of at least one artificial intelligence object in the virtual game can be predicted through an action prediction model. This not only reduces the number of status data acquired by the management server at a single time, reduces the communication load between the game server and the management server, and avoids game freezes due to excessive communication loads; and the action information of the artificial intelligence object is based on the multiple types of status data of the virtual game, which also ensures the accuracy of the action information, making the behavior of the artificial intelligence object more realistic and more in line with real-life combat situations.
[0214] Moreover, since the virtual game can be avoided as much as possible, the smoothness of the virtual game and the operation experience of the real object can be guaranteed; and the actions of the artificial intelligence object are more accurate, which ensures the quality of the battle between the artificial intelligence object and the virtual object controlled by the real object, that is, the quality of the virtual game is guaranteed, which is conducive to improving the game experience and operation level of the real object.
[0215] The control method of the artificial intelligence object provided in the embodiment of the present application can be applied to any game that supports human-computer combat. The game server (roomsvr) is responsible for the logical processing of the game battle, and can collect various operation data and status data in the game, including those of real objects and artificial intelligence objects (game robots). The object server (aisvr) can load the reinforcement learning model, is responsible for processing the operation reasoning of the reinforcement learning model, and outputs the action information of the artificial intelligence object based on the reinforcement learning model. The management server (battlemgr) is responsible for managing the object server (model service) to support a series of processes such as the generation, allocation, connection and destruction of artificial intelligence objects in the game.
[0216] Generation of artificial intelligence objects: At the beginning of a game, the game server creates a virtual battlefield (virtual environment) for the game. The game server can then send the game requirements to the management server to notify the management server of at least one artificial intelligence object in the game. The management server then sends control task information to at least one of the multiple object servers. The control task information may include the identification and level of at least one artificial intelligence object to instruct the object server to load the action prediction model of at least one artificial intelligence object. Model files of action prediction models of multiple artificial intelligence objects are stored in each object server. After receiving the control task information, the object server can load the action prediction model of at least one controlled artificial intelligence object.
[0217] Allocation of artificial intelligence objects: After loading the action prediction model, the management server determines that the object server can control the artificial intelligence object, and allocates the artificial intelligence object controlled by the object server to the corresponding game match. That is, the management server records the identifier (type) of the artificial intelligence object and the identifier of the object server corresponding to each game match. During the allocation process, when the management server finds that the action prediction model of the artificial intelligence object has been loaded in a certain object server, the management server can use the object server as the object server for controlling the artificial intelligence object, that is, there is no need to repeatedly load the same action prediction model, but reuse the previously loaded action prediction model.
[0218] Connection of AI objects: After determining the object server used to control the AI object in the game, the game server and the object server can interact through the management server. The game server is used to output the status data in the game. The object server is used to output the action information of the AI object. The output of the game server and the object server is the input of each other.
[0219] Destruction of AI objects: When the battle ends (e.g., the AI object dies) or the game is completed, the management server can destroy the AI object in the game. That is, the management server can send a destruction instruction to the object server to instruct the object server to release the load resources occupied by the action prediction model and disconnect the communication connection with the game server in order to proceed to the next round of game.
[0220] The status data of the virtual game may include the position and health of our or enemy heroes, the position and health of soldiers and monsters, skill cooldown time, etc. The output action information may include moving in a certain direction, releasing a certain skill, etc. The game logic frame rate is generally 10-20 frames per second. If the action prediction model is used to drive the artificial intelligence object in each frame, it will bring about the problem of too much and too frequent collection of status data, making the server communication load too high, which may cause the game server to freeze.
[0221] To solve this problem, the embodiment of the present application sets the logical frame rate of the artificial intelligence object to 5 frames per second, that is, the artificial intelligence object performs reasoning and outputs actions at most 5 times per second. In addition, in the present application, the status data in the game can be divided into three levels: fast, medium, and slow, and synchronized to the management server in a hierarchical manner. The fast-level data is updated and synchronized to the management server every frame, the medium-level data is updated and synchronized every 5 frames, and the slow-level data is updated and synchronized every 10 frames. The synchronization time intervals of each level are different, and only the status data that changes very quickly needs to be synchronized and updated every frame. For data that changes more slowly or is less important, the update time interval is longer, and the communication load is reduced through hierarchical synchronization of data.
[0222] Although medium and slow level status data are not output from the game server every frame, model prediction requires the input of complete status data every frame, so the status data with a long synchronization interval needs to be cached on the management server. When each frame of fast level data arrives, the medium and slow level data are taken from the cache and merged and forwarded to the object server. The object server uses the complete status data as input and outputs the action information of the AI object, which is then forwarded to the game server by the management server to control the AI object in the virtual game to perform the corresponding action.
[0223] This application integrates the generation, allocation, communication connection and destruction functions of artificial intelligence objects in the game by building a model service cluster (management server + multiple object servers). It can connect a large number of online game battlefields at the same time and provide more intelligent action instructions based on reinforcement learning models. In order to solve the problem of state data communication load, this application sets the logical frame number of artificial intelligence objects and synchronizes the state data in the game to the model service in a hierarchical manner. The synchronization time intervals of each level are different. The state data with longer time intervals reduces the communication load through caching.
[0224] Figure 6 is a block diagram of a control device for an artificial intelligence object provided according to an embodiment of the present application. The control device for the artificial intelligence object is deployed in a management server and can be used to execute the steps of the control method for the artificial intelligence object executed by the above management server, see Figure 6 , the device comprises:
[0225] A first determination module 601 is used to determine at least one artificial intelligence object in the virtual game based on object information sent by the game server when the virtual game is started, the game server is used to manage each participating object in the virtual game, and the object information includes an identifier of the artificial intelligence object in the virtual game;
[0226] A first acquisition module 602 is used to acquire multiple types of status data of the virtual game from the game server according to different acquisition frequencies during the game process of the virtual game, where the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game;
[0227] The second acquisition module 603 is used to call the action prediction model to obtain action information of at least one artificial intelligence object based on multiple types of state data of the virtual game, and the action information is used to indicate the next action to be performed by the at least one artificial intelligence object.
[0228] In some embodiments, the first type of status data among the multiple types of status data is acquired most frequently;
[0229] The second acquisition module 603 includes:
[0230] A processing unit, configured to combine the multiple types of state data used for this prediction based on the first type of state data acquired at the target time and the most recent other type of state data acquired before the target time;
[0231] A prediction unit, used to send the multiple types of state data used in this prediction to the action prediction model to predict the action information of at least one artificial intelligence object;
[0232] The first-category status data acquired at the target time is the latest acquired first-category status data, and the other-category status data is the data other than the first-category status data among the multiple-category status data.
[0233] In some embodiments, the apparatus further comprises:
[0234] The cache module is used to update and cache the second-category status data in other categories of status data after the second-category status data is acquired each time.
[0235] In some embodiments, the device further includes: a second determination module, used to determine the acquisition frequency of the first type of state data based on the performance of the action prediction model corresponding to at least one artificial intelligence object, the performance is used to represent the rate at which the action prediction model predicts action information, and the acquisition frequency of the first type of state data is positively correlated with the performance of the action prediction model; or
[0236] The second determination module is used to determine the frequency of obtaining the first type of status data based on the attribute information of the virtual game, the attribute information includes at least one of the logical frame number of the virtual game, the difficulty level of the virtual game and the display frame rate of the virtual game, and the logical frame number is used to indicate the number of times the state of the artificial intelligence object is updated per unit time in the virtual game.
[0237] In some embodiments, the prediction unit is used to send multiple types of state data used for prediction of any artificial intelligence object in the virtual game to an object server used to control the artificial intelligence object, where an action prediction model of the artificial intelligence object runs on the object server, and the action prediction model is trained based on reinforcement learning; and receive action information of the artificial intelligence object returned by the object server.
[0238] In some embodiments, the object server for controlling the artificial intelligence object is at least one of the following:
[0239] After the virtual game is started, the object server that has completed loading the action prediction model of the artificial intelligence object; or,
[0240] After other virtual games are started and before virtual games are started, the object server that completes the action prediction model of the artificial intelligence object is loaded. The other virtual games have been started before the virtual games are started and have not ended when the virtual games are started. There are also artificial intelligence objects in the other virtual games.
[0241] In some embodiments, the apparatus further comprises:
[0242] A sending module, used for sending control task information to at least one of the multiple object servers based on at least one artificial intelligence object in the virtual game when the virtual game is started, wherein the control task information of each object server is used to instruct the object server to load the action prediction model of each artificial intelligence object to be controlled;
[0243] The third determination module is used to determine the communication connection between the target object server and the game server for the target artificial intelligence object in the virtual game, when the target object server in at least one object server has loaded the action prediction model of the target artificial intelligence object, based on the communication address of the target object server, the identifier of the target artificial intelligence object and the game identifier of the virtual game, the game server is used to provide multiple categories of status data of the virtual game, and the communication connection is used to indicate that the multiple categories of status data of the virtual game are sent to the object server.
[0244] In some embodiments, a sending module is used to send first control task information to a first object server among multiple object servers, where the first object server is any object server among the multiple object servers, and the first control task information is used to instruct the first object server to load action prediction models of multiple artificial intelligence objects in a virtual game; in the process of the first object server loading the action prediction models of multiple artificial intelligence objects, if the remaining load resources of the first object server are lower than the target load resources, then a second control task information is sent to a second object server among the multiple object servers, where the target load resources are the resources required to load the action prediction models of the remaining artificial intelligence objects, and the second control task information is used to instruct the second object server to load the action prediction models of the remaining artificial intelligence objects.
[0245] In some embodiments, the apparatus further comprises:
[0246] A scheduling module is used to send third control task information to a fourth object server among multiple object servers for any artificial intelligence object in a virtual game when a third object server controlling the artificial intelligence object fails, wherein the third control task information is used to instruct the fourth object server to load the action prediction model of the artificial intelligence object; after the fourth object server has loaded the action prediction model of the artificial intelligence object, send multiple categories of status data of the virtual game to the fourth object server, and receive action information predicted by the fourth object server based on the action prediction model of the artificial intelligence object and the multiple categories of status data.
[0247] In some embodiments, the apparatus further comprises:
[0248] A sending module is used to send a destruction instruction to an object server used to control any artificial intelligence object in a virtual game in response to the death of the artificial intelligence object, wherein the destruction instruction is used to instruct the object server to release the load resources occupied by the action prediction model of the artificial intelligence object.
[0249] Figure 7 is a block diagram of another control device for an artificial intelligence object provided according to an embodiment of the present application. The control device for the artificial intelligence object is deployed in the game server and can be used to execute the steps of the control method for the artificial intelligence object executed by the game server. Figure 7 , the device comprises:
[0250] A control module 701 is used to control at least one artificial intelligence object to participate in the virtual game when the virtual game is started;
[0251] An acquisition module 702 is used to acquire multiple types of state data of the virtual game from the virtual game during the game process of the virtual game, where the multiple types of state data of the virtual game are used to indicate the state of each participant in the virtual game;
[0252] A sending module 703 is used to send multiple types of state data of the virtual game to the management server according to different acquisition frequencies, and the management server is used to obtain action information of at least one artificial intelligence object based on the multiple types of state data used in the current prediction, and the action information is used to indicate the action to be performed by the at least one artificial intelligence object next;
[0253] The control module 701 is also used to control at least one artificial intelligence object to perform the action indicated by the action information based on the action information of at least one artificial intelligence object returned by the management server.
[0254] In some embodiments, the sending module 703 is configured to perform at least one of the following:
[0255] Automatically send multiple types of status data of virtual games to the management server according to different acquisition frequencies;
[0256] When receiving acquisition requests sent by the management server at different acquisition frequencies, multiple types of status data of the virtual game are sent to the management server respectively.
[0257] Figure 8 is a block diagram of another artificial intelligence object control device provided according to an embodiment of the present application. The artificial intelligence object control device is deployed in an object server and can be used to execute the steps of the artificial intelligence object control method executed by the above object server. Figure 8 , the device comprises:
[0258] The receiving module 801 is used to receive, during the virtual game, multiple types of status data used for the current prediction sent by the management server, where the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game, and the multiple types of status data of the virtual game are obtained by the management server based on different acquisition frequencies;
[0259] Prediction module 802, used to call the action prediction model to predict the action information of at least one artificial intelligence object based on the multiple types of state data used in this prediction, where the action information is used to indicate the action to be performed next by the at least one artificial intelligence object;
[0260] The sending module 803 is used to return the action information of at least one artificial intelligence object to the management server.
[0261] In some embodiments, the action prediction model is trained based on reinforcement learning;
[0262] The prediction module 802 is used to input multiple types of state data used in the current prediction into the action prediction model of any artificial intelligence object controlled by the object server; through the action prediction model, the multiple types of state data used in the current prediction are processed to output the action information of the artificial intelligence object.
[0263] In some embodiments, the object server stores model files of motion prediction models of multiple artificial intelligence objects;
[0264] The receiving module 801 is further used to receive control task information sent by the management server when the virtual game is started, where the control task information is used to indicate at least one artificial intelligence object to be controlled by the object server;
[0265] The device also includes:
[0266] A loading module is used to load the motion prediction model of at least one artificial intelligence object to be controlled based on the control task information and the model files of multiple artificial intelligence objects.
[0267] In some embodiments, the receiving module 801 is further configured to receive a destruction instruction sent by the management server for any artificial intelligence object in the virtual game when the artificial intelligence object dies;
[0268] The device also includes:
[0269] The processing module is used to release the load resources occupied by the action prediction model of the artificial intelligence object in response to the destruction instruction.
[0270] The control device for any of the above-mentioned artificial intelligence objects provided in the embodiments of the present application, during the game process of a virtual game, uses different acquisition frequencies to synchronize multiple types of status data of the participating objects in the virtual game from the game server to the management server. In each synchronization process, it is not necessary to provide all the status data in the virtual game. The management server only needs to obtain part of the status data. It can predict the action information of at least one artificial intelligence object in the virtual game through an action prediction model based on the currently obtained partial status data and other previously obtained status data. This not only reduces the number of status data obtained by the management server at a single time, reduces the communication load between the game server and the management server, and avoids game freezes due to excessive communication load; and the action information of the artificial intelligence object is based on the multiple types of status data of the virtual game, which also ensures the accuracy of the action information, making the behavior of the artificial intelligence object more realistic and more in line with real-life combat situations.
[0271] Moreover, since the virtual game can be avoided as much as possible, the smoothness of the virtual game and the player's operating experience can be guaranteed; and the actions of the artificial intelligence object are more accurate, which ensures the quality of the battle between the artificial intelligence object and the virtual object controlled by the real object, that is, the quality of the virtual game is guaranteed, which is conducive to improving the game experience and operating level of the real object.
[0272] It should be noted that: when the control device for an artificial intelligence object provided in any of the above embodiments controls the activities of the artificial intelligence object, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the control device for an artificial intelligence object provided in the above embodiments and the control method embodiment of an artificial intelligence object belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.
[0273] The structure of any server among the game server, management server and object server can be as follows: Fig. 9 shown. Fig. 9 It is a structural diagram of a server provided according to an embodiment of the present application. The server 900 may have relatively large differences due to different configurations or performances, and may include one or more processors (Central Processing Units, CPU) 901 and one or more memories 902, wherein the memory 902 stores at least one computer program, and the at least one computer program is loaded and executed by the processor 901 to implement the control method of the artificial intelligence object provided by the above-mentioned various method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input and output interface for input and output. The server may also include other components for implementing device functions, which will not be repeated here.
[0274] The embodiment of the present application also provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is loaded and executed by a processor of a computer device to implement the operation performed by the computer device in the control method of the artificial intelligence object of the above embodiment. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.
[0275] In some embodiments, the computer program involved in the embodiments of the present application may be deployed and executed on a computer device, or on multiple computer devices located at one location, or on multiple computer devices distributed at multiple locations and interconnected by a communication network. Multiple computer devices distributed at multiple locations and interconnected by a communication network may constitute a blockchain system.
[0276] The embodiment of the present application also provides a computer program product, including a computer program, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the control method of the artificial intelligence object provided in the above various optional implementations.
[0277] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0278] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A control method for an artificial intelligence object, characterized in that: Applied to a management server, the method comprises: In the case where a virtual game is started, determining at least one artificial intelligence object in the virtual game based on object information sent by a game server, the game server being used to manage each participating object in the virtual game, the object information including an identifier of the artificial intelligence object in the virtual game; During the game process of the virtual game, multiple types of status data of the virtual game are respectively obtained from the game server according to different acquisition frequencies, and the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game; Based on the multiple types of status data of the virtual game, an action prediction model is called to obtain action information of at least one artificial intelligence object, where the action information is used to indicate the next action to be performed by the at least one artificial intelligence object.
2. The method according to claim 1, characterized in that: The first type of status data among the multiple types of status data has the highest acquisition frequency; The step of calling the action prediction model based on the multiple types of state data of the virtual game to obtain the action information of the at least one artificial intelligence object includes: Based on the first category of state data acquired at the target time and the most recent other category of state data acquired before the target time, combining multiple categories of state data used for this prediction; Sending the multiple types of state data used in the current prediction to the action prediction model to predict the action information of the at least one artificial intelligence object; The first-category status data acquired at the target time is the latest acquired first-category status data, and the other-category status data is data among the multiple-category status data except the first-category status data.
3. The method according to claim 2, characterized in that The method further comprises: For the second type of status data in the other types of status data, after the second type of status data is acquired each time, the second type of status data is updated and cached.
4. The method according to claim 2, characterized in that: The method further comprises at least one of the following: Determine the acquisition frequency of the first type of state data based on the performance of the action prediction model corresponding to the at least one artificial intelligence object, wherein the performance is used to represent the rate at which the action prediction model predicts action information, and the acquisition frequency of the first type of state data is positively correlated with the performance of the action prediction model; or Based on the attribute information of the virtual game, the frequency of obtaining the first type of status data is determined, the attribute information includes at least one of the number of logical frames of the virtual game, the difficulty level of the virtual game and the display frame rate of the virtual game, and the number of logical frames is used to represent the number of times the state of the artificial intelligence object is updated per unit time in the virtual game.
5. The method according to claim 2, characterized in that: The sending of the multiple types of state data used in the current prediction to the action prediction model to predict the action information of the at least one artificial intelligence object includes: For any artificial intelligence object in the virtual game, sending the multiple types of state data used for the current prediction to an object server used to control the artificial intelligence object, wherein an action prediction model of the artificial intelligence object is running on the object server, and the action prediction model is trained based on reinforcement learning; Receive the action information of the artificial intelligence object returned by the object server.
6. The method according to claim 5, characterized in that The object server for controlling the artificial intelligence object is at least one of the following: After the virtual game is started, the object server that has completed loading the action prediction model of the artificial intelligence object; or After other virtual games are started and before the virtual game is started, the object server that completes the action prediction model of the artificial intelligence object is loaded, the other virtual games have been started before the virtual game is started and have not ended when the virtual game is started, and the artificial intelligence object also exists in the other virtual games.
7. The method according to claim 1, characterized in that The method further comprises: When the virtual game is started, based on at least one artificial intelligence object in the virtual game, control task information is respectively sent to at least one object server among a plurality of object servers, wherein the control task information of each object server is used to instruct the object server to load the action prediction model of each artificial intelligence object to be controlled; For the target artificial intelligence object in the virtual game, when the target object server among the at least one object server has completed loading the action prediction model of the target artificial intelligence object, the communication connection between the target object server and the game server is determined based on the communication address of the target object server, the identifier of the target artificial intelligence object and the game identifier of the virtual game, the game server is used to provide multiple categories of status data of the virtual game, and the communication connection is used to instruct to send the multiple categories of status data of the virtual game to the object server.
8. The method according to claim 7, characterized in that The sending of control task information to at least one object server among the plurality of object servers respectively comprises: Sending first control task information to a first object server among the multiple object servers, where the first object server is any object server among the multiple object servers, and the first control task information is used to instruct the first object server to load action prediction models of multiple artificial intelligence objects in the virtual game; During the process of the first object server loading the motion prediction models of the multiple artificial intelligence objects, if the remaining load resources of the first object server are lower than the target load resources, a second control task information is sent to a second object server among the multiple object servers, where the target load resources are the resources required to load the motion prediction models of the remaining artificial intelligence objects, and the second control task information is used to instruct the second object server to load the motion prediction models of the remaining artificial intelligence objects.
9. The method according to claim 7, characterized in that: The method further comprises: For any artificial intelligence object in the virtual game, when a third object server controlling the artificial intelligence object fails, third control task information is sent to a fourth object server among the multiple object servers, wherein the third control task information is used to instruct the fourth object server to load the action prediction model of the artificial intelligence object; After the fourth object server loads the action prediction model of the artificial intelligence object, the multiple categories of status data of the virtual game are sent to the fourth object server, and the action information predicted by the fourth object server based on the action prediction model of the artificial intelligence object and the multiple categories of status data is received.
10. The method according to claim 7, characterized in that The method further comprises: For any artificial intelligence object in the virtual game, in response to the death of the artificial intelligence object, a destruction instruction is sent to the object server used to control the artificial intelligence object, and the destruction instruction is used to instruct the object server to release the load resources occupied by the action prediction model of the artificial intelligence object.
11. A control method for an artificial intelligence object, characterized in that: Applied to a game server, the method comprises: When a virtual game is started, controlling at least one artificial intelligence object to participate in the virtual game; During the virtual game, multiple types of status data of the virtual game are obtained from the virtual game, where the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game; According to different acquisition frequencies, the multiple types of state data of the virtual game are respectively sent to the management server, and the management server is used to obtain the action information of the at least one artificial intelligence object based on the multiple types of state data used in the current prediction, and the action information is used to indicate the action to be performed by the at least one artificial intelligence object next; Based on the action information of the at least one artificial intelligence object returned by the management server, the at least one artificial intelligence object is controlled to perform the action indicated by the action information.
12. The method according to claim 11, characterized in that The sending of the multiple types of status data of the virtual game to the management server respectively according to different acquisition frequencies includes at least one of the following: Automatically sending multiple types of status data of the virtual game to the management server according to different acquisition frequencies; or, When receiving acquisition requests sent by the management server at different acquisition frequencies, multiple types of status data of the virtual game are sent to the management server respectively.
13. A control method for an artificial intelligence object, characterized in that: Applied to an object server, the method comprises: During the virtual game, receiving multiple types of status data used for the current prediction sent by the management server, wherein the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game, and the multiple types of status data of the virtual game are obtained by the management server based on different acquisition frequencies; Based on the multiple types of state data used in this prediction, calling the action prediction model to predict the action information of at least one artificial intelligence object, the action information is used to indicate the action to be performed by the at least one artificial intelligence object next; Returning action information of the at least one artificial intelligence object to the management server.
14. A control system for an artificial intelligence object, characterized in that: The system comprises a counterpart server, a management server and a plurality of object servers, wherein the counterpart server and the plurality of object servers are communicatively connected via the management server; The game server is used to control at least one artificial intelligence object to participate in the virtual game when the virtual game is started, and to obtain multiple types of status data of the virtual game from the virtual game during the game process of the virtual game, and to send the multiple types of status data of the virtual game to the management server respectively according to different acquisition frequencies, wherein the multiple types of status data of the virtual game are used to indicate the status of each participating object in the virtual game; The management server is used to receive multiple types of status data of the virtual game at different acquisition frequencies, and send the multiple types of status data used for the current prediction to at least one object server used to control at least one artificial intelligence object in the virtual game; The at least one object server is used to predict action information of at least one artificial intelligence object in the virtual game based on the multiple types of state data used in the current prediction, wherein the action information is used to indicate the action to be performed next by the at least one artificial intelligence object; The management server is further configured to send the action information returned by the at least one object server to the counterpart server; The game server is also used to control at least one artificial intelligence object in the virtual game to perform the action indicated by the action information.
15. A control device for an artificial intelligence object, characterized in that: Deployed on a management server, the device includes: A first determination module is used to determine at least one artificial intelligence object in the virtual game based on object information sent by a game server when the virtual game is started, wherein the game server is used to manage each participating object in the virtual game, and the object information includes an identifier of the artificial intelligence object in the virtual game; A first acquisition module is used to respectively acquire, during the game process of the virtual game, multiple types of status data of the virtual game from the game server according to different acquisition frequencies, wherein the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game; The second acquisition module is used to call the action prediction model to obtain the action information of the at least one artificial intelligence object based on the multiple types of state data of the virtual game, and the action information is used to indicate the next action to be performed by the at least one artificial intelligence object.
16. A control device for an artificial intelligence object, characterized in that: Deployed on the game server, the device includes: A control module, used for controlling at least one artificial intelligence object to participate in the virtual game when the virtual game is started; an acquisition module, configured to acquire, during the game process of the virtual game, multiple types of status data of the virtual game from the virtual game, wherein the multiple types of status data of the virtual game are used to indicate the status of each participant in the virtual game; A sending module, used for sending the multiple types of status data of the virtual game to the management server respectively according to different acquisition frequencies, and the management server is used to obtain the action information of the at least one artificial intelligence object based on the multiple types of status data used in the current prediction, and the action information is used to indicate the action to be performed by the at least one artificial intelligence object next; The control module is also used to control the at least one artificial intelligence object to perform the action indicated by the action information based on the action information of the at least one artificial intelligence object returned by the management server.
17. A control device for an artificial intelligence object, characterized in that: Deployed on an object server, the device comprises: A receiving module, used for receiving, during the virtual game, a plurality of status data used for the current prediction sent by the management server, wherein the plurality of status data of the virtual game is used to indicate the status of each participant in the virtual game, and the plurality of status data of the virtual game is obtained by the management server based on different acquisition frequencies; A prediction module, used to call an action prediction model to predict action information of at least one artificial intelligence object based on the multiple types of state data used in this prediction, wherein the action information is used to indicate the action to be performed next by the at least one artificial intelligence object; A sending module is used to return the action information of the at least one artificial intelligence object to the management server.
18. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory is used to store at least one computer program, and the at least one computer program is loaded by the processor and executes the control method of the artificial intelligence object according to any one of claims 1 to 13.
19. A computer-readable storage medium, characterized in that: The computer-readable storage medium is used to store at least one computer program, and the at least one computer program is used to execute the control method of the artificial intelligence object according to any one of claims 1 to 13.
20. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the control method of the artificial intelligence object according to any one of claims 1 to 13 is implemented.