Role way-finding method and device based on static obstacles
By assigning dynamic identifiers to static obstacles and allowing conditional operations to change their attributes, impassable paths can be transformed into feasible paths, thus solving the problem of low accuracy in character pathfinding and achieving more efficient and accurate path planning.
Patent Information
- Application Number
- CN202410982557.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-19
- Publication Date
- 2026-01-20
AI Technical Summary
In character pathfinding scenarios based on static obstacles, existing technologies treat obstacles as insurmountable areas, resulting in low accuracy in path planning and consequently, low accuracy in character pathfinding.
By acquiring dynamic identifiers of static obstacles that are associated with obstacle paths, it is possible to change their obstacle attributes under conditional operations, thereby re-identifying previously impassable paths as feasible paths and expanding the range of feasible path selections.
It improves the accuracy of role-based pathfinding based on static obstacles and enhances the flexibility and adaptability of path planning, especially in complex environments where it can efficiently and accurately find the optimal path.
Smart Images

Figure CN121363957A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of computers, and in particular, to a role pathfinding method based on static obstacles, an apparatus and a storage medium, and an electronic device. BACKGROUND
[0002] In the role pathfinding scenario based on static obstacles, obstacles are usually regarded as non-crossable areas, for example, when encountering a building, the building will be bypassed. However, this method ignores the possibility of a passable path inside the obstacle, such as the door of the building. In fact, through the open or closed door, there may be a shorter path directly through the building. Therefore, only regarding obstacles as static and non-crossable entities will result in reduced accuracy of path planning, and thus the problem of low accuracy of role pathfinding based on static obstacles occurs. Therefore, there is a problem of low accuracy of role pathfinding based on static obstacles.
[0003] In view of the above problems, no effective solutions have been proposed so far. SUMMARY
[0004] Embodiments of the present application provide a role pathfinding method based on static obstacles, an apparatus and a storage medium, and an electronic device, to at least solve the technical problem of low accuracy of role pathfinding based on static obstacles.
[0005] According to an aspect of the embodiments of the present application, there is provided a method for pathfinding of a virtual character based on static obstacles, comprising: in response to a pathfinding request triggered for a virtual character, obtaining a candidate grid area, wherein the pathfinding request is used to request a movement path of the virtual character from a first position in a navigation grid to a second position in the navigation grid, and the candidate grid area is an area in which grids constituting the movement path are located in the navigation grid; obtaining an obstacle path with a first dynamic identifier in the candidate grid area, wherein the obstacle path is a path that is prohibited to pass, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited to pass due to a static obstacle having an association relationship; obtaining a static obstacle with a second dynamic identifier in the candidate grid area, wherein the static obstacle with the second dynamic identifier has the association relationship with the obstacle path with the first dynamic identifier, the static obstacle is an object with a fixed position and an obstacle attribute, the obstacle attribute is used to set whether the static obstacle is allowed to pass or prohibited to pass, and the second dynamic identifier is used to indicate that the static obstacle can be operated by a condition to change the setting of the obstacle attribute; in a case where the virtual character is allowed to perform the condition operation, identifying the obstacle path with the first dynamic identifier as a feasible path, wherein the feasible path is a path that the virtual character can pass; and obtaining the movement path based on the feasible path in the candidate grid area.
[0006] According to another aspect of the embodiments of the present application, there is provided another method for pathfinding of a virtual character based on static obstacles, comprising: using a first dynamic identifier to mark an obstacle path in a navigation grid that is prohibited to pass due to a static obstacle having an association relationship, wherein the obstacle path is a path that is prohibited to pass, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited to pass due to the static obstacle having the association relationship; using a second dynamic identifier to mark a static obstacle in the navigation grid that can be operated by a condition to change an obstacle attribute, wherein the static obstacle is an object with a fixed position and the obstacle attribute, the obstacle attribute is used to set whether the static obstacle is allowed to pass or prohibited to pass, and the second dynamic identifier is used to indicate that the static obstacle can be operated by the condition to change the setting of the obstacle attribute; and in response to a pathfinding request triggered for a virtual character by using the marked navigation grid, wherein the pathfinding request is used to request a movement path of the virtual character from a first position in the navigation grid to a second position in the navigation grid.
[0007] According to another aspect of the embodiments of the present application, a virtual character pathfinding device based on static obstacles is also provided, comprising: a first obtaining unit configured to obtain a candidate grid area in response to a pathfinding request triggered by a virtual character, wherein the pathfinding request is used to request a movement path of the virtual character from a first position in a navigation grid to a second position in the navigation grid, and the candidate grid area is an area in which grids constituting the movement path are located in the navigation grid; a second obtaining unit configured to obtain an obstacle path with a first dynamic identifier in the candidate grid area, wherein the obstacle path is a path that is prohibited to pass through, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited to pass through due to a static obstacle having an associated relationship; a third obtaining unit configured to obtain a static obstacle with a second dynamic identifier in the candidate grid area, wherein the static obstacle with the second dynamic identifier has the associated relationship with the obstacle path with the first dynamic identifier, the static obstacle is an object with a fixed position and an obstacle attribute, the obstacle attribute is used to set whether the static obstacle allows to pass through or is prohibited to pass through, and the second dynamic identifier is used to indicate that the static obstacle can be operated by a condition to change the setting of the obstacle attribute; a path unit configured to identify the obstacle path with the first dynamic identifier as a feasible path in a case that the virtual character is allowed to perform the condition operation, wherein the feasible path is a path that the virtual character can pass through; and a fourth obtaining unit configured to obtain the movement path based on the feasible path in the candidate grid area.
[0008] As an optional solution, the third obtaining unit comprises: a first obtaining module configured to obtain additional information carried by the obstacle path with the first dynamic identifier, wherein the additional information is used to indicate the static obstacle having the associated relationship with the obstacle path with the first dynamic identifier; and a determination module configured to determine the static obstacle with the second dynamic identifier from N static obstacles in the candidate grid area according to the indication of the additional information, wherein N is an integer greater than 1.
[0009] As an optional solution, the obtaining module comprises: an obtaining submodule configured to obtain a resource serial number carried by the obstacle path with the first dynamic identifier, wherein the resource serial number is an identifier corresponding to each static obstacle in the N static obstacles, different static obstacles correspond to different resource serial numbers, and the additional information comprises the resource serial number.
[0010] As an optional solution, the device further comprises a determining unit configured to determine a candidate grid region from the candidate grid region after the response to the pathfinding request triggered by the virtual character, wherein the candidate grid region satisfies the movement condition of the virtual character; the second obtaining unit comprises a second obtaining module configured to determine the obstacle path with the first dynamic identifier from the candidate grid region; and the third obtaining unit comprises a third obtaining module configured to determine the static obstacle with the second dynamic identifier from the candidate grid region.
[0011] According to another aspect of the embodiments of the present application, another device for character pathfinding based on static obstacles is further provided, which comprises a first marking unit configured to mark an obstacle path in a navigation grid which is prohibited to pass due to a static obstacle with an associated relationship by using a first dynamic identifier, wherein the obstacle path is a path prohibited to pass, and the first dynamic identifier is used to indicate that the obstacle path is a path prohibited to pass due to the static obstacle with the associated relationship; a second marking unit configured to mark a static obstacle in the navigation grid which can be operated by a condition to change an obstacle attribute by using a second dynamic identifier, wherein the static obstacle is an object with a fixed position and an obstacle attribute, the obstacle attribute is used to set the static obstacle to be allowed to pass or prohibited to pass, and the second dynamic identifier is used to indicate that the static obstacle can be operated by a condition to change the setting of the obstacle attribute; and a pathfinding unit configured to respond to a pathfinding request triggered by a virtual character by using the marked navigation grid, wherein the pathfinding request is used to request to obtain a movement path of the virtual character from a first position in the navigation grid to a second position in the navigation grid.
[0012] As an optional solution, the device further comprises a constructing unit configured to construct an initial grid according to model vertex information corresponding to a virtual scene before the first marking unit marks the obstacle path in the navigation grid which is prohibited to pass due to the static obstacle with the associated relationship by using the first dynamic identifier; and a third marking unit configured to mark an obstacle region and a pass region in the initial grid according to a movement attribute corresponding to a virtual character moving in the virtual scene before the first marking unit marks the obstacle path in the navigation grid which is prohibited to pass due to the static obstacle with the associated relationship by using the first dynamic identifier.
[0013] As an optional solution, the marking unit comprises at least one of the following: a first marking module configured to mark a first region in the initial grid which is set as forbidden to pass but can be reached by a first passable path, as the passable region, wherein the first passable path is determined according to the movement attribute; a second marking module configured to mark a second region and a third region in the initial grid as the obstacle region, wherein the second region is adjacent to the third region but lacks a second passable path, and the second passable path is determined according to the movement attribute; and a third marking module configured to mark a fourth region in the initial grid which is set as allowed to pass but has insufficient height, as the obstacle region, wherein the fourth region with insufficient height is determined according to the movement attribute.
[0014] As an optional solution, the marking unit comprises a fourth marking module configured to mark a fifth region in the initial grid as the obstacle region, wherein the initial grid is divided into at least two regions, and the at least two regions comprise the fifth region, and a region boundary width of the fifth region is less than a movement width indicated by the movement attribute.
[0015] As an optional solution, the first marking unit comprises a fourth obtaining module configured to obtain an obstacle path intersecting any static obstacle in the navigation grid, wherein the association relationship is determined according to the intersection of the static obstacle; and a storage module configured to store a resource serial number corresponding to the static obstacle intersecting the obstacle path, wherein the resource serial number is used to determine the obstacle path and the static obstacle having the association relationship.
[0016] As an optional solution, the second marking unit comprises a fifth marking module configured to mark a first sub-object in the static obstacle which can be operated to change the obstacle attribute using the second dynamic identifier, wherein the second dynamic identifier is used to indicate that the first sub-object can be operated to change the setting of the obstacle attribute; and the device further comprises a fourth marking unit configured to mark a second sub-object in the static obstacle which can be operated to change the obstacle attribute using a static identifier during the process of marking the static obstacle which can be operated to change the obstacle attribute using the second dynamic identifier, wherein the static identifier is used to indicate that the second sub-object is forbidden to change the setting of the obstacle attribute.
[0017] According to a further aspect of the embodiments of the present application, a computer program product or computer program is provided, which comprises computer instructions stored in a computer readable storage medium. A processor of an electronic device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the electronic device to perform the role pathfinding method based on static obstacles as described above.
[0018] According to a further aspect of the embodiments of the present application, an electronic device is also provided, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the role pathfinding method based on static obstacles as described above through the computer program.
[0019] In the embodiments of the present application, the obstacles are no longer regarded as completely impassable, but the dynamic properties thereof are considered, such as obtaining static obstacles having an association relationship with the obstacle paths, which are fixed in position, but the obstacle properties thereof can be changed through conditional operations. In the case where the virtual role is allowed to perform the conditional operations, the embodiments re-identify the paths originally regarded as obstacles as feasible paths, and thus the selection range of the feasible paths is expanded, thereby achieving the technical effect of improving the role pathfinding accuracy based on static obstacles, and further solving the technical problem of low role pathfinding accuracy based on static obstacles. BRIEF DESCRIPTION OF DRAWINGS
[0020] The accompanying drawings, which are included to provide a further understanding of the present application, constitute a part of the present application and illustrate the illustrative embodiments of the present application and the explanations thereof, and do not constitute improper limitations on the present application. In the drawings:
[0021] Figure 1 is a schematic diagram of an application environment of an optional role pathfinding method based on static obstacles according to an embodiment of the present application;
[0022] Figure 2 is a schematic diagram of a flow of an optional role pathfinding method based on static obstacles according to an embodiment of the present application;
[0023] Figure 3 is a schematic diagram of an optional role pathfinding method based on static obstacles according to an embodiment of the present application;
[0024] Figure 4 is a schematic diagram of a flow of another optional role pathfinding method based on static obstacles according to an embodiment of the present application;
[0025] Figure 5 is a schematic diagram of another optional role pathfinding method based on static obstacles according to an embodiment of the present application;
[0026] Figure 6 is a schematic diagram of another optional static obstacle based role pathfinding method according to an embodiment of the present application;
[0027] Figure 7 is a schematic diagram of an optional static obstacle based role pathfinding apparatus according to an embodiment of the present application;
[0028] Figure 8 is a schematic diagram of another optional static obstacle based role pathfinding apparatus according to an embodiment of the present application;
[0029] Figure 9 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to enable persons skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by persons skilled in the art without creative work should fall within the scope of protection of the present application.
[0031] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to the process, method, product or device.
[0032] According to an aspect of an embodiment of the present application, there is provided a static obstacle based role pathfinding method. Optionally, as an optional implementation, the above-mentioned static obstacle based role pathfinding method can be applied in an environment as shown in Figure 1 , but is not limited thereto. Wherein, it can but is not limited to include a user device 102 and a server 112, the user device 102 can but is not limited to include a display 104, a processor 106 and a memory 108, and the server 112 includes a database 114 and a processing engine 116.
[0033] The specific process can be summarized in the following steps:
[0034] Step S102: User equipment 102 obtains a pathfinding request triggered by the virtual character;
[0035] Step S104: Send the routing request to the server 112 via network 110;
[0036] In steps S106-S112, server 112 responds to the pathfinding request triggered by the virtual character through processing engine 116, obtains candidate grid areas, and further obtains obstacle paths with first dynamic identifiers and static obstacles with second dynamic identifiers in the candidate grid areas; and if the virtual character allows the execution of conditional operations, it identifies obstacle paths with first dynamic identifiers as feasible paths, and obtains movement paths based on feasible paths in the candidate grid areas;
[0037] In step S114, the mobile path is sent to the user equipment 102 via the network 110. The user equipment 102 displays the mobile path on the display 104 via the processor 106 and stores the mobile path in the memory 108.
[0038] remove Figure 1 Beyond the examples shown, the terminal devices described above can be terminal devices configured with a target client, including but not limited to at least one of the following: mobile phones (such as Android phones, iOS phones, etc.), laptops, tablets, PDAs, MIDs (Mobile Internet Devices), PADs, desktop computers, smart TVs, etc. The target client can be a video client, instant messaging client, browser client, educational client, etc. The networks described above can include, but are not limited to, wired networks and wireless networks. The wired networks include local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs). The wireless networks include Bluetooth, Wi-Fi, and other networks that enable wireless communication. The server described above can be a single server, a server cluster consisting of multiple servers, or a cloud server. The above is merely an example, and no limitations are imposed in this embodiment.
[0039] Alternatively, as an alternative implementation method, such as Figure 2 As shown, the role pathfinding method based on static obstacles can be executed by an electronic device, such as... Figure 1 The user equipment or server shown includes the following specific steps:
[0040] S202, in response to a pathfinding request triggered by the virtual character, obtaining a candidate grid area, wherein the pathfinding request is used to request to obtain a movement path of the virtual character from a first position in a navigation grid to a second position in the navigation grid, and the candidate grid area is an area in which grids constituting the movement path are located in the navigation grid;
[0041] S204, obtaining an obstacle path with a first dynamic identifier in the candidate grid area, wherein the obstacle path is a path that is prohibited to pass through, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited to pass through due to a static obstacle having an association relationship;
[0042] S206, obtaining a static obstacle with a second dynamic identifier in the candidate grid area, wherein the static obstacle with the second dynamic identifier has an association relationship with the obstacle path with the first dynamic identifier, the static obstacle is an object with a fixed position and an obstacle attribute, the obstacle attribute is used to set whether the static obstacle allows passage or is prohibited to pass through, and the second dynamic identifier is used to indicate that the static obstacle can be operated by a conditional operation to change the setting of the obstacle attribute;
[0043] S208, in a case where the virtual character allows the conditional operation to be performed, identifying the obstacle path with the first dynamic identifier as a feasible path, wherein the feasible path is a path that the virtual character can pass through;
[0044] S210, obtaining the movement path based on the feasible path in the candidate grid area.
[0045] Optionally, in the embodiment, the above-mentioned character pathfinding method based on static obstacles can be applied in multiple scenes, such as in a role-playing game (RPG) scene, a virtual character controlled by a player needs to move from the entrance of a village to the exit of the village. The game map is a navigation grid containing various buildings, trees and other static obstacles.
[0046] First, a candidate grid area is determined, which contains all the grids that can be passed through from the starting point to the end point. Within this area, some paths are marked as obstacle paths because they are blocked by houses or other static obstacles. These static obstacles (such as houses and trees) are originally set to be prohibited to pass through, and have a second dynamic identifier, meaning that they can become passable under certain conditions. If the player completes a certain task (such as finding a certain prop or solving a certain puzzle), these originally prohibited obstacles (such as a door that is originally locked) can become passable. Upon detecting this change, the originally marked obstacle paths are re-identified as feasible paths. Finally, based on the new set of feasible paths, an optimal path from the starting point to the end point is planned for the player.
[0047] Optionally, in this embodiment, the pathfinding request can be a request triggered by a virtual character, aiming to obtain a movement path from one location (first location) to another location (second location) in a navigation mesh.
[0048] Optionally, in this embodiment, the candidate mesh regions can be a set of meshes in the navigation mesh that can constitute a movement path. These meshes are regions that the virtual character can pass through.
[0049] Optionally, in this embodiment, the obstacle path can be a path marked as forbidden to pass through, which can be caused by the presence of certain obstacles, or a path forbidden to pass through due to association with static obstacles, with a first dynamic identifier.
[0050] Optionally, in this embodiment, the static obstacle can be an object with a fixed position, having an obstacle attribute, which can be set to allow or forbid passage. When the static obstacle is associated with an obstacle path, it will be marked with a second dynamic identifier, meaning that the passage state of the static obstacle can be changed through certain conditional operations.
[0051] Optionally, in this embodiment, the conditional operation is a specific operation that can change the obstacle attribute of the static obstacle. When the virtual character is allowed to perform these operations, the obstacle path that was originally forbidden to pass through can become a feasible path, such as opening a door, opening a window, climbing over, rock climbing, etc.
[0052] Optionally, in this embodiment, the feasible path can include paths that are directly marked as passable, and paths that are originally marked as obstacle paths but become passable under certain conditions. Once the obstacle path is identified as a feasible path, the virtual character can move through it for pathfinding.
[0053] For further illustration, optionally, a player-controlled character needs to move from point A to point B. The game map is a navigation mesh, in which certain paths are blocked by houses, forming obstacle paths. However, some of these houses can be opened by completing certain tasks (such as finding a key). When the player completes the task and obtains the key, the paths originally blocked by the houses become feasible paths, and the character can now move through these paths to the target point, and thus the above-mentioned paths blocked by the houses are considered as paths for pathfinding.
[0054] It should be noted that by introducing dynamic identifiers and conditional operations, this embodiment can adjust path planning according to actual conditions, enabling virtual characters (or actual devices) to efficiently and accurately find the optimal path from the starting point to the ending point in a complex and variable environment. This not only improves user experience (such as in a game environment), but also improves the efficiency and safety of actual applications (such as in intelligent transportation or warehouse systems).
[0055] Further exemplarily, the optional Figure 3 As shown, in response to a pathfinding request triggered for the virtual character 302, a candidate grid area is obtained, where the pathfinding request is used to request to obtain a movement path of the virtual character 302 from a first position 306 in the navigation grid 304 to a second position 308 in the navigation grid 304, and the candidate grid area is an area in which grids constituting the movement path are located in the navigation grid 304;
[0056] An obstacle path 310 with the first dynamic identifier in the candidate grid area is obtained, where the obstacle path 310 is a path that is prohibited to pass through, and the first dynamic identifier is used to indicate that the obstacle path 310 is a path that is prohibited to pass through due to the static obstacle 314 having an association relationship;
[0057] A static obstacle 314 with the second dynamic identifier in the candidate grid area is obtained, where the static obstacle 314 with the second dynamic identifier has an association relationship with the obstacle path 310 with the first dynamic identifier, the static obstacle 314 is an object that is fixed in position and has an obstacle attribute, the obstacle attribute is used to set whether the static obstacle 314 is allowed to pass through or prohibited to pass through, and the second dynamic identifier is used to indicate that the static obstacle 314 can be operated by a conditional operation to change the setting of the obstacle attribute;
[0058] In a case where the virtual character 302 is allowed to perform the conditional operation, the obstacle path 310 with the first dynamic identifier is identified as a feasible path 312, where the feasible path 312 is a path that the virtual character 302 can pass through; and based on the feasible path 312 in the candidate grid area, the movement path is obtained.
[0059] Through the embodiments provided in the present application, the obstacles are no longer regarded as completely impassable, but the dynamic attributes thereof are considered, such as obtaining the static obstacles having an association relationship with the obstacle paths, which are fixed in position, but the obstacle attributes thereof can be changed by the conditional operation. In a case where the virtual character is allowed to perform the conditional operation, the embodiments re-identify the path that is originally regarded as an obstacle as a feasible path, and thus the purpose of expanding the selection range of the feasible path is achieved, thereby achieving the technical effect of improving the pathfinding accuracy of the character based on the static obstacles.
[0060] As an optional solution, obtaining the static obstacle with the second dynamic identifier in the candidate grid area includes:
[0061] S1-1, obtaining additional information of the obstacle path with the first dynamic identifier, where the additional information is used to indicate the static obstacle having the association relationship with the obstacle path with the first dynamic identifier;
[0062] S1-2, determine, according to the indication of the additional information, the static obstacle with the second dynamic identifier from the N static obstacles of the candidate grid area, where N is an integer greater than 1.
[0063] Optionally, in the embodiment, the additional information can be information associated with the obstacle path with the first dynamic identifier, used to indicate the static obstacles having an association relationship with the path, such as the ID or number of the static obstacle, the position coordinates of the static obstacle, the type or classification of the obstacle, and the like.
[0064] It should be noted that the embodiment describes how to identify and obtain those static obstacles (which will be given the second dynamic identifier) associated with the path of a certain dynamic obstacle (with the first dynamic identifier) from the candidate grid area. This process is divided into two steps: first, the embodiment obtains additional information related to the obstacle path with the first dynamic identifier, which can indicate which static obstacles are associated with the dynamic path; second, according to the indication of the additional information, the embodiment identifies those static obstacles related to the dynamic path from the multiple static obstacles in the candidate grid area and gives them the second dynamic identifier.
[0065] Further illustration, optionally, it is assumed that in an intelligent warehouse system, mobile robots (with the first dynamic identifier) are moving in the warehouse to carry goods. The moving path of these robots may interact with certain static obstacles (such as shelves, pillars, etc.) in the warehouse. In order to avoid collision, the system needs to know which static obstacles are associated with the moving path of the robot. At this time, the system can use the above method to determine these associated static obstacles by obtaining additional information and giving them the second dynamic identifier for subsequent path planning and obstacle avoidance operations.
[0066] Through the embodiments provided in the present application, static obstacles associated with the path of a dynamic obstacle can be identified in real time and accurately, and specific identifiers can be given to them. This enables the system to more accurately consider the influence of these static obstacles in subsequent path planning and obstacle avoidance operations, thereby improving the safety and operating efficiency of the entire system. At the same time, this method also enhances the flexibility and adaptability of the system, enabling it to perform efficient navigation and operation in a complex dynamic environment.
[0067] As an optional solution, the additional information carried by the obstacle path with the first dynamic identifier includes:
[0068] The resource serial number carried by the obstacle path with the first dynamic identifier, wherein the resource serial number is an identifier corresponding to each static obstacle of the N static obstacles, and different static obstacles correspond to different resource serial numbers, and the additional information includes the resource serial number.
[0069] Optionally, in this embodiment, the resource sequence number is a unique identifier corresponding to each static obstacle in the N static obstacles. Different static obstacles correspond to different resource sequence numbers, which are used to distinguish and identify each static obstacle.
[0070] It should be noted that this embodiment describes how to obtain additional information related to the obstacle path with the first dynamic identifier, in particular the resource sequence number. The resource sequence number is the identifier of the static obstacle, and each static obstacle has a unique resource sequence number, which is included in the additional information.
[0071] Further illustration, optionally, it is assumed that in an intelligent logistics warehouse, there are multiple shelves as static obstacles. Each shelf is assigned a unique resource sequence number, such as shelf A with resource sequence number 001, shelf B with resource sequence number 002, and so on. When a mobile robot with a first dynamic identifier plans its path, this embodiment obtains additional information on this path, including the resource sequence numbers of which shelves (i.e. static obstacles) so that the robot can know which shelves to avoid or interact with during the journey.
[0072] By obtaining the resource sequence number carried by the obstacle path with the first dynamic identifier as additional information, this embodiment can accurately know which static obstacles are associated with the dynamic path. This makes this embodiment more accurate and efficient when planning paths and avoiding obstacles. At the same time, the uniqueness of the resource sequence number ensures that each static obstacle can be correctly identified and detected, thereby improving the reliability and safety of the entire system.
[0073] As an optional solution, in response to the pathfinding request triggered by the virtual character, the method further comprises: determining a candidate grid area from the candidate grid area, wherein the candidate grid area meets the movement condition of the virtual character;
[0074] Obtaining the obstacle path with the first dynamic identifier in the candidate grid area comprises: determining the obstacle path with the first dynamic identifier from the candidate grid area;
[0075] Obtaining the static obstacle with the second dynamic identifier in the candidate grid area comprises: determining the static obstacle with the second dynamic identifier from the candidate grid area.
[0076] Optionally, in this embodiment, the alternative grid regions can be further filtered from the candidate grid regions, which meet the virtual character movement conditions, where the virtual character movement conditions can refer to the restrictions and requirements that the virtual character (such as a player-controlled character, NPC, robot, or other dynamic entity) is subject to when moving in the game or a specific environment. These conditions can be set based on game rules, physical limitations, character attributes, or task requirements, among other factors.
[0077] The virtual character movement conditions can include, but are not limited to, the following aspects:
[0078] Terrain adaptability: The virtual character may only be able to move on certain terrains, such as flat ground, grass, sand, etc., and cannot walk on water or vertical walls.
[0079] Movement speed: The movement speed of the character may be limited, depending on the character's attributes (such as strength, agility, etc.) or external factors (such as whether carrying heavy objects, whether injured, etc.).
[0080] Jumping ability: The character may have different jumping heights and distances, which will affect the areas it can reach.
[0081] Passability: Some areas may be too narrow or have obstacles that prevent the character from passing through.
[0082] Special abilities: Certain characters may have special skills, such as flying, teleportation, etc., which greatly expand their range of movement.
[0083] Task or plot restrictions: In certain specific tasks or plots, the movement of the character may be restricted, for example, only within a certain area, or needing to follow a specific path.
[0084] Safety considerations: This embodiment may set up some safety areas where the character will not be harmed, while leaving these areas may face danger.
[0085] Interaction requirements: In some cases, the character needs to interact with other objects or NPCs in the environment, which may affect its movement (for example, needing to stop and talk to the NPC).
[0086] It should be noted that this embodiment describes several key steps in a pathfinding method. First, in response to a pathfinding request from a virtual character, a series of candidate grid regions are obtained. Then, from these candidate grid regions, alternative grid regions that meet the virtual character movement conditions are filtered out. Next, the obstacle path with the first dynamic identifier and the static obstacle with the second dynamic identifier are determined from the alternative grid regions.
[0087] For further illustration, in an optional example in a game scenario, a virtual character controlled by a player needs to move from one location to another. The embodiment first generates a series of candidate grid areas, which may contain paths that the player can walk on and possible obstacles. Then, the embodiment filters out candidate grid areas according to the moving ability of the player (such as jumping height, moving speed, etc.). Finally, the embodiment determines which areas are obstacle paths with the first dynamic identifier (such as moving enemies, open doors, etc.) and which areas are static obstacles with the second dynamic identifier (such as a bridge that may collapse suddenly, a treasure chest that can be opened, etc.) from the candidate grid areas.
[0088] Through the embodiments provided in the present application, the obstacle paths that need to be avoided by the virtual character in the pathfinding process and the static obstacles that may change in state can be more accurately determined. This not only can improve the accuracy and efficiency of pathfinding, but also can increase the interest and challenge of the game. At the same time, in the real-world path planning problem, this method can also help autonomous vehicles or robots to reach the destination more safely and efficiently.
[0089] Optionally, as an optional implementation, as shown in Figure 4 The character pathfinding method based on static obstacles can be executed by an electronic device, which can be a user device or a server as shown in Figure 1 The specific steps include:
[0090] S402, using a first dynamic identifier to mark an obstacle path in a navigation grid that is prohibited to pass due to an associated static obstacle, wherein the obstacle path is a path that is prohibited to pass, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited to pass due to the associated static obstacle;
[0091] S404, using a second dynamic identifier to mark a static obstacle in the navigation grid that can be changed in obstacle attribute through conditional operation, wherein the static obstacle is a fixed-position object with an obstacle attribute, the obstacle attribute is used to set the static obstacle to allow or prohibit passing, and the second dynamic identifier is used to indicate that the static obstacle can be changed in obstacle attribute through conditional operation;
[0092] S406, responding to a pathfinding request triggered for a virtual character through the marked navigation grid, wherein the pathfinding request is used to request a moving path of the virtual character from a first position in the navigation grid to a second position in the navigation grid.
[0093] The specific embodiments can refer to the examples shown in the above-mentioned character pathfinding method based on static obstacles, which will not be described here in this example.
[0094] It should be noted that by introducing the first dynamic identifier and the second dynamic identifier, the embodiment can more accurately understand the actual passing state of the static obstacle and the internal path thereof. This refined understanding enables the embodiment to make more accurate decisions when planning a path, thereby significantly improving the accuracy of the virtual character's pathfinding based on static obstacles.
[0095] By way of further example, in an optional game environment, there is a door (static obstacle) and a corridor (path). The door is closed by default, resulting in a part of the corridor (obstacle path) being impassable. The embodiment uses the first dynamic identifier to mark this part of the corridor that is impassable due to the closed door. At the same time, the door can change its passing state through certain conditional operations (such as finding a key and opening the door), so the embodiment uses the second dynamic identifier to mark the door. When a player (virtual character) requests to move from one end of the corridor to the other end, the embodiment will refer to these identifiers to plan a feasible moving path.
[0096] Through the embodiments provided in the present application, obstacles are no longer regarded as completely impassable, but their dynamic properties are considered, such as obtaining static obstacles having an associated relationship with the obstacle path. These static obstacles, although fixed in position, have obstacle properties that can be changed through conditional operations. In this way, in the case where the virtual character is allowed to perform these conditional operations, the embodiment re-identifies the path that was originally considered an obstacle as a feasible path, thereby achieving the purpose of expanding the selection range of feasible paths, and thus achieving the technical effect of improving the accuracy of the virtual character's pathfinding based on static obstacles.
[0097] As an optional solution, before using the first dynamic identifier to mark the obstacle path in the navigation grid that is prohibited from passing due to the associated static obstacle, the method further comprises:
[0098] S2-1, constructing an initial grid according to model vertex information corresponding to the virtual scene;
[0099] S2-2, marking obstacle regions and passing regions in the initial grid according to movement attributes corresponding to the virtual character moving in the virtual scene.
[0100] Optionally, in the embodiment, the initial grid can be a basic grid structure constructed based on the model vertex information of the virtual scene, for subsequent path planning and navigation.
[0101] Optionally, in the embodiment, the movement attribute can refer to the characteristics that the virtual character has when moving in the scene, such as moving speed, ability to jump, ability to cross certain types of obstacles, etc., which will affect the character's moving ability in the scene.
[0102] Optionally, in this embodiment, the obstacle region can be a region marked as impassable in the initial grid, usually due to the presence of obstacles or terrain restrictions, etc.
[0103] Optionally, in this embodiment, the passable region can be a region marked as passable in the initial grid, where the character can move freely.
[0104] It should be noted that the embodiment described relates to a pathfinding method in a virtual scene, particularly the preparation steps before using dynamic markers to label the navigation grid. First, according to the model vertex information of the virtual scene, an initial grid is constructed, which is the basis for subsequent path planning. Then, according to the movement attributes of the virtual character moving in the virtual scene, the obstacle regions and passable regions in the initial grid are marked to clearly indicate which places the character cannot pass through and which places the character can pass through.
[0105] Further illustration, optionally in a game scene, the terrain can include mountains, rivers, forests and plains, etc. First, according to the model vertex information of these terrains, this embodiment will construct an initial grid. Next, considering that the character in the game may not be able to climb mountains or cross deep rivers, these regions will be marked as obstacle regions. While plains and shallow rivers may be marked as passable regions, as the character can move freely in these places.
[0106] By constructing an initial grid according to the model vertex information of the virtual scene, and marking obstacle regions and passable regions according to the movement attributes of the virtual character, this embodiment can establish an accurate and efficient navigation foundation. This helps the subsequent path planning algorithm to find the optimal path from the starting point to the ending point more quickly, while ensuring the safety and feasibility of the path. This method improves the movement efficiency and pathfinding accuracy of virtual characters in complex scenes.
[0107] As an optional solution, the obstacle regions and passable regions in the initial grid are marked according to the movement attributes of the virtual character moving in the virtual scene, including at least one of the following:
[0108] S3-1, marking a first region in the initial grid as a passable region, where the first region is set as impassable but can be reached by a first path allowing passage, wherein the first path allowing passage is determined according to the movement attributes;
[0109] S3-2, marking a second region and a third region in the initial grid as obstacle regions, wherein the second region and the third region are adjacent but lack a second path allowing passage, wherein the second path allowing passage is determined according to the movement attributes;
[0110] S3-3, marking the fourth region in the initial grid that is set to allow passage but has insufficient height as an obstacle region, wherein the fourth region with insufficient height is determined according to the movement attribute.
[0111] Optionally, in this embodiment, the passage region can be a region in the initial grid that is determined to be passable according to the movement attribute of the virtual character.
[0112] Optionally, in this embodiment, the obstacle region can be a region in the initial grid that the virtual character cannot pass through due to various reasons such as terrain, height restrictions, etc.
[0113] Optionally, in this embodiment, the movement attribute can refer to the movement ability of the virtual character in the virtual scene, including but not limited to jumping height, ability to cross obstacles, etc.
[0114] It should be noted that this embodiment describes how to mark the obstacle region and the passage region in the initial grid according to the movement attribute of the virtual character. Specifically, three different situations are involved: first, some regions that are originally set to prohibit passage should be marked as passage regions if the virtual character can reach them through a certain path; second, if there is a lack of path between two adjacent regions that the virtual character can pass through, these regions should be marked as obstacle regions; third, even if some regions are originally set to allow passage, if their height is insufficient for the virtual character to pass through, these regions should also be marked as obstacle regions.
[0115] For further illustration, optionally, it is assumed that in a game scene, there is a low tunnel, a high platform, and a broken bridge. According to the movement attribute of the player (such as jumping height and crossing ability):
[0116] If the player can bend down to pass through the low tunnel, the tunnel region is marked as a passage region.
[0117] If the high platform is too high for the player to jump onto, the high platform region is marked as an obstacle region.
[0118] If there is not enough path on both sides of the broken bridge for the player to pass through, the regions on both sides of the bridge are also marked as obstacle regions.
[0119] By comprehensively considering the movement attribute of the virtual character and the specific terrain features of the virtual scene, the obstacle region and the passage region in the initial grid are finely marked, which can significantly improve the accuracy and practicality of path planning. This method ensures that the movement of the virtual character in the scene not only conforms to the physical rules, but also reflects the individualized ability of the character. Ultimately, this will enhance the user experience and make the navigation in the virtual world more realistic and smooth.
[0120] As an optional solution, according to the movement attribute corresponding to the virtual character moving in the virtual scene, the obstacle region and the passable region in the initial grid are marked, including:
[0121] The fifth region in the initial grid is marked as an obstacle region, wherein the initial grid is divided into at least two regions, the at least two regions include the fifth region, and the region boundary width of the fifth region is less than the movement width indicated by the movement attribute.
[0122] Optionally, in the embodiment, the fifth region can be a region in the initial grid that is of particular interest, characterized by a region boundary width that is less than the movement width of the virtual character.
[0123] Optionally, in the embodiment, the movement width can refer to the minimum space width required by the virtual character when moving, which is determined by the physical size of the virtual character and the movement manner.
[0124] Optionally, in the embodiment, the obstacle region can be a region in the navigation grid that the virtual character cannot pass through due to various reasons such as insufficient region width.
[0125] It should be noted that the embodiment describes a situation that needs special attention when marking the initial grid according to the movement attribute of the virtual character: when the boundary width of a certain region (hereinafter referred to as the fifth region) is less than the movement width of the virtual character, this region should be marked as an obstacle region. This is because if the boundary width of the region is too narrow, the virtual character may not be able to pass through, so it should be considered as an obstacle.
[0126] Further illustration, optionally, assume that in a game scene, there is a narrow passage. If the width of this passage is less than the movement width required by the player character (such as the character being too wide to pass through), then this narrow passage (i.e. the fifth region) will be marked as an obstacle region because the player cannot pass through.
[0127] By fine marking of a specific region (such as the fifth region) in the initial grid, taking into account the movement width of the virtual character, the accuracy and efficiency of path planning can be significantly improved. This method can ensure that the virtual character avoids regions that cannot be passed through due to insufficient width when navigating, thereby improving user experience and preventing potential path planning errors.
[0128] As an optional solution, the first dynamic identifier is used to mark an obstacle path in the navigation grid that is prohibited from passing through due to the associated relationship with a static obstacle, including:
[0129] S4-1, obtaining an obstacle path intersecting any static obstacle in the navigation grid, wherein the associated relationship is determined according to the intersection of the static obstacle;
[0130] S4-2, store the resource serial number corresponding to the static obstacle intersecting with the obstacle path, wherein the resource serial number is used to determine the association between the obstacle path and the static obstacle.
[0131] Optionally, in this embodiment, the association can refer to the relationship formed by the relative position and intersection between the static obstacle and the obstacle path.
[0132] Optionally, in this embodiment, the resource serial number can be a number used to uniquely identify the static obstacle, facilitating subsequent determination of the correspondence between the obstacle path and the static obstacle.
[0133] It should be noted that this embodiment describes a process of using the first dynamic identifier to mark the obstacle path that is prohibited to pass due to the static obstacle in the navigation grid. First, this embodiment will obtain the obstacle path intersecting with any static obstacle, and the association here is determined based on the intersection between the static obstacle and the path. Then, this embodiment will store the resource serial number corresponding to the static obstacle intersecting with the obstacle path, which is used to subsequently determine which obstacle paths are associated with which static obstacles.
[0134] Further illustration, optionally, it is assumed that in the navigation grid of a game map, a wall (static obstacle) crosses an originally passable path, making it an obstacle path. This embodiment will first detect the intersection between the wall and the path to determine the association between them. Then, this embodiment will assign a resource serial number to the wall, such as "001", and associate this serial number with the obstacle path. In this way, in subsequent path planning or obstacle processing, the wall and the obstacle path affected by it can be quickly located through the resource serial number.
[0135] By using the first dynamic identifier to mark the obstacle path in the navigation grid and combining the resource serial number to determine the association between the obstacle path and the static obstacle, the efficiency and accuracy of path planning can be greatly improved. This method can reflect the obstacle situation in the scene in real time, providing a safe and effective navigation solution for virtual characters or entities. At the same time, through the reference of the resource serial number, the management and query operation of the obstacles by this embodiment are also facilitated.
[0136] As an optional solution, using a second dynamic identifier to mark a static obstacle in a navigation grid that can be changed in obstacle attribute through a conditional operation, comprising: using a second dynamic identifier to mark a first sub-object in a static obstacle that can be changed in obstacle attribute through a conditional operation, wherein the second dynamic identifier is used to indicate the setting that the first sub-object can be changed in obstacle attribute through a conditional operation;
[0137] In the process of using the second dynamic identifier to mark the static obstacle whose obstacle attribute can be changed by the conditional operation in the navigation grid, the method further comprises: using a static identifier to mark a second sub-object in the static obstacle whose obstacle attribute can be changed by the conditional operation, wherein the static identifier is used to indicate that the second sub-object is prohibited from changing the obstacle attribute.
[0138] Optionally, in this embodiment, the static identifier can be a fixed identification method used to indicate that the second sub-object in the static obstacle is prohibited from changing its obstacle attribute.
[0139] Optionally, in this embodiment, the first sub-object and the second sub-object can be different parts or components in the static obstacle, wherein the first sub-object can change the obstacle attribute by the conditional operation, while the second sub-object is prohibited from changing.
[0140] It should be noted that this embodiment describes a method of using two different types of identifiers to mark static obstacles in a navigation grid. Among them, the second dynamic identifier is used to mark the first sub-object in the static obstacle whose obstacle attribute can be changed by certain conditional operations. And the static identifier is used to mark the second sub-object in the static obstacle which is prohibited from changing its obstacle attribute.
[0141] Further illustration, for example, in a game scene, there is a closed door (static obstacle). The door is composed of two parts: the door lock (first sub-object) and the door panel (second sub-object). In the initial state, the door is closed, i.e. the obstacle attribute is "unpassable". However, when the player finds the key and completes the unlocking operation (conditional operation), the obstacle attribute of the door lock will change to "passable", while the door panel always maintains the obstacle attribute of "unpassable". Here, the door lock is marked as the second dynamic identifier because it can change the obstacle attribute by conditional operation; while the door panel is marked as the static identifier because it is prohibited from changing the obstacle attribute.
[0142] By using the second dynamic identifier and the static identifier to mark different sub-objects in the static obstacle whose obstacle attribute can be changed by the conditional operation, this embodiment can achieve fine control of the obstacle attribute. This method improves the flexibility and adaptability of obstacle setting, so that the attribute of the obstacle can be dynamically adjusted under different conditions, thereby better meeting the actual application requirements. At the same time, through the use of static identifier, it also ensures that the obstacle attribute of some key parts will not be changed accidentally, thereby ensuring the stability and safety of the obstacle setting.
[0143] As an optional solution, for the convenience of understanding, the above-mentioned role pathfinding method based on static obstacles is applied in an open world scene, a static object switching mechanism based on a navmesh terrain (navigation mesh) is used to synchronize the influence on the pathfinding performance in the real scene. The TileCache mode of the Navmesh in RecastNavigation can provide real-time addition and deletion of objects on the navmesh and real-time image pathfinding performance, but this mode has a large performance consumption. For games with a large number of fixed static position objects in the game, the static object switching mechanism provided by the embodiment can achieve the same performance effect with very small performance consumption.
[0144] Specifically, the TileCache mode of RecastNavigation can conveniently affect the navmesh pathfinding by adding or deleting objects in real time, and is suitable for processing a small number of dynamic objects with variable positions. However, for a large number of static objects with fixed positions, this mode has a large performance consumption.
[0145] The embodiment provides an object switching mechanism for a large number of static objects with fixed positions, which avoids the navmesh rebaking of the local area of TileCache and greatly improves the pathfinding efficiency, thereby providing good support for the placement of objects by level and AI designers in the underlying mechanism.
[0146] Further examples are optional, for example Figure 5 As shown, the player needs to complete the task of rescuing the trapped character (virtual sheep), the level starts, the trapped character cannot pathfind out of the cage (static object) in the cage, and after the player obtains the key and opens the cage latch, the trapped character smoothly escapes.
[0147] It should be noted that to bake the static object information onto the navmesh, the embodiment needs to construct the static object information data first. The static object physical space information is generally composed of two kinds of models of directional bounding boxes and capsules. A static object is often composed of multiple bounding boxes or capsules. Each individual bounding box or capsule carries its own label information in addition to its own physical space data information, such as a cage object, which includes a door latch and a cage body. The door latch bounding box has a special door identification. When the cage is opened as a whole by a game event, the object in the door latch area needs to be switched, and the other parts of the object do not change. The configuration data information of the static object includes the unique id of the object, a set of directional bounding boxes or capsules, and the corresponding labels for the bounding boxes or capsules according to the characteristics of the object.
[0148] Further examples are optional, for example Figure 6As shown, the specific steps are as follows:
[0149] Step 1: Import 3D modeling data.
[0150] First, the obj file of 3D modeling needs to be imported in this embodiment, which is crucial because it provides the basic data for building a virtual environment. During the import process, this embodiment loads vertex information into memory and constructs a triangular mesh according to the face (f) parameter, which is the basic unit of a 3D scene. At the same time, this embodiment initializes the building configuration to ensure that the basic settings of the scene meet the expectations. In addition, it is necessary to import pre-baked parameters that match the scene, such as the width of the agent (agentRadius), the size and height of the cell (cellsize and cellheight), the maximum angle of the walkable slope (walkableClimb), and the maximum climbable height (walkableHeight). These parameters are crucial for subsequent path planning and obstacle recognition.
[0151] Step 2: Initialize static object information.
[0152] Next, this embodiment imports the data information of static objects and stores multiple boxes and cylinders separately. Set attribute labels for these geometric bodies and identify the object ID they belong to, which provides necessary data preparation for subsequent region type identification of the voxelized height field.
[0153] Step 3: Voxelize polygons and build height field.
[0154] After importing the complete map data, this embodiment divides the map into multiple tile grids according to the previously set parameters, and each tile contains multiple cell units. In this process, this embodiment calculates the normal of each triangle and compares it with the maximum walkable angle, storing the result in a marked array. Subsequently, this embodiment finds the corresponding span of the cut polygon and sets the walkable attribute of the span according to the walkable situation of the triangle, and finally adds it to the height field according to its projection coordinates on the xz plane.
[0155] Step 4: Filter walkable surfaces and build compressed height field.
[0156] With the two key parameters walkableClimb and walkableHeight, this embodiment makes detailed adjustments to the walkability of spans. This includes marking some spans that are not originally walkable but can be reached through other walkable areas as walkable, and marking places where neither adjacent area can be climbed as non-walkable. After these adjustments are completed, this embodiment constructs a compressed height field, providing a more accurate data basis for subsequent path planning.
[0157] Step 5: Region division of walkable surface.
[0158] To ensure the accuracy of path planning, this embodiment makes fine pruning on the boundaries of walkable areas. In particular, areas with boundaries smaller than the radius of the navigation object are marked as non-walkable, thereby avoiding collisions or passage failures that may occur in actual applications.
[0159] Step 6: Label height field with static object data.
[0160] In this step, this embodiment uses static object data to label the height field. Specifically, this embodiment identifies the height field voxel data type covered by static objects as STATIC_OBSTACLE. For overlapping areas, such as cages and other special cases, this embodiment will make more detailed identification processing. This step provides a key data basis for subsequent polygon region division and polygon mesh generation.
[0161] Step 7: Simplify region contours and build polygon mesh.
[0162] To more efficiently handle path planning problems, this embodiment calculates the distance from each span to the region boundary and makes these distance values smoother through fuzzy processing. On this basis, this embodiment applies the watershed algorithm to find the dividing line between different regions, thereby simplifying the region contours and building a polygon mesh.
[0163] Step 8: Polygon height optimization and cutting.
[0164] After building the polygon mesh, this embodiment further optimizes it. This includes triangulating the polygon and applying the ear clipping algorithm for triangle merging to reduce the number of meshes and improve subsequent navigation speed. At the same time, this embodiment prevents terrain from being modulated by height sampling the polygon mesh to prevent terrain from being modulated, ensuring the accuracy and continuity of the terrain.
[0165] Step 9: Bake static object information into polygon.
[0166] The last step is to bake the static object information into the polygons. The embodiment traverses each poly in the tile and saves the corresponding object resource ID (res_id) according to its intersection with the static object. This processing method not only saves storage space but also reduces the size of the baked data. At the same time, the embodiment attaches the mapping relationship between res_id and the unique ID of the static object as additional information to the navmesh for subsequent logic. This step ensures the close association between static objects and the polygon mesh, providing strong support for subsequent path planning and obstacle processing.
[0167] Through the embodiments provided by the present application, the object state is closely combined with the navmesh, providing a high-performance operation interface for the change of in-game level objects. This combination not only realizes real-time synchronization of object state and terrain pathfinding data, but also efficiently affects the terrain pathfinding result by changing the object state. This technical means provides a solid underlying foundation for level design, enabling designers to more flexibly adjust level layout and object properties, thereby creating a more rich and dynamic gaming experience. At the same time, this greatly improves the performance and quality of the game, because the optimized navmesh can respond more quickly to changes in object state, reducing the consumption of computing resources and time, ensuring the smoothness and stability of the game.
[0168] It can be understood that in the specific embodiments of the present application, data related to user information is involved, and when the above embodiments of the present application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0169] It should be noted that, for the foregoing method embodiments, in order to simply describe, they are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited by the action order described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should know that the embodiments described in the specification all belong to preferred embodiments, and the actions and modules involved are not necessarily required by the present application.
[0170] According to another aspect of the embodiments of the present application, a static obstacle-based character pathfinding device for implementing the static obstacle-based character pathfinding method described above is also provided. As shown in Figure 7 the device includes:
[0171] The first obtaining unit 702 is configured to obtain a candidate grid area in response to a pathfinding request triggered by the virtual character, wherein the pathfinding request is used to request a movement path of the virtual character from a first position in a navigation grid to a second position in the navigation grid, and the candidate grid area is an area in which grids constituting the movement path are located in the navigation grid.
[0172] The second obtaining unit 704 is configured to obtain an obstacle path with a first dynamic identifier in the candidate grid area, wherein the obstacle path is a path that is prohibited to pass through, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited to pass through due to a static obstacle having an association relationship.
[0173] The third obtaining unit 706 is configured to obtain a static obstacle with a second dynamic identifier in the candidate grid area, wherein the static obstacle with the second dynamic identifier has an association relationship with the obstacle path with the first dynamic identifier, the static obstacle is an object with a fixed position and an obstacle attribute, the obstacle attribute is used to set whether the static obstacle allows passage or is prohibited to pass through, and the second dynamic identifier is used to indicate that the static obstacle can be operated to change the setting of the obstacle attribute.
[0174] The path unit 708 is configured to identify the obstacle path with the first dynamic identifier as a feasible path in a case where the virtual character allows the conditional operation to be performed, wherein the feasible path is a path that the virtual character can pass through.
[0175] The fourth obtaining unit 710 is configured to obtain the movement path based on the feasible path in the candidate grid area.
[0176] The embodiments can refer to the examples shown in the above-mentioned method for pathfinding of a character based on a static obstacle, which will not be described herein again in this example.
[0177] As an optional solution, the third obtaining unit 706 includes:
[0178] The first obtaining module is configured to obtain additional information of the obstacle path with the first dynamic identifier, wherein the additional information is used to indicate the static obstacle having the association relationship with the obstacle path with the first dynamic identifier.
[0179] The determining module is configured to determine the static obstacle with the second dynamic identifier from N static obstacles in the candidate grid area according to the indication of the additional information, wherein N is an integer greater than 1.
[0180] The embodiments can refer to the examples shown in the above-mentioned method for pathfinding of a character based on a static obstacle, which will not be described herein again in this example.
[0181] As an optional solution, the obtaining module includes:
[0182] The acquisition sub-module is configured to acquire a resource serial number carried by the obstacle path with the first dynamic identifier, where the resource serial number is an identifier corresponding to each static obstacle in the N static obstacles, different static obstacles correspond to different resource serial numbers, and the additional information includes the carried resource serial number.
[0183] The specific embodiments can refer to the examples shown in the above-mentioned role pathfinding method based on static obstacles, which will not be described here in this example.
[0184] As an optional solution, the device further includes a determination unit configured to determine a candidate grid area from the candidate grid area in response to the pathfinding request triggered for the virtual role, where the candidate grid area meets the movement condition of the virtual role.
[0185] The second acquisition unit 704 includes a second acquisition module configured to determine the obstacle path with the first dynamic identifier from the candidate grid area.
[0186] The third acquisition unit 706 includes a third acquisition module configured to determine the static obstacle with the second dynamic identifier from the candidate grid area.
[0187] The specific embodiments can refer to the examples shown in the above-mentioned role pathfinding method based on static obstacles, which will not be described here in this example.
[0188] According to another aspect of the embodiments of the present application, another role pathfinding device based on static obstacles for implementing the above-mentioned role pathfinding method based on static obstacles is also provided. As shown in the device includes: Figure 8
[0189] The first marking unit 802 is configured to mark the obstacle path in the navigation grid that is prohibited to pass due to the static obstacle with the associated relationship using the first dynamic identifier, where the obstacle path is a path prohibited to pass, and the first dynamic identifier is used to indicate that the obstacle path is a path prohibited to pass due to the static obstacle with the associated relationship.
[0190] The second marking unit 804 is configured to mark the static obstacle in the navigation grid that can be changed in the obstacle attribute through the conditional operation using the second dynamic identifier, where the static obstacle is a fixed-position object with an obstacle attribute, the obstacle attribute is used to set the static obstacle to allow or prohibit passing, and the second dynamic identifier is used to indicate that the static obstacle can be changed in the obstacle attribute through the conditional operation.
[0191] The pathfinding unit 806 is configured to respond to the pathfinding request triggered for the virtual role through the marked navigation grid, where the pathfinding request is used to request to acquire the movement path of the virtual role from the first position in the navigation grid to the second position in the navigation grid.
[0192] The specific embodiments can refer to the examples shown in the above-mentioned role pathfinding method based on static obstacles, which will not be repeated here in this example.
[0193] As an optional solution, the device further comprises:
[0194] The construction unit is configured to, before marking the obstacle path in the navigation grid that is prohibited from passing due to the static obstacles having the association relationship, construct an initial grid according to model vertex information corresponding to the virtual scene.
[0195] The third marking unit is configured to, before marking the obstacle path in the navigation grid that is prohibited from passing due to the static obstacles having the association relationship, mark the obstacle region and the passing region in the initial grid according to the movement attribute corresponding to the virtual role moving in the virtual scene.
[0196] The specific embodiments can refer to the examples shown in the above-mentioned role pathfinding method based on static obstacles, which will not be repeated here in this example.
[0197] As an optional solution, the marking unit comprises at least one of the following:
[0198] The first marking module is configured to mark a first region in the initial grid that is set as prohibited from passing but can be reached by a first path that allows passing as a passing region, wherein the first path that allows passing is determined according to the movement attribute.
[0199] The second marking module is configured to mark a second region and a third region in the initial grid as obstacle regions, wherein the second region is adjacent to the third region but lacks a second path that allows passing, and the second path that allows passing is determined according to the movement attribute.
[0200] The third marking module is configured to mark a fourth region in the initial grid that is set as allowing passing but is insufficient in height as an obstacle region, wherein the fourth region that is insufficient in height is determined according to the movement attribute.
[0201] The specific embodiments can refer to the examples shown in the above-mentioned role pathfinding method based on static obstacles, which will not be repeated here in this example.
[0202] As an optional solution, the marking unit comprises:
[0203] The fourth marking module is configured to mark a fifth region in the initial grid as an obstacle region, wherein the initial grid is divided into at least two regions, the at least two regions include the fifth region, and a region boundary width of the fifth region is less than a movement width indicated by the movement attribute.
[0204] For specific implementation examples, please refer to the example shown in the above-described role-based pathfinding method based on static obstacles, which will not be repeated here.
[0205] As an optional solution, the first marking unit 802 includes:
[0206] The fourth acquisition module is used to acquire obstacle paths in the navigation grid that intersect with any static obstacle, wherein the association relationship is determined based on the intersection of static obstacles;
[0207] The storage module is used to store the resource sequence numbers corresponding to static obstacles that intersect with obstacle paths. The resource sequence numbers are used to determine the obstacle paths and static obstacles that have an association relationship.
[0208] For specific implementation examples, please refer to the example shown in the above-described role-based pathfinding method based on static obstacles, which will not be repeated here.
[0209] As an optional solution, the second marking unit 804 includes: a fifth marking module for marking a first sub-object in a static obstacle whose obstacle attributes can be changed through conditional operations using a second dynamic identifier, wherein the second dynamic identifier is used to indicate that the first sub-object's obstacle attributes can be changed through conditional operations;
[0210] The device further includes: a fourth marking unit, used to mark a second sub-object among static obstacles whose obstacle attributes can be changed through conditional operations during the process of marking static obstacles in the navigation grid using a second dynamic mark, wherein the static mark is used to indicate that the setting of the second sub-object prohibits changing obstacle attributes.
[0211] For specific implementation examples, please refer to the example shown in the above-described role-based pathfinding method based on static obstacles, which will not be repeated here.
[0212] According to another aspect of the embodiments of this application, an electronic device for implementing the above-described role pathfinding method based on static obstacles is also provided. This electronic device may, but is not limited to, […]. Figure 1 The user equipment 102 or server 112 shown in the figure, in this embodiment, is taken as an example of an electronic device, namely user equipment 102. Further, as shown in the figure... Figure 9 As shown, the electronic device includes a memory 902 and a processor 904. The memory 902 stores a computer program, and the processor 904 is configured to execute the steps of any of the above method embodiments through the computer program.
[0213] Optionally, in this embodiment, the aforementioned electronic device may be located in at least one of a plurality of network devices in a computer network.
[0214] Optionally, in the embodiment, the processor can be configured to execute the following steps by a computer program:
[0215] S5-1, in response to a pathfinding request triggered for the virtual character, obtaining a candidate grid area, wherein the pathfinding request is used to request to obtain a movement path of the virtual character from a first position in a navigation grid to a second position in the navigation grid, and the candidate grid area is an area in which a grid constituting the movement path is located in the navigation grid;
[0216] S5-2, obtaining an obstacle path with a first dynamic identifier in the candidate grid area, wherein the obstacle path is a path that is prohibited to pass through, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited to pass through due to a static obstacle having an association relationship;
[0217] S5-3, obtaining a static obstacle with a second dynamic identifier in the candidate grid area, wherein the static obstacle with the second dynamic identifier has an association relationship with the obstacle path with the first dynamic identifier, the static obstacle is an object with a fixed position and an obstacle attribute, the obstacle attribute is used to set whether the static obstacle allows passage or is prohibited to pass through, and the second dynamic identifier is used to indicate that the static obstacle can be operated by a conditional operation to change the setting of the obstacle attribute;
[0218] S5-4, in a case where the virtual character allows the conditional operation to be performed, identifying the obstacle path with the first dynamic identifier as a feasible path, wherein the feasible path is a path that the virtual character can pass through;
[0219] S5-5, obtaining the movement path based on the feasible path in the candidate grid area, or
[0220] S6-1, using the first dynamic identifier to mark an obstacle path in the navigation grid that is prohibited to pass through due to a static obstacle having an association relationship, wherein the obstacle path is a path that is prohibited to pass through, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited to pass through due to the static obstacle having the association relationship;
[0221] S6-2, using the second dynamic identifier to mark a static obstacle in the navigation grid that can be operated by a conditional operation to change an obstacle attribute, wherein the static obstacle is an object with a fixed position and an obstacle attribute, the obstacle attribute is used to set whether the static obstacle allows passage or is prohibited to pass through, and the second dynamic identifier is used to indicate that the static obstacle can be operated by the conditional operation to change the setting of the obstacle attribute;
[0222] S6-3, in response to a pathfinding request triggered for the virtual character by using the marked navigation grid, wherein the pathfinding request is used to request to obtain a movement path of the virtual character from a first position in the navigation grid to a second position in the navigation grid.
[0223] Alternatively, as those skilled in the art will understand, Figure 9 The structure shown is for illustrative purposes only. Figure 9 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 9 The more or fewer components shown (such as network interfaces, etc.), or having the same Figure 9 The different configurations shown.
[0224] The memory 902 can be used to store software programs and modules, such as the program instructions / modules corresponding to the role-finding method and device based on static obstacles in this embodiment. The processor 904 executes various functional applications and data processing by running the software programs and modules stored in the memory 902, thereby realizing the aforementioned role-finding method based on static obstacles. The memory 902 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 902 may further include memory remotely located relative to the processor 904, and these remote memories can be connected to electronic devices via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Specifically, the memory 902 may be used, but is not limited to, to store information such as a first dynamic identifier, a second dynamic identifier, and a navigation grid. As an example, such as... Figure 9 As shown, the memory 902 may include, but is not limited to, the first acquisition unit 702, the second acquisition unit 704, the third acquisition unit 706, the path unit 708, and the fourth acquisition unit 710 (or the first marking unit 802, the second marking unit 804, and the path finding unit 806, not shown in the figure) of the static obstacle-based character pathfinding device. Furthermore, it may include, but is not limited to, other module units of the static obstacle-based character pathfinding device, which will not be described in detail in this example.
[0225] Optionally, the transmission device 906 described above is used to receive or send data via a network. Specific examples of the network described above may include wired networks and wireless networks. In one example, the transmission device 906 includes a Network Interface Controller (NIC), which can be connected to other network devices and routers via a network cable to communicate with the Internet or a local area network. In another example, the transmission device 906 is a Radio Frequency (RF) module, used for wireless communication with the Internet.
[0226] In addition, the electronic device further includes a display 908 configured to display the first dynamic identifier, the second dynamic identifier, and the navigation grid, and the like, and a connection bus 910 configured to connect various module components in the electronic device.
[0227] In other embodiments, the user device or the server can be a node in a distributed system, where the distributed system can be a blockchain system, which can be a distributed system formed by the plurality of nodes connected through network communication. Wherein, the nodes can form a peer-to-peer network, and any form of computing device, such as a server, a user device, and the like, can become a node in the blockchain system by joining the peer-to-peer network.
[0228] According to an aspect of the present application, a computer program product is provided, which includes computer programs / instructions containing program codes for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through a communication part, and / or installed from a removable medium. When the computer program is executed by a central processing unit, various functions provided by the embodiments of the present application are performed.
[0229] The above-mentioned serial numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0230] It should be noted that the computer system of the electronic device is only an example, and should not limit the functions and use range of the embodiments of the present application.
[0231] The computer system includes a central processing unit (CPU), which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) or programs loaded from a storage part to a random access memory (RAM). In the random access memory, various programs and data required for system operation are also stored. The central processing unit, the read-only memory, and the random access memory are connected to each other through a bus. An input / output interface (I / O interface) is also connected to the bus.
[0232] The following components are connected to the input / output interface: an input section including a keyboard, a mouse, etc.; an output section including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), etc., and a speaker, etc.; a storage section including a hard disk, etc.; and a communication section including a network interface card such as a local area network card, a modem, etc. The communication section performs communication processing via a network such as the Internet. A drive is also connected to the input / output interface as necessary. A removable media such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the drive as necessary, so that a computer program read out from the removable media is installed in the storage section as necessary.
[0233] In particular, according to embodiments of the present application, the processes described in the various method flowcharts can be implemented as a computer software program. For example, embodiments of the present application include a computer program product comprising a computer program carried on a computer readable medium, the computer program containing program code for executing the methods illustrated in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section, and / or installed from a removable media. When the computer program is executed by the central processing unit, the various functions defined in the system of the present application are performed.
[0234] According to an aspect of the present application, a computer readable storage medium is provided, from which a processor of a computer device reads computer instructions, the processor executes the computer instructions, causing the computer device to perform the method provided in the various optional implementation manners described above.
[0235] Optionally, in the present embodiment, the computer readable storage medium described above can be configured to store a computer program for executing the following steps:
[0236] S5-1, in response to a pathfinding request triggered by the virtual character, obtaining a candidate grid area, wherein the pathfinding request is used to request to obtain a movement path of the virtual character from a first position in a navigation grid to a second position in the navigation grid, and the candidate grid area is an area in which grids constituting the movement path are located in the navigation grid;
[0237] S5-2, obtaining an obstacle path with a first dynamic identifier in the candidate grid area, wherein the obstacle path is a path that is prohibited to pass through, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited to pass through due to a static obstacle having an association relationship;
[0238] S5-3, obtaining a static obstacle with a second dynamic identifier in the candidate grid area, wherein the static obstacle with the second dynamic identifier has a correlation relationship with the obstacle path with the first dynamic identifier, the static obstacle is an object with a fixed position and an obstacle attribute, the obstacle attribute is used to set whether the static obstacle allows passing or not, and the second dynamic identifier is used to indicate that the static obstacle can be changed in the obstacle attribute by a conditional operation;
[0239] S5-4, in a case where the virtual character allows the conditional operation to be performed, identifying the obstacle path with the first dynamic identifier as a feasible path, wherein the feasible path is a path through which the virtual character can pass;
[0240] S5-5, obtaining a moving path based on the feasible path in the candidate grid area, or
[0241] S6-1, marking, using a first dynamic identifier, an obstacle path in the navigation grid which is prohibited to pass due to a static obstacle having a correlation relationship, wherein the obstacle path is a path which is prohibited to pass, and the first dynamic identifier is used to indicate that the obstacle path is a path which is prohibited to pass due to the static obstacle having the correlation relationship;
[0242] S6-2, marking, using a second dynamic identifier, a static obstacle in the navigation grid which can be changed in an obstacle attribute by a conditional operation, wherein the static obstacle is an object with a fixed position and the obstacle attribute, the obstacle attribute is used to set whether the static obstacle allows passing or not, and the second dynamic identifier is used to indicate that the static obstacle can be changed in the obstacle attribute by the conditional operation;
[0243] S6-3, responding to a pathfinding request triggered for the virtual character by using the marked navigation grid, wherein the pathfinding request is used to request to obtain a moving path of the virtual character from a first position in the navigation grid to a second position in the navigation grid.
[0244] Optionally, in the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined target, and can be implemented entirely or partially 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 an integral module or unit that includes the function of the module or unit.
[0245] Optionally, in the embodiment, all or part of the steps in the various methods of the above embodiments can be understood by those of ordinary skill in the art that the above steps can be completed by instructing the hardware related to the electronic device by a program, and the program can be stored in a computer readable storage medium, and the storage medium can include a flash disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, etc.
[0246] The serial numbers of the embodiments of the application described above are only for description, not representing the advantages or disadvantages of the embodiments.
[0247] The integrated units in the above embodiments, if realized in the form of software function units and sold or used as independent products, can be stored in the above computer readable storage medium. Based on such understanding, the technical solutions of the application essentially or the parts that make contributions to the prior art or the whole or part of the technical solutions can be embodied in the form of software products, and the computer software products are stored in the storage medium, including a plurality of instructions for causing one or more computer devices (which can be personal computers, servers or network devices, etc.) to execute all or part of the steps of the embodiments of the application.
[0248] In the above embodiments of the application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0249] In the several embodiments provided by the present application, it should be understood that the disclosed user equipment can be implemented in other ways. Of course, the above device embodiments are only schematic. The division of the units is only a logical function division. There can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, accessors or buses, and can be electrical, mechanical or in other forms.
[0250] The units described as separate components can or can not be physically separate, and the components displayed as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. According to actual needs, part or all of the units can be selected to achieve the purpose of the embodiment.
[0251] In addition, each of the functional units in the various embodiments of the present application can be integrated in one processing unit, or each of the units can exist physically, or two or more units can be integrated in one unit. The integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
[0252] The above only describes the preferred embodiments of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should also be considered as the protection scope of the present application.
Claims
1. A static obstacle-based character pathfinding method, characterized in that, The method comprises: in response to a pathfinding request triggered by a virtual character, obtaining a candidate grid area, wherein the pathfinding request is used to request to obtain a movement path of the virtual character from a first position in a navigation grid to a second position in the navigation grid, and the candidate grid area is an area in which a grid constituting the movement path is located in the navigation grid; obtaining an obstacle path with a first dynamic identifier in the candidate grid area, wherein the obstacle path is a path that is prohibited to pass through, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited to pass through due to a static obstacle having an association relationship; obtaining a static obstacle with a second dynamic identifier in the candidate grid area, wherein the static obstacle with the second dynamic identifier has the association relationship with the obstacle path with the first dynamic identifier, the static obstacle is an object with a fixed position and an obstacle attribute, the obstacle attribute is used to set whether the static obstacle allows passage or is prohibited to pass through, and the second dynamic identifier is used to indicate that the static obstacle can be operated by a condition to change the setting of the obstacle attribute; in a case where the virtual character allows the condition operation to be performed, identifying the obstacle path with the first dynamic identifier as a feasible path, wherein the feasible path is a path that the virtual character can pass through; based on the feasible path in the candidate grid area, obtaining the movement path.
2. The method of claim 1, wherein, The obtaining of the static obstacle with the second dynamic identifier in the candidate grid area comprises: obtaining additional information carried by the obstacle path with the first dynamic identifier, wherein the additional information is used to indicate the static obstacle having the association relationship with the obstacle path with the first dynamic identifier; determining the static obstacle with the second dynamic identifier from N static obstacles in the candidate grid area according to the indication of the additional information, wherein N is an integer greater than 1.
3. The method of claim 2, wherein, The obtaining of the additional information carried by the obstacle path with the first dynamic identifier comprises: obtaining a resource serial number carried by the obstacle path with the first dynamic identifier, wherein the resource serial number is an identifier corresponding to each static obstacle in the N static obstacles, different static obstacles correspond to different resource serial numbers, and the additional information comprises the carried resource serial number.
4. The method of any one of claims 1 to 3, wherein after the obtaining of the candidate grid area in response to the pathfinding request triggered by the virtual character, the method further comprises: determining a candidate grid area from the candidate grid area, wherein the candidate grid area meets a movement condition of the virtual character; the obtaining of the obstacle path with the first dynamic identifier in the candidate grid area comprises: determining the obstacle path with the first dynamic identifier from the candidate grid area; the obtaining of the static obstacle with the second dynamic identifier in the candidate grid area comprises: determining the static obstacle with the second dynamic identifier from the candidate grid area.
5. A static obstacle-based character pathfinding method, characterized in that, The method comprises: mark, using a first dynamic identifier, an obstacle path in the navigation mesh that is forbidden to pass due to a static obstacle having a correlation relationship, wherein the obstacle path is a path forbidden to pass, and the first dynamic identifier is used to indicate that the obstacle path is a path forbidden to pass due to a static obstacle having a correlation relationship; mark, using a second dynamic identifier, a static obstacle in the navigation mesh that can be operated by a condition to change an obstacle attribute, wherein the static obstacle is an object that is fixed in position and has an obstacle attribute, the obstacle attribute is used to set whether the static obstacle allows passage or is forbidden to pass, and the second dynamic identifier is used to indicate that the static obstacle can be operated by a condition to change the setting of the obstacle attribute; respond to a pathfinding request triggered for a virtual character by using the marked navigation mesh, wherein the pathfinding request is used to request a movement path of the virtual character from a first position in the navigation mesh to a second position in the navigation mesh.
6. The method of claim 5, wherein, Before the step of marking, using a first dynamic identifier, an obstacle path in the navigation mesh that is forbidden to pass due to a static obstacle having a correlation relationship, the method further comprises: constructing an initial mesh according to model vertex information corresponding to a virtual scene; marking, according to a movement attribute corresponding to a virtual character moving in the virtual scene, an obstacle region and a passage region in the initial mesh.
7. The method of claim 6, wherein, The step of marking, according to a movement attribute corresponding to a virtual character moving in the virtual scene, an obstacle region and a passage region in the initial mesh, comprises at least one of the following: marking, as the passage region, a first region in the initial mesh that is set as forbidden to pass but can be reached by a first path that allows passage, wherein the first path that allows passage is determined according to the movement attribute; marking, as the obstacle region, a second region and a third region in the initial mesh, wherein the second region is adjacent to the third region but lacks a second path that allows passage, and the second path that allows passage is determined according to the movement attribute; marking, as the obstacle region, a fourth region in the initial mesh that is set as allowing passage but has insufficient height, wherein the fourth region with insufficient height is determined according to the movement attribute.
8. The method of claim 6, wherein, The step of marking, according to a movement attribute corresponding to a virtual character moving in the virtual scene, an obstacle region and a passage region in the initial mesh, comprises: marking, as the obstacle region, a fifth region in the initial mesh, wherein the initial mesh is divided into at least two regions, the at least two regions include the fifth region, and a region boundary width of the fifth region is less than a movement width indicated by the movement attribute.
9. The method according to any one of claims 5 to 8, characterized in that, The step of marking, using a first dynamic identifier, an obstacle path in the navigation mesh that is forbidden to pass due to a static obstacle having a correlation relationship, comprises: obtaining an obstacle path in the navigation mesh that intersects any static obstacle, wherein the correlation relationship is determined according to intersection of the static obstacle; store a resource sequence number corresponding to a static obstacle intersecting the obstacle path, wherein the resource sequence number is used to determine the obstacle path and the static obstacle having the association relationship.
10. The method of any one of claims 5 to 8, wherein, the using the second dynamic identifier to mark the static obstacle in the navigation grid that can be operated by the condition to change the obstacle attribute comprises: using the second dynamic identifier to mark a first sub-object in the static obstacle that can be operated by the condition to change the obstacle attribute, wherein the second dynamic identifier is used to indicate that the first sub-object can be operated by the condition to change the setting of the obstacle attribute; in the process of using the second dynamic identifier to mark the static obstacle in the navigation grid that can be operated by the condition to change the obstacle attribute, the method further comprises: using a static identifier to mark a second sub-object in the static obstacle that can be operated by the condition to change the obstacle attribute, wherein the static identifier is used to indicate that the second sub-object is prohibited from changing the setting of the obstacle attribute.
11. A static obstacle based character pathfinding device, characterized by, comprise: a first obtaining unit, configured to obtain a candidate grid area in response to a pathfinding request triggered by a virtual character, wherein the pathfinding request is used to request to obtain a movement path of the virtual character from a first position in a navigation grid to a second position in the navigation grid, and the candidate grid area is an area in which a grid constituting the movement path is located in the navigation grid; a second obtaining unit, configured to obtain an obstacle path with a first dynamic identifier in the candidate grid area, wherein the obstacle path is a path that is prohibited from being passed through, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited from being passed through due to a static obstacle having an association relationship; a third obtaining unit, configured to obtain a static obstacle with a second dynamic identifier in the candidate grid area, wherein the static obstacle with the second dynamic identifier has the association relationship with the obstacle path with the first dynamic identifier, the static obstacle is an object that is fixed in position and has an obstacle attribute, the obstacle attribute is used to set whether the static obstacle allows passage or is prohibited from passage, and the second dynamic identifier is used to indicate that the static obstacle can be operated by a condition to change the setting of the obstacle attribute; a path unit, configured to identify the obstacle path with the first dynamic identifier as a feasible path in a case where the virtual character allows the condition to be performed, wherein the feasible path is a path that can be passed through by the virtual character; a fourth obtaining unit, configured to obtain the movement path based on the feasible path in the candidate grid area.
12. A static obstacle based character pathfinding device, characterized by, comprise: a first marking unit, configured to mark an obstacle path in a navigation grid that is prohibited from being passed through due to a static obstacle having an association relationship by using a first dynamic identifier, wherein the obstacle path is a path that is prohibited from being passed through, and the first dynamic identifier is used to indicate that the obstacle path is a path that is prohibited from being passed through due to the static obstacle having the association relationship; A second marking unit is configured to mark a static obstacle in the navigation mesh, which can be operated by a conditional operation to change an obstacle attribute, using a second dynamic identifier, wherein the static obstacle is an object with a fixed position and an obstacle attribute, and the obstacle attribute is used to set whether the static obstacle allows passage or prohibits passage, and the second dynamic identifier is used to indicate that the static obstacle can be operated by a conditional operation to change the setting of the obstacle attribute. A pathfinding unit is configured to respond to a pathfinding request triggered by a virtual character by using the marked navigation mesh, wherein the pathfinding request is used to request a movement path of the virtual character from a first position in the navigation mesh to a second position in the navigation mesh.
13. A computer readable storage medium, characterized in that, The computer readable storage medium includes a stored program, wherein the program is executed by an electronic device to perform the method in any one of claims 1-4 or 5-10.
14. A computer program product comprising computer programs / instructions, characterized in that, The computer program / instruction is executed by a processor to implement the steps of the method in any one of claims 1-4 or 5-10.
15. An electronic device comprising a memory and a processor, characterized in that The memory stores a computer program, and the processor is configured to perform the method in any one of claims 1-4 or 5-10 by using the computer program.