Blocking detection method and device in virtual environment and related product

By cached blocking detection results in the virtual environment and reducing unnecessary detection times, the problem of blocking detection in the prior art resulting in excessive load on the game server CPU is solved, and the smoothness of the game is improved.

CN120037664APending Publication Date: 2025-05-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311583749.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

Blocking detection methods in existing virtual environments cause excessive CPU load on the game server, resulting in poor player games running smoothly.

Method used

By querying the block detection result between the first coordinate and the second coordinate in the cache, it will be read directly if it exists; if it does not exist, it will be performed and the result will be saved to reduce the number of unnecessary block detections.

Benefits of technology

Reduces the load on the game server CPU and improves the smoothness of players' games.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120037664A_ABST
    Figure CN120037664A_ABST
Patent Text Reader

Abstract

The invention discloses a blocking detection method and device in a virtual environment and a related product, the embodiment of the invention can be applied to a vehicle-mounted scene, and the method comprises the following steps: determining a first coordinate based on the position information of a first virtual character; a second coordinate corresponding to an action target of an action to be executed in the virtual environment based on the first virtual character; querying a blocking detection result between the first coordinate and the second coordinate in a cache; if the blocking detection result exists in the cache, reading the blocking detection result; if the blocking detection result does not exist in the cache, carrying out blocking detection between the first coordinate and the second coordinate, and generating a blocking detection result between the first coordinate and the second coordinate; and storing the blocking detection result between the first coordinate and the second coordinate in the cache. According to the method provided by the invention, the load of the game server can be reduced by reducing the number of times of blocking detection, so that the playing fluency of players is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of game technologies, and in particular, to a method, an apparatus, and related products for obstacle detection in a virtual environment. Background Art

[0002] Today, with the continuous development of technology, the game industry is also developing rapidly, and games have become a mainstream form of entertainment. There are multiple different types of games. Massively Multiplayer Online Game (MMOG) is a type of game. A massively multiplayer online game can support a large number of players to play in the same virtual environment. Virtual characters in a massively multiplayer online game can perform various different types of actions, such as moving, fighting, and chatting. In some massively multiplayer online games, virtual characters need to perform obstacle detection before executing an action, and determine whether the action can be successfully executed by the virtual character through the obstacle detection.

[0003] The existing obstacle detection in a virtual environment uses a direct detection method. For any action that any virtual character in the same virtual environment is about to perform, an obstacle detection will be carried out once, and it is judged whether this action can be successfully executed based on the result of the obstacle detection.

[0004] Performing obstacle detection in a virtual environment by the existing method often causes the CPU load of the game server to be too high, and the game cannot run smoothly when players play. Summary of the Invention

[0005] Embodiments of this application provide an apparatus and related products, aiming to solve the problem that the game does not run smoothly when players play.

[0006] The first aspect of this application provides a method for obstacle detection in a virtual environment. The method includes the following steps:

[0007] Determine a first coordinate based on the position information of a first virtual character in the virtual environment;

[0008] Based on the action that the first virtual character is about to execute in the virtual environment, determine a second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action;

[0009] Query the obstacle detection result between the first coordinate and the second coordinate in the cache;

[0010] If the obstacle detection result exists in the cache, read the obstacle detection result, and the obstacle detection result is used as a judgment condition for whether the action is successfully executed;

[0011] If the blocking detection result does not exist in the cache, perform blocking detection between the first coordinate and the second coordinate to generate a blocking detection result between the first coordinate and the second coordinate; save the blocking detection result between the first coordinate and the second coordinate to the cache.

[0012] The second aspect of the present application provides a blocking detection device in a virtual environment, and the device includes the following modules:

[0013] A first coordinate determination module, configured to determine a first coordinate based on the position information of a first virtual character in a virtual environment;

[0014] A second coordinate determination module, configured to determine, based on an action that the first virtual character is about to perform in the virtual environment, a second coordinate corresponding to an action target of the first virtual character when the first virtual character performs the action;

[0015] A query module, configured to query a blocking detection result between the first coordinate and the second coordinate in a cache;

[0016] A reading module, if the blocking detection result exists in the cache, is configured to read the blocking detection result, and the blocking detection result is used as a judgment condition for whether the action is successfully executed;

[0017] A blocking detection module, if the blocking detection result does not exist in the cache, is configured to perform blocking detection between the first coordinate and the second coordinate to generate a blocking detection result between the first coordinate and the second coordinate; save the blocking detection result between the first coordinate and the second coordinate to the cache.

[0018] The third aspect of the present application provides a blocking detection device in a virtual environment, and the device includes a processor and a memory:

[0019] The memory is configured to store program code and transmit the program code to the processor;

[0020] The processor is configured to execute the steps provided in the first aspect according to the instructions in the program code.

[0021] The fourth aspect of the present application provides a computer-readable storage medium, and the computer-readable storage medium is configured to store program code, and the program code is used to execute the steps of the blocking detection method in the virtual environment provided in the first aspect.

[0022] The fifth aspect of the present application provides a computer program product, including a computer program or instruction, and when the computer program or instruction is executed, the steps of the blocking detection method in the virtual environment provided in the first aspect are implemented.

[0023] As can be seen from the above technical solutions, the embodiments of the present application have the following advantages:

[0024] In the technical solution of the present application, a first coordinate is determined based on the position information of the first virtual character in the virtual environment, and a second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action is determined based on the action to be executed by the first virtual character. The method provided by the present application coordinates the virtual characters and action targets in the virtual scene. The blocking detection result between the first coordinate and the second coordinate can represent the blocking detection result between the virtual character and the action target in the virtual scene. In the technical solution of the present application, the blocking detection result between the first coordinate and the second coordinate can be searched in the cache first. If the blocking detection result between the first coordinate and the second coordinate exists in the cache, the blocking detection result in the cache can be directly read, and the blocking detection result is used to judge whether the action is successfully executed. Directly reading the blocking detection result between the first coordinate and the second coordinate in the cache without performing blocking detection between the first coordinate and the second coordinate reduces the load on the CPU of the game server compared with the related art and increases the smoothness of the player's game operation. If the blocking detection result between the first coordinate and the second coordinate does not exist in the cache, blocking detection is performed between the first coordinate and the second coordinate at this time to obtain the blocking detection result, and the blocking detection result is saved after obtaining the blocking detection result. The saved blocking detection result can be used as a condition for judging the success of the action executed between the first coordinate and the second coordinate subsequently. The solution provided by the present application reduces the number of blocking detections in the virtual environment compared with the related art, reduces the load on the CPU of the game server by reducing the number of blocking detections, and thus increases the smoothness of the player's game operation. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] Figure 1 It is a scene architecture diagram of a method for blocking detection in a virtual environment provided by an embodiment of the present application;

[0026] Figure 2 It is a flowchart of a method for blocking detection in a virtual environment provided by an embodiment of the present application;

[0027] Figure 3 It is a schematic diagram of performing blocking detection between a first coordinate and a second coordinate provided by an embodiment of the present application;

[0028] Figure 4 It is another schematic diagram of performing blocking detection between a first coordinate and a second coordinate provided by an embodiment of the present application;

[0029] Figure 5 It is a schematic diagram of a blocking detection provided by an embodiment of the present application;

[0030] Figure 6 Schematic diagram of a movement capable of blocking a target provided by an embodiment of the present application;

[0031] Figure 7 Flowchart of a method for deleting a blocking detection result in a cache provided by an embodiment of the present application;

[0032] Figure 8 Schematic diagram of dividing a virtual environment into multiple three-dimensional spaces provided by an embodiment of the present application;

[0033] Figure 9 Schematic diagram of determining a three-dimensional space provided by an embodiment of the present application;

[0034] Figure 10 Schematic diagram of a virtual environment provided by an embodiment of the present application;

[0035] Figure 11 Another schematic diagram of a virtual environment provided by an embodiment of the present application

[0036] Figure 12 Another schematic diagram of a virtual environment provided by an embodiment of the present application;

[0037] Figure 13 Another schematic diagram of a virtual environment provided by an embodiment of the present application;

[0038] Figure 14 Schematic diagram of a virtual environment provided by an embodiment of the present application;

[0039] Figure 15 Schematic diagram of obtaining a blocking detection result between a third coordinate and a fourth coordinate provided by an embodiment of the present application;

[0040] Figure 16 Schematic diagram of a virtual scene for performing multi-target actions provided by an embodiment of the present application;

[0041] Figure 17 Schematic diagram of the structure of a blocking detection device in a virtual environment provided by an embodiment of the present application;

[0042] Figure 18 Schematic diagram of the structure of a server in an embodiment of the present application;

[0043] Figure 19 Schematic diagram of the structure of a terminal device in an embodiment of the present application. Detailed implementation manners

[0044] As mentioned above, massively multiplayer online games can support a large number of players playing in the same virtual environment. Virtual characters in massively multiplayer online games can perform many different types of actions, such as moving, fighting, and talking. In some massively multiplayer online games, virtual characters need to perform blocking detection before performing actions, and the blocking detection is used to determine whether the action is successfully performed by the virtual character. For example, there are virtual characters A and B in a virtual environment. Virtual character A launches a long-distance attack on virtual character B. The game server will perform blocking detection between virtual character A and virtual character B. If the virtual detection result between virtual character A and virtual character B is no blocking, then virtual character A can successfully launch a long-distance attack on virtual character B. If the virtual detection result between virtual character A and virtual character B is blocking, then virtual character A cannot launch a long-distance attack on virtual character B.

[0045] In a massively multiplayer online game, there may be hundreds or even thousands of virtual characters in the same virtual environment. When a large number of virtual characters gather in the same virtual environment to play the game, the game server will perform blocking detection on certain actions that each virtual character is about to perform. A large number of blocking detections will put a relatively large burden on the game server. During the process of a large number of blocking detections on the game server, players who are connected to the game server to play will feel that the game is not running smoothly.

[0046] In view of the above problems, the present application provides an obstruction detection method in a virtual environment to solve the problem that in some specific scenarios in the related technology, obstruction detection will impose a relatively large burden on the game server, thereby causing the game to run unsmoothly during the player's play.

[0047] In the technical solution provided in the present application, several terms that may be involved in the embodiments of the present application below are first explained.

[0048] Virtual environment: It is a virtual environment displayed (or provided) when an application runs on a terminal. This virtual environment can be a simulation environment of the real world, a semi-simulated and semi-fictional environment, or a purely fictional environment. The virtual environment can be any one of a two-dimensional virtual environment, a 2.5D virtual environment, and a three-dimensional virtual environment, and the embodiments of the present application do not limit this. This virtual environment can provide a battle environment between virtual objects. Exemplarily, in a confrontation game, a virtual object controlled by a player battles with other virtual objects (such as monsters) in the virtual environment. The virtual object controlled by the player attacks the monsters to survive in the virtual environment. When the health value of the virtual object controlled by the player in the virtual environment is zero, the life of the virtual object controlled by the player in the virtual environment ends; when the virtual object controlled by the player kills a monster, it is considered that the virtual object controlled by the player is the winning party, and the virtual object controlled by the player can obtain rewards such as level improvement, attribute improvement, or obtaining equipment. Each client can control one or more virtual objects in the virtual environment.

[0049] Non-Player Character (NPC): In a game, to enrich the player experience, characters driven by game logic are provided, which communicate, interact, fight, etc. with players based on different functional positions.

[0050] The execution subject of the blocking detection method in the virtual environment provided by the embodiments of the present application can be a terminal device. For example, based on the position information of a first virtual character in the virtual environment, a first coordinate is determined on the terminal device. As an example, the terminal device can specifically include but is not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. In addition, the execution subject of the blocking detection method in the virtual environment provided by the embodiments of the present application can also be a server, that is, based on the action that a first virtual character is about to execute in the virtual environment, when determining the second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action. If the game runs on a terminal device, the terminal device can determine a first coordinate based on the position information of the first virtual character in the virtual environment, and the terminal device can also determine the second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action based on the action that the first virtual character is about to execute in the virtual environment. The server further queries the blocking detection result between the first coordinate and the second coordinate in the cache. The blocking detection method in the virtual environment provided by the embodiments of the present application can also be executed collaboratively by the terminal device and the server. Therefore, the embodiments of the present application do not limit the implementation subject of executing the technical solution of the present application.

[0051] Figure 1The scene architecture diagram of a blocking detection method in a virtual environment is exemplarily shown. The figure includes a server and various forms of terminal devices. Figure 1 The server shown can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. Additionally, the server can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.

[0052] Figure 2 The flowchart of a blocking detection method in a virtual environment provided by an embodiment of this application is as follows. Figure 2 In the blocking detection method in the virtual environment shown, it includes:

[0053] S201: Determine a first coordinate based on the position information of a first virtual character in the virtual environment.

[0054] The terminal device determines a first coordinate based on the position information of a first virtual character in the virtual environment. The first virtual character can be a virtual character controlled by a player or an NPC in the game. In a possible implementation, the first virtual character can also be a virtual character capable of performing actions in the virtual environment. For example, the first virtual character can be a virtual pet raised by a virtual character controlled by a player in the game, or the first virtual character can also be a virtual character summoned by a virtual character controlled by a player in the game by releasing a specific skill. In a possible implementation, the first virtual character is character A controlled by player A, and character A may occupy a certain space in the virtual environment. The terminal device can obtain the coordinates (100, 60, 30) of the center point of character A in the virtual environment, and the terminal device can use the coordinates of the center point of character A in the virtual environment as the position information of character A in the virtual environment. After the terminal device obtains the position information of character A in the virtual environment, the terminal device can determine (100, 60, 30) as the first coordinate based on the position information of character A in the virtual environment.

[0055] S202: Based on the action that the first virtual character is about to perform in the virtual environment, determine the second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action.

[0056] The terminal device can determine the action that the first virtual character is about to perform in the virtual environment. In a possible implementation, the first virtual character is a virtual character controlled by a player. Since the first virtual character is controlled by the player, the terminal device can determine the action that the first virtual character is about to perform by the instruction for controlling the first virtual character input by the player. For example, if the player inputs an instruction to attack another virtual character, at this time, the terminal device can determine that the action that the first virtual character is about to perform in the virtual environment is to attack another virtual character based on the instruction input by the player to attack another virtual character. In a possible implementation, the first virtual character is an NPC in the game. The NPC in the game performs actions according to the logic preset by the game. The terminal device can determine the action that the NPC in the game is about to perform through the logic preset by the game.

[0057] The terminal device can determine the second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action based on the action that the first virtual character is about to perform in the virtual environment. In a possible implementation, the action that the first virtual character is about to perform in the virtual environment is to move to a certain position in the virtual environment. In this case, the action target of the first virtual character is this position in the virtual environment. For example, the first virtual character is a virtual character controlled by a player, and the player inputs an instruction to control the virtual character to move to the position of a flower in the virtual environment. The action target of the first virtual character is this flower, and the coordinate corresponding to this flower is (200, 100, 50). The second coordinate corresponding to the action target of the first virtual character determined by the terminal device is (200, 100, 50).

[0058] In another possible implementation, the first virtual character is virtual character A controlled by a player. The player inputs an instruction to control virtual character A to attack virtual character B in the virtual environment. The action target of virtual character A is virtual character B. The coordinate of virtual character B in the virtual environment is (100, 90, 30). The second coordinate corresponding to the action target of virtual character A determined by the terminal device is (100, 90, 30).

[0059] S203: Query whether there is a blocking detection result between the first coordinate and the second coordinate in the cache.

[0060] The terminal device queries the blocking detection result between the first coordinate and the second coordinate in the cache. The blocking detection result may be a blocking detection result indicating no block between the first coordinate and the second coordinate, or may be a blocking detection result indicating a block between the first coordinate and the second coordinate. When there is a block between the first coordinate and the second coordinate, the blocking detection result may further include specific blocking objects. In a possible implementation, the cache is the cache of the game server. If the blocking detection result exists in the cache, S204 is executed; if the blocking detection result does not exist in the cache, S205 is executed.

[0061] S204: Read the blocking detection result, and the blocking detection result is used as the judgment condition for whether the action is successfully executed.

[0062] If there is a blocking detection result between the first coordinate and the second coordinate in the cache, the terminal device can read the blocking detection result between the first coordinate and the second coordinate.

[0063] In a possible implementation, the first virtual character is virtual character B summoned by virtual character A controlled by the player in the game by releasing a specific skill. Virtual character B is about to release a healing skill on virtual character A in the virtual environment. The terminal device determines the first coordinate based on the position information of virtual character B, the action target of virtual character B to release the healing skill is virtual character A, and the terminal device determines the second coordinate corresponding to virtual character A. If there is a blocking detection result between the first coordinate and the second coordinate in the cache, the terminal device reads the blocking detection result between the first coordinate and the second coordinate, and judges whether the healing skill that virtual character B is about to release on virtual character A in the virtual environment takes effect through the blocking detection result. If the terminal device determines that there is a block between the first coordinate and the second coordinate through the blocking detection result, at this time, the healing skill that virtual character B is about to release on virtual character A in the virtual environment will not take effect; if the terminal device determines that there is no block between the first coordinate and the second coordinate through the blocking detection result, at this time, the healing skill that virtual character B is about to release on virtual character A in the virtual environment takes effect.

[0064] In another possible implementation, the first virtual character is the virtual character A controlled by the player, and the virtual character A is about to move to a position with coordinates (100, 90, 30) in the virtual environment. The terminal device determines the first coordinate based on the position information of the virtual character A, and determines the second coordinate as (100, 90, 30) based on the end point of the movement of the virtual character A. If there is a blocking detection result between the first coordinate and the second coordinate in the cache, the terminal device reads the blocking detection result between the first coordinate and the second coordinate, and determines whether the virtual character A can successfully move to the position with coordinates (100, 90, 30) in the virtual environment through the blocking detection result. If the terminal device determines that there is a block between the first coordinate and the second coordinate through the blocking detection result, at this time, the virtual character A cannot directly move to the position with coordinates (100, 90, 30) in the virtual environment; if the terminal device determines that there is no block between the first coordinate and the second coordinate through the blocking detection result, at this time, the virtual character A can directly move to the position with coordinates (100, 90, 30) in the virtual environment.

[0065] S205: Perform a blocking detection between the first coordinate and the second coordinate to generate a blocking detection result between the first coordinate and the second coordinate; save the blocking detection result between the first coordinate and the second coordinate to the cache.

[0066] If the terminal device does not query the blocking detection result between the first coordinate and the second coordinate in the cache, at this time, the terminal device can perform a blocking detection between the first coordinate and the second coordinate.

[0067] In a possible implementation, the terminal device can generate a straight line between the first coordinate and the second coordinate. The terminal device determines the blocking detection result between the first coordinate and the second coordinate by whether there is an obstacle encountered by this straight line between the first coordinate and the second coordinate, and generates a blocking detection result between the first coordinate and the second coordinate. After the terminal device generates the blocking detection result between the first coordinate and the second coordinate, it saves the blocking detection result between the first coordinate and the second coordinate to the cache.

[0068] Figure 3A schematic diagram for performing blocking detection between a first coordinate and a second coordinate provided by this application. The virtual character below is the first virtual character, and the virtual character above is the action target that the first virtual character is about to attack. The black dot in the first virtual character can represent the coordinate of the first virtual character, and the black dot in the action target that the first virtual character is about to attack can represent the coordinate of this action target. The terminal device can determine the coordinate of the black dot in the first virtual character as the first coordinate, and determine the coordinate of the black dot in the action target that the first virtual character is about to attack as the second coordinate. The terminal device generates a straight line between the first coordinate and the second coordinate. This straight line does not encounter an obstacle in the virtual environment. The terminal device can generate a non-blocking blocking detection result between the first coordinate and the second coordinate, and save the non-blocking blocking detection result between the first coordinate and the second coordinate to the cache.

[0069] If the blocking detection result between the first coordinate and the second coordinate indicates no block, then assign the execution result of the action performed by the first virtual character to the second virtual character. The execution result of the action includes increasing the attribute value of the second virtual character or decreasing the attribute value of the second virtual character.

[0070] In a possible implementation, the first virtual character uses Skill A. The action target of Skill A is the second virtual character. The blocking detection result between the first coordinate and the second coordinate indicates no block. The first virtual character successfully uses Skill A on the second virtual character. If the effect of Skill A is to cause 10 points of damage, then at this time the terminal device can assign the execution result of Skill A to the second virtual character, reducing the health value of the second virtual character by 10 points. If the effect of Skill A is to restore 10 points of health, then at this time the terminal device can assign the execution result of Skill A to the second virtual character, increasing the health value of the second virtual character by 10 points. If the blocking detection result between the first coordinate and the second coordinate indicates a block, then the first virtual character cannot successfully release Skill A on the second virtual character.

[0071] Figure 4Another schematic diagram for performing blocking detection between a first coordinate and a second coordinate provided by this application. The virtual character below is the first virtual character, and the arrow above is the position where the first virtual character is to move. The black dot in the first virtual character can represent the coordinate of the first virtual character, and the black dot on the arrow can represent the coordinate when the first virtual character moves to the position of the arrow. The terminal device can determine the coordinate of the black dot in the first virtual character as the first coordinate and the coordinate of the black dot on the arrow as the second coordinate. The terminal device generates a straight line between the first coordinate and the second coordinate, and this straight line encounters a cylindrical obstacle in the virtual environment. The terminal device can generate a blocking detection result with blocking between the first coordinate and the second coordinate and save the blocking detection result with blocking between the first coordinate and the second coordinate to the cache.

[0072] In a possible implementation manner, the action target is an environmental target in the virtual environment. At this time, the virtual character will move in the virtual environment. If the blocking detection result between the first coordinate and the second coordinate is that there is no block, the terminal device controls the first virtual character to move from the first coordinate to the second coordinate based on the blocking detection result. If the blocking detection result between the first coordinate and the second coordinate is that there is a block, the terminal device controls the first virtual character to move from the first coordinate to the second coordinate based on the pathfinding logic of the game. The pathfinding logic can find an unblocked path for the first virtual character to move to the second coordinate. Figure 4 In the schematic diagram for performing blocking detection between the first coordinate and the second coordinate provided, if the blocking detection result between the first coordinate and the second coordinate is that there is a block, at this time, the pathfinding logic of the game will find a route to bypass the cylindrical obstacle in the figure. The terminal device can control the first virtual character to bypass this cylinder and move to the position corresponding to the second coordinate based on the route found by the pathfinding logic.

[0073] In the method provided by this application, when the virtual character executes a movement-type action, the terminal device can use the blocking detection result as a judgment condition for whether the movement-type action is successful. In the case where the virtual character cannot move normally due to the existence of a block in the virtual environment, the terminal device can control the virtual character to bypass the block through the pathfinding logic of the game, enabling the virtual character to complete normal movement. The method provided by this application sets a precondition for calling the pathfinding logic. When the blocking detection result is that there is no block, the movement can be completed without using the pathfinding logic of the game. Compared with the related art, the burden on the game server can be further reduced, and the smoothness of the player running the game can be increased.

[0074] To ensure that the blocking detection results stored in the cache do not affect the smoothness of game operation, a storage upper limit for the blocking detection results can be set for the cache. In a possible implementation, when the terminal device saves the blocking detection result between the first coordinate and the second coordinate, it can first determine whether the number of blocking detection results already stored in the cache has reached the upper limit. If the number of blocking detection results already stored in the cache has not reached the upper limit, the blocking detection result between the first coordinate and the second coordinate is saved to the cache; if the number of blocking detection results already stored in the cache has reached the upper limit, the earliest stored blocking detection result in the cache is deleted; after deletion, the blocking detection result between the first coordinate and the second coordinate is saved to the cache.

[0075] In a possible implementation, after the terminal device performs the blocking detection, it can save the time when the blocking detection is performed to the blocking detection result. Figure 5 This is a schematic diagram of a blocking detection provided by the present application. The four black dots in the figure represent the coordinates of four virtual characters. The blocking detection result between coordinate 1 and coordinate 2 is saved in the cache, and the detection time of the blocking detection result between coordinate 1 and coordinate 2 is 20:00. The blocking detection result between coordinate 3 and coordinate 4 is not saved in the cache. The terminal device generates the blocking detection result between coordinate 3 and coordinate 4 through the blocking detection at 20:06. The terminal device determines that the number of blocking detection results stored in the cache has reached the upper limit. At this time, the terminal device can search in the cache for the earliest stored blocking detection result in the cache. The blocking detection result between coordinate 1 and coordinate 2 stored at 20:00 is found as the earliest stored blocking detection result in the cache. At this time, the terminal device can delete the blocking detection result between coordinate 1 and coordinate 2, and save the blocking detection result between coordinate 3 and coordinate 4 after deletion.

[0076] The method provided by the present application takes into account the impact of the cache capacity on the game operation smoothness, and ensures that the stored blocking detection results do not affect the game operation smoothness by setting a storage upper limit for the blocking detection results in the cache. The method provided by the present application takes into account the timeliness of the blocking detection results. The probability of querying the newly generated blocking detection results is relatively high. When the number of blocking detection results stored in the cache reaches the upper limit, the earliest stored blocking detection result in the cache is deleted, and the new blocking detection result is saved. Without affecting the game operation smoothness, the cache is continuously updated to improve the availability of the blocking detection results stored in the cache.

[0077] The method provided by this application does not need to perform blocking detection between the first coordinate and the second coordinate for any action. The method provided by this application can first read the blocking detection result between the first coordinate and the second coordinate from the cache. If there is a blocking detection result between the first coordinate and the second coordinate in the cache, read the blocking detection result between the first coordinate and the second coordinate, and determine whether the action is successfully executed based on the blocking detection result between the first coordinate and the second coordinate. When there is no blocking detection result between the first coordinate and the second coordinate in the cache, blocking detection is performed between the first coordinate and the second coordinate to obtain a blocking detection result, and after obtaining the blocking detection result, the blocking detection result is saved. The saved blocking detection result can be used as a condition for judging the success of subsequent actions between the first coordinate and the second coordinate. The method provided by this application reduces the number of times of performing blocking detection to reduce the load on the CPU of the game server, thereby increasing the smoothness of the player's game operation.

[0078] The blockable objects that can block the successful execution of actions in the game include static blockers such as terrain protrusions, buildings, trees, stones, or objects placed by players. The blockable objects that can block the successful execution of actions can also include blockers that can change coordinates in the virtual environment, such as walls created by the skills of the virtual character or rolling stones placed by the player. When the coordinates of the blockable objects that can block the successful execution of actions change, it may cause the saved blocking detection results in the cache to become unavailable. Figure 6 This is a schematic diagram of the movement of a blockable object provided by this application. The cylinder in the figure can roll in the direction of the arrow, from position 1 to position 2 and finally to position 3. When the cylinder in the figure is at position 1, the terminal device can perform blocking detection between the first coordinate corresponding to the virtual character on the left and the second coordinate corresponding to the virtual character on the right. At this time, the blocking detection result is that there is no block. After the terminal device obtains the blocking detection result, it can save the blocking detection result of no block between the first coordinate and the second coordinate to the cache. When the cylinder in the figure rolls from position 1 to position 2 in the direction of the arrow, the blocking detection result between the first coordinate and the second coordinate queried by the terminal device in the cache is that there is no block, but in fact, when the cylinder rolls to position 2, the accurate blocking detection result between the first coordinate and the second coordinate is that there is a block. To solve the above problems and similar problems, this application provides a method for deleting the blocking detection results in the cache. Figure 7 This is a flowchart of a method for deleting the blocking detection results in the cache provided by an embodiment of this application. As Figure 7 shown in the method for deleting the blocking detection results in the cache, it includes:

[0079] S701: Divide the virtual environment into multiple three-dimensional spaces.

[0080] The terminal device can divide the virtual environment into multiple three-dimensional spaces according to a preset space size. Figure 8 It is a schematic diagram of dividing the virtual environment into multiple three-dimensional spaces provided by this application. Figure 8 Two three-dimensional spaces are shown in it. The multiple three-dimensional spaces divided by the terminal device can have the same space size as these two three-dimensional spaces.

[0081] S702: Determine the first three-dimensional space corresponding to the first coordinate according to the first coordinate, and determine the second three-dimensional space corresponding to the second coordinate according to the second coordinate.

[0082] The terminal device can determine the first three-dimensional space corresponding to the first coordinate according to the first coordinate, and determine the second three-dimensional space corresponding to the second coordinate according to the second coordinate. Figure 9 It is a schematic diagram of determining a three-dimensional space provided by this application. The virtual character in the lower left corner is the first virtual character. The black dot in the first virtual character is the first coordinate determined by the terminal device based on the position information of the first virtual character in the virtual environment. The virtual character on the right is the action target for which the first virtual character is about to execute an action. The black dot in the virtual character on the right is the second coordinate determined by the terminal device. The three-dimensional space where the first coordinate is located is the first three-dimensional space corresponding to the first coordinate, and the three-dimensional space where the second coordinate is located is the second three-dimensional space corresponding to the second coordinate.

[0083] S703: Determine the path between the first three-dimensional space and the second three-dimensional space.

[0084] The terminal device determines the path between the first three-dimensional space and the second three-dimensional space. In a possible implementation, the terminal device can connect the spatial midpoint of the first three-dimensional space and the spatial midpoint of the second three-dimensional space, and use the line connecting the spatial midpoint of the first three-dimensional space and the spatial midpoint of the second three-dimensional space as the path between the first three-dimensional space and the second three-dimensional space. Figure 10 It is a schematic diagram of a virtual environment provided by this application. Figure 10 The leftmost space is the first three-dimensional space. The black dot in the first three-dimensional space represents the spatial midpoint of the first three-dimensional space. The third space from left to right is the second three-dimensional space. The black dot in the second three-dimensional space represents the spatial midpoint of the second three-dimensional space. The line connecting the two black dots can be used as the path between the first three-dimensional space and the second three-dimensional space.

[0085] In another possible implementation, the terminal device can connect the first coordinate and the second coordinate, and use the line connecting the first coordinate and the second coordinate as the path between the first three-dimensional space and the second three-dimensional space. Figure 11 It is another schematic diagram of a virtual environment provided by this application. Figure 11The virtual character in the lower left corner is the first virtual character. The black dot in the first virtual character is the first coordinate determined by the terminal device based on the position information of the first virtual character in the virtual environment. The virtual character on the right is the action target for which the first virtual character is about to perform an action. The black dot in the virtual character on the right is the second coordinate determined by the terminal device. The processing device determines the connection line between the first coordinate and the second coordinate as the path between the first three-dimensional space and the second three-dimensional space.

[0086] S704: Use the three-dimensional spaces passed by the path to form a set of three-dimensional spaces.

[0087] The terminal device uses the three-dimensional spaces passed by the path to form a set of three-dimensional spaces. In Figure 10 In the provided schematic diagram of the virtual environment, the path from the first three-dimensional space to the second three-dimensional space passes through three three-dimensional spaces, and the terminal device can form a set of three-dimensional spaces with these three three-dimensional spaces. In Figure 11 In the provided schematic diagram of the virtual environment, the path from the first three-dimensional space to the second three-dimensional space passes through five three-dimensional spaces, and the terminal device can form a set of three-dimensional spaces with these five three-dimensional spaces.

[0088] S705: If the coordinates of the blockable target in any of the three-dimensional spaces in the set of three-dimensional spaces change, delete the block detection results stored in the cache.

[0089] Any of the three-dimensional spaces in the set of three-dimensional spaces may include one or more blockable targets. Figure 12 This is another schematic diagram of the virtual environment provided by this application. Figure 12 The virtual environment in it includes a three-dimensional space. There is a rollable blockable target in this three-dimensional space. In the actual scenario, this rollable blockable target can be a log or a stone in the virtual environment. There is also a stationary blockable target in this three-dimensional space. In the actual scenario, this stationary blockable target can be a tree trunk in the virtual environment. In a possible implementation, the change in the coordinates of the blockable target in the three-dimensional space can be that the rollable blockable target rolls out of the range of the three-dimensional space from the solid line position and rolls to the dotted line position. At this time, the processing device can delete the block detection results stored in the cache.

[0090] In another possible implementation, a threshold can be set for the change in the coordinates of the blockable target. For example, when the change in the coordinates of the blockable target in any of the three-dimensional spaces is greater than the threshold within a preset time, delete the block detection results stored in the cache.

[0091] In yet another possible implementation, the change in the coordinates of the blockable target can be the generation of a blockable target in the three-dimensional space. Figure 13Another schematic diagram of a virtual environment provided for this application Figure 13 In the three-dimensional space, there is only one stationary obstructable target. In an actual scenario, this stationary obstructable target can be a tree trunk in the virtual environment. At this time, player A controls virtual character A to create a box in the three-dimensional space. The appearance of this box can also be regarded as a change in the coordinates of the obstructable target in the three-dimensional space. If the coordinates of the obstructable target in any three-dimensional space in the three-dimensional space set change as described above, the terminal device can delete the stored obstruction detection result in the cache.

[0092] In another possible implementation, the change in the coordinates of the obstructable target can be that the obstructable target in the three-dimensional space is removed from the three-dimensional space. Figure 14 A schematic diagram of a virtual environment provided for this application Figure 14 In the three-dimensional space, there is a stationary obstructable target and a box created by a virtual character. This box will exist in the virtual environment for 10 seconds. In an actual scenario, this stationary obstructable target can be a tree trunk in the virtual environment. After 10 seconds, this box created by the virtual character will disappear in the three-dimensional space. The disappearance of this box can be regarded as a change in the coordinates of the obstructable target. At this time, the terminal device can delete the stored obstruction detection result in the cache.

[0093] The method provided by this application takes into account the problem that the obstruction detection result becomes unavailable due to the change in the coordinates of the obstructable target. The method provided by this application divides the virtual environment into multiple three-dimensional spaces, analyzes the coordinates of the obstructable target inside the three-dimensional space, and deletes the stored obstruction detection result in the cache when the obstruction detection result becomes unavailable due to the change in the coordinates of the obstructable target, improving the accuracy of obstruction detection in the virtual environment.

[0094] In a possible implementation, when the obstruction detection result between the first coordinate and the second coordinate is that there is an obstruction, the terminal device can use the obstruction detection result between the first coordinate and the second coordinate as the obstruction detection result between the third coordinate and the fourth coordinate. Figure 15 A schematic diagram for obtaining the obstruction detection result between the third coordinate and the fourth coordinate provided for this application. In Figure 15 the obstruction detection result between the first coordinate and the second coordinate is that there is an obstruction. Since the line connecting the third coordinate to the fourth coordinate passes through the first coordinate and the second coordinate, the obstruction detection result between the third coordinate and the fourth coordinate is also an obstruction detection result indicating that there is an obstruction.

[0095] When the blocking detection result between the first coordinate and the second coordinate provided by this application indicates that there is a block, the blocking detection result between the third coordinate and the fourth coordinate can be obtained based on the blocking detection result between the first coordinate and the second coordinate. Even if the blocking detection result between the third coordinate and the fourth coordinate is not saved in the cache, the terminal device can obtain the blocking detection result that there is a block between the third coordinate and the fourth coordinate without performing a blocking detection. Compared with the related art, the number of blocking detections is further reduced, and the load on the CPU of the game server is reduced by reducing the number of blocking detections, thereby further increasing the smoothness of the player's game operation.

[0096] In a possible implementation manner, the actions performed by the virtual character can have multiple action targets. Figure 16 This is a schematic diagram of a virtual scene for performing a multi-target action provided by this application. The virtual character in the lower left corner releases skill A. The circular dotted line in the figure is the range of skill A. There are three virtual characters in the circular dotted line. If the virtual character in the lower left corner is the first virtual character, and the three virtual characters in the circular dotted line are all action targets, these three action targets correspond to three second coordinates. The terminal device searches for the blocking detection results corresponding to the three second coordinates at the first coordinate in the cache. Determine whether skill A is successfully executed for the three virtual characters in the circular dotted line according to the three blocking detection results.

[0097] The method provided by this application takes into account the situation where one action corresponds to multiple action targets. When one action corresponds to multiple action targets, the terminal device can determine multiple second coordinates based on the multiple action targets. For an action with multiple action targets, the method provided by this application can perform more accurate blocking detection on the first virtual character performing the action and each action target.

[0098] Based on the blocking detection method in the virtual environment provided in the foregoing embodiments, this application also correspondingly provides a blocking detection device 1700 in the virtual environment. The following is combined with Figure 17 for description. Figure 17 This is a schematic structural diagram of the blocking detection device in the virtual environment provided by the embodiments of this application. As Figure 17 shown, the blocking detection device in the virtual environment includes:

[0099] A first coordinate determination module 1701, configured to determine a first coordinate based on the position information of the first virtual character in the virtual environment;

[0100] A second coordinate determination module 1702, configured to determine, based on the action that the first virtual character is about to perform in the virtual environment, the second coordinates corresponding to the action targets of the first virtual character when the first virtual character acts according to the action;

[0101] A query module 1703, configured to query the blocking detection result between the first coordinate and the second coordinate in the cache;

[0102] A reading module 1704, if the blocking detection result exists in the cache, is configured to read the blocking detection result, and the blocking detection result is used as a judgment condition for whether the action is successfully executed;

[0103] A blocking detection module 1705, if the blocking detection result does not exist in the cache, is configured to perform a blocking detection between the first coordinate and the second coordinate to generate a blocking detection result between the first coordinate and the second coordinate; save the blocking detection result between the first coordinate and the second coordinate to the cache.

[0104] In a possible implementation manner, the cache stores the blocking detection result with a quantity upper limit, and the blocking detection module is specifically configured to:

[0105] If the number of the blocking detection results stored in the cache does not reach the quantity upper limit, save the blocking detection result between the first coordinate and the second coordinate to the cache;

[0106] If the number of the blocking detection results stored in the cache reaches the quantity upper limit, delete the earliest stored blocking detection result in the cache; save the blocking detection result between the first coordinate and the second coordinate to the cache.

[0107] In a possible implementation manner, the device further includes a blocking detection result deletion module, and the module is specifically configured to:

[0108] Divide the virtual environment into multiple three-dimensional spaces;

[0109] Determine a first three-dimensional space corresponding to the first coordinate according to the first coordinate, and determine a second three-dimensional space corresponding to the second coordinate according to the second coordinate;

[0110] Determine a path from the first three-dimensional space to the second three-dimensional space;

[0111] Use the three-dimensional spaces passed by the path to form a three-dimensional space set;

[0112] If the coordinates of the blockable target in any three-dimensional space in the three-dimensional space set change, delete the blocking detection result stored in the cache, where the blockable target is a virtual target that makes the action unable to be successfully executed.

[0113] In a possible implementation manner, the device further includes a blocking detection result expansion module, and the blocking detection result expansion module is specifically configured to:

[0114] If the blocking detection result between the first coordinate and the second coordinate indicates the existence of a block, then use the blocking detection result between the first coordinate and the second coordinate as the blocking detection result between the third coordinate and the fourth coordinate, and the line connecting the third coordinate to the fourth coordinate passes through the first coordinate and the second coordinate.

[0115] In a possible implementation, the action target is a second virtual character, and the device further includes an action execution module, and the action execution module is specifically configured to:

[0116] If the blocking detection result between the first coordinate and the second coordinate indicates the non - existence of a block, then assign the execution result of the action executed by the first virtual character to the second virtual character, and the execution result of the action includes increasing the attribute value of the second virtual character or decreasing the attribute value of the second virtual character.

[0117] If the blocking detection result between the first coordinate and the second coordinate indicates the existence of a block, then the first virtual character cannot successfully execute the action.

[0118] In a possible implementation, the action target is an environmental target in the virtual environment, and the device further includes: a movement module, and the movement module is specifically configured to:

[0119] If the blocking detection result between the first coordinate and the second coordinate indicates the non - existence of a block, then control the first virtual character to move from the first coordinate to the second coordinate based on the blocking detection result;

[0120] If the blocking detection result between the first coordinate and the second coordinate indicates the existence of a block, then control the first virtual character to move from the first coordinate to the second coordinate based on the path - finding logic of the game, and the path - finding logic is to find an unblocked path for the first virtual character to move to the second coordinate.

[0121] In a possible implementation, the blocking detection module is specifically configured to:

[0122] Based on the action of the first virtual character in the virtual environment that is about to be executed and has multiple action targets, determine the second coordinates respectively corresponding to the multiple action targets of the first virtual character when the first virtual character acts according to the action;

[0123] The query module is specifically configured to:

[0124] Query the blocking detection result between the first coordinate and each of the second coordinates in the cache.

[0125] In the embodiments of the present application, the term "module" or "unit" refers to a computer program with a predetermined function or a part of a computer program, which works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as a processing circuit or a memory), or a combination thereof. Similarly, one processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be a part of the overall module or unit that includes the function of the module or unit.

[0126] The structure of the blocking detection device in the virtual environment will be introduced below in the forms of the server and the terminal device respectively.

[0127] Figure 18 FIG. is a schematic structural diagram of a server provided by an embodiment of the present application. The server 900 may vary greatly due to different configurations or performances, and may include one or more central processing units (CPUs) 922 (for example, one or more processors) and a memory 932, and one or more storage media 930 (for example, one or more mass storage devices) for storing application programs 942 or data 944. Among them, the memory 932 and the storage media 930 can be short-term storage or persistent storage. The program stored in the storage media 930 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the server. Further, the central processing unit 922 can be set to communicate with the storage media 930 and execute a series of instruction operations in the storage media 930 on the server 900.

[0128] The server 900 may further include one or more power supplies 926, one or more wired or wireless network interfaces 950, one or more input / output interfaces 958, and / or one or more operating systems 941, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM and so on.

[0129] Among them, the CPU 922 is used to execute the following steps:

[0130] Determine the first coordinate based on the position information of the first virtual character in the virtual environment;

[0131] Based on the action that the first virtual character is about to execute in the virtual environment, determine the second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action;

[0132] Query the blocking detection result between the first coordinate and the second coordinate in the cache;

[0133] If the blocking detection result exists in the cache, read the blocking detection result, and the blocking detection result is used as a judgment condition for whether the action is successfully executed;

[0134] If the blocking detection result does not exist in the cache, perform a blocking detection between the first coordinate and the second coordinate to generate a blocking detection result between the first coordinate and the second coordinate; save the blocking detection result between the first coordinate and the second coordinate to the cache.

[0135] The embodiment of the present application also provides another one, as Figure 19 shown. For the convenience of description, only the parts related to the embodiment of the present application are shown. For the specific technical details not disclosed, please refer to the method part of the embodiment of the present application. The terminal can be any terminal device including a mobile phone, a tablet computer, a personal digital assistant (full English name: Personal Digital Assistant, English abbreviation: PDA), a point of sales (full English name: Point of Sales, English abbreviation: POS), an in-vehicle computer, etc. Taking the terminal as a mobile phone as an example:

[0136] Figure 19 Shown is a block diagram of a part of the structure of a mobile phone related to the terminal provided by the embodiment of the present application. Refer to Figure 19 , the mobile phone includes: a radio frequency (full English name: Radio Frequency, English abbreviation: RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (full English name: wirelessfidelity, English abbreviation: WiFi) module 1070, a processor 1080, and a power supply 1090 and other components. Those skilled in the art can understand that Figure 19 the structure of the mobile phone shown in

[0137] does not limit the mobile phone, and may include more or fewer components than shown in the figure, or combine some components, or arrange different components. Figure 19 The following specifically introduces each component of the mobile phone:

[0138] The RF circuit 1010 can be used for receiving and transmitting information or signals during communication. Specifically, after receiving the downlink information from the base station, it is sent to the processor 1080 for processing. Additionally, the uplink data is sent to the base station. Generally, the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier (Full English name: Low Noise Amplifier, English abbreviation: LNA), a duplexer, etc. In addition, the RF circuit 1010 can also communicate with the network and other devices via wireless communication. The above wireless communication can use any communication standard or protocol, including but not limited to the Global System of Mobile communication (Full English name: Global System of Mobile communication, English abbreviation: GSM), General Packet Radio Service (Full English name: General Packet Radio Service, GPRS), Code Division Multiple Access (Full English name: Code Division Multiple Access, English abbreviation: CDMA), Wideband Code Division Multiple Access (Full English name: Wideband Code Division Multiple Access, English abbreviation: WCDMA), Long Term Evolution (Full English name: Long Term Evolution, English abbreviation: LTE), email, Short Messaging Service (Full English name: Short Messaging Service, SMS), etc.

[0139] The memory 1020 can be used to store software programs and modules. The processor 1080 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1020. The memory 1020 mainly includes a program storage area and a data storage area. Among them, the program storage area can store the operating system, application programs required for at least one function (such as the sound playback function, image playback function, etc.); the data storage area can store the data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory 1020 can include high-speed random access memory and can also include non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices.

[0140] The input unit 1030 can be used to receive input numerical or character information and generate key signal inputs related to the user settings and function controls of the mobile phone. Specifically, the input unit 1030 can include a touch panel 1031 and other input devices 1032. The touch panel 1031, also known as a touch screen, can collect touch operations of the user on or near it (such as operations of the user using any suitable object or accessory such as a finger, a stylus, etc. on or near the touch panel 1031), and drive corresponding connection devices according to a pre-set program. Optionally, the touch panel 1031 can include two parts: a touch detection device and a touch controller. Among them, the touch detection device detects the touch position of the user and detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into contact coordinates, and then sends it to the processor 1080, and can receive and execute commands sent by the processor 1080. In addition, various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch panel 1031. In addition to the touch panel 1031, the input unit 1030 can also include other input devices 1032. Specifically, the other input devices 1032 can include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, power on / off keys, etc.), a trackball, a mouse, a joystick, etc.

[0141] The display unit 1040 can be used to display information input by the user or information provided to the user and various menus of the mobile phone. The display unit 1040 can include a display panel 1041. Optionally, the display panel 1041 can be configured in forms such as a liquid crystal display (full English name: Liquid Crystal Display, English abbreviation: LCD), an organic light-emitting diode (full English name: Organic Light-Emitting Diode, English abbreviation: OLED), etc. Further, the touch panel 1031 can cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near it, it transmits it to the processor 1080 to determine the type of touch event. Subsequently, the processor 1080 provides corresponding visual output on the display panel 1041 according to the type of touch event. Although in Figure 19 the touch panel 1031 and the display panel 1041 are implemented as two independent components to realize the input and input functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated to realize the input and output functions of the mobile phone.

[0142] The mobile phone may further include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor. Among them, the ambient light sensor can adjust the brightness of the display panel 1041 according to the brightness of the ambient light, and the proximity sensor can turn off the display panel 1041 and / or the backlight when the mobile phone is moved to the ear. As a kind of motion sensor, the accelerometer sensor can detect the magnitude of acceleration in various directions (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used for applications that identify the posture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as for other sensors that the mobile phone can also be configured with, such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., they will not be elaborated here.

[0143] The audio circuit 1060, the speaker 1061, and the microphone 1062 can provide an audio interface between the user and the mobile phone. The audio circuit 1060 can transmit the electrical signal converted from the received audio data to the speaker 1061, and the speaker 1061 converts it into a sound signal for output; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1060 and then converted into audio data. After the audio data is output to the processor 1080 for processing, it is sent through the RF circuit 1010 to, for example, another mobile phone, or the audio data is output to the memory 1020 for further processing.

[0144] WiFi belongs to short - range wireless transmission technology. The mobile phone can help users send and receive emails, browse the web, and access streaming media through the WiFi module 1070, which provides users with wireless broadband Internet access. Although Figure 19 the WiFi module 1070 is shown, it can be understood that it does not belong to an essential component of the mobile phone and can be omitted completely within the scope of not changing the essence of the invention according to needs.

[0145] The processor 1080 is the control center of the mobile phone. It uses various interfaces and circuits to connect all parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 1020, and by calling the data stored in the memory 1020, it executes various functions of the mobile phone and processes data, thereby collecting overall data and information of the mobile phone. Optionally, the processor 1080 may include one or more processing units; preferably, the processor 1080 may integrate an application processor and a modem processor. Among them, the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communication. It can be understood that the above - mentioned modem processor may not be integrated into the processor 1080 either.

[0146] The mobile phone further includes a power supply 1090 (such as a battery) for supplying power to each component. Preferably, the power supply can be logically connected to the processor 1080 through a power management system, so as to implement functions such as charging management, discharging management, and power consumption management through the power management system.

[0147] Although not shown, the mobile phone may further include a camera, a Bluetooth module, etc., which will not be elaborated here.

[0148] In the embodiment of the present application, the processor 1080 included in the terminal further has the following functions:

[0149] Determine a first coordinate based on the position information of the first virtual character in the virtual environment;

[0150] Based on the action that the first virtual character is about to execute in the virtual environment, determine a second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action;

[0151] Query the blocking detection result between the first coordinate and the second coordinate in the cache;

[0152] If the blocking detection result exists in the cache, read the blocking detection result, and the blocking detection result is used as a judgment condition for whether the action is successfully executed;

[0153] If the blocking detection result does not exist in the cache, perform a blocking detection between the first coordinate and the second coordinate to generate a blocking detection result between the first coordinate and the second coordinate; save the blocking detection result between the first coordinate and the second coordinate to the cache.

[0154] The embodiment of the present application further provides a computer-readable storage medium for storing program codes, and the program codes are used to execute any one of the implementation manners described in the foregoing various embodiments.

[0155] The embodiment of the present application further provides a computer program product including instructions, and when it runs on a computer, it causes the computer to execute any one of the implementation manners described in the foregoing various embodiments.

[0156] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the above-described systems and devices can refer to the corresponding processes in the foregoing method embodiments, which will not be elaborated here.

[0157] In several embodiments provided by the present application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative. For example, the division of the system is only a logical function division. In actual implementation, there may be other division methods. For example, multiple systems can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.

[0158] The systems described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0159] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0160] If the above integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of the present application. And the aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memories (English full name: Read-Only Memory, English abbreviation: ROM), random access memories (English full name: Random Access Memory, English abbreviation: RAM), magnetic disks or optical disks and other various media that can store program codes.

[0161] The above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions recorded in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application.

Claims

1. A method for obstacle detection in a virtual environment, characterized in that, it includes: Determining a first coordinate based on the position information of a first virtual character in the virtual environment; Based on the action that the first virtual character is about to perform in the virtual environment, determining a second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action; Querying the obstacle detection result between the first coordinate and the second coordinate in the cache; If the obstacle detection result exists in the cache, reading the obstacle detection result, and the obstacle detection result is used as a judgment condition for whether the action is successfully executed; If the obstacle detection result does not exist in the cache, performing obstacle detection between the first coordinate and the second coordinate to generate an obstacle detection result between the first coordinate and the second coordinate; Saving the obstacle detection result between the first coordinate and the second coordinate to the cache.

2. The method according to claim 1, characterized in that, The cache stores the obstacle detection results with a quantity upper limit, and the saving the obstacle detection result between the first coordinate and the second coordinate to the cache includes: If the number of obstacle detection results stored in the cache does not reach the quantity upper limit, saving the obstacle detection result between the first coordinate and the second coordinate to the cache; If the number of obstacle detection results stored in the cache reaches the quantity upper limit, deleting the earliest stored obstacle detection result in the cache; saving the obstacle detection result between the first coordinate and the second coordinate to the cache.

3. The method according to claim 1, characterized in that, The method further includes: Dividing the virtual environment into multiple three-dimensional spaces; Determining a first three-dimensional space corresponding to the first coordinate according to the first coordinate, and determining a second three-dimensional space corresponding to the second coordinate according to the second coordinate; Determining a path from the first three-dimensional space to the second three-dimensional space; Using the three-dimensional spaces passed by the path to form a three-dimensional space set; If the coordinates of the blockable target in any three-dimensional space in the three-dimensional space set change, deleting the obstacle detection results stored in the cache, and the blockable target is a virtual target that makes the action unable to be successfully executed.

4. The method according to claim 1, characterized in that, The method further includes: If the obstacle detection result between the first coordinate and the second coordinate is that there is an obstacle, using the obstacle detection result between the first coordinate and the second coordinate as the obstacle detection result between a third coordinate and a fourth coordinate, and the line connecting the third coordinate to the fourth coordinate passes through the first coordinate and the second coordinate.

5. The method according to claim 1, characterized in that, The action target is a second virtual character, and the method further includes: If the blocking detection result between the first coordinate and the second coordinate indicates no blockage, then assign the execution result of the action performed by the first virtual character to the second virtual character, where the execution result of the action includes increasing or decreasing the attribute value of the second virtual character. If the blocking detection result between the first coordinate and the second coordinate indicates the existence of a blockage, then the first virtual character cannot successfully perform the action.

6. The method according to claim 1, wherein, the action target is an environmental target in the virtual environment, and the method further includes: if the blocking detection result between the first coordinate and the second coordinate indicates no blockage, then control the first virtual character to move from the first coordinate to the second coordinate based on the blocking detection result; if the blocking detection result between the first coordinate and the second coordinate indicates the existence of a blockage, then control the first virtual character to move from the first coordinate to the second coordinate based on the pathfinding logic of the game, where the pathfinding logic is to find an unblocked path for the first virtual character to move to the second coordinate.

7. The method according to claim 1, wherein, determining the second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action based on the action that the first virtual character is about to perform in the virtual environment includes: determining the second coordinates corresponding to the multiple action targets of the first virtual character respectively when the first virtual character acts according to the action based on the action with multiple action targets that the first virtual character is about to perform in the virtual environment; querying the blocking detection result between the first coordinate and the second coordinate in the cache includes: querying the blocking detection result between the first coordinate and each second coordinate in the cache.

8. A blocking detection device in a virtual environment, wherein, it includes: a first coordinate determination module for determining a first coordinate based on the position information of a first virtual character in the virtual environment; a second coordinate determination module for determining the second coordinate corresponding to the action target of the first virtual character when the first virtual character acts according to the action based on the action that the first virtual character is about to perform in the virtual environment; a query module for querying the blocking detection result between the first coordinate and the second coordinate in the cache; a reading module for reading the blocking detection result if the blocking detection result exists in the cache, where the blocking detection result is used as a judgment condition for whether the action is successfully executed; a blocking detection module for performing a blocking detection between the first coordinate and the second coordinate to generate a blocking detection result between the first coordinate and the second coordinate if the blocking detection result does not exist in the cache; saving the blocking detection result between the first coordinate and the second coordinate to the cache.

9. A blocking detection device in a virtual environment, wherein, the device includes a processor and a memory: The memory is used to store program code and transmit the program code to the processor; The processor is configured to execute the steps recited in any one of claims 1 to 7 according to the instructions in the program code.

10. A computer-readable storage medium, characterized in that, the computer-readable storage medium is used to store program code, and the program code is used to execute the steps recited in any one of claims 1 to 7.

11. A computer program product, characterized in that, it includes a computer program or instructions which, when executed, implement the steps recited in any one of claims 1 to 7.