Virtual environment path planning method and system based on regional group density evaluation

CN116753974BActive Publication Date: 2026-09-11ZHEJIANG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310733359.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-20
Publication Date
2026-09-11
Estimated Expiration
2043-06-20

AI Technical Summary

Technical Problem

当拥堵状况频繁出现,路径规划的效率就会降低,因为智能体会频繁尝试重新搜索路径已挣脱密集群体的束缚

Benefits of technology

[0025] This invention introduces a regional population density assessment method to achieve a quantitative assessment of population congestion in virtual scenarios. It can accurately predict the distribution of intelligent agent groups in virtual scenarios, providing accurate data support for path planning.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116753974B_ABST
    Figure CN116753974B_ABST
Patent Text Reader

Abstract

The application discloses a virtual environment path planning method and system based on regional group density evaluation, comprising the following steps: constructing a navigation grid map of a movable region of a virtual environment, calculating an agent group density value of all navigation grids on the navigation grid map, calculating an agent group density value on all path searching links on the navigation grid map, calculating a heuristic function in a cost function of an A* algorithm according to the density values of the navigation grids and the path searching links, searching a global path on the navigation grid map by using an improved A* algorithm, and calculating an optimized global path by using a funnel algorithm. Therefore, the application quantitatively evaluates the regional group congestion situation, adopts the improved A* algorithm for path planning, realizes the purpose of guiding the agent to avoid the congestion groups in the density evaluation range, improves the quality of the planned path, and makes the path searching process of the agent in the virtual scene more smooth, stable and efficient.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of path planning technology, and specifically to a virtual environment path planning method and system based on regional population density assessment. Background Technology

[0002] In recent years, with the rapid development of virtual reality technology, swarm simulation technology has been widely applied in dynamic virtual scenes, covering multiple fields such as virtual simulation, games, and education. Path planning technology is one of the most critical technologies enabling intelligent agents to autonomously plan feasible paths from their starting position to their destination in virtual scenes. Path planning technology needs to ensure that the planned path yields optimal results under given conditions, such as satisfying conditions like shortest path, shortest movement time, and minimum movement cost. Currently, numerous studies have proposed many different techniques for solving path planning problems, such as search algorithms based on pre-computed scene maps, artificial potential field algorithms, genetic algorithms, and reinforcement learning methods.

[0003] The most popular path planning method in virtual environments is based on navigation grids. This method requires pre-compiling a map of the movable area of ​​the scene, using a search algorithm such as A* to plan the optimal path, and combining it with local obstacle avoidance algorithms such as mutual obstacle avoidance to avoid dynamic obstacles. The map used in this path planning method is generated based on a static scene; therefore, the planned path does not avoid dynamic obstacles in the scene, such as other agents. However, by combining this method with local obstacle avoidance algorithms, such as velocity-based obstacle avoidance algorithms, social force model-based algorithms, or reinforcement learning-based algorithms, the agent can avoid dynamic obstacles while following the optimal path obtained through path planning.

[0004] However, existing technologies often fail to handle congestion issues effectively in virtual scenarios. When agents cluster to a certain density, they form congested crowds that disrupt normal path planning, making it nearly impossible to traverse dense groups using local obstacle avoidance algorithms. Frequent congestion reduces path planning efficiency as agents repeatedly attempt to re-search for new paths to escape the dense group. Furthermore, congestion also affects the performance of individual agents and the overall group simulation. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention proposes a virtual environment path planning method based on regional population density assessment. The specific technical solution is as follows:

[0006] Step 1: Model the movable area of ​​the virtual environment using the navigation grid method;

[0007] Step 2: Based on the location information of the agents in the virtual environment, calculate the agent population density value of all navigation grids on the navigation grid map;

[0008] Step 3: Based on the usage information of the pathfinding links in the virtual environment, calculate the population density value of agents on all pathfinding links on the navigation grid map;

[0009] Step 4: Improve the cost function of the pathfinding algorithm based on the density information of the regional population. Combine the density values ​​of the navigation grid and the pathfinding links to calculate the heuristic function in the cost function, improve the directionality of path planning, avoid the agent entering congested areas with high population density, and improve pathfinding efficiency. Further adjust the contribution of the density values ​​of the searched navigation grids and pathfinding links to the heuristic function in the cost function based on their distance from the pathfinding starting point, to avoid the agent prematurely considering congestion at long distances. The weight of navigation grids with lower density values ​​will be higher than that of navigation grids with higher density values; the weight of pathfinding links with lower density values ​​will be higher than that of pathfinding links with lower density values; the contribution of the density values ​​of navigation grids and pathfinding links farther from the pathfinding starting point to the weights will be lower than that of navigation grids and pathfinding links closer to the pathfinding starting point.

[0010] Step 5: Use the improved A* algorithm to search for the globally optimal path from the pathfinding start point to the pathfinding end point on the navigation grid map. Based on the constructed global path navigation grid and pathfinding link sequence, use the funnel algorithm to calculate the path nodes and obtain the optimized global path.

[0011] Furthermore, the formula for calculating the agent population density value of the navigation grid on the navigation grid map is as follows:

[0012]

[0013] Among them, P i S represents the agent population density value of navigation grid i on the navigation grid map. i It is the area of ​​the navigation grid with index i, n i It is the total number of agents whose center point is located on the navigation grid with index i, and k is the index of the agent on the navigation grid with index i, k = 1, 2, ..., n i ,s k It is the area of ​​the two-dimensional projection of the agent with sequence number k onto the navigation grid.

[0014] Furthermore, the agent population density value P of the pathfinding links on the navigation grid map... j The calculation formula is as follows:

[0015]

[0016] Among them, P j L represents the population density value of agents for the pathfinding link with index j on the navigation grid map. jIt is the width of the pathfinding link with index j, n j This represents the number of agents currently using the pathfinding link with index j, where k is the index of the agent currently using the pathfinding link with index j, k = 1, 2, ..., n. j ,l k It is the width of the agent with the sequence number k.

[0017] Furthermore, the cost function calculation formula for the pathfinding algorithm is as follows:

[0018] F(x) = G(x) + H(x),

[0019] Where x represents the current navigation grid or pathfinding link being searched, F(x) is the weight calculated by the cost function, G(x) represents the distance from the pathfinding starting point to the already searched path x, and H(x) is the heuristic function of x.

[0020] Furthermore, the formula for calculating the heuristic function H(x) is as follows:

[0021] H(x) = h(x) + c(x) * p(x),

[0022] Where h(x) represents the estimated distance of the path from x to the pathfinding endpoint, p(x) represents the contribution of the density value of x to H(x), and c(x) represents the ratio of the contribution of the density value of x to H(x).

[0023] Furthermore, the value of p(x) is based on the density value P of x. x Calculate when P x When p = 0, the value of p(x) is 0; when P = 0, the value of p(x) is x When G(x) = 1, p(x) is a maximum value; the value of c(x) is calculated based on the path distance G(x) from the pathfinding starting point to x and the density evaluation distance d. When G(x) = 0, c(x) is 1, and when G(x) > d, p(x) is 0.

[0024] The beneficial effects of this invention are as follows:

[0025] This invention introduces a regional population density assessment method to achieve a quantitative assessment of population congestion in virtual scenarios. It can accurately predict the distribution of intelligent agent groups in virtual scenarios, providing accurate data support for path planning.

[0026] This invention makes beneficial improvements to the heuristic function in the cost function when using the improved A* algorithm for path planning. By adding a density value contribution function and a density value contribution ratio function, it achieves the goal of guiding the agent to avoid congested groups within the density evaluation range, thereby improving the quality of the planned path, reducing the overhead of potential re-path planning and local obstacle avoidance, and enhancing the agent's pathfinding performance in virtual scenarios. Attached Figure Description

[0027] Figure 1 A flowchart of a virtual environment path planning method based on regional population density assessment;

[0028] Figure 2 Modeling a pathfinding grid map for a virtual scene;

[0029] Figure 3 A schematic diagram illustrating the optimal path planned by an intelligent agent in a virtual scene with a dense crowd using the method of this invention;

[0030] Figure 4 A schematic diagram illustrating the optimal path planned by an agent in a virtual scene with a sparse population using the method of this invention;

[0031] Figure 5 This is a schematic diagram of the system flow of the present invention. Detailed Implementation

[0032] The present invention will be described in detail below with reference to the accompanying drawings and preferred embodiments. The objectives and effects of the present invention will become clearer as a result. The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0033] The virtual environment path planning method based on regional population density assessment of the present invention uses regional population density assessment to quantify the population congestion in the virtual scene, providing a feasible solution for intelligent agents to plan the optimal path to avoid congested areas.

[0034] like Figure 1 As shown, the specific implementation steps of a virtual environment path planning method based on regional population density assessment include:

[0035] Step 1: As Figure 2 As shown, the movable area of ​​the virtual environment is modeled using the navigation grid method, and the walkable area in the virtual environment is divided into a set of polygons. Figure 2 In the diagram, A and B are two pathfinding links, dark gray rectangles represent static obstacles, and light gray polygons represent the generated navigation mesh.

[0036] Step 2: Based on the agents' location information in the virtual environment, calculate the agent population density value for all navigation grids on the navigation grid map; the formula for calculating the density value of the navigation grid is:

[0037]

[0038] Among them, P i S represents the agent population density value of navigation grid i on the navigation grid map.i It is the area of ​​the navigation grid with index i, n i It is the total number of agents whose center point is located on the navigation grid with index i, and k is the index of the agent on the navigation grid with index i, k = 1, 2, ..., n i ,s k It is the area of ​​the two-dimensional projection of the agent with index k onto the navigation grid;

[0039] Step 3: Based on the usage information of pathfinding links in the virtual environment, calculate the agent population density value on all pathfinding links on the navigation grid map; the formula for calculating the density value of a pathfinding link is:

[0040]

[0041] Among them, P j L represents the population density value of agents for the pathfinding link with index j on the navigation grid map. j It is the width of the pathfinding link with index j, n j This represents the number of agents currently using the pathfinding link with index j, where k is the index of the agent currently using the pathfinding link with index j, k = 1, 2, ..., n. j ,l k It is the width of the agent with sequence number k;

[0042] Step 4: Use the improved A* algorithm to search for the optimal path from the starting point to the destination on the navigation grid map. This invention improves the cost function of the pathfinding algorithm based on the density information and density evaluation distance of the regional population. The macroscopic cost function of the pathfinding algorithm is:

[0043] F(x) = G(x) + H(x),

[0044] Where x represents the current navigation grid or pathfinding link being searched, F(x) is the weight calculated by the cost function, G(x) represents the distance from the pathfinding starting point to the already searched path x, and H(x) is the heuristic function of x.

[0045] Furthermore, the formula for calculating the heuristic function H(x) is as follows:

[0046] H(x) = h(x) + c(x) * p(x),

[0047] Where h(x) represents the estimated distance of the path from x to the destination, p(x) represents the contribution of the density value of x to H(x), and c(x) represents the ratio of the contribution of the density value of x to H(x). The functional implementations of c(x) and p(x) are not unique, but both satisfy:

[0048] The value of p(x) depends on the density value P of x. x Calculate when Px When p = 0, the value of p(x) is 0; when P = 0, the value of p(x) is x When G(x) = 1, p(x) is a maximum value; the value of c(x) is calculated based on the path distance G(x) from the pathfinding starting point to x and the density evaluation distance d. When G(x) = 0, c(x) is 1, and when G(x) > d, p(x) is 0.

[0049] In this embodiment, the contribution function p(x) of the density value of x to H(x) is defined as:

[0050]

[0051] Where P x S represents the density value of x. x Let x represent the area;

[0052] In this embodiment, the ratio function c(x) of the contribution of the density value of x to H(x) is defined as:

[0053]

[0054] Where G(x) represents the distance of the searched path from the pathfinding starting point to x, and d represents the density evaluation distance;

[0055] Step 5: Based on the navigation grid and pathfinding link sequence constructed by global path planning, use the funnel algorithm to calculate path nodes and obtain the optimized global path.

[0056] To more intuitively demonstrate the effectiveness of this invention, this invention... Figure 2 Based on the virtual scenario, two different group distribution scenarios were designed to compare the results of path planning.

[0057] Example 1:

[0058] like Figure 3 As shown, gray circles without a grid represent agents requiring pathfinding, gray circles with a grid represent other agents in the scene, and black dashed lines with arrows represent the optimal paths planned by the agents. A large number of agents are gathered at the left corridor and the B-pathfinding link in the virtual scene, forming a relatively dense group. Given this group distribution, the method of this invention plans a path that bypasses the dense group at the left corridor, choosing the right-hand passage, and avoiding the frequently used B-pathfinding link, opting instead for the unobstructed A-pathfinding link, ultimately planning an optimal path that automatically avoids the dense group.

[0059] Example 2:

[0060] like Figure 4As shown, gray circles without grids represent agents requiring pathfinding, gray circles with grids represent other agents in the scene, and black dashed lines with arrows represent the optimal paths planned by the agents. A small number of agents are clustered in the left corridor of the virtual scene, while a large number are clustered at the B-pathfinding link. Given this group distribution, the method of this invention plans a path that passes through the sparse group in the left corridor, selects the right-hand passage, avoids the frequently used and more distant B-pathfinding link, and selects the smoother and closer A-pathfinding link, ultimately planning an optimal path that balances the overhead of avoiding the group and the overhead of traversing it.

[0061] like Figure 5 As shown, a virtual environment path planning system based on regional population density assessment is presented. The system includes the following modules:

[0062] Modeling module: Models the movable areas of the virtual environment using the navigation grid method;

[0063] Navigation grid calculation module: Calculates the agent population density value of all navigation grids on the navigation grid map based on the position information of agents in the virtual environment;

[0064] Pathfinding Link Calculation Module: Based on the usage information of pathfinding links in the virtual environment, calculate the agent population density value on all pathfinding links on the navigation grid map;

[0065] Function Improvement Module: Improves the cost function of the pathfinding algorithm based on the density information of the region population. It calculates the heuristic function in the cost function by combining the density values ​​of the navigation grid and the pathfinding links. It adjusts the contribution of the density values ​​of the searched navigation grids and pathfinding links to the heuristic function in the cost function based on their distance from the pathfinding starting point. Navigation grids with lower density values ​​have higher weights than those with higher density values; pathfinding links with lower density values ​​have higher weights than those with lower density values; the contribution of the density values ​​of navigation grids and pathfinding links farther from the pathfinding starting point to their weights is lower than that of navigation grids and pathfinding links closer to the pathfinding starting point.

[0066] Search building module: The improved A* algorithm is used to search for the globally optimal path from the pathfinding start point to the pathfinding end point on the navigation grid map. Based on the constructed global path navigation grid and pathfinding link sequence, the funnel algorithm is used to calculate the path nodes to obtain the optimized global path.

[0067] It will be understood by those skilled in the art that the above descriptions are merely preferred examples of the invention and are not intended to limit the invention. Although the invention has been described in detail with reference to the foregoing examples, those skilled in the art can still modify the technical solutions described in the foregoing examples or make equivalent substitutions for some of the technical features. All modifications and equivalent substitutions made within the spirit and principles of the invention should be included within the scope of protection of the invention.

Claims

1. A virtual environment path planning method based on regional population density assessment, characterized in that, The method includes the following steps: S1: Map modeling of movable areas in a virtual environment based on the navigation grid method; S2: Based on the location information of the agents in the virtual environment, calculate the agent population density value of all navigation grids on the navigation grid map; S3: Based on the usage information of the pathfinding links in the virtual environment, calculate the population density value of agents on all pathfinding links on the navigation grid map; S4: Improve the cost function of the pathfinding algorithm based on the density information of the region population, and calculate the heuristic function in the cost function by combining the density values ​​of the navigation grid and the pathfinding links; adjust the contribution of the density values ​​of the searched navigation grids and pathfinding links to the heuristic function in the cost function according to their distance from the pathfinding start point; navigation grids with lower density values ​​have higher weights than navigation grids with higher density values; pathfinding links with lower density values ​​have higher weights than pathfinding links with lower density values; the contribution of the density values ​​of navigation grids and pathfinding links far from the pathfinding start point to the weights will be lower than that of navigation grids and pathfinding links close to the pathfinding start point. S5: An improved A* algorithm is used to search for the globally optimal path from the starting point to the ending point on the navigation grid map. Based on the constructed global path navigation grid and the pathfinding link sequence, the funnel algorithm is used to calculate the path nodes to obtain the optimized global path.

2. The virtual environment path planning method based on regional population density assessment according to claim 1, characterized in that, The formula for calculating the agent population density value of the navigation grid on the navigation grid map in S2 is as follows: wherein P i represents the population density value of the agent group of the navigation grid with the serial number i on the navigation grid map, S i is the area of the navigation grid with the serial number i, n i is the total number of agents with the center point located on the navigation grid with the serial number i, k is the serial number of the agent on the navigation grid with the serial number i, k = 1, 2, …, n i , s k is the area of the two-dimensional projection of the agent with the serial number k on the navigation grid.

3. The virtual environment path planning method based on regional population density assessment according to claim 1, characterized in that, The population density value P of the agent group of the navigation link on the navigation grid map in S3 j The calculation formula is as follows: Among them, P j L represents the population density value of agents for the pathfinding link with index j on the navigation grid map. j It is the width of the pathfinding link with index j, n j This represents the number of agents currently using the pathfinding link with index j, where k is the index of the agent currently using the pathfinding link with index j, k = 1, 2, ..., n. j ,l k It is the width of the agent with the sequence number k.

4. The virtual environment path planning method based on regional population density assessment according to claim 1, characterized in that, The cost function of the pathfinding algorithm in step 4 is calculated as follows: F(x) = G(x) + H(x), Where x represents the current navigation grid or pathfinding link being searched, F(x) is the weight calculated by the cost function, G(x) represents the distance from the pathfinding starting point to the already searched path x, and H(x) is the heuristic function of x.

5. A virtual environment path planning method based on regional population density assessment according to claim 4, characterized in that, The formula for calculating the heuristic function H(x) is: H(x) = h(x) + c(x) * p(x), Where h(x) represents the estimated distance of the path from x to the destination, p(x) represents the contribution of the density value of x to H(x), and c(x) represents the ratio of the contribution of the density value of x to H(x).

6. The virtual environment path planning method based on regional population density assessment according to claim 5, characterized in that, The value of p(x) is based on the density value P of x. x Calculate when P x When p = 0, the value of p(x) is 0; when P = 0, the value of p(x) is x When G(x) = 1, p(x) is a maximum value; the value of c(x) is calculated based on the path distance G(x) from the pathfinding starting point to x and the density evaluation distance d. When G(x) = 0, c(x) is 1, and when G(x) > d, p(x) is 0.

7. A virtual environment path planning system based on regional population density assessment, characterized in that, The system includes the following modules: Modeling module: Models the movable areas of the virtual environment using the navigation grid method; Navigation grid calculation module: Calculates the agent population density value of all navigation grids on the navigation grid map based on the position information of agents in the virtual environment; Pathfinding Link Calculation Module: Based on the usage information of pathfinding links in the virtual environment, calculates the population density value of agents on all pathfinding links on the navigation grid map; Function Improvement Module: Improves the cost function of the pathfinding algorithm based on the density information of the region population. It calculates the heuristic function in the cost function by combining the density values ​​of the navigation grid and the pathfinding links. It adjusts the contribution of the density values ​​of the searched navigation grids and pathfinding links to the heuristic function in the cost function based on their distance from the pathfinding starting point. Navigation grids with lower density values ​​have higher weights than those with higher density values; pathfinding links with lower density values ​​have higher weights than those with lower density values; the contribution of the density values ​​of navigation grids and pathfinding links farther from the pathfinding starting point to their weights is lower than that of navigation grids and pathfinding links closer to the pathfinding starting point. Search building module: The improved A* algorithm is used to search for the globally optimal path from the pathfinding start point to the pathfinding end point on the navigation grid map. Based on the constructed global path navigation grid and pathfinding link sequence, the funnel algorithm is used to calculate the path nodes to obtain the optimized global path.

Citation Information

Patent Citations

  • Indoor navigation dynamic obstacle avoidance routing method

    CN111836199A