Avoidance method and device for game AI, storage medium and computer equipment

文档序号:837703 发布日期:2021-04-02 浏览:14次 中文

阅读说明:本技术 游戏ai的躲避方法、装置、存储介质及计算机设备 (Avoidance method and device for game AI, storage medium and computer equipment ) 是由 孙誉玮 于 2021-01-08 设计创作,主要内容包括:本申请实施例公开了一种游戏AI的躲避方法、装置、存储介质及计算机设备。该方法包括:以游戏AI当前所在位置为二维坐标系的原点,将虚拟追赶角色与游戏AI的活动范围象限化为二维坐标系中的四个象限;当游戏AI与虚拟追赶角色之间的距离为第一距离时,确定将虚拟追赶角色所在象限的对角象限作为游戏AI躲避虚拟追赶角色的第一目标象限;若第一目标象限不存在第一可躲避平面域块,则根据第二目标象限中平面域块的属性,控制游戏AI逃离至第二目标象限以躲避虚拟追赶角色。本申请实施例提供的技术方案使得游戏AI躲避的方式更加灵活多变。(The embodiment of the application discloses an avoidance method and device of a game AI, a storage medium and computer equipment. The method comprises the following steps: with the current position of the game AI as the origin of a two-dimensional coordinate system, the activity ranges of the virtual chasing role and the game AI are quadrant into four quadrants in the two-dimensional coordinate system; when the distance between the game AI and the virtual chasing role is a first distance, determining that the opposite angle quadrant of the quadrant in which the virtual chasing role is located is used as a first target quadrant of the game AI for avoiding the virtual chasing role; and if the first target quadrant does not have the first evaluable plane domain block, controlling the game AI to escape to the second target quadrant according to the attribute of the plane domain block in the second target quadrant so as to avoid the virtual pursuit role. The technical scheme provided by the embodiment of the application enables the mode of game AI evasion to be more flexible and changeable.)

1. An avoidance method of a game AI, comprising:

with the current position of a game AI as the origin of a two-dimensional coordinate system, the virtual catch-up role and the activity range of the game AI are divided into four quadrants in the two-dimensional coordinate system;

when the distance between the game AI and the virtual chasing character is a first distance, determining that a diagonal quadrant of a quadrant in which the virtual chasing character is located is used as a first target quadrant for the game AI to avoid the virtual chasing character, wherein the first distance is not greater than a preset distance threshold;

and if the first target quadrant does not have the first evasive plane domain block, controlling the game AI to escape to the second target quadrant to avoid the virtual chasing role according to the attribute of the plane domain block in the second target quadrant, wherein the second target quadrant comprises any quadrant except the quadrant where the virtual chasing role is located.

2. An evading method for a game AI according to claim 1, wherein the controlling the game AI to escape to the second target quadrant to avoid the virtual catch-up character according to the attributes of the plane field block in the second target quadrant comprises:

searching for a flat domain block in the second target quadrant;

if the second target quadrant has a connected plane area block with a connected unit inside, calculating the safety degree of the connected plane area block according to the attribute of the connected plane area block, and determining the connected plane area block with the safety degree not less than a preset safety threshold as a third evasive plane area block of the game AI;

and selecting an avoidance scheme matched with the geometric attributes to avoid the virtual pursuit role according to the geometric attributes of the third avoidable plane domain block.

3. An evasive method for a game AI according to claim 2, wherein the calculating a security degree of the connected plane domain block according to the attribute of the connected plane domain block, and determining the connected plane domain block whose security degree is not less than a preset security threshold as a third evasive plane domain block of the game AI includes:

acquiring at least one of blood volume information of the game AI and teammates of the game AI in the connected plane domain block, number information of connected units in the connected plane domain block, a distance ratio and number information of safety platforms in the connected plane domain block, wherein the distance ratio is a ratio of a distance from the virtual chasing character to the connected plane domain block to a distance from the game AI to the connected plane domain block;

according to the blood volume information, the number information of the connected units, the distance ratio and the number information of the safety platforms, respectively assigning corresponding score values to at least one of the blood volume information, the number information of the connected units, the distance ratio and the number information of the safety platforms;

calculating a safe total score of the connected plane domain block according to the score and a weight of at least one of the blood volume information, the number information of the connected units, the distance ratio and the number information of the safe platforms;

and determining the connected plane domain block with the safe total score not less than a preset safe threshold value as a third evasive plane domain block of the game AI.

4. An avoidance method for a game AI according to claim 2, characterized in that the method further comprises:

and if the second target quadrant only has the non-connected plane domain block, determining a safety platform in the second target quadrant as a target platform for avoiding the virtual pursuit role.

5. An avoidance method for a game AI according to claim 3 or 4, characterized in that the security platform is determined by:

acquiring the attack heat of all platforms in the second target quadrant by the virtual chasing role when supporting the game AI;

and determining the platform with the heat degree not greater than a preset heat degree value in the second target quadrant as the safety platform.

6. An avoidance method for a game AI according to claim 2, characterized in that the method further comprises:

if the second target quadrant only has a non-connected plane area block, determining whether the non-connected plane area block has a platform;

if the non-connected plane domain block does not have a platform, calculating the safety degree of the connected plane domain block in the quadrant in which the virtual chasing role is located according to the attribute of the connected plane domain block in the quadrant in which the virtual chasing role is located;

and determining the connected plane domain block with the safety degree of the connected plane domain block in the quadrant in which the virtual chasing role is positioned not less than the preset safety threshold as a fourth evasive plane domain block of the game AI.

7. An avoidance method for a game AI according to claim 1, characterized in that the method further comprises:

and when the distance between the game AI and the virtual catch-up character is a second distance, controlling the game AI to escape to a second evasive plane area block to avoid the virtual catch-up character, wherein the second distance is greater than the preset distance threshold value, and at least one plane area block with the safety degree smaller than the preset safety threshold value exists between the second evasive plane area block and the position of the game AI.

8. An evading method for a game AI according to claim 7, wherein said controlling the game AI to escape to a second evadable planar area block to evade the virtual catch-up character comprises:

excluding all plane area blocks with the safety degree smaller than a preset safety threshold value from the position of the game AI to the second evasive plane area block to obtain passable plane area blocks;

searching the plane domain block from the position of the game AI in the passable plane domain block to the second avoidable plane domain block based on a breadth-first traversal scheme to form a reachable path;

and controlling the game AI to escape to the second evasive plane area block according to the reachable path.

9. An avoidance method for a game AI according to claim 7, characterized in that the method further comprises:

calculating the communication relation of platforms in all the plane area blocks between the position of the game AI and the second avoidable plane area block;

according to the calculated communication relation, all the plane domain blocks between the position of the game AI and the second avoidable plane domain block are divided again, so that the platforms of the same plane domain block in the plane domain blocks after being divided again are in strong communication;

and calculating the communication relation of the plane domain blocks in the plane domain blocks after the plane domain blocks are re-divided according to the strong communication relation of the platforms in the plane domain blocks after the plane domain blocks are re-divided.

10. An avoidance apparatus for a game AI, comprising:

the quadrant module is used for taking the current position of the game AI as the origin of a two-dimensional coordinate system and quadrant the virtual catch-up role and the activity range of the game AI into four quadrants in the two-dimensional coordinate system;

a first determining module, configured to determine, when a distance between the game AI and the virtual catch-up character is a first distance, that a diagonal quadrant of a quadrant in which the virtual catch-up character is located is used as a first target quadrant for the game AI to avoid the virtual catch-up character, where the first distance is not greater than a preset distance threshold;

and the first control module is used for controlling the game AI to escape to the second target quadrant to avoid the virtual chasing role according to the attribute of the plane domain block in the second target quadrant if the first target quadrant does not have the first avoidable plane domain block, and the second target quadrant comprises any quadrant except the quadrant in which the virtual chasing role is positioned.

11. A computer-readable storage medium, characterized in that it stores a computer program adapted to be loaded by a processor for performing the steps of the evasive method of game AI according to any one of claims 1 to 9.

12. A computer device, characterized in that the computer device comprises a memory in which a computer program is stored and a processor that executes the steps in the dodging method of the game AI according to any one of claims 1 to 9 by calling the computer program stored in the memory.

Technical Field

The present application relates to the field of computer technologies, and in particular, to the field of electronic games, and in particular, to a method and an apparatus for avoiding AI games, a storage medium, and a computer device.

Background

Game AI (Artificial Intelligence), is an anthropomorphic character controlled by a computer program in a competitive game. In designing or controlling the game AI, it is not the sole purpose to win in the game play. Thus, broadly speaking, an anthropomorphic character that gives a game player some degree of intelligence during the game, making the game more engaging, challenging and/or playful, may be referred to as a game AI.

In evasive games, existing methods for evasive game AI are often based on simple evasive logic, for example, when a pursuing virtual character is in danger, the pursued virtual character (here, the pursued virtual character may be a game AI or a non-AI character in the game) may randomly select an evasive location, or, when the pursuing virtual character attacks or is within the attack range, the pursued virtual character passively jumps over to avoid pursuit.

However, the above existing evasive methods may not achieve the desired effect, for example, randomly selecting an evasive location, as if it were a panic in real life, may collide with the pursuit virtual character head-on, and jump passively, and may fall into the attack range of the pursuit character again. In this case, the player who handles the game AI may frequently encounter the dilemma of evasion failure, bringing about a great deal of hit to the player's confidence.

Disclosure of Invention

The embodiment of the application provides an avoidance method and device for a game AI, a storage medium and computer equipment, which can reasonably avoid logic and avoid pursuing and/or attacking of pursuing a virtual character.

The embodiment of the application provides an avoidance method of a game AI, which comprises the following steps:

with the current position of a game AI as the origin of a two-dimensional coordinate system, the virtual catch-up role and the activity range of the game AI are divided into four quadrants in the two-dimensional coordinate system;

when the distance between the game AI and the virtual chasing character is a first distance, determining that a diagonal quadrant of a quadrant in which the virtual chasing character is located is used as a first target quadrant for the game AI to avoid the virtual chasing character, wherein the first distance is not greater than a preset distance threshold;

and if the first target quadrant does not have the first evasive plane domain block, controlling the game AI to escape to the second target quadrant to avoid the virtual chasing role according to the attribute of the plane domain block in the second target quadrant, wherein the second target quadrant comprises any quadrant except the quadrant where the virtual chasing role is located.

Optionally, the controlling, according to the attribute of the plane domain block in the second target quadrant, the game AI to escape to the second target quadrant to avoid the virtual catch-up character includes: searching for a flat domain block in the second target quadrant; if the second target quadrant has a connected plane area block with a connected unit inside, calculating the safety degree of the connected plane area block according to the attribute of the connected plane area block, and determining the connected plane area block with the safety degree not less than a preset safety threshold as a third evasive plane area block of the game AI; and selecting an avoidance scheme matched with the geometric attributes to avoid the virtual pursuit role according to the geometric attributes of the third avoidable plane domain block.

Optionally, the calculating a security degree of the connected plane domain block according to the attribute of the connected plane domain block, and determining the connected plane domain block of which the security degree is not less than a preset security threshold as a third evasive plane domain block of the game AI includes: acquiring at least one of blood volume information of the game AI and teammates of the game AI in the connected plane area block, number information of connected units in the connected plane area block, distance ratio and number information of safety platforms in the connected plane area block; according to the blood volume information, the number information of the connected units, the distance ratio and the number information of the safety platforms, respectively assigning corresponding score values to at least one of the blood volume information, the number information of the connected units, the distance ratio and the number information of the safety platforms; calculating a safe total score of the connected plane domain block according to the score and a weight of at least one of the blood volume information, the number information of the connected units, the distance ratio and the number information of the safe platforms; and determining the connected plane domain block with the safe total score not less than a preset safe threshold value as a third evasive plane domain block of the game AI, wherein the distance ratio is the ratio of the distance from the virtual chasing character to the connected plane domain block to the distance from the game AI to the connected plane domain block.

Optionally, the method further comprises: and if the second target quadrant only has the non-connected plane domain block, determining a safety platform in the second target quadrant as a target platform for avoiding the virtual pursuit role.

Optionally, the secure platform is determined by: acquiring the attack heat of all platforms in the second target quadrant by the virtual chasing role when supporting the game AI; and determining the platform with the heat degree not greater than a preset heat degree value in the second target quadrant as the safety platform.

Optionally, the method further comprises: if the second target quadrant only has a non-connected plane area block, determining whether the non-connected plane area block has a platform; if the non-connected plane domain block does not have a platform, calculating the safety degree of the connected plane domain block in the quadrant in which the virtual chasing role is located according to the attribute of the connected plane domain block in the quadrant in which the virtual chasing role is located; and determining the connected plane domain block with the safety degree of the connected plane domain block in the quadrant in which the virtual chasing role is positioned not less than the preset safety threshold as a fourth evasive plane domain block of the game AI.

Optionally, the method further comprises: and when the distance between the game AI and the virtual catch-up character is a second distance, controlling the game AI to escape to a second evasive plane area block to avoid the virtual catch-up character, wherein the second distance is greater than the preset distance threshold value, and at least one plane area block with the safety degree smaller than the preset safety threshold value exists between the second evasive plane area block and the position of the game AI.

Optionally, the controlling the game AI to escape to a second evasive planar area block to avoid the virtual catch-up character includes: excluding all plane area blocks with the safety degree smaller than a preset safety threshold value from the position of the game AI to the second evasive plane area block to obtain passable plane area blocks; searching the plane domain block from the position of the game AI in the passable plane domain block to the second avoidable plane domain block based on a breadth-first traversal scheme to form a reachable path; and controlling the game AI to escape to the second evasive plane area block according to the reachable path.

Optionally, the method further comprises: calculating the communication relation of platforms in all the plane area blocks between the position of the game AI and the second avoidable plane area block; according to the calculated communication relation, all the plane domain blocks between the position of the game AI and the second avoidable plane domain block are divided again, so that the platforms of the same plane domain block in the plane domain blocks after being divided again are in strong communication; and calculating the communication relation of the plane domain blocks in the plane domain blocks after the plane domain blocks are divided again according to the communication relation of the platforms in the plane domain blocks after the plane domain blocks are divided again.

An embodiment of the present application further provides an avoidance device for a game AI, including:

the quadrant module is used for taking the current position of the game AI as the origin of a two-dimensional coordinate system and quadrant the virtual catch-up role and the activity range of the game AI into four quadrants in the two-dimensional coordinate system;

a first determining module, configured to determine, when a distance between the game AI and the virtual catch-up character is a first distance, that a diagonal quadrant of a quadrant in which the virtual catch-up character is located is used as a first target quadrant for the game AI to avoid the virtual catch-up character, where the first distance is not greater than a preset distance threshold;

and the first control module is used for controlling the game AI to escape to the second target quadrant to avoid the virtual chasing role according to the attribute of the plane domain block in the second target quadrant if the first target quadrant does not have the first avoidable plane domain block, and the second target quadrant comprises any quadrant except the quadrant in which the virtual chasing role is positioned.

An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored, where the computer program is suitable for being loaded by a processor to perform the steps in the game AI evading method according to any of the above embodiments.

An embodiment of the present application further provides a computer device, where the computer device includes a memory and a processor, where the memory stores a computer program, and the processor executes, by calling the computer program stored in the memory, the steps in the game AI hiding method according to any of the above embodiments.

It can be known from the technical solutions provided in the embodiments of the present application that the activity ranges of the virtual catch-up character and the game AI are divided into four quadrants in a two-dimensional coordinate system, and different target quadrants or hiding spaces are selected according to different distances between the game AI and the virtual catch-up character, and particularly, when there is no first hiding plane domain block in a diagonal quadrant of the quadrant in which the virtual catch-up character is located, the game AI is controlled to escape to the second target quadrant to hide the virtual catch-up character according to attributes of the plane domain block in the second target quadrant, so that the hiding manner of the game AI is more flexible and changeable, the winning rate of the game AI in the extranet is optimized, the game interest and challenge of the player are improved, the balance of the game AI and the virtual catch-up character corresponding to the player segment position can be controlled, and the stickiness and activity of the player are increased.

Drawings

In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic system diagram of an avoidance device of a game AI according to an embodiment of the present disclosure.

Fig. 2 is a schematic flow chart of an avoidance method of a game AI according to an embodiment of the present disclosure.

Fig. 3a is a schematic diagram of the virtual catch-up character and the activity range of the game AI being quadrant into four quadrants in a two-dimensional coordinate system according to the embodiment of the present application.

Fig. 3b is a schematic diagram of the virtual catch-up character and the activity range of the game AI being quadrant into four quadrants in a two-dimensional coordinate system according to another embodiment of the present application.

Fig. 4 is a thermodynamic diagram generated according to a game AI historically located on a platform and attacked by a virtual chasing character according to an embodiment of the present application.

Fig. 5 is a schematic structural diagram of an avoidance device of a game AI according to an embodiment of the present application.

Fig. 6 is a schematic structural diagram of an avoiding device of a game AI according to another embodiment of the present application.

Fig. 7 is a schematic structural diagram of an avoiding device of a game AI according to another embodiment of the present application.

Fig. 8a is a schematic structural diagram of an avoiding device of a game AI according to another embodiment of the present application.

Fig. 8b is a schematic structural diagram of an avoiding device of a game AI according to another embodiment of the present application.

Fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application.

Detailed Description

The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.

The embodiment of the application provides an avoidance method and device of a game AI, a storage medium and computer equipment. Specifically, the avoidance method of the game AI according to the embodiment of the present application may be executed by a computer device, where the computer device may be a terminal or a server. The terminal may be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like, and the terminal device may further include a client, where the client may be a game application client, a browser client carrying a game program, or an instant messaging client, and the like. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and a big data and artificial intelligence platform.

For example, when the evasive method of the game AI is run in a terminal, a terminal device stores a game application and is used for presenting a virtual scene in a game screen. The terminal device is used for interacting with a user through a graphical user interface, for example, downloading and installing a game application program through the terminal device and running the game application program. The manner in which the terminal device provides the graphical user interface to the user may include a variety of ways, for example, the graphical user interface may be rendered for display on a display screen of the terminal device or presented by holographic projection. For example, the terminal device may include a touch display screen for presenting a graphical user interface including a game screen and receiving operation instructions generated by a user acting on the graphical user interface, and a processor for executing the game, generating the graphical user interface, responding to the operation instructions, and controlling display of the graphical user interface on the touch display screen.

For example, when the evasive method of the game AI is run on a server, it may be a cloud game. Cloud gaming refers to a gaming regime based on cloud computing. In the running mode of the cloud game, the running main body of the game application program and the game picture presenting main body are separated, and the storage and the running of the hiding method of the game AI are finished on the cloud game server. The game screen presentation is performed at a cloud game client, which is mainly used for receiving and sending game data and presenting the game screen, for example, the cloud game client may be a display device with a data transmission function near a user side, such as a mobile terminal, a television, a computer, a palm computer, a personal digital assistant, and the like, but a terminal device for performing game data processing is a cloud game server at the cloud end. When a game is played, a user operates the cloud game client to send an operation instruction to the cloud game server, the cloud game server runs the game according to the operation instruction, data such as game pictures and the like are encoded and compressed, the data are returned to the cloud game client through a network, and finally the data are decoded through the cloud game client and the game pictures are output.

Referring to fig. 1, fig. 1 is a schematic system diagram of an avoiding device of a game AI according to an embodiment of the present application. The system may include at least one terminal 1000, at least one server 2000, at least one database 3000, and a network 4000. The terminal 1000 held by the user can be connected to servers of different games through the network 4000. Terminal 1000 can be any device having computing hardware capable of supporting and executing a software product corresponding to a game. In addition, terminal 1000 can have one or more multi-touch sensitive screens for sensing and obtaining user input through touch or slide operations performed at multiple points on one or more touch sensitive display screens. In addition, when the system includes a plurality of terminals 1000, a plurality of servers 2000, and a plurality of networks 4000, different terminals 1000 may be connected to each other through different networks 4000 and through different servers 2000. The network 4000 may be a wireless network or a wired network, such as a Wireless Local Area Network (WLAN), a Local Area Network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, and so on. In addition, different terminals 1000 may be connected to other terminals or a server using their own bluetooth network or hotspot network. For example, a plurality of users may be online through different terminals 1000 to be connected and synchronized with each other through a suitable network to support multiplayer games. In addition, the system may include a plurality of databases 3000, the plurality of databases 3000 being coupled to different servers 2000, and information related to the game environment may be continuously stored in the databases 3000 when different users play the multiplayer game online.

The embodiment of the application provides an avoidance method of a game AI, which can be executed by a terminal or a server. The embodiment of the present application is described by taking an example in which a method for avoiding an AI game is executed by a terminal. The terminal comprises a touch display screen and a processor, wherein the touch display screen is used for presenting a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface. When a user operates the graphical user interface through the touch display screen, the graphical user interface can control the local content of the terminal through responding to the received operation instruction, and can also control the content of the opposite-end server through responding to the received operation instruction. For example, the operation instruction generated by the user acting on the graphical user interface comprises an instruction for starting a game application, and the processor is configured to start the game application after receiving the instruction provided by the user for starting the game application. Further, the processor is configured to render and draw a graphical user interface associated with the game on the touch display screen. A touch display screen is a multi-touch sensitive screen capable of sensing a touch or slide operation performed at a plurality of points on the screen at the same time. The user uses a finger to perform touch operation on the graphical user interface, and when the graphical user interface detects the touch operation, different virtual objects in the graphical user interface of the game are controlled to perform actions corresponding to the touch operation. For example, the game may be any one of a leisure game, an action game, a role-playing game, a strategy game, a sports game, a game of chance, and the like. Wherein the game may include a virtual scene of the game drawn on a graphical user interface. Further, one or more virtual objects, such as virtual characters, controlled by the user (or player) may be included in the virtual scene of the game. Additionally, one or more obstacles, such as railings, ravines, walls, etc., may also be included in the virtual scene of the game to limit movement of the virtual objects, e.g., to limit movement of one or more objects to a particular area within the virtual scene. Optionally, the virtual scene of the game also includes one or more elements, such as skills, points, character health, energy, etc., to provide assistance to the player, provide virtual services, increase points related to player performance, etc. In addition, the graphical user interface may also present one or more indicators to provide instructional information to the player. For example, a game may include a player-controlled virtual object and one or more other virtual objects (such as enemy characters). In one embodiment, one or more other virtual objects are controlled by other players of the game. For example, one or more other virtual objects may be computer controlled, such as a robot using Artificial Intelligence (AI) algorithms, to implement a human-machine fight mode. For example, the virtual objects possess various skills or capabilities that the game player uses to achieve the goal. For example, the virtual object possesses one or more weapons, props, tools, etc. that may be used to eliminate other objects from the game. Such skills or capabilities may be activated by a player of the game using one of a plurality of preset touch operations with a touch display screen of the terminal. The processor may be configured to present a corresponding game screen in response to an operation instruction generated by a touch operation of a user.

Please refer to fig. 2, which is a schematic flow chart of a game AI hiding method according to an embodiment of the present application, mainly including steps S201 to S203, which is described in detail as follows:

in step S201, the current position of the game AI is taken as the origin of the two-dimensional coordinate system, and the active ranges of the virtual catch-up character and the game AI are quadrant-converted into four quadrants in the two-dimensional coordinate system.

In the embodiment of the present application, the virtual chasing character and the game AI are a chasing character and a chased character in a evasive game, respectively, for example, in an evasive game such as a cat and a mouse, the cat is the virtual chasing character, and the mouse is the chased character or the game AI, which generally needs to be in a state of chasing or attacking in the evasive game. The game AI may be a character that is operated by a player of a game novice, or may be a character that is completely controlled by a computer program, and may be a partner training of a player who operates a virtual catch-up character when the game AI is confronted with the virtual catch-up character. In order to locate the virtual catch-up character and the game AI, in the embodiment of the present application, the current position of the game AI is the origin of the two-dimensional coordinate system, and the active ranges of the virtual catch-up character and the game AI are divided into four quadrants in the two-dimensional coordinate system, as shown in fig. 3a, where the edge of the largest frame is the boundary between the active ranges of the virtual catch-up character (represented by the frame 301 in the figure) and the game AI (represented by the frame 302 in the figure), or the inside of the largest frame is the active ranges of the virtual catch-up character and the game AI.

It should be noted that fig. 3a illustrates an example of the position of the game AI at the current time. In fact, the two-dimensional coordinate system illustrated in fig. 3a is moving, that is, the two-dimensional coordinate system moves with the movement of the game AI, but the game AI is always at the origin of the two-dimensional coordinate system, or the current position of the game AI is always taken as the origin of the two-dimensional coordinate system. For example, the origin (denoted by O 'in the figure) of the two-dimensional coordinate system illustrated in fig. 3a is the current position of the game AI, and if the game AI needs to escape to a certain point (denoted by O in the figure) of the two-dimensional coordinate system illustrated in fig. 3a at a certain time t, the origin of the two-dimensional coordinate system varies with the movement of the game AI from the current time to the time t, and when the time t arrives, the origin of the two-dimensional coordinate system illustrated in fig. 3a changes from the point denoted by O' in the figure to the origin of the two-dimensional coordinate system at the time t (denoted by O in the figure), as shown in fig. 3b (the dotted line in the figure is the two-dimensional coordinate system illustrated in fig. 3 a). Since the origin of the two-dimensional coordinate system changes from time to time, a plane domain block (a rectangular box indicated by a grid line in the drawing) in a quadrant of the two-dimensional coordinate system at a certain time may be in another quadrant of the two-dimensional coordinate system at the next time, for example, a room in the active range of the virtual chasing character and the game AI may be in another quadrant of the two-dimensional coordinate system at the next time, or a plane domain block (i.e., the plane domain block is divided by two quadrants) in two quadrants of the two-dimensional coordinate system at a certain time, and is in a quadrant of the two-dimensional coordinate system at the next time, which is an example of converting the active range of the virtual chasing character and the game AI into four quadrants of the two-dimensional coordinate system, and of course, there are other examples. In other words, once the active range of the virtual catch-up character and the game AI is quadrant into four quadrants in the two-dimensional coordinate system, there is randomness in which one or different portions of the one or different tiles in the active range are located in which quadrant, which varies with the origin of the two-dimensional coordinate system.

Step S202, when the distance between the game AI and the virtual catch-up character is a first distance, determining that the opposite angle quadrant of the quadrant in which the virtual catch-up character is located is used as a first target quadrant for the game AI to avoid the virtual catch-up character, wherein the first distance is not greater than a preset distance threshold.

In the embodiment of the present application, the preset distance threshold may be a preset safety distance, that is, when the distance between the game AI and the virtual catch-up character is less than or equal to the safety distance, it means that the game AI is in danger of being captured or attacked by the virtual catch-up character. As shown in fig. 3a or fig. 3b, when the distance between the game AI and the virtual chasing character is short, the opposite corner quadrant of the quadrant in which the virtual chasing character is located is a safer quadrant relative to the adjacent quadrant of the quadrant in which the virtual chasing character is located (for example, when the quadrant in which the virtual chasing character is located is the third quadrant, the second quadrant and the fourth quadrant are adjacent to the quadrant in which the virtual chasing character is located), and therefore, when the distance between the game AI and the virtual chasing character is the first distance, it is determined that the opposite corner quadrant in which the virtual chasing character is located is the first target quadrant in which the game AI avoids the virtual chasing character, and at this time, the game AI should be controlled to escape to the first target quadrant. The diagonal quadrant of the quadrant in which the virtual chasing character is located means that if the quadrant in which the virtual chasing character is located is the first quadrant, the diagonal quadrant of the quadrant in which the virtual chasing character is located is the third quadrant, if the quadrant in which the virtual chasing character is located is the second quadrant, the diagonal quadrant in which the virtual chasing character is located is the fourth quadrant, or if the quadrant in which the virtual chasing character is located is the third quadrant, the diagonal quadrant in which the virtual chasing character is located is the first quadrant, if the quadrant in which the virtual chasing character is located is the fourth quadrant, the diagonal quadrant in which the virtual chasing character is located is the second quadrant, and so on.

Step S203, if the first target quadrant has no first evadable plane area block, controlling the game AI to escape to a second target quadrant to avoid the virtual chasing role according to the attribute of the plane area block in the second target quadrant, wherein the second target quadrant comprises any quadrant except the quadrant where the virtual chasing role is located.

In the embodiment of the present application, the plane domain block belongs to a plane area within the active range of the virtual chasing character and the game AI, which can be avoided by the game AI, for example, a room in an avoiding type game can be regarded as an example of the plane domain block. The second target quadrant in the embodiment of the present application may be any quadrant except the quadrant in which the virtual chasing role is located in the two-dimensional coordinate system. Taking fig. 3a as an example, when the virtual catch-up character is located at the third quadrant, the second target quadrant may be the first quadrant, the second quadrant, or the fourth quadrant in the two-dimensional coordinate system, and when the virtual catch-up character is located at the second quadrant, the second target quadrant may be the first quadrant, the third quadrant, or the fourth quadrant in the two-dimensional coordinate system, and so on. If the first target quadrant, i.e. the quadrant opposite to the quadrant in which the virtual chasing character is located, does not have the first evasive plane area block, then the game AI can be controlled to escape to the second target quadrant to avoid the virtual chasing character according to the attribute of the plane area block in the second target quadrant.

As an embodiment of the present application, if the first evasive plan area block does not exist in the first target quadrant in step S203, controlling the game AI to escape to the second target quadrant to avoid the virtual catch-up character according to the attribute of the plan area block in the second target quadrant may be implemented by steps S2031 to S2033 as follows:

step S2031: a flat domain block in the second target quadrant is searched.

When searching for the plane domain block in the second target quadrant, the algorithm may be traversed with breadth first to search for the plane domain block in the second target quadrant, or the algorithm may be traversed with depth first to search for the plane domain block in the second target quadrant, which is not limited in this application. As for the flat domain block, as described above, an example thereof may be a room within the range of activity of the virtual catch-up character and game AI in the avoidance-like game.

Step S2032: and if the second target quadrant has a connected plane domain block with a connected unit inside, calculating the safety degree of the connected plane domain block according to the attribute of the connected plane domain block, and determining the connected plane domain block with the safety degree not less than a preset safety threshold as a third evasive plane domain block of the game AI.

In the embodiment of the present application, if a plane domain block has a connected unit inside it, the plane domain block is a so-called connected plane domain block, or if a plane domain block has a smaller, connectable plane domain block inside it, the plane domain block is a connected plane domain block. In this sense, a connected component is actually a connectable flat domain block within a large connected flat domain block. As for the definition of "communication" here, the meaning of the communication is the same as that in the graph theory, and the embodiment of the present application is not described in detail. As an embodiment of the present application, calculating the security level of the connected plane domain block according to the attribute of the connected plane domain block, and determining the connected plane domain block having the security level not less than the preset security threshold as the third evasive plane domain block of the game AI may be implemented through the following steps S1 to S4, which are described as follows:

step S1: and acquiring at least one of blood volume information of the game AI and the teammates of the game AI in the connected plane area block, the number information of the connected units in the connected plane area block, a distance ratio and the number information of the safety platforms in the connected plane area block, wherein the distance ratio is the ratio of the distance from the virtual chasing character to the connected plane area block to the distance from the game AI to the connected plane area block.

In the embodiment of the present application, at least one of the blood volume information of teammates of the game AI and the game AI in one connected plane domain block, the number information of the connected cells in the connected plane domain block, and the number information of the security platforms in the connected plane domain block may be regarded as the attribute of the connected plane domain block, and the attribute may be prepared in advance in the form of a configuration file, so that the blood volume information of teammates of the game AI and the game AI, the number information of the connected cells in the connected plane domain block, and the number information of the security platforms in the connected plane domain block may be obtained from the configuration file, and the ratio of the distance from the virtual chasing character to the connected plane domain block to the distance from the game AI to the connected plane domain block may be calculated in real time according to the difference between the positions of the virtual chasing character and the game AI. To a certain extent, the above-mentioned attributes of the connected flat domain block and the ratio of the distance from the virtual chasing character to the connected flat domain block to the distance from the game AI to the connected flat domain block determine the security of the connected flat domain block, for example, the greater the number of connected elements in one connected flat domain block, the more beneficial the game AI is to avoid the virtual chasing character, and therefore, the safer the connected flat domain block is; as another example, the greater the number of secure platforms in a connected flat-area block, the more beneficial the game AI is to avoid the virtual pursuit of the character, and thus, the more secure the connected flat-area block is, and so on.

Step S2: and respectively assigning corresponding score values to at least one of the blood volume information of the teammates communicating the game AI and the game AI in the plane domain block, the number information of the communicating units in the communicating plane domain block, the distance ratio and the number information of the safety platforms in the communicating plane domain block according to the blood volume information of the teammates communicating the game AI and the game AI in the communicating plane domain block, the number information of the communicating units in the communicating plane domain block, the distance ratio and the number information of the safety platforms in the communicating plane domain block.

For the convenience of the following description, the assignment of blood volume information connecting the game AI and teammates of the game AI in the plane field block is used here as S1Means for using S as assigned value of number information of connected units in connected flat domain block2Indicating that the distance ratio is assigned by S3Indicating that the number information of the security platforms in the connected flat domain block is assigned and used S4And (4) showing. Further, the blood volume considering the game AI is actually for S1It is significant, for example, if the blood volume of the game AI is full, it should be biased to escape to a connected flat domain block far from its teammates, otherwise, it should be biased to escape to a connected flat domain block with better blood volume status of its teammates, therefore, in the embodiment of the present application, p is used to represent the score of the blood volume information of the game AI, and the score rule of the blood volume p of the game AI is to assign the value of p to 1 when the game AI is full, otherwise, assign the value of p to-1.

Specifically, assigning rules to blood volume information of the game AI and teammates of the game AI in the connected plane area block, number information of the connected units in the connected plane area block, distance ratio, and number information of the safety platforms in the connected plane area block are respectively: if there is one team member of game AI with blood volume greater than the preset blood volume threshold value, for example, 80%, in the connected flat domain block, S is performed1Is increased by 1, otherwise by 0.5, and is summed up to S1A value of (d); if there is one connected unit in the connected plane domain block, S is2Increase in value ofAdding 1, adding up to obtain S2A value of (d); s above3The value is the distance ratio (i.e. the ratio of the distance from the virtual chasing character to the connected flat area block to the distance from the game AI to the connected flat area block), or the distance ratio is calculated and then assigned to S3(ii) a If there is one safety platform in the connected plane domain block, the S4Is increased by 1 and summed to give S4The value of (c).

Step S3: and calculating the safe total score of the connected plane domain block according to the blood volume information of the game AI in the connected plane domain block and the teammates of the game AI, the quantity information of the connected units in the connected plane domain block, the distance ratio, the weight of at least one of the quantity information of the safe platforms in the connected plane domain block and the score value of each item.

Suppose S1And p is weighted by W1,S2Has a weight of W2,S3Has a weight of W3,S4Has a weight of W4Then connect the safe total score S of the plane domain blocktotalComprises the following steps:

Stotal=S1*p*W1+S2*W2+S3*W3+S4*W4

step S4: and determining a connected plane domain block with the safe total score not less than a preset safe threshold value as a third evasive plane domain block of the game AI.

Calculating the safety total score S of each connected flat domain block according to the steps S1 to S3totalIf some or some of the connected flat domain blocks have StotalAnd if the value is greater than or equal to the preset safety threshold value, determining the certain connected plane domain block or the certain connected plane domain blocks as third evasive plane domain blocks of the game AI.

It can also be known from the above determination of the safety score of a connected flat domain block when the weight W is determined1、W2、W3And/or W4When adjusting, the safe total score S of a connected plane domain block can be adjustedtotalEquivalently, the avoidance skill of the game AI can be improved or reduced, so that the game AI can be graded, and the avoidance game is addedOr the difficulty of defeating the game AI is reduced, and the fun and the challenge of the game player are improved.

Step S2033: and selecting an avoidance scheme matched with the geometric attributes to avoid the virtual pursuit role according to the geometric attributes of the third avoidable plane domain block.

In this embodiment of the application, when the planar domain block is rectangular, according to the geometric attribute of the third evaluable planar domain block, selecting an evasive scheme matching the geometric attribute to evade the virtual chasing role may be: if the lateral length of the third eluable planar domain block is greater than the longitudinal length, the game AI may select to move left and right to elude the virtual chasing character, otherwise, if the lateral length of the third eluable planar domain block is less than the longitudinal length, the game AI may select to move up and down to elude the virtual chasing character, and if the lateral length of the third eluable planar domain block is equal to the longitudinal length, the game AI may select to move up and down or left and right to elude the virtual chasing character.

In the above step S203 or steps S2031 to S2033, the evading scheme is described that the second target quadrant has a connected flat area block having a connected unit therein, however, there may be a scene that the second target quadrant only has a non-connected flat area block or the second target quadrant does not have a connected flat area block in the game. And two avoidance schemes are provided under the scene, wherein one scheme is that if the second target quadrant only has the non-connected plane area block, the safety platform in the second target quadrant is determined as the target platform avoiding the virtual pursuit role, and the game AI is controlled to escape to the safety platform. First, a description will be given of a platform which is a support for supporting a game AI in a planar area block in an escape-type game, and in which the game AI can move in the lateral or longitudinal direction of the support or jump between the supports to avoid a virtual character to be pursued. However, the more platforms within a non-flat domain block, the more secure the flat domain block. Generally, the more secure platforms within a flat domain block, the more secure the flat domain block is in relative terms.

As for the determination of the security platform in the second target quadrant, an embodiment of the present application obtains the heat of all the platforms in the second target quadrant being attacked by the virtual catch-up character when supporting the game AI, and determines the platform in the second target quadrant having the heat not greater than the preset heat as the security platform, wherein the heat of the platform being attacked by the virtual catch-up character when supporting the game AI can be determined by counting the frequency or the number of times of being attacked by the virtual catch-up character when the game AI is historically located on the platform, and generating a corresponding thermodynamic diagram, that is, according to the frequency or the number of times of being attacked by the virtual catch-up character when supporting the game AI on each platform, different colors are used for identification, the more the frequency or the number of times, the color of the platform is closer to red, and the platform with the preset heat is correspondingly identified as a specific color (which may be referred to as a thermodynamic threshold color). As shown in fig. 4, the game AI is a thermodynamic diagram generated by a virtual chaser character attacking the game AI when the game AI is historically located on the platform. Thus, as long as the thermodynamic diagram is called, the identified color of each platform is compared with the thermal threshold color, and if the thermal threshold color is red than the identified color of a certain platform, the platform is determined to belong to a safe platform, otherwise, the platform belongs to an unsafe platform. As to the specific manner of determining the thermodynamic diagram, an embodiment of the present application is: acquiring thermodynamic diagram data of a platform, wherein the thermodynamic diagram data of the platform at least comprises information such as frequency or times of attack by a virtual chasing character when a game AI is supported on the platform; acquiring a preset time interval; determining integration granularity for integrating thermodynamic diagram data of the platform according to the length of a preset time interval; forming a thermodynamic diagram data sequence according to the integration granularity and thermodynamic diagram data of the platform; and sequentially generating a plurality of thermodynamic diagrams according to the thermodynamic diagram data sequence of the preset time interval and the platform to form a dynamic thermodynamic diagram.

As mentioned above, when only the unconnected plane area block exists in the second target quadrant, there are two avoiding schemes, and the other avoiding scheme is from step S '1 to step S' 3, which are described as follows:

step S' 1: and if the second target quadrant only has the non-connected plane area block, determining whether the non-connected plane area block has a platform.

As previously mentioned, the platform evades a support within the tile area block that can carry a game AI that can move laterally or longitudinally on the support or jump between supports to evade a virtual chaser character. While the more platforms within a flat domain block that are not, the more secure the flat domain block is, for a non-connected flat domain block, the more secure the platform is, the more the non-connected flat domain block can evade the virtual pursuit of the character. Therefore, if the second target quadrant has only non-connected flat domain blocks, it is first determined whether the non-connected flat domain blocks have platforms.

Step S' 2: and if the non-connected plane domain block does not have a platform, calculating the safety degree of the connected plane domain block in the quadrant in which the virtual chasing role is located according to the attribute of the connected plane domain block in the quadrant in which the virtual chasing role is located.

Generally, for the game AI, the quadrant in which the virtual chasing character is located is a dangerous quadrant, however, when the game AI is faced with only the unconnected flat area blocks in the quadrant, and the unconnected flat area blocks do not have a platform, the game AI is more likely to be chased or captured by the virtual chasing character unless escaping to the quadrant in which the virtual chasing character is located. Under the scene that only the non-connected flat domain block exists in the quadrants and the platform does not exist in the non-connected flat domain block, the optimal strategy is to escape from the quadrant in which the virtual chasing role is located or the connected flat domain block in which the virtual chasing role is located is safer. Therefore, in an embodiment of the present application, if the non-connected flat domain block does not have a platform, the security of the connected flat domain block in the quadrant in which the virtual chasing role is located is calculated according to the attribute of the connected flat domain block in the quadrant in which the virtual chasing role is located. As for a specific method for calculating the security of the connected flat domain block, reference may be made to the method for calculating the security of the connected flat domain block according to the attribute of the connected flat domain block in the second target quadrant in the foregoing embodiment, except that the processing object at this time is replaced by the connected flat domain block in the quadrant where the virtual catch-up role is located, so reference may be made to the description of steps S1 to S3 in the foregoing embodiment, and details thereof are not repeated here.

Step S' 3: and determining the connected plane domain block with the safety degree of the connected plane domain block in the quadrant in which the virtual chasing role is positioned not less than a preset safety threshold as a fourth evasive plane domain block of the game AI.

Since the method for calculating the security of the connected flat domain block in the quadrant in which the virtual chasing character is located in step S' 2 is the same as the method for calculating the security of the connected flat domain block in the second target quadrant in steps S1 to S3 in the foregoing embodiment, the connected flat domain block whose security is not less than the preset security threshold in the quadrant in which the virtual chasing character is located is determined as the fourth evasive flat domain block of the game AI, and the connected flat domain block whose total security score is not less than the preset security threshold may be determined as the third evasive flat domain block of the game AI in step S4 in the foregoing embodiment, which will not be described herein.

In the above embodiment, a quadrant holding time may also be set to prevent frequent switching of quadrants when the distance between the game AI and the virtual catch-up character is the first distance or when the game AI moves on a long platform.

Since the second distance is defined to be greater than the preset distance threshold, when the distance between the game AI and the virtual chasing character is the second distance, it means that the chasing or attacking of the game AI by the virtual chasing character belongs to long-distance chasing or attacking, and the avoiding scheme of the game AI under such a scenario is different from the avoiding scheme of the game AI when the distance between the game AI and the virtual chasing character is the first distance, specifically, the method of the above embodiment further includes: when the distance between the game AI and the virtual chasing character is the second distance, the game AI is controlled to escape to the second avoidable plane area block to avoid the virtual chasing character, wherein the second distance is greater than the preset distance threshold, at least one plane area block with a safety degree smaller than the preset safety threshold exists between the second avoidable plane area block and the position of the game AI, and the definition of the safety degree is the same as that of the safety degree mentioned in the foregoing embodiment, which is not repeated herein.

As an embodiment of the present application, when the distance between the game AI and the virtual chasing character is the second distance, the step of controlling the game AI to escape to the second evasive plane area block to avoid the virtual chasing character may be implemented by the following steps S2041 to S2043:

step S2041: and excluding the plane area blocks with the safety degrees smaller than the preset safety threshold value from all the plane area blocks from the position of the game AI to the second evasive plane area block to obtain passable plane area blocks.

Consider that when a player is playing a game, when it is known that a certain area belongs to a dangerous area, although the path from the dangerous area to a destination area is short, from a safety perspective, the player may prefer to avoid the dangerous area by detour. Therefore, when the game AI is controlled to escape to the second evasive plane block to avoid the virtual character, the plane area block with the security degree smaller than the preset security threshold value among all the plane area blocks from the position of the game AI to the second evasive plane area block needs to be excluded to obtain the passable plane area block. As for the plan area blocks with the security degree smaller than the preset security threshold value from the position of the game AI to the second evadible plan area block, the determination method is the technical solutions of step S2032 or step S1 to step S4 of the foregoing embodiment, and the difference is that the processing object of the foregoing embodiment is a connected plan area block in the second target quadrant, and the processing object here is all plan area blocks from the position of the game AI to the second evadible plan area block. In addition, another scheme for excluding the plane domain blocks with the security degrees smaller than the preset security threshold value from all the plane domain blocks between the position of the game AI and the second evaluable plane domain block may be to assign a larger weight to the plane domain blocks with the security degrees smaller than the preset security threshold value from all the plane domain blocks between the position of the game AI and the second evaluable plane domain block, where the weight indicates that the plane domain blocks need to pass through a longer distance if the plane domain blocks need to pass through, so that the plane domain blocks are naturally excluded in subsequent routing.

Step S2042: and searching a plane domain block which can pass through the position of the game AI in the plane domain block to a second evasive plane domain block based on a breadth-first traversal scheme to form an reachable path.

As an embodiment of the present application, based on a breadth-first traversal scheme, searching for a plane domain block that can pass through a position of a game AI in the plane domain block to a second evasive plane domain block, and forming an reachable path may be implemented by the following steps S1-a to S1-h, which are described as follows:

step S1-a: recording the position of the game AI as a starting point coordinate, recording the second avoidable plane area block as an end point coordinate, and taking the direction from the starting point to the end point as a searching direction;

step S1-b: judging whether the type of the next plane domain block in the current searching direction belongs to type one or type two, if the type belongs to type one, executing step S1-c, and if the type belongs to type two, executing step S1-d, wherein type one represents a plane domain block without obstacles around, and type two represents a plane domain block with obstacles around;

step S1-c: moving one flat domain block along the current search direction and then returning to step S1-b;

step S1-d: dividing two search branches, trying to bypass obstacles along a clockwise wind direction and a counterclockwise direction respectively, establishing two threads at the moment, and maintaining a search deflection angle and a rotation amount respectively, wherein the deflection angle is an included angle between the direction from a current plane area block to a terminal point and the current moving direction, and the rotation amount is a game AI self-rotation angle;

step S1-e: judging whether a search branch bypasses the obstacle or not, if so, executing the step S1-g; otherwise, if both branches have been stopped, the process is ended, and if there is at least one ongoing search branch, step S1-f is executed;

step S1-f: for any path-finding branch, moving the path-finding branch towards a movable plane domain block according to the current direction, and calculating the current search deflection angle and the current rotation amount;

if the search deflection angle is larger and larger, trying to deflect towards the direction of reducing the search deflection angle, if not, indicating that the terminal point is not reachable, and stopping the search branch; checking the value of the rotation amount, stopping the search branch if the threshold value is exceeded, and then returning to step S1-e: (ii) a

Step S1-g: terminating the other search branch;

step S1-h: and judging whether the terminal is reached, if so, ending the process, otherwise, returning to the step S1-a.

The above embodiment is to continuously advance and correct the search direction of the player by maintaining a search yaw angle and a rotation amount until reaching a target point or the target point is inaccessible, thereby improving the efficiency of searching for a target at a long distance and improving the experience of the player.

As another embodiment of the present application, based on the breadth-first traversal scheme, the search for the plane domain block that can pass through the position of the game AI in the plane domain block to the second evasive plane domain block to form the reachable path may be implemented by the following steps S2-a to S2-c, which are described as follows:

step S2-a: respectively performing breadth-first traversal in a distributed database by taking the position of the game AI and the second avoidable plane domain block as root nodes, and obtaining a layer of new plane domain block by searching each time;

step S2-b: carrying out intersection proofreading on the new plane domain block and the highest layer plane domain block of the opposite side search set;

and step S2-c, if the plane domain block intersection exists, determining all intersection points, and reversely tracing the path through all the intersection points to find the shortest path between the position of the game AI and the second evasive plane domain block.

The embodiment adopts a mode of searching at two ends simultaneously, overcomes the technical problem that the time consumed along with the increase of the number of the path layers can be increased when the shortest path is inquired based on the unidirectional breadth-first traversal, greatly slows down the increase of the plane domain block of the search layer, and further improves the search efficiency of the shortest path.

Step S2043: and controlling the game AI to escape to the second evasive plane area block according to the reachable path.

The shortest path obtained in step S2042 is the reachable path, and the game AI is controlled to escape to the second evasive plane area block according to the reachable path.

In the process of the long-distance routing of the game AI to the second evasive planar area block to evade the virtual catch-up character, it may exist that all platforms in one planar area block are not necessarily strongly connected, and thus, the game AI may still be captured or attacked by the virtual catch-up character when escaping to the planar area block. In order to solve the above problem, all the flat domain blocks from the position of the game AI to the second evasive flat domain block may be optimized, and the specific scheme includes the following steps S '2041 to S' 2043, which are described as follows:

step S' 2041: and calculating the communication relation of the platforms in all the plane area blocks from the position of the game AI to the second evasive plane area block.

As described above, in the embodiment of the present application, when planning a game, a game planner records, in a configuration file, all plane domain blocks within an activity range of a virtual catch-up character and the game AI, including information such as an identifier and a position of each plane domain block, so that a connection relationship between platforms in all plane domain blocks from a position of the game AI to a second evasive plane domain block can be calculated through the configuration file.

Step S' 2042: and according to the communication relation of the platforms in all the plane domain blocks between the position of the game AI and the second evasive plane domain block, re-dividing all the plane domain blocks between the position of the game AI and the second evasive plane domain block, so that the platforms of the same plane domain block in the re-divided plane domain blocks are strongly communicated.

Since all platforms in one planar domain block are not necessarily in strong communication, it is necessary to re-partition all planar domain blocks from the position of the game AI to the second evasive planar domain block according to the communication relationship of the platforms in all planar domain blocks from the position of the game AI to the second evasive planar domain block, so that the platforms of the same planar domain block in the re-partitioned planar domain blocks are in strong communication. Here, the strong Connected (strong Connected) is the same as that in the computer theory, that is, a path from v1 to v2 and a path from v2 to v1 exist between any two points v1 and v2 in the Directed Graph (Directed Graph), and specifically, in this application, the platform of the same plane domain block is Strongly Connected, that is, there is a reachable path between any two platforms in the same plane domain block.

In the embodiment of the present application, a method for checking whether platforms of a same plane domain block in a newly divided plane domain block are strongly connected includes steps (1) to (5), which are described as follows:

step (1): loading graph data corresponding to the plane domain block;

step (2): preprocessing the graph data loaded in the step (1);

the preprocessing of the graph data includes dividing the graph according to the number of partitions, storing the partitions, and performing vertex copying processing on mutually linked vertices in different partitions.

And (3): storing the preprocessed data into a plurality of graphic processors, performing breadth-first traversal by taking a replication vertex as a center, and recording replication side information;

and (4): the copied edges are transmitted back to a central processing unit, the strong connection graph is detected, and the vertexes belonging to the same strong connection graph are marked;

and (5): and transmitting the marked vertexes back to the multiple graphics processors for strong connection graph detection.

Step S' 2043: and calculating the communication relation of the plane domain blocks in the plane domain blocks after the plane domain blocks are re-divided according to the strong communication relation of the platforms in the plane domain blocks after the plane domain blocks are re-divided.

The connectivity of the plane domain blocks in the newly divided plane domain blocks is calculated, so that when the game AI is controlled to escape to the second evadible plane domain block in step S204 to avoid the virtual character catch-up in the foregoing embodiment, it can be known which plane domain blocks are connected plane domain blocks.

The method for avoiding the game AI provided by the embodiment of the application can be known that the virtual catch-up character and the active range of the game AI are divided into four quadrants in a two-dimensional coordinate system, and different target quadrants or avoiding spaces are selected according to different distances between the game AI and the virtual catch-up character, and particularly, when a first avoidable plane domain block does not exist in a diagonal quadrant of the quadrant in which the virtual catch-up character is located, the game AI is controlled to escape to a second target quadrant to avoid the virtual catch-up character according to the attribute of the plane domain block in the second target quadrant, so that the mode of avoiding the game AI is more flexible, the winning rate of the game AI in an extranet is optimized, the game interest and the challenge of a player are improved, the balance of segment position promotion of the game AI and the virtual catch-up character corresponding to the player can be controlled, and the viscosity and the activity of the player are increased.

In order to better implement the game AI eluding method according to the embodiment of the present application, an eluding device for a game AI is further provided in the embodiment of the present application. Please refer to fig. 5, which is a schematic structural diagram of an avoiding device of a game AI according to an embodiment of the present application. The avoidance apparatus of the game AI may comprise a quadrant module 501, a first determination module 502 and a first control module 503, wherein:

the quadrant module 501 is configured to quadrant the activity ranges of the virtual catch-up character and the game AI into four quadrants in the two-dimensional coordinate system, with the current position of the game AI as an origin of the two-dimensional coordinate system;

a first determining module 502, configured to determine, when a distance between the game AI and the virtual chasing character is a first distance, that a diagonal quadrant of a quadrant in which the virtual chasing character is located is used as a first target quadrant for the game AI to avoid the virtual chasing character, where the first distance is not greater than a preset distance threshold;

the first control module 503 is configured to, if the first target quadrant does not have the first evasive plan area block, control the game AI to escape to a second target quadrant according to an attribute of the plan area block in the second target quadrant to avoid the virtual chasing role, where the second target quadrant includes any quadrant except for the quadrant where the virtual chasing role is located.

Optionally, the first control module 503 is specifically configured to search for a plane domain block in a second target quadrant, if a connected plane domain block having a connected unit inside the connected plane domain block exists in the second target quadrant, calculate a security degree of the connected plane domain block according to an attribute of the connected plane domain block, determine the connected plane domain block having the security degree not less than a preset security threshold as a third evasive plane domain block of the game AI, and select an evasive scheme matched with the geometric attribute to evade the virtual pursuit character according to the geometric attribute of the third evasive plane domain block.

Optionally, the above calculating the security of the connected plane domain block according to the attribute of the connected plane domain block, and determining the connected plane domain block whose security is not less than the preset security threshold as the third evasive plane domain block of the game AI may be: the method comprises the steps of obtaining at least one of blood volume information of a game AI and a team friend of the game AI in a connected plane domain block, the number information of connected units in the connected plane domain block, a distance ratio and the number information of safety platforms in the connected plane domain block, respectively assigning corresponding score values to at least one of the blood volume information, the number information of the connected units, the distance ratio and the number information of the safety platforms according to the blood volume information, the number information of the connected units, the distance ratio and the number information of the safety platforms, calculating a safety total score of the connected plane domain block according to the weight and the score values of the blood volume information, the number information of the connected units, the distance ratio and the number information of the safety platforms, and determining the connected plane domain block with the safety total score not less than a preset safety threshold value as a third hiding plane avoidance domain block of the game AI, wherein the distance ratio is the ratio of the distance from a virtual pursuing character to the connected plane domain block to the distance from the game AI to the connected plane domain block.

Please refer to fig. 6, which is another schematic structural diagram of an avoiding device of a game AI according to an embodiment of the present application. Fig. 6 differs from fig. 5 in that: the avoidance device for the game AI further comprises a second determination module 601, configured to determine, if only the unconnected plane area block exists in the second target quadrant, that the security platform in the second target quadrant serves as a target platform for avoiding the virtual character to be pursued.

Optionally, the security platform is determined as follows: and acquiring the heat of attack of the virtual chasing character when all the platforms in the second target quadrant support the game AI, and determining the platform with the heat not more than the preset heat value in the second target quadrant as a safety platform.

Please refer to fig. 7, which is another schematic structural diagram of an avoiding device of a game AI according to an embodiment of the present application. Fig. 7 differs from fig. 5 in that: the avoidance device of the game AI further includes a third determining module 701, a first calculating module 702, and a fourth determining module 703, wherein:

a third determining module 701, configured to determine whether a platform exists in the unconnected flat area block if only the unconnected flat area block exists in the second target quadrant;

a first calculating module 702, configured to calculate, if the non-connected flat domain block does not have a platform, a security level of the connected flat domain block in the quadrant in which the virtual chasing role is located according to an attribute of the connected flat domain block in the quadrant in which the virtual chasing role is located;

a fourth determining module 703 is configured to determine, as a fourth evasive plane area block of the game AI, a connected plane area block in which the security degree of the connected plane area block in the quadrant in which the virtual chasing character is located is not less than a preset security threshold.

Please refer to fig. 8a, which is a schematic structural diagram of an avoiding device of a game AI according to an embodiment of the present application. Fig. 8a differs from fig. 5 in that: the avoidance apparatus of the game AI further includes a second calculation module 801, a division module 802, and a third calculation module 803, wherein:

a second calculating module 801, configured to calculate a connection relationship between the position of the game AI and platforms in all the planar domain blocks between the second avoidable planar domain block;

a dividing module 802, configured to re-divide all the plane domain blocks from the location of the game AI to the second avoidable plane domain block according to the calculated connectivity relationship, so that platforms of the same plane domain block in the re-divided plane domain blocks are strongly connected;

and a third calculating module 803, configured to calculate, according to the strong connectivity of the platform in the re-divided plane domain block, connectivity of the plane domain block in the re-divided plane domain block.

Please refer to fig. 8b, which is a schematic structural diagram of an avoiding device of a game AI according to an embodiment of the present application. Fig. 8b differs from fig. 5 in that: the avoidance device of the game AI may further include a second control module 804, configured to control the game AI to escape to a second avoidable plane domain block to avoid the virtual catch-up character when a distance between the game AI and the virtual catch-up character is a second distance, where the second distance is greater than a preset distance threshold, and at least one plane domain block having a security degree smaller than a preset security threshold exists between the second avoidable plane domain block and a position where the game AI is located.

Optionally, the second control module 804 is specifically configured to exclude all plane domain blocks, of which the security degrees are smaller than a preset security threshold, from among the plane domain blocks from the position of the game AI to the second elusive plane domain block, to obtain a passable plane domain block, and search for a plane domain block that can pass through the position of the game AI in the plane domain block to the second elusive plane domain block based on a scheme of breadth-first traversal, to form a reachable path, and control the game AI to escape to the second elusive plane domain block according to the reachable path.

All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.

It can be known from the above-mentioned hiding device for a game AI provided in the embodiment of the present application that the activity ranges of a virtual catch-up character and the game AI are divided into four quadrants in a two-dimensional coordinate system, and different target quadrants or hiding spaces are selected according to different distances between the game AI and the virtual catch-up character, and particularly, when there is no first hiding plane domain block in a diagonal quadrant of the quadrant in which the virtual catch-up character is located, the game AI is controlled to escape to the second target quadrant to hide the virtual catch-up character according to attributes of the plane domain block in the second target quadrant, so that the hiding manner of the game AI is more flexible and changeable, the winning rate of the game AI in an extranet is optimized, the game interest and challenge of a player are improved, the balance of the game AI and the virtual catch-up character corresponding to a player segment can be controlled, and the stickiness and activity of the player are increased.

Correspondingly, the embodiment of the present application further provides a Computer device, where the Computer device may be a terminal or a server, and the terminal may be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like. As shown in fig. 9, fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer apparatus 400 includes a processor 401 having one or more processing cores, a memory 402 having one or more computer-readable storage media, and a computer program stored on the memory 402 and executable on the processor. The processor 401 is electrically connected to the memory 402. Those skilled in the art will appreciate that the computer device configurations illustrated in the figures are not meant to be limiting of computer devices and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.

The processor 401 is a control center of the computer device 400, connects the respective parts of the entire computer device 400 using various interfaces and lines, performs various functions of the computer device 400 and processes data by running or loading software programs and/or modules stored in the memory 402 and calling data stored in the memory 402, thereby monitoring the computer device 400 as a whole.

In the embodiment of the present application, the processor 401 in the computer device 400 loads instructions corresponding to processes of one or more application programs into the memory 402 according to the following steps, and the processor 401 runs the application programs stored in the memory 402, thereby implementing various functions:

with the current position of the game AI as the origin of a two-dimensional coordinate system, the activity ranges of the virtual chasing role and the game AI are quadrant into four quadrants in the two-dimensional coordinate system; when the distance between the game AI and the virtual chasing role is a first distance, determining a quadrant opposite to the quadrant in which the virtual chasing role is located as a first target quadrant for the game AI to avoid the virtual chasing role, wherein the first distance is not greater than a preset distance threshold; if the first target quadrant does not have the first evasive plane domain block, controlling the game AI to escape to a second target quadrant to avoid the virtual chasing role according to the attribute of the plane domain block in the second target quadrant, wherein the second target quadrant comprises any quadrant except the quadrant in which the virtual chasing role is positioned; and when the distance between the game AI and the virtual pursuit character is a second distance, controlling the game AI to escape to a second evasive plane area block to avoid the virtual pursuit character, wherein the second distance is greater than a preset distance threshold value.

The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.

Optionally, as shown in fig. 9, the computer device 400 further includes: a touch display screen 403, a radio frequency circuit 404, an audio circuit 405, an input unit 406, and a power supply 409. The processor 401 is electrically connected to the touch display screen 403, the radio frequency circuit 404, the audio circuit 405, the input unit 406, and the power source 409. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 9 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.

The touch display screen 403 may be used for displaying a graphical user interface and receiving operation instructions generated by a user acting on the graphical user interface. The touch display screen 403 may include a display panel and a touch panel. The display panel may be used, among other things, to display information entered by or provided to a user and various graphical user interfaces of the computer device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus pen, and the like), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 401, and can receive and execute commands sent by the processor 401. The touch panel may overlay the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel may transmit the touch operation to the processor 401 to determine the type of the touch event, and then the processor 401 may provide a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 403 to realize input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display screen 403 may also be used as a part of the input unit 406 to implement an input function.

In the embodiment of the present application, a game application is executed by the processor 401 to generate a graphical user interface on the touch display screen 403, where a virtual scene on the graphical user interface includes at least one skill control area, and the skill control area includes at least one skill control. The touch display screen 403 is used for presenting a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface.

The rf circuit 404 may be used for transceiving rf signals to establish wireless communication with a network device or other computer device via wireless communication, and for transceiving signals with the network device or other computer device.

The audio circuit 405 may be used to provide an audio interface between a user and a computer device through speakers, microphones. The audio circuit 405 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 405 and converted into audio data, which is then processed by the audio data output processor 401, and then sent to, for example, another computer device via the radio frequency circuit 404, or output to the memory 402 for further processing. The audio circuit 405 may also include an earbud jack to provide communication of a peripheral headset with the computer device.

The input unit 406 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and to generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.

The power supply 409 is used to power the various components of the computer device 400. Optionally, the power source 409 may be logically connected to the processor 401 through a power management system, so as to implement functions of managing charging, discharging, power consumption management, and the like through the power management system. The power supply 409 may also include any component of one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.

Although not shown in fig. 9, the computer device 400 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described in detail herein.

In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.

As can be seen from the above, in the computer device provided in this embodiment, the active ranges of the virtual catch-up character and the game AI are divided into four quadrants in the two-dimensional coordinate system, and different target quadrants or hiding spaces are selected according to different distances between the game AI and the virtual catch-up character, and particularly, when there is no first hiding plane domain block in the quadrant corresponding to the quadrant where the virtual catch-up character is located, the game AI is controlled to escape to the second target quadrant to hide the virtual catch-up character according to the attribute of the plane domain block in the second target quadrant, so that the hiding manner of the game AI is more flexible and changeable, the rate of the game AI in the external network is optimized, the game interest and challenge of the player are improved, the balance of segment position promotion of the game AI and the virtual catch-up character corresponding to the player can be controlled, and the stickiness and activity of the player are increased.

It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.

To this end, embodiments of the present application provide a computer-readable storage medium, in which a plurality of computer programs are stored, where the computer programs can be loaded by a processor to execute the steps in any one of the methods for avoiding the game AI provided by the embodiments of the present application. For example, the computer program may perform the steps of:

with the current position of the game AI as the origin of a two-dimensional coordinate system, the activity ranges of the virtual chasing role and the game AI are quadrant into four quadrants in the two-dimensional coordinate system; when the distance between the game AI and the virtual chasing role is a first distance, determining a quadrant opposite to the quadrant in which the virtual chasing role is located as a first target quadrant for the game AI to avoid the virtual chasing role, wherein the first distance is not greater than a preset distance threshold; if the first target quadrant does not have the first evasive plane domain block, controlling the game AI to escape to a second target quadrant to avoid the virtual chasing role according to the attribute of the plane domain block in the second target quadrant, wherein the second target quadrant comprises any quadrant except the quadrant in which the virtual chasing role is positioned; and when the distance between the game AI and the virtual pursuit character is a second distance, controlling the game AI to escape to a second evasive plane area block to avoid the virtual pursuit character, wherein the second distance is greater than a preset distance threshold value.

The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.

Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.

Since the computer program stored in the storage medium can execute the steps in any game AI evading method provided in the embodiments of the present application, the beneficial effects that can be achieved by any game AI evading method provided in the embodiments of the present application can be achieved, which are detailed in the foregoing embodiments and will not be described herein again.

The detailed description is given above to a method, an apparatus, a storage medium, and a computer device for avoiding a game AI provided in the embodiments of the present application, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiments is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

27页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:引导信息的显示方法、装置、存储介质及计算机设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类