Route searching method and device in virtual scene, equipment and readable storage medium
By dividing the virtual scene into blocks and dynamically updating the weight coefficients, the problems of high complexity and unstable quality in path planning under dynamic battlefield environments are solved, and efficient path planning results are achieved.
Patent Information
- Application Number
- CN202510672924.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2026-11-24
AI Technical Summary
Existing path planning methods suffer from high computational complexity and unstable path quality in dynamic battlefield environments, making it difficult to meet the needs of diverse game strategies and environments in strategy games.
The virtual scene is divided into multiple sub-virtual scene blocks, which correspond one-to-one with the navigation grid. The target sub-virtual scene block is determined by responding to the pathfinding command through the graphical user interface, the corresponding sub-navigation grid is loaded, and the weight coefficients are dynamically updated based on real-time game information for path planning.
It reduces the computational load of path planning, improves the efficiency and effectiveness of path planning in dynamic environments, and ensures the quality of paths in dynamic environments.
Smart Images

Figure CN123148647A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and specifically to a pathfinding method, apparatus, device, and readable storage medium in a virtual scene. Background Technology
[0002] Many games, especially strategy games (SLGs), often use path navigation. For example, when controlling a virtual object to move towards an enemy-occupied area for reconnaissance, a reasonable movement path needs to be planned. As games have evolved, to provide users with a richer gaming experience, games allow users to execute more diverse game strategies, while also introducing more diverse and dynamic environmental factors into the game scene, such as terrain changes, weather changes, and seasonal changes.
[0003] Currently, the commonly used pre-baked static navigation mesh (NavMesh) is insufficient to meet the needs of dynamic battlefield environment changes and real-time tactical decision-making. Path planning in dynamic environments also suffers from high computational complexity and inconsistent path quality. In particular, the increasing availability of game map resources further exacerbates the impact on the efficiency and effectiveness of path planning in virtual dynamic environments. Summary of the Invention
[0004] Therefore, it is necessary to provide a pathfinding method, device, equipment, and readable storage medium in a virtual scene to address the aforementioned technical problems and solve the problem that the dynamic path planning effect is not ideal in related technologies.
[0005] In a first aspect, this application provides a pathfinding method within a virtual scene, which provides at least a portion of the virtual scene through a graphical user interface, wherein the virtual scene is divided into multiple sub-virtual scene blocks, the virtual scene is associated with a first navigation grid, the multiple sub-virtual scene blocks correspond one-to-one with multiple sub-navigation grids in the first navigation grid, and the first navigation grid includes an initial weight coefficient related to the terrain parameters of the virtual scene;
[0006] The method includes:
[0007] In response to the first pathfinding command, based on the initial position and the target position, a first target sub-virtual scene block between the initial position and the target position is determined from the plurality of sub-virtual scene blocks;
[0008] The first target navigation grid is obtained by loading the sub-navigation grid corresponding to the first target sub-virtual scene block from the first navigation grid;
[0009] Based on the real-time game information when the first pathfinding command is triggered, the initial weight coefficients of the first target navigation grid are updated, and path planning is performed based on the first target navigation grid after the weight coefficients are updated to obtain the first planned path of the first pathfinding command.
[0010] Secondly, this application provides a pathfinding device in a virtual scene, which provides at least a portion of the virtual scene through a graphical user interface, wherein the virtual scene is divided into multiple sub-virtual scene blocks, the virtual scene is associated with a first navigation grid, the multiple sub-virtual scene blocks correspond one-to-one with multiple sub-navigation grids in the first navigation grid, and the first navigation grid includes an initial weight coefficient related to the terrain parameters of the virtual scene.
[0011] The device includes:
[0012] A determination module is used to respond to a first pathfinding instruction and, based on an initial position and a target position, determine the initial position of a first target sub-virtual scene block between the initial position and the target position from the plurality of sub-virtual scene blocks;
[0013] A loading module is used to load the sub-navigation grid corresponding to the first target sub-virtual scene block from the first navigation grid to obtain the first target navigation grid;
[0014] The update module is used to update the initial weight coefficients of the first target navigation grid based on the real-time game information when the first pathfinding command is triggered, and to perform path planning based on the first target navigation grid after the weight coefficients are updated, so as to obtain the first planned path of the first pathfinding command.
[0015] Thirdly, this application also provides a computer device, the computer device comprising:
[0016] One or more processors;
[0017] Memory; and
[0018] One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the pathfinding method in the virtual scene provided above.
[0019] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, the computer program being loaded by a processor to execute the pathfinding method in the virtual scene provided above.
[0020] Fifthly, embodiments of this application provide a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the pathfinding method within the virtual scene described above.
[0021] The pathfinding method within a virtual scene provided in this application provides at least a portion of the virtual scene's screen through a graphical user interface. By dividing the virtual scene into multiple sub-virtual scene blocks and correspondingly associating them with sub-navigation grids, upon responding to a pathfinding command, based on the initial and target positions, a target sub-virtual scene block between the initial and target positions is first determined from the multiple sub-virtual scene blocks. Then, the sub-navigation grid corresponding to the target sub-virtual scene block is loaded from the navigation grid, resulting in a partially loaded target navigation grid. This allows for convenient updating of the initial weight coefficients of the loaded target navigation grid based on real-time game information triggered by the pathfinding command. Path planning is then performed based on the updated target navigation grid to obtain the planned path. The solution provided in this application obtains the target navigation grid by dividing and loading sub-navigation grids from a portion of the scene blocks. By loading fewer segmented navigation grids, the computational load for path planning is reduced. Simultaneously, with subsequent dynamic weight adjustments, the weights of the loaded partial navigation grids are updated, meeting the path planning requirements in dynamic environments. Furthermore, since the loaded scene blocks are those between the initial and target positions, the path planning effect in dynamic environments is effectively guaranteed. Attached Figure Description
[0022] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0023] Figure 1 A schematic diagram illustrating the implementation environment of a pathfinding method in a virtual scene provided in an embodiment of this application;
[0024] Figure 2 This application provides a schematic flowchart of a pathfinding method in a virtual scene.
[0025] Figure 3 This application provides an embodiment of a schematic diagram illustrating the effect of determining a first target sub-virtual scene block.
[0026] Figure 4This application provides a schematic diagram of a process for determining a target road segment based on different real-time game information, as an embodiment of the present application.
[0027] Figure 5 A schematic diagram illustrating the effect of path planning from an initial position within a city to a target position within another city, provided for an embodiment of this application;
[0028] Figure 6 A schematic diagram illustrating the effect of selecting sub-virtual scene blocks to obtain a navigation mesh during secondary pathfinding provided in this application;
[0029] Figure 7 This is a schematic diagram of the structure of a pathfinding device in a virtual scene provided in an embodiment of this application;
[0030] Figure 8 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation
[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0032] In the description of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the stated features. In the description of this application, "multiple" means two or more, unless otherwise explicitly specified.
[0033] In the description of this application, the word "for example" is used to mean "used as an example, illustration, or description." Any embodiment described as "for example" in this application is not necessarily to be construed as being more preferred or advantageous than other embodiments. The following description is provided to enable any person skilled in the art to make and use the invention. Details are set forth in the following description for purposes of explanation. It should be understood that those skilled in the art will recognize that the invention can be made without using these specific details. In other instances, well-known structures and processes will not be described in detail to avoid obscuring the description of the invention with unnecessary detail. Therefore, the invention is not intended to be limited to the embodiments shown, but is consistent with the broadest scope of the principles and features disclosed in this application.
[0034] To facilitate understanding of the pathfinding method within a virtual scene provided in this application's embodiments, the relevant application scenarios of the pathfinding method within a virtual scene will first be described. Specifically, the pathfinding method within a virtual scene provided in this application typically operates in a type of virtual game that requires controlling virtual objects to find their way to a specified location. For example, in strategy games, users often need to move specific virtual objects to a specified virtual city or region to execute specific game strategies, such as stealth or persuasion. During this process, a pathfinding algorithm is triggered to find a path from a specific location, usually the current location of the virtual object to be moved, to the specified target location. Currently, the common pathfinding method involves pre-baking a static navigation mesh (NavMesh) on a map and combining it with a real-time global planning algorithm, such as the A* (A* search algorithm) pathfinding algorithm, to achieve path planning.
[0035] As gameplay evolves and becomes more diverse, users can execute more varied game strategies. Simultaneously, game environments offer more diverse and dynamic environmental factors, such as terrain changes, weather variations, and seasonal changes. To enhance the realism of the game experience, these changes in game information often affect pathfinding for virtual objects. For example, in certain game scenarios, some paths may be impassable, such as paths on some rivers during rain or snow, or paths within enemy territory when executing a stealth infiltration strategy. However, current methods using pre-baked static navigation meshes (NavMesh) are insufficient for pathfinding in specific dynamic battlefield environments and under real-time tactical decision-making requirements. Other path planning methods for dynamic environments also suffer from high computational complexity and inconsistent path quality. Furthermore, the increasing number of game map resources further exacerbates the impact on the efficiency and effectiveness of path planning methods in dynamic environments.
[0036] To address the aforementioned issues and achieve effective path planning in dynamic game environments, particularly on large maps, this application provides a pathfinding method within a virtual scene. This method utilizes map and navigation grid segmentation, combined with actual pathfinding commands, to dynamically select and load portions of navigation grids. Furthermore, it dynamically adjusts the terrain weights of the loaded navigation grids, thereby effectively achieving global path planning in dynamic environments. The details are explained below.
[0037] The pathfinding method in a virtual scene provided in this application can be executed by a computer device, which can be at least one of a server or a terminal. The following is a schematic diagram of the implementation environment of the pathfinding method in a virtual scene provided in this application. See also... Figure 1 , Figure 1 This is a schematic diagram illustrating the implementation environment of a pathfinding method in a virtual scene provided in an embodiment of this application. The implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 can be directly or indirectly connected via wired or wireless communication, which is not limited herein.
[0038] In some embodiments, a target application running a virtual scene is installed on terminal 101, and at least a portion of the virtual scene is provided through a graphical user interface. Virtual objects can move within the virtual scene. Server 102 is a backend server for the target application, used to provide paths for the virtual objects to move within the virtual scene. In other embodiments, terminal 101 itself is also used to determine the paths for the virtual objects to move within the virtual scene; this is not specifically limited here. In the embodiments of this application, the virtual object can be a virtual object controlled by a player, and terminal 101 or server 102 provides a reference path for the player to control the movement of the virtual object. The virtual object can also be an AI robot of the NPC (NonPlayer Character) type, which moves based on the provided path.
[0039] In some embodiments, terminal 101 may be a smartphone, tablet, laptop, desktop computer, smart voice interaction device, smart home appliance, vehicle terminal, aircraft, VR (Virtual Reality) device, AR (Augmented Reality) device, etc., but is not limited thereto. In some embodiments, server 102 may be a standalone server, a server cluster composed of multiple servers, or a distributed system. It may also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. In some embodiments, server 102 undertakes the main computing work, and terminal 101 undertakes the secondary computing work; or, server 102 undertakes the secondary computing services, and terminal 101 undertakes the main computing work; or, server 102 and terminal 101 collaborate on computing using a distributed computing architecture.
[0040] Please see Figure 2 As shown, Figure 2This is a flowchart illustrating the steps of a pathfinding method in a virtual scene provided in an embodiment of this application. The terminal provides at least a portion of the virtual scene through a graphical user interface. The virtual scene is divided into multiple sub-virtual scene blocks, and the virtual scene is associated with a first navigation grid. The multiple sub-virtual scene blocks correspond one-to-one with multiple sub-navigation grids in the first navigation grid. The first navigation grid includes an initial weight coefficient related to the terrain parameters of the virtual scene.
[0041] Specifically, the first navigation grid associated with the virtual scene can typically be obtained in advance through pre-baking. This first navigation grid usually includes initial weight coefficients related to the terrain parameters of the virtual scene. These initial weight coefficients describe the selection priority of the first navigation grid under different terrains and can be used to describe the movement cost per unit length under that terrain. For example, in one possible implementation, the terrain parameters of the virtual scene can typically include different types of terrain such as plains, grasslands, rivers, forests, mountains, swamps, and roads. Based on this, different weight coefficients can be configured for different terrains. For example, the initial weight coefficient for roads can be configured as 5, the initial weight coefficient for plains as 10, and the initial weight coefficient for forests as 15. Of course, the above-described scheme is only one possible embodiment, and other weight coefficients configured for different terrains in the game are also feasible. This application does not limit this.
[0042] The multiple sub-virtual scene blocks that a virtual scene is divided into are often recorded in the background in the form of data, rather than being displayed in the graphical user interface. For example, in some embodiments, the positions of the multiple sub-virtual scene blocks obtained by dividing the virtual scene can be determined by recording the boundary coordinates. Of course, the first navigation grid associated with the virtual scene is also divided into multiple sub-navigation grids, each corresponding to one of the multiple sub-virtual scene blocks.
[0043] Building upon the foregoing, the terminal or a server connected to the terminal executes steps S210 to S230 to implement the pathfinding method within the virtual scene provided in this application. Specifically, this includes the following steps:
[0044] S210, in response to the first pathfinding command, based on the initial position and the target position, determine the first target sub-virtual scene block between the initial position and the target position from the plurality of sub-virtual scene blocks.
[0045] In some embodiments of this application, the first pathfinding instruction can generally be considered as an instruction that plans the path to a specific location, triggered in conjunction with an instruction that requires moving a virtual object to a specific location during game operation. Of course, the first pathfinding instruction can also be triggered independently. For example, a user can, in pathfinding mode, seek a planned path from the starting touch point of the swipe operation to the location of the virtual scene where the ending touch point is located through a swipe operation on the graphical user interface. This application does not limit the manner in which the first pathfinding instruction is triggered. For ease of description, in subsequent embodiments of this application, the first pathfinding instruction will be described as an instruction that plans the path to a specific location, triggered in conjunction with an instruction that requires moving a virtual object to a specific location during game operation.
[0046] The commands triggered to move a virtual object to a specific location can be of various types. For example, they can include user-triggered commands on a graphical user interface to move a first virtual object to a specific location, such as move, attack, or stealth. They can also include commands triggered by AI (Artificial Intelligence) to move a second virtual object, such as an NPC character, to a specific location. Of course, commands to move a virtual object to a specific location triggered through other means are also possible, and this application does not limit the method of triggering such commands.
[0047] Building upon the aforementioned foundation, the first pathfinding instruction typically requires planning a path from an initial position to a target position. The initial position can be the current real-time position of a specific virtual object selected when the first pathfinding instruction is triggered, or it can be the position of the starting touch point of the swipe operation when the first pathfinding instruction is triggered. The target position is typically the location to which the specific virtual object needs to be moved, selected when the first pathfinding instruction is triggered. For example, when an instruction is triggered to control a virtual object to execute a stealth strategy within a target city, the location of the target city in the virtual scene can be used as the target position. Alternatively, the target position can be the position of the ending touch point of the swipe operation when the first pathfinding instruction is triggered. This embodiment of the application does not limit the initial and ending positions associated with the first pathfinding instruction.
[0048] After determining the initial and target positions associated with the first pathfinding command, the virtual scene is divided into multiple sub-virtual scene blocks. Therefore, the terminal or server will then determine the first target sub-virtual scene block between the initial and target positions from these sub-virtual scene blocks. Specifically, the first target sub-virtual scene block includes one or more sub-virtual scene blocks. When the initial and target positions are in the same sub-virtual scene block, the first target sub-virtual scene block is that sub-virtual scene block. When the initial and target positions are in different sub-virtual scene blocks, the first target sub-virtual scene block includes at least the sub-virtual scene blocks containing both the initial and target positions, for example, when the sub-virtual scene blocks containing the initial and target positions are adjacent. Of course, when the sub-virtual scene blocks containing the initial and target positions are not adjacent, the first target sub-virtual scene block may also include more sub-virtual scene blocks located between the initial and target positions.
[0049] Specifically, in one embodiment, the first target sub-virtual scene block between the initial position and the target position may include the first target sub-virtual scene block traversed by the line connecting the initial position and the target position. That is, in one embodiment, determining the first target sub-virtual scene block between the initial position and the target position from the plurality of sub-virtual scene blocks includes:
[0050] The first target sub-virtual scene block through which the line connecting the initial position and the target position passes is determined from the plurality of sub-virtual scene blocks.
[0051] Furthermore, in one embodiment, taking the initial position as the initial position of the virtual object selected when the first pathfinding instruction is triggered, and the target position as the target position indicated by the first pathfinding instruction, in response to the first pathfinding instruction, based on the initial position and the target position, determining the first target sub-virtual scene block between the initial position and the target position from the plurality of sub-virtual scene blocks includes:
[0052] In response to the first pathfinding command, based on the initial position of the virtual object selected when the first pathfinding command is triggered and the target position indicated by the first pathfinding command, the first target sub-virtual scene block through which the line connecting the initial position and the target position passes is determined from the plurality of sub-virtual scene blocks.
[0053] For a clearer understanding of the above, please refer to [link / reference]. Figure 3 , Figure 3 The following is a detailed illustration of the effect of determining a first target sub-virtual scene block according to an embodiment of this application.
[0054] like Figure 3 As shown, a virtual scene 310 is provided in the graphical user interface, wherein the virtual scene 310 is configured to be divided into multiple sub-virtual scene blocks 320, for example, with Figure 3 As shown, it includes 4×4 sub-virtual scene blocks 320. Of course, based on actual needs, the sub-virtual scene blocks 320 obtained by dividing the virtual scene 310 can also include more, such as 6×6 or 8×8. This application does not limit this. At this time, when a pathfinding instruction from the initial position 330 to the target position 340 is detected, the first target sub-virtual scene block 350 covered by the line connecting the initial position 330 and the target position 340 can be obtained. The sub-navigation grids of these first target sub-virtual scene blocks 350 constitute the first target navigation grid in this application.
[0055] The solution provided in this application, after triggering a pathfinding command, first determines the first target sub-virtual scene block between the initial position and the target position from the sub-virtual scene blocks of the segmented block based on the initial position and target position associated with the pathfinding command. This is used for subsequent loading of the navigation mesh, updating of weights, and path planning. This can effectively reduce the amount of computation for path planning and improve the efficiency and effect of path planning in dynamic environments. The following will describe this in detail.
[0056] S220, load the sub-navigation grid corresponding to the first target sub-virtual scene block from the first navigation grid to obtain the first target navigation grid.
[0057] After determining the first target sub-virtual scene block between the initial position and the target position based on the initial position and the target position, in this embodiment of the application, the sub-navigation grid corresponding to the first target sub-virtual scene block will be loaded from the first navigation grid associated with the complete virtual scene to obtain the first target navigation grid.
[0058] Specifically, the solution provided in this application loads the sub-navigation grids corresponding to the first target sub-virtual scene block from the first navigation grid, and then splices these sub-navigation grids to form a first target navigation grid of a specific shape. The first target navigation grid contains the passable roads within these first target sub-virtual scene blocks. Other unloaded sub-navigation grids are not used in this path planning.
[0059] It should be noted that although the solution provided in this application does not load all navigation grids, and therefore may not be able to plan the globally optimal path, the pathfinding method within the virtual scene provided in this application is mainly applicable to games with very large maps, and the number of sub-virtual scene blocks divided into the virtual scene is relatively small compared to the overall game map size. For example, in one possible implementation, the virtual scene can be divided into 8×8 sub-virtual scene blocks. In this case, each sub-virtual scene block still has a relatively large size, ensuring the richness of paths within each sub-virtual scene block and the connectivity between sub-virtual scene blocks. This allows the optimal path to be found with a high probability even when only the sub-navigation grids corresponding to some sub-virtual scene blocks are loaded. Even if the optimal path cannot be found, in some embodiments of this application, more sub-virtual scene blocks can be reloaded using a re-pathfinding instruction to perform pathfinding again. The specific implementation scheme will be described in subsequent embodiments.
[0060] S230, based on the real-time game information when the first pathfinding command is triggered, the initial weight coefficient of the first target navigation grid is updated, and path planning is performed based on the first target navigation grid after the weight coefficient is updated to obtain the first planned path of the first pathfinding command.
[0061] After loading the sub-navigation mesh corresponding to the first target sub-virtual scene block between the initial position and the target position, and obtaining the first target navigation mesh, in order to achieve optimal path planning under the influence of dynamic environment, in one embodiment of this application, the initial weight coefficient of the loaded first target navigation mesh is further updated according to the real-time game information when the first pathfinding command is triggered, so that the updated weight coefficient of the current navigation mesh can better adapt to the real-time game information. Thus, path planning is performed based on the first target navigation mesh with updated weight coefficients to obtain the first planned path of the first pathfinding command under the influence of dynamic environment. This will be explained in detail below.
[0062] In some embodiments of this application, real-time game information can be regarded as game operation information that can affect the cost of virtual objects moving on different paths. It can usually be obtained by capturing or parsing program operation data. This application does not limit the means of collecting real-time game information.
[0063] Specifically, in one embodiment of this application, real-time game information may typically include the pathfinding tactical strategy selected when the first pathfinding instruction is triggered. For example, if the user selects different tactical strategies, such as infiltration, persuasion, or negotiation, then under different tactical strategies, virtual objects may be required to not, be allowed, or be preferentially allowed to move within the area controlled by a specific faction.
[0064] Alternatively, in another embodiment of this application, real-time game information may also include weather information that can affect movement effects in different terrains. For example, in rainy or snowy weather, movement in mountainous or swampy areas will be more difficult. Therefore, the cost of movement in mountainous or swampy terrain can be further increased to reduce the likelihood of virtual objects moving in mountainous or swampy terrain. Or, in foggy weather, visibility in forest terrain will be more limited, making it more vulnerable to attacks from other virtual objects. Similarly, the weights under this specific terrain can be adjusted appropriately.
[0065] Alternatively, in another embodiment of this application, the real-time game information may also include type information of virtual objects that are subject to different terrain interferences on different terrains. For example, in one possible implementation, the type information of virtual objects may be different types of troops, such as infantry, cavalry, artillery, or sailors. Taking infantry as the benchmark, cavalry will move more easily on open terrains such as plains and roads, while movement in terrains such as mountains, forests, and swamps will be more easily blocked by obstacles. Therefore, when cavalry is selected as the moving virtual object, the movement cost of cavalry on plains and roads can be appropriately reduced, while the movement cost of cavalry on mountains, forests, and swamps can be increased. For similar reasons, the movement cost of artillery on river terrain can be increased accordingly, while the movement cost of sailors on river terrain can be reduced. Of course, the above-mentioned solutions are only some possible implementations. In fact, based on the actual needs of the game, the real-time game information may include more to allow for updating the initial weight coefficients of the navigation grid. Specifically, the update of the initial weight coefficients based on the aforementioned real-time game information can be achieved through a configuration association table. That is, different configuration information can be associated with different real-time game information, presented in the form of a configuration table. The configuration information typically includes configuration conditions and weighting coefficients for weighting the weight coefficients. In one embodiment, updating the initial weight coefficients of the first target navigation grid based on the real-time game information triggered by the first pathfinding instruction includes:
[0066] Based on the real-time game information triggered by the first pathfinding command, and the configuration information associated with the real-time game information, a target road segment that meets the configuration conditions is determined in the first target navigation grid; the configuration information includes the configuration conditions and weighting coefficients.
[0067] Based on the weighting coefficients, the initial weight coefficients of the target road segments in the first target navigation grid are updated to obtain the first target navigation grid with updated target road segment weight coefficients.
[0068] In some embodiments of this application, taking the aforementioned real-time game information as an example, the configuration information associated with tactical strategies usually includes faction information, the configuration information associated with the weather information of the virtual scene usually includes the first terrain that can be affected by the weather information, and the configuration information associated with virtual objects usually includes the second terrain associated with the type information of the virtual objects. At this time, under different real-world game information, there are multiple different implementation schemes for determining the target road segment that meets the configuration conditions in the first target navigation grid.
[0069] For example, please see Figure 4 , Figure 4 A flowchart illustrating steps for determining a target road segment based on different real-time game information provided in this application embodiment specifically includes steps S410 to S430:
[0070] S410, in response to the first pathfinding instruction triggering the selected tactical strategy as the target tactical strategy, the target road segment under the target camp associated with the target tactical strategy is determined in the first target navigation grid.
[0071] S420, in response to the first pathfinding instruction being triggered, the weather information of the virtual scene is the target weather information, and the target road segment under the first target terrain associated with the target weather information is determined in the first target navigation grid.
[0072] S430, in response to the target type of the target virtual object selected when the first pathfinding instruction is triggered, the target road segment located under the second target terrain is determined in the first target navigation grid.
[0073] The above description can be referred to the explanation provided above. For example, when the weather information is rain or snow, the first target terrain can be mountains or swamps. Alternatively, when the selected virtual object is cavalry, the second target terrain can also be mountains or swamps.
[0074] Of course, it should be noted that the above-described solution is only an example using a single piece of real-time game information. In fact, the update of the weight coefficients in the target navigation grid can also be configured to combine multiple different pieces of real-time game information. For example, in one possible implementation, when cavalry needs to be moved to the target location in rainy or snowy weather, the weight coefficient of the swamp terrain in the first target navigation grid will be simultaneously affected by the combined weather and unit information.
[0075] Specifically, the process of updating the weight coefficients in the first target navigation grid can be achieved through the weighting coefficients in the configuration information, which can effectively realize the superposition effect calculation of the weight coefficients in the first target navigation grid by different real-time game information.
[0076] Specifically, to facilitate understanding of the above content, the following examples illustrate the configuration of different real-time game information.
[0077] Basic terrain weights (plains 10, roads 5, forests 15, swamps 25)
[0078] - Tactical adjustment coefficient (e.g., enemy area +200%)
[0079] - Unit type adjustment parameters (cavalry weight in swamps +50%, spies in enemy territory -50%)
[0080] -Environmental impact factors (rain / snow weather, swamp weight +30%)
[0081] When the user executes an avoidance tactic, i.e., the enemy territory gains a +200% bonus, the final weight of plains within the enemy territory becomes 10 + 10 × 200% = 30. Similarly, the weight of roads within the enemy territory becomes 15, and the weight of forests within the enemy territory becomes 45. Alternatively, when controlling cavalry movement in rainy or snowy weather, the weight of swampy terrain becomes 25 + 25 × 50% + 25 × 30% = 45.
[0082] Of course, it should be noted that the weighting coefficients provided above are illustrated by example using an additive method. In fact, the weighting coefficients configured for different real-time game information can also exist in a multiplicative manner, such as 120% or 150%. This application embodiment will not repeat the explanation here.
[0083] Of course, the configuration information provided above are only some possible configuration schemes. In fact, based on different game requirements, real-time game information can also include more dynamic factors that can affect the pathfinding path. In this case, the configuration information configured for this game information can also include more, and the specific configuration data can be recorded in the form of a configuration table, so that it can be adjusted in real time according to actual needs. This application does not limit this. Any method similar to that provided in this application, which uses real-time information from game operation to weight and update the weight coefficients of the loaded target navigation grid to obtain a target navigation network with finer weight coefficients in a dynamic environment, should be considered within the scope of protection claimed in this application.
[0084] Based on the aforementioned solution, which updates the weight coefficients of the first target navigation grid, a path can be planned on the first target navigation grid after the weight coefficients have been updated using a pre-set pathfinding algorithm. This will yield the first planned path for the first pathfinding command, which can be used to control the virtual object to move from its initial position to its target position.
[0085] Specifically, as described above, the weight coefficients in the first target navigation grid can be understood as the cost of moving on a specific terrain or path. The higher the weight coefficient, the higher the cost. Therefore, in some embodiments of this application, a dynamic path planning algorithm can be used to select the path with the lower cost as the planned path. That is, in one embodiment of this application, the path planning based on the first target navigation grid updated with the weight coefficients to obtain the first planned path for the first pathfinding instruction includes:
[0086] The cost coefficient of each road segment per unit length is determined based on the updated weight coefficients of each road segment in the first target navigation grid; wherein the cost coefficient of each road segment per unit length is positively correlated with the updated weight coefficient of the road segment.
[0087] Based on the cost coefficient of each road segment per unit length, path planning is performed in the first target navigation grid to obtain the first planned path of the first pathfinding instruction, wherein the total cost coefficient of all road segments on the first planned path is the lowest.
[0088] In this embodiment, the dynamic path planning algorithm can be the A* algorithm. Of course, other dynamic path planning algorithms can also be selected based on actual needs, which will not be elaborated here.
[0089] Specifically, to facilitate understanding of the solution provided in this application's embodiments, let's take the aforementioned terrain weights as an example. For instance, consider road 5, plains 10, and forest 15. If a planned path A involves walking 3 units from the forest, while another path B involves walking 4 units from the plains, the shorter path A would typically be chosen based on the shortest distance. However, considering terrain weights, the cost of path A is 3 × 15, or 45, while the cost of path B is 4 × 10, or 40. In this embodiment, path A would be chosen because it incurs a lower cost, which translates to shorter time and lower resource consumption in the game.
[0090] It is understandable that the weight coefficients in the target navigation grid can change due to different real-time game information. In other words, even if the initial position and the target position are the same, the weight coefficients in the target navigation grid will be different in different game scenarios due to different real-time game information, such as different virtual objects, different tactical strategies, or different game weather information. At this time, different optimal paths may be planned in different game scenarios, thus achieving the planning effect in a dynamic environment. Furthermore, by partially loading the navigation grid to further update the weight coefficients on the basis of the static navigation grid, the amount of computation in a dynamic environment is effectively reduced, and the efficiency and effect of global path planning in a dynamic environment are improved.
[0091] Furthermore, the aforementioned implementation method is merely an example of pathfinding in a virtual scene. In fact, in some embodiments of this application, based on the actual needs of gameplay, at least one virtual city model can be configured in the virtual scene. Each virtual city can be independently regarded as a plot of land, used to implement gameplay within the city, such as city buildings, city internal affairs, etc. In this case, the virtual city model will also have a pre-baked second navigation grid for indicating the road layout within the city. In order to achieve the effect of entering and exiting the city, the second navigation grid usually also includes at least one preset entry and exit point for indicating the entry and exit position of the virtual city model. Based on the aforementioned solution, in some embodiments of this application, when at least one of the initial position or target position is in a virtual city model rather than in the virtual scene, it is also necessary to plan the virtual city model. That is, in one embodiment, the pathfinding method in the virtual scene includes:
[0092] In response to the initial position being within the first virtual city model, a second planned path is generated from the initial position to the preset entry and exit point of the first virtual city model based on the second navigation grid of the first virtual city model.
[0093] In response to the target location being within the second virtual city model, a third planned path from the preset entry and exit points of the second virtual city model to the target location is generated based on the second navigation grid of the second virtual city scene.
[0094] In this embodiment, when the first pathfinding command requires a virtual object located in a certain position within the first virtual city model, such as a building, to move to another target location within the virtual scene, since each virtual city module can be considered an independent plot of land and configured with an independent navigation grid, this embodiment also generates a second planned path from the initial position to a preset entry / exit point of the first virtual city model based on the second navigation grid of the first virtual city model. After entering the virtual scene of the large map through the preset entry / exit point, further path planning is performed in the virtual scene to obtain the first planned path. In this way, the virtual object can first travel along the second planned path to the preset entry / exit point, and then further travel along the first planned path to the target location.
[0095] Alternatively, in another embodiment of this application, when the target location is within the second virtual city model, for example, when the first pathfinding instruction requires the virtual object to access other virtual objects within the second virtual city model, or to enter other virtual buildings within the second virtual city model, in addition to path planning on the virtual scene to enter the second virtual city, further path planning is required within the second virtual city. That is, a third planned path from the preset entry and exit points of the second virtual city model to the target location is generated based on the second navigation grid of the second virtual city scene. This allows the virtual object to continue along the third planned path to the target location within the second virtual city while traveling along the first planned path to the second virtual city, so as to access other virtual objects.
[0096] Of course, the aforementioned solution can also be applied to path planning from an initial position within the first virtual city model to a target position within the second virtual city model. That is, firstly, a second planned path from the initial position to the preset entry / exit point of the first virtual city model is generated using the second navigation grid of the first virtual city model. Then, the path planning from the first virtual city model to the second virtual city model is completed using the solution provided in any of the aforementioned embodiments to obtain a first planned path. Next, a third planned path from the preset entry / exit point of the second virtual city model to the target position is generated using the second navigation grid of the second virtual city scene. Thus, the virtual object can be controlled to move sequentially along the second planned path, the first planned path, and the third planned path from the initial position within the first virtual city model to the target position within the second virtual city model.
[0097] Furthermore, in some embodiments of this application, the second navigation grid may also include multiple preset entry and exit points, i.e., multiple city gates of the city. In this case, during the process of generating a second planned path from the initial position to the preset entry and exit points of the first virtual city model using the second navigation grid based on the first virtual city model, it is necessary to select the entry and exit point closest to the target position as a transit point, i.e., the first target entry and exit point, based on the relative orientation of the first virtual city. Similarly, during the process of generating a third planned path from the preset entry and exit points of the second virtual city model to the target position using the second navigation grid based on the second virtual city model, it is also necessary to select the entry and exit point closest to the initial position as a transit point, i.e., the second target entry and exit point, based on the relative orientation of the second virtual city. That is to say, in some embodiments of this application, the generation of the second planned path from the initial position to the preset entry and exit points of the first virtual city model using the second navigation grid based on the first virtual city model includes:
[0098] Based on the first directional information of the target location relative to the first virtual city model, a first target entry / exit point corresponding to the first directional information is determined from multiple preset entry / exit points of the first virtual city model;
[0099] A second planned path from the initial position to the first target entry / exit point is generated based on the second navigation grid of the first virtual city model. The generation of a third planned path from the preset entry / exit point of the second virtual city model to the target position based on the second navigation grid of the second virtual city model includes:
[0100] Based on the second orientation information of the initial position relative to the second virtual city model, a second target entry / exit point corresponding to the second orientation information is determined from a plurality of preset entry / exit points of the second virtual city model;
[0101] A third planning path from the second target entry / exit point to the target location is generated based on the second navigation grid of the second virtual city model.
[0102] For details, please refer to [link / reference]. Figure 5 , Figure 5 The following is a detailed illustration of the path planning effect from an initial position within a city to a target position within another city, provided as an embodiment of this application.
[0103] and Figure 3 Unlike the graphical user interface shown, in this embodiment, the virtual scene 310 may further include at least one virtual city model, for example... Figure 5The game includes a first virtual city model 360 and a second virtual city model 370. It should be noted that during actual gameplay, the first virtual city model 360 and the second virtual city model 370 may be presented on the game screen as thumbnails or city icons. Furthermore, the first virtual city model 360 and the second virtual city model 370 may also include multiple preset entry and exit points, such as a first entry and exit point 3610 for the first virtual city model 360 and a second entry and exit point 3710 for the second virtual city model 370. At this time, when a pathfinding operation is detected from the initial position 330 in the first virtual city model 360 to the target position 340 in the second virtual city model 370, the first target entry / exit point 3611 is determined from the first entry / exit point 3610 of the first virtual city model 360 based on the orientation of the target position 340 relative to the first virtual city model 360. Similarly, the second target entry / exit point 3711 is determined from the second entry / exit point 3710 of the second virtual city model 370. Thus, the planned routes from the initial position 340 to the first target entry / exit point 3611, from the first target entry / exit point 3611 to the second target entry / exit point 3711, and from the second target entry / exit point 3711 to the target position 340 are planned in sequence.
[0104] Furthermore, in some embodiments of this application, considering that in some special scenarios, such as legion wars, a large amount of computing resources are often required for war calculations, in order to further improve the pathfinding efficiency of virtual objects in such scenarios and avoid consuming a large amount of resources, thus affecting the performance of the war, in some embodiments of this application, when a virtual object is in a preset state, the sub-navigation grid corresponding to the first sub-virtual scene block where the virtual object is located is loaded from the first navigation grid to obtain a second target navigation grid, which is used for path planning of the virtual object in the preset state. Specifically, in one embodiment, the pathfinding method of the virtual scene further includes:
[0105] In response to the virtual object being in a preset state, the sub-navigation grid corresponding to the second target sub-virtual scene block where the virtual object is located is loaded from the first navigation grid to obtain the second target navigation grid. The second target navigation grid is used for path planning of the virtual object in the preset state.
[0106] Specifically, in this embodiment, the preset state includes a combat state. Since virtual objects often engage in combat within a small area, when a virtual object is in combat, the sub-navigation grid corresponding to the first sub-virtual scene block where the virtual object is located is loaded to obtain a second target navigation grid. Based on this second target navigation grid, path planning is performed on the virtual object in combat, such as planning paths for commands initiated by the virtual object, such as attack, retreat, and cover. This further improves path planning efficiency and meets the real-time requirements of virtual warfare.
[0107] Of course, in another embodiment, if a virtual object is detected to be located at the edge of the first sub-virtual scene block, loading only the sub-navigation mesh corresponding to a single first sub-virtual scene block may prevent path planning for instructions initiated from adjacent sub-virtual scene blocks. Therefore, in some embodiments of this application, the method further includes:
[0108] If the initial position of the virtual object does not exceed the first distance threshold from the edge of the second target sub-virtual scene block, then the sub-navigation grid corresponding to the third target sub-virtual scene block is loaded from the first navigation grid to obtain the third target navigation grid.
[0109] In this embodiment of the application, the third target sub-virtual scene block includes sub-virtual scene blocks whose initial position to the virtual object does not exceed a second distance threshold.
[0110] In this embodiment, by detecting the distance between the initial position of the virtual object and the edge of the second target sub-virtual scene block, and when the distance does not exceed a preset first distance threshold, that is, when the virtual object is at the edge of the second target sub-virtual scene block, a third sub-virtual scene block that is no more than the second distance threshold from the initial position of the virtual object is determined from the virtual scene, that is, the adjacent sub-virtual scene. Then, the sub-navigation grids corresponding to the first and second sub-virtual scene blocks are loaded from the first navigation grid to obtain the third target navigation grid, so as to realize the path planning of the virtual object in the preset state based on the third target navigation grid.
[0111] The solution provided by the embodiments of this application, when a virtual object is in a combat state, can obtain a path plan for the virtual object in the preset state by loading only the second target sub-virtual scene block where the virtual object is located, or loading a third sub-virtual scene block whose initial position does not exceed a second distance threshold when the virtual object is at the edge of the second target sub-virtual scene block. This can effectively reduce the computational load of the path planning for the virtual object and meet the real-time requirements for virtual object pathfinding in the combat state.
[0112] Furthermore, in some embodiments of this application, if the path planning of the first pathfinding instruction fails, or if the user is not satisfied with the planned first path and wants to re-plan the path, a re-pathfinding instruction can be used to initiate pathfinding again. Unlike the pathfinding method initiated by the first pathfinding instruction, the solution provided in this application considers the sub-navigation grids of more sub-virtual scene blocks. For example, in one possible implementation, path replanning can be based on all sub-virtual scene blocks, i.e., based on the first navigation grid of the virtual scene. Of course, in some embodiments of this application, the planning effect for virtual objects can be further improved by loading the sub-navigation grid of a fourth target sub-virtual scene block whose connection between the initial position and the target position does not exceed a preset third distance threshold. That is, in one embodiment, the virtual scene pathfinding method further includes:
[0113] In response to the failure of path planning in the first pathfinding instruction, or in response to the re-pathfinding instruction at the target location, a fourth target sub-virtual scene block is determined from the plurality of sub-virtual scene blocks whose connection between the initial location and the target location does not exceed a preset third distance threshold;
[0114] The fourth target navigation grid is obtained by loading the sub-navigation grid corresponding to the fourth target sub-virtual scene block from the first navigation grid;
[0115] Based on the real-time game information triggered by the first pathfinding command, the initial weight coefficients of the fourth target navigation grid are updated, and path planning is performed based on the fourth target navigation grid after the weight coefficients are updated to obtain the fifth planned path.
[0116] In this embodiment, since a fourth target sub-virtual scene block is determined whose connection between the initial position and the target position does not exceed a preset third distance threshold, and its corresponding sub-navigation grid is loaded, the resulting fourth target navigation grid contains more road network information than the first target navigation grid. Therefore, after updating the weight coefficient of the fourth target navigation grid, path planning is performed based on the fourth target navigation grid with updated weight coefficients to further seek a better planning path, namely the fifth planning path.
[0117] For a clearer understanding of the above, please refer to [link / reference]. Figure 6 , Figure 6 A schematic diagram illustrating the effect of selecting a sub-virtual scene block to obtain a navigation grid during secondary pathfinding provided in this application.
[0118] In this embodiment of the application, with Figure 3Compared to the graphical user interface shown, when a rerouting command from the initial position 330 to the target position 340 is initiated again, in addition to loading the sub-navigation grid of the first target sub-virtual scene block 350 covered by the line connecting the initial position 330 to the target position 340, a fourth target sub-virtual scene block 380 that is less than a certain distance threshold from this line will also be loaded, thus obtaining the fourth target navigation grid.
[0119] Furthermore, after the path planning from the initial position to the target position is realized through the pathfinding method provided in the embodiments of this application, in some embodiments of this application, the virtual object is further controlled to proceed along the planned path, for example, the first planned path to the target position.
[0120] Of course, it should be noted that due to the dynamic changes in game information, virtual objects may encounter situations where the planned path becomes unavailable while moving along it. Therefore, to meet the dynamic path planning requirements of virtual objects during movement, some embodiments of this application also provide a solution that uses waypoints to control the movement of virtual objects, thereby allowing virtual objects to temporarily avoid unavailable paths. In other words, in one embodiment, the pathfinding method for the virtual scene further includes:
[0121] Multiple waypoints are generated on the first planned path, and the virtual object is controlled to travel along the first planned path to the target location based on the multiple waypoints.
[0122] Specifically, in this embodiment, there are multiple possible ways to generate the multiple waypoints on the first planned path. For example, in one possible implementation, waypoints can be generated at turns, forks, or locations with specific buildings on the first planned path. For straight sections, waypoints can be generated at preset distances at regular intervals. Specifically, these waypoints are sequentially marked on the first planned path, and based on the generated waypoints, the virtual object is controlled to proceed along the first planned path, passing each waypoint in turn to reach the target location.
[0123] Based on the aforementioned solutions, due to the dynamic nature of the game, other users may create virtual building models in the virtual scene, such as city gates, docks, or barracks. Therefore, in some embodiments of this application, if a target virtual building model is detected on the first planned path, the virtual character will be controlled to avoid it based on the building type information of the target virtual building model, or the path will be replanned. In other words, the pathfinding method in the virtual scene further includes:
[0124] During the process of controlling the virtual object to travel along the first planned path based on the multiple waypoints, if there is a target virtual building model on the first planned path, the virtual character is controlled to avoid it based on the building type information of the target virtual building model, or the path is replanned.
[0125] Specifically, in some embodiments, if the building type information of the target virtual building model is a first building type that can be avoided, then the next path point on the first planning path is used as the target location for path planning to obtain a fourth planning path;
[0126] While controlling the virtual object to travel along the fourth planned path to the next waypoint, the virtual object is controlled to continue traveling along the first planned path.
[0127] Here, the target virtual building model of the first building type can typically refer to a small building that can be avoided, such as a barracks or fortifications. At this point, the virtual object is controlled to temporarily initiate a path planning process with the next alley on the first planned path as the target location, resulting in a fourth planned path. After avoiding the target virtual building model along the fourth planned path and reaching the next alley on the first planned path, the virtual object continues to travel along the first planned path.
[0128] Furthermore, in some embodiments, if the building type information of the target virtual building model is an unavoidable second building type, such as a large building type that needs to be passed through, like a city gate or camp entrance, then if the target virtual building model is detected to be in an impassable state, a re-pathfinding request will be initiated. The path will be re-planned based on the virtual character's current position and the target position when the first pathfinding command was triggered. That is, the re-pathfinding includes:
[0129] If the building type information of the target virtual building model is an unavoidable second building type, and the second building type is in an impassable state, then the path planning is re-performed based on the current position of the virtual character and the target position.
[0130] Of course, the above description is only one possible implementation. In fact, for the unavoidable second building type, it is possible to further detect whether the target virtual building model can be attacked or dismantled. If the target virtual building model can be attacked or dismantled, an attack request or dismantling request will be initiated to determine whether to attack or dismantle the target virtual building model. After the attack or dismantling of the target virtual building model is completed, the virtual object will continue to travel along the first planned path. Of course, during the process of replanning the path based on the current position of the virtual character and the target position, if the path planning fails, the virtual object will be controlled to wait.
[0131] The waypoint strategy provided in this application generates several waypoints on the planned path after it is generated, and controls the virtual character to move along the waypoints in sequence. In a dynamic game environment, when the planned path is temporarily blocked by other virtual building models, the virtual character can be controlled to initiate a pathfinding request to subsequent waypoints based on the building type of the virtual building model, so as to temporarily avoid the virtual building or re-initiate pathfinding planning. This satisfies the pathfinding needs of the character in a dynamic environment and improves the user experience.
[0132] In addition, it should be noted that the pathfinding in the virtual scene provided in this application embodiment can run on a terminal or a server. In particular, it can be processed asynchronously, that is, managed by an independent thread pool, and a pathfinding service running in parallel is established for the main thread to call.
[0133] For example, when a user initiates a command, the front-end interface of the terminal device waits for the routing result to appear before displaying it for the user to confirm. After confirmation, the user then performs an action, such as moving.
[0134] When AI deploys troops, it will execute actions only after the pathfinding results are available.
[0135] The asynchronous processing described above separates pathfinding into independent path planning and action execution, enabling concurrent pathfinding requests from multiple units and supporting real-time path planning for 1000+ units in parallel.
[0136] The pathfinding method within a virtual scene provided in this application provides at least a portion of the virtual scene's screen through a graphical user interface. By dividing the virtual scene into multiple sub-virtual scene blocks and correspondingly associating them with sub-navigation grids, upon responding to a pathfinding command, based on the initial and target positions, a target sub-virtual scene block between the initial and target positions is first determined from the multiple sub-virtual scene blocks. Then, the sub-navigation grid corresponding to the target sub-virtual scene block is loaded from the navigation grid, resulting in a partially loaded target navigation grid. This allows for convenient updating of the initial weight coefficients of the loaded target navigation grid based on real-time game information triggered by the pathfinding command. Path planning is then performed based on the updated target navigation grid to obtain the planned path. The solution provided in this application obtains the target navigation grid by dividing and loading sub-navigation grids from a portion of the scene blocks. By loading fewer segmented navigation grids, the computational load for path planning is reduced. Simultaneously, with subsequent dynamic weight adjustments, the weights of the loaded partial navigation grids are updated, meeting the path planning requirements in dynamic environments. Furthermore, since the loaded scene blocks are those between the initial and target positions, the path planning effect in dynamic environments is effectively guaranteed.
[0137] To better implement the virtual scene pathfinding method provided in this application embodiment, based on the virtual scene pathfinding method provided in this application embodiment, this application embodiment also provides a virtual scene pathfinding device, wherein at least a portion of the virtual scene is provided through a graphical user interface, wherein the virtual scene is divided into multiple sub-virtual scene blocks, the virtual scene is associated with a first navigation grid, and the multiple sub-virtual scene blocks correspond one-to-one with multiple sub-navigation grids in the first navigation grid, the first navigation grid including initial weight coefficients related to the terrain parameters of the virtual scene, such as... Figure 7 As shown, the pathfinding device 700 in the virtual scene includes:
[0138] The determination module 710 is used to respond to the first pathfinding instruction and, based on the initial position and the target position, determine the first target sub-virtual scene block between the initial position and the target position from multiple sub-virtual scene blocks;
[0139] The loading module 720 is used to load the sub-navigation grid corresponding to the first target sub-virtual scene block from the first navigation grid to obtain the first target navigation grid;
[0140] The update module 730 is used to update the initial weight coefficient of the first target navigation grid based on the real-time game information when the first pathfinding command is triggered, and to perform path planning based on the first target navigation grid after the weight coefficient update to obtain the first planned path of the first pathfinding command.
[0141] In one embodiment of this application, the update module 730 is further configured to determine a target road segment that meets the configuration conditions in the first target navigation grid based on the real-time game information when the first pathfinding instruction is triggered and the configuration information associated with the real-time game information; the configuration information includes configuration conditions and weighting coefficients;
[0142] Based on the weighting coefficients, the initial weight coefficients of the target road segments in the first target navigation grid are updated to obtain the first target navigation grid after the target road segment weight coefficients are updated.
[0143] In one embodiment of this application, the update module 730 is further configured to, in response to the first pathfinding instruction triggering the selected tactical strategy as the target tactical strategy, determine the target road segment in the first target navigation grid that is under the target camp associated with the target tactical strategy.
[0144] In one embodiment of this application, the update module 730 is further configured to determine the target road segment in the first target navigation grid under the first target terrain associated with the target weather information in response to the weather information of the virtual scene being the target weather information when the first pathfinding instruction is triggered.
[0145] In one embodiment of this application, the update module 730 is further configured to, in response to the target type of the target virtual object selected when the first pathfinding instruction is triggered, determine the target road segment in the first target navigation grid that is under the second target terrain, the second target terrain being able to affect the movement of the virtual object of the target type.
[0146] In one embodiment of this application, the update module 730 is further configured to, in response to the initial position being within the first virtual city model, generate a second planned path from the initial position to a preset entry / exit point of the first virtual city model based on the second navigation grid of the first virtual city model; and / or
[0147] In response to the target location being within the second virtual city model, a third planned path from the preset entry and exit points of the second virtual city model to the target location is generated based on the second navigation grid of the second virtual city scene.
[0148] In one embodiment of this application, the update module 730 is further configured to determine a first target entry / exit point corresponding to the first orientation information from a plurality of preset entry / exit points of the first virtual city model based on the first orientation information of the target location relative to the first virtual city model.
[0149] A second planned path from the initial position to the first target entry / exit point is generated based on the second navigation grid of the first virtual city model.
[0150] or
[0151] Based on the second orientation information of the initial position relative to the second virtual city model, the second target entry and exit point corresponding to the second orientation information is determined from multiple preset entry and exit points of the second virtual city model;
[0152] The second navigation grid, based on the second virtual city model, generates a third planned path from the second target entry / exit point to the target location.
[0153] In one embodiment of this application, the update module 730 is further configured to determine the cost coefficient of each unit length of road segment based on the updated weight coefficients of each road segment of the first target navigation grid; wherein the cost coefficient of each unit length of road segment is positively correlated with the updated weight coefficients of the road segment;
[0154] Based on the cost coefficient of each unit length road segment, path planning is performed in the first target navigation grid to obtain the first planned path of the first pathfinding instruction, wherein the total cost coefficient of all road segments on the first planned path is the lowest.
[0155] In one embodiment of this application, the determining module 710 is further configured to respond to a first pathfinding instruction and, based on the initial position of the virtual object selected when the first pathfinding instruction is triggered and the target position indicated by the first pathfinding instruction, determine the first target sub-virtual scene block through which the line connecting the initial position and the target position passes from a plurality of sub-virtual scene blocks.
[0156] In one embodiment of this application, the update module 730 is further configured to generate multiple waypoints on the first planned path, and to control the virtual object to travel along the first planned path to the target location based on the multiple waypoints.
[0157] In one embodiment of this application, the update module 730 is further configured to, during the process of controlling the virtual object to travel along the first planned path based on multiple waypoints, if there is a target virtual building model on the first planned path, control the virtual character to avoid it based on the building type information of the target virtual building model, or re-plan the path.
[0158] In one embodiment of this application, the update module 730 is further configured to, if the building type information of the target virtual building model is a first building type that can be avoided, then use the next path point on the first planning path as the target location for path planning to obtain a fourth planning path.
[0159] When controlling the virtual object to travel along the fourth planned path to the next waypoint, control the virtual object to continue traveling along the first planned path.
[0160] In one embodiment of this application, the update module 730 is further configured to re-plan the path based on the current position and the target position of the virtual character if the building type information of the target virtual building model is an unavoidable second building type, and the second building type is in an impassable state.
[0161] In one embodiment of this application, the update module 730 is further configured to, in response to the virtual object being in a preset state, load the sub-navigation grid corresponding to the second target sub-virtual scene block where the virtual object is located from the first navigation grid to obtain the second target navigation grid, the second target navigation grid being used for path planning of the virtual object in the preset state;
[0162] The preset states include the combat state.
[0163] In one embodiment of this application, the update module 730 is further configured to load the sub-navigation grid corresponding to the third target sub-virtual scene block from the first navigation grid if the initial position of the virtual object does not exceed the first distance threshold with respect to the edge of the second target sub-virtual scene block, thereby obtaining the third target navigation grid. The third target sub-virtual scene block includes sub-virtual scene blocks whose initial position does not exceed the second distance threshold with respect to the virtual object.
[0164] In one embodiment of this application, the update module 730 is further configured to, in response to the path planning failure of the first pathfinding instruction, or in response to the re-pathfinding instruction of the target location, determine from a plurality of sub-virtual scene blocks a fourth target sub-virtual scene block whose connection between the initial location and the target location does not exceed a preset third distance threshold.
[0165] Load the sub-navigation grid corresponding to the fourth target sub-virtual scene block from the first navigation grid to obtain the fourth target navigation grid;
[0166] Based on the real-time game information triggered by the first pathfinding command, the initial weight coefficients of the fourth target navigation grid are updated, and path planning is performed based on the fourth target navigation grid after the weight coefficients are updated to obtain the fifth planned path.
[0167] Specific limitations regarding the pathfinding device within the virtual scene can be found in the limitations regarding the pathfinding method within the virtual scene described above, and will not be repeated here. Each module in the aforementioned pathfinding device within the virtual scene can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0168] This application embodiment provides at least a portion of a virtual scene through a graphical user interface. By dividing the virtual scene into multiple sub-virtual scene blocks and correspondingly associating them with sub-navigation grids, upon responding to a pathfinding command, based on the initial and target positions, a target sub-virtual scene block between the initial and target positions is first determined from the multiple sub-virtual scene blocks. Then, the sub-navigation grid corresponding to the target sub-virtual scene block is loaded from the navigation grid, resulting in a partially loaded target navigation grid. This allows for convenient updating of the initial weight coefficients of the loaded target navigation grid based on real-time game information triggered by the pathfinding command. Path planning is then performed based on the updated target navigation grid to obtain the planned path. The solution provided in this application obtains the target navigation grid by dividing and loading sub-navigation grids from a portion of the scene blocks. Loading fewer segmented navigation grids reduces the computational load for path planning. Simultaneously, subsequent dynamic weight adjustments update the weights of the loaded partial navigation grids, meeting the path planning requirements in dynamic environments. Furthermore, the fact that the loaded scene blocks are between the initial and target positions effectively ensures the path planning effect in dynamic environments.
[0169] In some embodiments of this application, the pathfinding device 700 in the virtual scene can be implemented as a computer program, and the computer program can be implemented in, for example... Figure 8 The computer device shown is running the program. The computer device's memory can store the various program modules that make up the pathfinding device 700 within the virtual scene, for example, Figure 7 The shown modules are the determining module 710, the loading module 720, and the updating module 730. The computer program comprised of these modules causes the processor to execute the steps of the interactive control methods in the game described in the various embodiments of this application.
[0170] For example, Figure 8 The computer device shown can be used as follows Figure 7 The determination module 710 in the pathfinding device 700 within the virtual scene executed step S210. The computer device can execute step S220 via the loading module 720. The computer device can execute step S230 via the updating module 730. The computer device includes a processor, memory, and a network interface connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communication with external computer devices via a network connection. When the computer program is executed by the processor, it implements a pathfinding method within the virtual scene.
[0171] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0172] In some embodiments of this application, a computer device is provided, including one or more processors; memory; and one or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the processor to perform the following steps:
[0173] In response to the first pathfinding command, based on the initial position and the target position, determine the first target sub-virtual scene block between the initial position and the target position from multiple sub-virtual scene blocks;
[0174] Load the sub-navigation grid corresponding to the first target sub-virtual scene block from the first navigation grid to obtain the first target navigation grid;
[0175] Based on the real-time game information when the first pathfinding command is triggered, the initial weight coefficients of the first target navigation grid are updated, and path planning is performed based on the first target navigation grid after the weight coefficients are updated to obtain the first planned path of the first pathfinding command.
[0176] In one embodiment, the processor may further implement the following steps: based on real-time game information triggered by the first pathfinding instruction and configuration information associated with the real-time game information, determine a target road segment in the first target navigation grid that meets the configuration conditions; the configuration information includes configuration conditions and weighting coefficients;
[0177] Based on the weighting coefficients, the initial weight coefficients of the target road segments in the first target navigation grid are updated to obtain the first target navigation grid after the target road segment weight coefficients are updated.
[0178] In one embodiment, the processor may further implement the following steps: in response to a first pathfinding instruction triggering the selected tactical strategy as a target tactical strategy, determine a target road segment in a first target navigation grid that is under the target camp associated with the target tactical strategy.
[0179] In one embodiment, the processor may further implement the following steps: in response to the weather information of the virtual scene being the target weather information when the first pathfinding instruction is triggered, determine the target road segment in the first target navigation grid that is under the first target terrain associated with the target weather information.
[0180] In one embodiment, the processor may further implement the following steps: in response to the target type of the target virtual object selected when the first pathfinding instruction is triggered, determine the target road segment in the first target navigation grid that is under the second target terrain, the second target terrain being able to affect the movement of the virtual object of the target type.
[0181] In one embodiment, the processor may further implement the following steps: in response to the initial position being within a first virtual city model, generating a second planned path from the initial position to a preset entry / exit point of the first virtual city model based on a second navigation grid of the first virtual city model; and / or
[0182] In response to the target location being within the second virtual city model, a third planned path from the preset entry and exit points of the second virtual city model to the target location is generated based on the second navigation grid of the second virtual city scene.
[0183] In one embodiment, the processor may further implement the following steps: based on the first directional information of the target location relative to the first virtual city model, determine the first target entry / exit point corresponding to the first directional information from a plurality of preset entry / exit points of the first virtual city model;
[0184] The second navigation grid, based on the first virtual city model, generates a second planned path from the initial position to the first target entry / exit point.
[0185] In one embodiment, the processor may further implement the following steps: based on the second orientation information of the initial position relative to the second virtual city model, determine the second target entry / exit point corresponding to the second orientation information from a plurality of preset entry / exit points of the second virtual city model;
[0186] The second navigation grid, based on the second virtual city model, generates a third planned path from the second target entry / exit point to the target location.
[0187] In one embodiment, the processor may further implement the following steps: determining the cost coefficient of each segment per unit length based on the updated weight coefficients of each segment of the first target navigation grid; wherein the cost coefficient of each segment per unit length is positively correlated with the updated weight coefficients of the segment;
[0188] Based on the cost coefficient of each unit length road segment, path planning is performed in the first target navigation grid to obtain the first planned path of the first pathfinding instruction, wherein the total cost coefficient of all road segments on the first planned path is the lowest.
[0189] In one embodiment, the processor may further perform the following steps: in response to a first pathfinding instruction, based on the initial position of the virtual object selected when the first pathfinding instruction is triggered and the target position indicated by the first pathfinding instruction, determine from a plurality of sub-virtual scene blocks the first target sub-virtual scene block through which the line connecting the initial position and the target position passes.
[0190] In one embodiment, the processor may further implement the following steps: generating multiple waypoints on a first planned path, and controlling a virtual object to travel along the first planned path to a target location based on the multiple waypoints.
[0191] In one embodiment, the processor may further implement the following steps: during the process of controlling the virtual object to travel along the first planned path based on multiple waypoints, if there is a target virtual building model on the first planned path, the virtual character is controlled to avoid it based on the building type information of the target virtual building model, or the path is replanned.
[0192] In one embodiment, the processor may further implement the following steps: if the building type information of the target virtual building model is a first building type that can be avoided, then the next path point on the first planning path is used as the target location for path planning to obtain a fourth planning path;
[0193] When controlling the virtual object to travel along the fourth planned path to the next waypoint, control the virtual object to continue traveling along the first planned path.
[0194] In one embodiment, the processor may further implement the following steps: if the building type information of the target virtual building model is an unavoidable second building type, and the second building type is in an impassable state, then re-plan the path based on the current position and the target position of the virtual character.
[0195] In one embodiment, the processor may further implement the following steps: in response to the virtual object being in a preset state, loading the sub-navigation grid corresponding to the second target sub-virtual scene block where the virtual object is located from the first navigation grid to obtain the second target navigation grid, the second target navigation grid being used for path planning of the virtual object in the preset state;
[0196] The preset states include the combat state.
[0197] In one embodiment, the processor may further implement the following steps: if the initial position of the virtual object does not exceed a first distance threshold from the edge of the second target sub-virtual scene block, then load the sub-navigation grid corresponding to the third target sub-virtual scene block from the first navigation grid to obtain the third target navigation grid, wherein the third target sub-virtual scene block includes sub-virtual scene blocks whose initial position does not exceed the second distance threshold from the virtual object.
[0198] In one embodiment, the processor may further implement the following steps: in response to a path planning failure of the first pathfinding instruction, or in response to a re-pathfinding instruction at the target location, determining a fourth target sub-virtual scene block from a plurality of sub-virtual scene blocks whose connection between the initial location and the target location does not exceed a preset third distance threshold;
[0199] Load the sub-navigation grid corresponding to the fourth target sub-virtual scene block from the first navigation grid to obtain the fourth target navigation grid;
[0200] Based on the real-time game information triggered by the first pathfinding command, the initial weight coefficients of the fourth target navigation grid are updated, and path planning is performed based on the fourth target navigation grid after the weight coefficients are updated to obtain the fifth planned path.
[0201] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0202] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0203] The foregoing has provided a detailed description of a pathfinding method, apparatus, computer device, and storage medium in a virtual scene provided by the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.
Claims
1. A pathfinding method in a virtual scene, characterized in that, The virtual scene is provided through a graphical user interface, wherein the virtual scene is divided into multiple sub-virtual scene blocks, the virtual scene is associated with a first navigation grid, the multiple sub-virtual scene blocks correspond one-to-one with multiple sub-navigation grids in the first navigation grid, and the first navigation grid includes initial weight coefficients related to the terrain parameters of the virtual scene. The method includes: In response to the first pathfinding command, based on the initial position and the target position, a first target sub-virtual scene block between the initial position and the target position is determined from the plurality of sub-virtual scene blocks; The first target navigation grid is obtained by loading the sub-navigation grid corresponding to the first target sub-virtual scene block from the first navigation grid; Based on the real-time game information when the first pathfinding command is triggered, the initial weight coefficients of the first target navigation grid are updated, and path planning is performed based on the first target navigation grid after the weight coefficients are updated to obtain the first planned path of the first pathfinding command.
2. The method of claim 1, wherein, The step of updating the initial weight coefficients of the first target navigation grid based on real-time game information triggered by the first pathfinding command includes: Based on the real-time game information triggered by the first pathfinding command, and the configuration information associated with the real-time game information, a target road segment that meets the configuration conditions is determined in the first target navigation grid; the configuration information includes the configuration conditions and weighting coefficients. Based on the weighting coefficients, the initial weight coefficients of the target road segments in the first target navigation grid are updated to obtain the first target navigation grid with updated target road segment weight coefficients.
3. The method of claim 2, wherein, The real-time game information includes the tactical strategy selected when the first pathfinding command is triggered, and the configuration information associated with the tactical strategy includes faction information; The step of determining a target road segment that meets the configuration conditions in the first target navigation grid based on the real-time game information triggered by the first pathfinding command and the configuration information associated with the real-time game information includes: In response to the first pathfinding command triggering the selection of the tactical strategy as the target tactical strategy, the target road segment under the target camp associated with the target tactical strategy is determined in the first target navigation grid.
4. The method of claim 2, wherein, The real-time game information includes the weather information of the virtual scene when the first pathfinding command is triggered, and the configuration information associated with the weather information includes a first terrain that can be affected by the weather information; The step of determining a target road segment that meets the configuration conditions in the first target navigation grid based on the real-time game information triggered by the first pathfinding command and the configuration information associated with the real-time game information includes: In response to the first pathfinding command being triggered, the weather information of the virtual scene is the target weather information, and the target road segment under the first target terrain associated with the target weather information is determined in the first target navigation grid.
5. The method of claim 2, wherein, The real-time game information includes the virtual object selected when the first pathfinding command is triggered, and the configuration information associated with the virtual object includes a second terrain associated with the type information of the virtual object; The step of determining a target road segment that meets the configuration conditions in the first target navigation grid based on the real-time game information triggered by the first pathfinding command and the configuration information associated with the real-time game information includes: In response to the target type of the target virtual object selected when the first pathfinding instruction is triggered, a target road segment under the second target terrain is determined in the first target navigation grid, and the second target terrain can affect the movement of the virtual object of the target type.
6. The method of claim 1, wherein, The virtual scene also includes at least one virtual city model, the virtual city model including a second navigation grid, the second navigation grid including at least one preset entry / exit point for indicating the entry / exit position of the virtual city model; The method further includes: In response to the initial position being within a first virtual city model, a second planned path is generated based on the second navigation grid of the first virtual city model, from the initial position to a preset entry / exit point in the first virtual city model; and / or In response to the target location being within the second virtual city model, a third planned path from the preset entry and exit points of the second virtual city model to the target location is generated based on the second navigation grid of the second virtual city scene.
7. The method of claim 6, wherein, The second navigation grid includes multiple preset entry and exit points; The second planning path generated from the initial position to the preset entry and exit point of the first virtual city model based on the second navigation grid of the first virtual city model includes: Based on the first directional information of the target location relative to the first virtual city model, a first target entry / exit point corresponding to the first directional information is determined from multiple preset entry / exit points of the first virtual city model; A second planned path from the initial position to the first target entry / exit point is generated based on the second navigation grid of the first virtual city model; or The generation of a third planned path from the preset entry / exit point of the second virtual city model to the target location based on the second navigation grid of the second virtual city model includes: Based on the second orientation information of the initial position relative to the second virtual city model, a second target entry / exit point corresponding to the second orientation information is determined from a plurality of preset entry / exit points of the second virtual city model; A third planning path from the second target entry / exit point to the target location is generated based on the second navigation grid of the second virtual city model.
8. The method of claim 1, wherein, The path planning based on the updated first target navigation grid with weighted coefficients to obtain the first planned path for the first pathfinding instruction includes: The cost coefficient of each road segment per unit length is determined based on the updated weight coefficients of each road segment in the first target navigation grid; wherein the cost coefficient of each road segment per unit length is positively correlated with the updated weight coefficient of the road segment. Based on the cost coefficient of each road segment per unit length, path planning is performed in the first target navigation grid to obtain the first planned path of the first pathfinding instruction, wherein the total cost coefficient of all road segments on the first planned path is the lowest.
9. The method of claim 1, wherein, The step of responding to the first pathfinding command, based on the initial position and the target position, to determine the first target sub-virtual scene block between the initial position and the target position from the plurality of sub-virtual scene blocks, includes: In response to the first pathfinding command, based on the initial position of the virtual object selected when the first pathfinding command is triggered and the target position indicated by the first pathfinding command, the first target sub-virtual scene block through which the line connecting the initial position and the target position passes is determined from the plurality of sub-virtual scene blocks.
10. The method according to claim 9, characterized in that, The method further includes: Multiple waypoints are generated on the first planned path, and the virtual object is controlled to travel along the first planned path to the target location based on the multiple waypoints.
11. The method according to claim 10, characterized in that, The virtual scene also includes at least one virtual building model, and the method further includes: During the process of controlling the virtual object to travel along the first planned path based on the multiple waypoints, if there is a target virtual building model on the first planned path, the virtual character is controlled to avoid it based on the building type information of the target virtual building model, or the path is replanned.
12. The method according to claim 11, characterized in that, Controlling the virtual character to avoid obstacles includes: If the building type information of the target virtual building model is the first building type that can be avoided, then the next point on the first planning path is used as the target location for path planning to obtain the fourth planning path; While controlling the virtual object to travel along the fourth planned path to the next waypoint, the virtual object is controlled to continue traveling along the first planned path.
13. The method according to claim 11, characterized in that, Re-plan the route, including: If the building type information of the target virtual building model is an unavoidable second building type, and the second building type is in an impassable state, then the path planning is re-performed based on the current position of the virtual character and the target position.
14. The method according to claim 9, characterized in that, The method further includes: In response to the virtual object being in a preset state, the sub-navigation grid corresponding to the second target sub-virtual scene block where the virtual object is located is loaded from the first navigation grid to obtain the second target navigation grid. The second target navigation grid is used for path planning of the virtual object in the preset state. The preset state includes the combat state.
15. The method according to claim 14, characterized in that, The method further includes: If the initial position of the virtual object does not exceed a first distance threshold from the edge of the second target sub-virtual scene block, then the sub-navigation grid corresponding to the third target sub-virtual scene block is loaded from the first navigation grid to obtain the third target navigation grid. The third target sub-virtual scene block includes sub-virtual scene blocks whose initial position does not exceed a second distance threshold from the virtual object.
16. The method according to claim 1, characterized in that, The method further includes: In response to the failure of path planning in the first pathfinding instruction, or in response to the re-pathfinding instruction at the target location, a fourth target sub-virtual scene block is determined from the plurality of sub-virtual scene blocks whose connection between the initial location and the target location does not exceed a preset third distance threshold; The fourth target navigation grid is obtained by loading the sub-navigation grid corresponding to the fourth target sub-virtual scene block from the first navigation grid; Based on the real-time game information triggered by the first pathfinding command, the initial weight coefficients of the fourth target navigation grid are updated, and path planning is performed based on the fourth target navigation grid after the weight coefficients are updated to obtain the fifth planned path.
17. The method according to any one of claims 1 to 16, characterized in that, The number of sub-virtual scene blocks is determined based on the virtual size of the virtual scene, and the sub-virtual scene blocks are rectangular plots.
18. A pathfinding device in a virtual scene, characterized in that, The virtual scene is provided through a graphical user interface, wherein the virtual scene is divided into multiple sub-virtual scene blocks, the virtual scene is associated with a first navigation grid, the multiple sub-virtual scene blocks correspond one-to-one with multiple sub-navigation grids in the first navigation grid, and the first navigation grid includes initial weight coefficients related to the terrain parameters of the virtual scene. The device includes: A determination module is used to respond to a first pathfinding instruction and, based on an initial position and a target position, determine the initial position of a first target sub-virtual scene block between the initial position and the target position from the plurality of sub-virtual scene blocks; A loading module is used to load the sub-navigation grid corresponding to the first target sub-virtual scene block from the first navigation grid to obtain the first target navigation grid; The update module is used to update the initial weight coefficients of the first target navigation grid based on the real-time game information when the first pathfinding command is triggered, and to perform path planning based on the first target navigation grid after the weight coefficients are updated, so as to obtain the first planned path of the first pathfinding command.
19. A computer device, characterized in that, The computer device includes: One or more processors; Memory; and One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the processor to implement the pathfinding method in the virtual scene according to any one of claims 1 to 17.
20. A computer-readable storage medium, characterized in that, It stores a computer program, which is loaded by a processor to execute the pathfinding method in the virtual scene as described in any one of claims 1 to 17.
