A Virtual Reality Simulation Method for Crowd Evacuation in a Multiexit Indoor Fire Environment

: Evacuation simulations in virtual indoor ﬁre scenes hold great signiﬁcance for public safety. However, existing evacuation simulation methods are ine ﬃ cient and provide poor visualized when applied to virtual reality (VR) simulations. Additionally, the inﬂuences of the interaction of evacuation processes on the choice of multiple exits have not been fully considered. In the paper, we propose a VR simulation method for crowd evacuation in a multiexit indoor ﬁre environment. An indoor 3D scene model and character model, for studying the environmental factors that a ﬀ ect the multiexit selection of personnel during the ﬁre process, are combined with environmental factors to enhance the evacuation route planning algorithm to improve the e ﬃ ciency of the VR simulation of evacuation in the scene. In addition, a prototype system that supports multiple experience modes is proposed, and case experiment analyses are performed. The results show that the method described in this paper can e ﬀ ectively support the real-time simulation of indoor ﬁre evacuations in virtual scenes, providing both reliable simulation results and good visualization e ﬀ ects.


Introduction
As the process of urbanization intensifies, the complexity of building structures is constantly increasing, and the density of people is rapidly increasing [1]. The frequency of indoor fires is gradually increasing, posing vast challenges to public safety. When a fire breaks out, it is difficult to choose an effective escape route because the trapped people at the site of fire do not have a clear understanding of the fire situation or do not understand the building structure [2]. In addition, because of the complexity of human behaviors, indoor fires often result in congestion, trampling, and death [3]. To guarantee their safety, people need to leave the scene of fire as quickly as they can [4]. Virtual reality (VR) simulation, which is the simulation of 3D objects and 3D environments to help people learn from experiences [5][6][7], is widely used in the fields of education and training [8][9][10]. It can also be used to help people train to escape [11]. One study [12] has shown that familiarity with building structures in virtual scenes can help people find the best way out of trouble in fire scenes, which is important for public safety.
Regarding indoor fire evacuation simulations, it is possible to focus on the construction of the passage area in a three-dimensional space, as well as the location of the fire source, the impact of the diffusion range, the state of the person in the evacuation process of the path selection, and the change in exit selection during the evacuation process. Furthermore, VR simulations of indoor fire evacuation require users to experience or observe the entire process of evacuation simulations in the real time of a virtual environment, which means that high computational efficiency and a reliable visual experience are required. In fact, in the process of indoor fire evacuation simulation, the escape route of each person involves the study of dynamic route planning. There are two key issues that need to be determined to complete path planning, i.e., the expression of path nodes and the type of search algorithm. A grid is the most commonly used method of expressing path nodes [13][14][15]. However, when used in path planning, the volume of moving objects is limited due to nodes. A grid supports up to 8 movement directions. At the same time, a large number of nodes will still be added even when the map range has increased and the complexity has not changed too much, thus increasing the difficulty of calculation. Qing et al. [16] divided buildings into dense grids to plan evacuation paths, but the computational cost was too high to display the real-time visual simulation process. To overcome the shortcomings of the grid, the node expression of the waypoint [17,18] was proposed, making it possible to add nodes freely in the scene and to connect all nodes to build a traffic network. Although many calculations can be reduced, the location of the waypoint needs to be designed. The accuracy of the results and the reliability of the path trajectory depend on the designer's concept. In actual research, some researchers have extracted the passage nodes of buildings to construct a waypoint for evacuation path planning [19][20][21], and this research mainly analyzes the evacuation flow trend. If real numerical evacuation results are expected, denser waypoints should be applied [22]. Doing so would undermine the advantage of the waypoint for fast computation. Navigation mesh is a better node representation method [23,24]. It can directly act on the 3D scene and automatically decompose it into nodes covered by polygons, reducing the number of nodes. It is not necessary to pass through adjacent nodes, and units of different volumes can move more reasonably. Because the navigation mesh can be directly generated from three-dimensional objects, it can reduce the number of nodes, and it can increase computational efficiency while ensuring the rationality of the action trajectory, its application in VR simulation has more advantages. Nevertheless, it is rarely mentioned in the existing indoor fire evacuation simulation literature. Otherwise, in terms of search algorithms, swarm intelligence optimization algorithms, e.g., ant colony algorithms [25,26], perform well in the path finding effect to approximate the optimal path. Due to their high computational complexity, this path is difficult to calculate in real time in VR simulations. Local search algorithms, e.g., the well-known A* algorithm [27,28], will search all the nodes around it. Therefore, the amount of A* calculation in a complex three-dimensional scene will increase sharply, which will decrease the visualization efficiency of VR. The dynamic window algorithm (DWG) [29], which is widely used in the robot local avoidance algorithm, is mostly suitable for two-dimensional space. The goal of this algorithm is to optimize speed control; thus, it is not suitable for the evacuation of three-dimensional scenes. The navigation mesh inflection point algorithm [30] searches for the path by checking the node of the target towards the destination. It will skip some neighboring nodes according to the scene. It still maintains faster search efficiency in a complex scene, and the planned path is smoother. Thus, it is suitable for VR simulations and visualizations.
Human behavior also needs to be considered in evacuation simulations. In emergency evacuation, there will be some behaviors that affect the evacuation efficiency [31][32][33], and these behaviors often appear under the influence of dynamic environments such as dense crowds, blocked exits, and the spread of disasters. In an evacuation simulation, as the number of people in the scene increases, it is worth considering whether more factors are needed to constrain the behavior of the crowd in the simulation to improve evacuation efficiency.
Therefore, this paper proposes a method of VR simulation for crowd evacuation in multiexit indoor fire scenes. Based on the path finding algorithm of the navigation mesh, the rules of a single person dynamically avoiding obstacles in the scene and selecting multiple exits, are studied. The construction of static indoor fire scenes and the dynamic environmental impact factors of indoor fires, are analyzed to improve the single-person evacuation rules and to propose a simulation method for crowd evacuation routes. A prototype system is constructed, and experiments are performed to validate the proposed method. Real-time, reliable and efficient visualization of the simulations is realized by this method.

Overall Framework
The framework is shown in Figure 1. First, we study the dynamic path planning of an occupant under the condition of multiple exits, focusing on the issues of dynamic obstacle avoidance and exit selection. Second, on the basis of an occupant evacuation, the VR simulation of indoor fire evacuation is studied, including indoor environment modeling and dynamic environmental factors that affect evacuation. Finally, the VR camera is introduced to show the evacuation simulation of the crowd in the virtual environment.
are analyzed to improve the single-person evacuation rules and to propose a simulation method for crowd evacuation routes. A prototype system is constructed, and experiments are performed to validate the proposed method. Real-time, reliable and efficient visualization of the simulations is realized by this method.

Overall Framework
The framework is shown in Figure 1. First, we study the dynamic path planning of an occupant under the condition of multiple exits, focusing on the issues of dynamic obstacle avoidance and exit selection. Second, on the basis of an occupant evacuation, the VR simulation of indoor fire evacuation is studied, including indoor environment modeling and dynamic environmental factors that affect evacuation. Finally, the VR camera is introduced to show the evacuation simulation of the crowd in the virtual environment.  Figure 1. The framework for VR simulation of crowd evacuation in a multiexit indoor fire environment.

Dynamic Planning of Evacuation Paths for an Occupant in Multiexit Indoor Fire Scenes
The evacuation path planning of an occupant is important for the crowd evacuation path. The accurate and efficient planning of the evacuation path in disaster scenarios can help evacuees quickly and safely escape fire scenes. This section introduces the application of the navigation inflection point algorithm in path planning, and it discusses the optimization and use of the algorithm under the condition of multiple exits.

Path Planning Based on the Corner Point Algorithm of the Navigation Mesh
A navigation mesh is a feasible surface composed of multiple convex polygons constructed in a three-dimensional scene, and each convex polygon can be used as a node for path planning. The inflection point algorithm is a commonly used path finding algorithm in the navigation mesh. It is a method of searching for the shortest path with minimum cost based on the node and destination direction. The path is obtained by connecting the vertices of the convex polygon from the starting point. As shown in Figure 2, the addition of the inflection point is determined by judging the position of the line connecting the vertex and the starting point, and finally, the inflection point is connected to the output path. In Figure 2, P0 is the starting point, D is the end point, Li represents the inflection point on the left, Ri represents the inflection point on the right, and B represents the path to be selected.

Dynamic Planning of Evacuation Paths for an Occupant in Multiexit Indoor Fire Scenes
The evacuation path planning of an occupant is important for the crowd evacuation path. The accurate and efficient planning of the evacuation path in disaster scenarios can help evacuees quickly and safely escape fire scenes. This section introduces the application of the navigation inflection point algorithm in path planning, and it discusses the optimization and use of the algorithm under the condition of multiple exits.

Path Planning Based on the Corner Point Algorithm of the Navigation Mesh
A navigation mesh is a feasible surface composed of multiple convex polygons constructed in a three-dimensional scene, and each convex polygon can be used as a node for path planning. The inflection point algorithm is a commonly used path finding algorithm in the navigation mesh. It is a method of searching for the shortest path with minimum cost based on the node and destination direction. The path is obtained by connecting the vertices of the convex polygon from the starting point. As shown in Figure 2, the addition of the inflection point is determined by judging the position of the line connecting the vertex and the starting point, and finally, the inflection point is connected to the output path. In Figure 2, P0 is the starting point, D is the end point, Li represents the inflection point on the left, Ri represents the inflection point on the right, and B represents the path to be selected. In dynamic path planning, various dynamic obstacles may appear in the scene over time, and the initial static navigation mesh becomes unsuitable. At this time, the grid needs to be dynamically updated [34] to plan a new path (Figure 3), thus realizing dynamic path planning. In addition, this paper compares other dynamic programming algorithms in terms of real-time efficiency, path smoothness, and adaptability to complex constraints, and it ranks them in terms of three levels, high, medium, and low, based on existing studies [35][36][37] (Table 1). Here, higher realtime calculation efficiency means that the calculation has lower time complexity. Higher path smoothness means that the walking route is closer to the real path. Higher adaptability to complex constraints means that the algorithm is more suitable for complex dynamic environments. For VR simulations, the efficiency of real-time calculation can ensure smooth exploration in VR, and the smoothness of the path affects the visualization effect of VR. Therefore this paper selects the inflection point algorithm as the basis of path planning.  In dynamic path planning, various dynamic obstacles may appear in the scene over time, and the initial static navigation mesh becomes unsuitable. At this time, the grid needs to be dynamically updated [34] to plan a new path (Figure 3), thus realizing dynamic path planning. In dynamic path planning, various dynamic obstacles may appear in the scene over time, and the initial static navigation mesh becomes unsuitable. At this time, the grid needs to be dynamically updated [34] to plan a new path (Figure 3), thus realizing dynamic path planning. In addition, this paper compares other dynamic programming algorithms in terms of real-time efficiency, path smoothness, and adaptability to complex constraints, and it ranks them in terms of three levels, high, medium, and low, based on existing studies [35][36][37] (Table 1). Here, higher realtime calculation efficiency means that the calculation has lower time complexity. Higher path smoothness means that the walking route is closer to the real path. Higher adaptability to complex constraints means that the algorithm is more suitable for complex dynamic environments. For VR simulations, the efficiency of real-time calculation can ensure smooth exploration in VR, and the smoothness of the path affects the visualization effect of VR. Therefore this paper selects the inflection point algorithm as the basis of path planning. Under the condition of multiple exits, the choice of destination needs to be considered when planning the route. Studies have shown that people are more inclined to choose exits that are closer In addition, this paper compares other dynamic programming algorithms in terms of real-time efficiency, path smoothness, and adaptability to complex constraints, and it ranks them in terms of three levels, high, medium, and low, based on existing studies [35][36][37] (Table 1). Here, higher real-time calculation efficiency means that the calculation has lower time complexity. Higher path smoothness means that the walking route is closer to the real path. Higher adaptability to complex constraints means that the algorithm is more suitable for complex dynamic environments. For VR simulations, the efficiency of real-time calculation can ensure smooth exploration in VR, and the smoothness of the path affects the visualization effect of VR. Therefore this paper selects the inflection point algorithm as the basis of path planning.

Evacuation Route Planning for an Occupant in Multiexit Scenes
Under the condition of multiple exits, the choice of destination needs to be considered when planning the route. Studies have shown that people are more inclined to choose exits that are closer to ISPRS Int. J. Geo-Inf. 2020, 9,750 5 of 17 them during evacuations [31]. Therefore, the distance is utilized as the travel cost in the present study. When people are evacuated, the position of the accessible exit is recorded in the set, where the travel distance, d, from each exit is calculated. The exit with the least travel cost is selected as the evacuation destination. Whenever the set of exits is updated with the navigation mesh, the evacuation exits are reselected for path planning. The specific steps are as follows: 1.
Construct an indoor navigation mesh with a convex polygon as the basic unit.

2.
Determine the initial position information of people, the position information of each exit, and the safety area information. Set the initial location information of people and the location information collection of n exits that can be used for escape Destination = {D 1 , D 2 , · · · D i , · · · D n }, and set the safe area as outdoor space.

3.
Determine whether the current position of the people is in a safe area. If it is not in the safe area, proceed with the following steps; if it is already in the safe area, the evacuation is over.

4.
Calculate the evacuation travel cost d i for each exit. Based on the current indoor scene, the evacuation route calculated by the route planning method is the travel cost of the evacuation route from the current location to exit i, and the travel cost is recorded as the planned path length.

5.
Find the exit j with the lowest evacuation cost. Based on step (3) with regard to the calculated travel costs d 1 , d 2 , d n , exit j with the lowest travel cost is selected d j = min{d 1 · · · d n }.

6.
Based on the currently selected exit j, people will follow the dynamically planned escape route to escape. Update the position of people and update the navigation mesh if a dynamic obstacle is added to the scene. 7.
Determine whether the navigation mesh is updated. If the navigation mesh is updated, repeat step (3). If the indoor navigation mesh is not updated, proceed to step (5).
After confirming the rule of multiple exits for a single person in an indoor fire, it is necessary to further study how to apply and expand this rule so that it can be applied to the VR simulation of indoor fire crowd evacuation.

VR Simulation of Indoor Fire Crowd Evacuation
In VR simulation, directly using the rules formulated in Section 2.2 will lead to some problems, such as how to construct a navigation grid in a 3D indoor scene. As people expand, they will affect each other, and crowd gathering will also affect the judgment of passing. Meanwhile, the simulation of crowd evacuation based on the cost of distance will cause the crowd to maintain the original evacuation route even if there is congestion and the fire is spreading. Doing so will cause misjudgment in the choice of exit and other unsafe behaviors. This section discusses crowd evacuation simulation methods in virtual scenes.

Construction of a Virtual Indoor Fire Scene
The construction of indoor scenes is the basis of evacuation simulation. Only after a complete indoor layout is established can the connectivity and semantic relations of the path planning algorithm be used for path planning within the building range [38,39]. On the other hand, the initial construction of the navigation mesh also needs to clarify the semantics of the three-dimensional model, and obtain a three-dimensional feasible surface composed of polygonal nodes based on passable and impassable areas. We take the ground, walls, stairs and indoor obstacles as the elements of the 3D virtual scene to construct the indoor scene (shown in Figure 4).  When an indoor fire occurs, the coverage and location of the fire and the location of people affect the evacuation simulation to a certain extent. In the course of a fire, the position and coverage of the fire and the overall condition of the people continuously change. Therefore, it is necessary to determine the safety of the area at each point in time and to update the path in real time. Therefore, we propose three environmental factors that affect area safety, i.e., the severity of the fire, the degree of crowding, and the degree of exit blockage. These factors are used to determine the safety of the indoor area at each point in time. After establishing dynamic environmental factors, the crowd evacuation will no longer just use distance as the travel cost: the three environmental factors will also be added to the travel cost calculation.
(1) Fire impact severity (α) The degree of hazard of a fire gradually decreases with the fire source area. When the number of evacuees increases, to reach the exit safely, it is necessary to consider passing through a safer disaster area. We define the data structure of fire hazard severity as follows: represents the disaster impact range. In consideration of flame heat radiation [41], the disaster range refers to the ratio of the distance from the disaster source to the distance from the disaster edge to the source of the disaster. The weight of the severity of the disaster is assigned based on the _ , as shown in formula (2), where a larger weight α means a more serious fire impact.
(2) Crowdedness (β) After the indoor environment is built, the indoor scene is divided into area of navigablespace and nonnavigablespace based on the division of passable areas in IndoorGML [40], which provides a basis for the subsequent planning, analysis of evacuation routes and construction of the navigation mesh, as shown in Table 2.

Dynamic Environmental Factor Analysis
When an indoor fire occurs, the coverage and location of the fire and the location of people affect the evacuation simulation to a certain extent. In the course of a fire, the position and coverage of the fire and the overall condition of the people continuously change. Therefore, it is necessary to determine the safety of the area at each point in time and to update the path in real time. Therefore, we propose three environmental factors that affect area safety, i.e., the severity of the fire, the degree of crowding, and the degree of exit blockage. These factors are used to determine the safety of the indoor area at each point in time. After establishing dynamic environmental factors, the crowd evacuation will no longer just use distance as the travel cost: the three environmental factors will also be added to the travel cost calculation.
(1) Fire impact severity (α) The degree of hazard of a fire gradually decreases with the fire source area. When the number of evacuees increases, to reach the exit safely, it is necessary to consider passing through a safer disaster area. We define the data structure of fire hazard severity as follows: Event_Range represents the disaster impact range. In consideration of flame heat radiation [41], the disaster range refers to the ratio of the distance from the disaster source to the distance from the ISPRS Int. J. Geo-Inf. 2020, 9, 750 7 of 17 disaster edge to the source of the disaster. The weight of the severity of the disaster is assigned based on the Event_Range, as shown in Formula (2), where a larger weight α means a more serious fire impact.
(2) Crowdedness (β) During an evacuation, when the number of people indoors reaches a certain scale, crowding easily occurs due to the close distance of the people. This crowding leads to the collapse of orderly movement [41] and affects the evacuation efficiency of the crowd. Related research [3] has used the relationship between the speed of the horizontal passage and the flow of people to make a standardized representation of the flow of people and the average speed corresponding to the congestion levels of different paths. On this basis, we define the data structure of the congestion degree of the indoor environment as follows: Crowd_Level represents the degree of crowding, which is negatively related to the speed of the crowd, and the speed of crowd is related to the density of the flow of people. Crowd_Range represents the congested area range. Num_People represents the number of people in the range. Based on the range and the number of people, the density of people in the area can be obtained. Based on the model of relationship between the speed V (m/s) and the density ρ (persons/ m 2 ) of the flow of people [42], the speed of the people can be obtained, as shown in Formula (4). When V = 1.4 m/s, the low density of the flow of people means that the crowd is flowing smoothly. When the speed V is smaller, it is more crowded.
When setting the weight of the crowdedness degree based on speed V, as shown in Formula (5), a larger weight β indicates more severe crowdedness.
(3) The degree of exit blockage (γ) When an occupant is planning an evacuation route, the only considerations for the exit are the disaster threat and the length of the route. However, after the number of evacuated people increases, a blockage at the exit easily forms when the number of exits remains unchanged. The large number of people gathered in the exit-centered area is likely to cause panic [43,44], which will further cause casualties and affect the efficiency of evacuation. If the evacuees can select the relatively less blocked exit by judging the degree of exit blockage, then the waiting time in the blocked exit can be reduced. Furthermore, the evacuation can be completed as soon as possible, and more risks can be avoided. We define the exit blockage data structure as follows: Exit_Level indicates the degree of exit blockage. Exit_Number and Exit_Range, indicate the number of people gathered within a limited range of the exit area. The degree of exit congestion is directly related to the number of people in the exit area. Based on a study on exit congestion [45], we calculate the area ratio K of people occupying the restricted exit area (48 m × 36 m). The weight of the degree of exit blockage is set based on K, as shown in Formula (7). A larger weight γ indicates more severe exit blockage. γ = K

VR Simulation of Crowd Evacuation
After adding dynamic environmental factors, the choice of evacuation routes and exits is no longer determined just by distance. This choice is related to the state of fire source, the degree of crowd congestion and the degree of congestion at the exit. At this time, the subset D i of the exit set is expanded as follows: C 1 and C 2 represent the proportion of each factor, and d i represents the route distance between where people are currently and the exit. Set P as a single occupant in the crowd, and the evacuation process is shown in Figure 5.
1 and 2 represent the proportion of each factor, and represents the route distance between where people are currently and the exit. Set P as a single occupant in the crowd, and the evacuation process is shown in Figure 5. In Figure 5, < > represents the cost set of all exits, represents the minimum cost, and < > means that the person chose the exit . In addition, since it is a VR simulation, the simulation process is updated frame by frame during the running of the visualization program.
The change in α is determined by the extension of the flame and the distance between the person and the fire source. The wider the flame spread and the closer the person is to the fire source, the higher the weight of α is (Section 2.3.2). For the scene, the spread and dissipation of flames are the addition and deletion of dynamic obstacles, affecting the update of the navigation mesh. As shown in Figure 6, the value of α needs to be calculated during path planning, and a path with a smaller α is selected as the evacuation plan. When calculating the value of α, people on the same floor and the fire source should be selected for calculation, and the vertical distance is not considered.  In Figure 5, < F ji > represents the cost set of all exits, f ji represents the minimum cost, and P j < D i > means that the person j chose the exit i. In addition, since it is a VR simulation, the simulation process is updated frame by frame during the running of the visualization program.
The change in α is determined by the extension of the flame and the distance between the person and the fire source. The wider the flame spread and the closer the person is to the fire source, the higher the weight of α is (Section 2.3.2). For the scene, the spread and dissipation of flames are the addition and deletion of dynamic obstacles, affecting the update of the navigation mesh. As shown in Figure 6, the value of α needs to be calculated during path planning, and a path with a smaller α is selected as the evacuation plan. When calculating the value of α, people on the same floor and the fire source should be selected for calculation, and the vertical distance is not considered. and the fire source. The wider the flame spread and the closer the person is to the fire source, the higher the weight of α is (Section 2.3.2). For the scene, the spread and dissipation of flames are the addition and deletion of dynamic obstacles, affecting the update of the navigation mesh. As shown in Figure 6, the value of α needs to be calculated during path planning, and a path with a smaller α is selected as the evacuation plan. When calculating the value of α, people on the same floor and the fire source should be selected for calculation, and the vertical distance is not considered. The change in β is determined by the speed of the crowd during the evacuation process. As shown in Figure 7, when crowding occurs during the evacuation process, the speed of the gathering The change in β is determined by the speed of the crowd during the evacuation process. As shown in Figure 7, when crowding occurs during the evacuation process, the speed of the gathering crowd should be calculated based on Formula (4) in Section 2.2.2, and the β value should be changed according to the speed. When the value of β changes and the degree of congestion changes, the navigation mesh path is updated again. If the route passes through the bounding box containing the value of β, costβ i (= C 1 β i ) is added to the route, and the route with the smallest cost is finally selected as the evacuation route. When obtaining the number of gathered people, the density-based spatial clustering of applications with noise (DBSCAN) clustering algorithm is used to obtain the gathered people [46,47]. The reason is that the number of people gathered is not known in advance and the crowded shape under the navigation mesh is not necessarily regular.
crowd should be calculated based on formula (4) in Section 2.2.2, and the β value should be changed according to the speed. When the value of β changes and the degree of congestion changes, the navigation mesh path is updated again. If the route passes through the bounding box containing the value of β, (= 1 ) is added to the route, and the route with the smallest cost is finally selected as the evacuation route. When obtaining the number of gathered people, the density-based spatial clustering of applications with noise (DBSCAN) clustering algorithm is used to obtain the gathered people [46,47]. The reason is that the number of people gathered is not known in advance and the crowded shape under the navigation mesh is not necessarily regular.  The change in γ is determined by the proportion of people within a limited range of the exit. Since the locations of exits are different, the spaces in which they are located are also different. Hence, the range is artificially specified. The proportion of people within the range is calculated. We assign a value to γ. When the value of γ changes and the degree of congestion changes, the selection of exits by people is updated. At this time, the selection of exits by people should be considered by adding weight γ. Let = + 2 , where d is the path distance of the person to the exit, and 2 is a constant that determines the proportion of γ. After calculating the cost, the smallest value is selected as the evacuation exit ( Figure 8).  The change in γ is determined by the proportion of people within a limited range of the exit. Since the locations of exits are different, the spaces in which they are located are also different. Hence, the range is artificially specified. The proportion of people within the range is calculated. We assign a value to γ. When the value of γ changes and the degree of congestion changes, the selection of exits by people is updated. At this time, the selection of exits by people should be considered by adding weight γ. Let ostγ i = d + C 2 γ i , where d is the path distance of the person to the exit, and C 2 is a constant that determines the proportion of γ. After calculating the cost, the smallest value is selected as the evacuation exit (Figure 8).
After combining the dynamic factors to determine the movement of the crowd at each moment, adding a VR camera to the scene and setting its position and roaming mode can allow the public to perform interactive exploration in the VR simulation process. the range is artificially specified. The proportion of people within the range is calculated. We assign a value to γ. When the value of γ changes and the degree of congestion changes, the selection of exits by people is updated. At this time, the selection of exits by people should be considered by adding weight γ. Let = + 2 , where d is the path distance of the person to the exit, and 2 is a constant that determines the proportion of γ. After calculating the cost, the smallest value is selected as the evacuation exit (Figure 8). After combining the dynamic factors to determine the movement of the crowd at each moment, adding a VR camera to the scene and setting its position and roaming mode can allow the public to perform interactive exploration in the VR simulation process.

Preparation
(1) Prototype system Based on the above principles, this article developed an indoor fire crowd evacuation simulation prototype system. The hardware environment of the system test is an ACER notebook. The CPU

Preparation
(1) Prototype system Based on the above principles, this article developed an indoor fire crowd evacuation simulation prototype system. The hardware environment of the system test is an ACER notebook. The CPU processor is an Intel(R) Core (TM) i7-5500U CPU @ 2.40 GHz, and the host memory is 8 G. The graphics card is NVDIA GeForce 920 M. The video memory is 128 MB, and the operating system is Windows 10 64-bit. The test platform is Unity3D, and the development environment is C#. NET; the details are shown in Table 3. (2) Case scenario Based on the discussion of virtual scene construction in Section 2.3.1, an indoor 3D model with a total area of 500 m 2 was constructed. The indoor model contains two floors, 20 rooms, two stairways, multiple passages and corridors, obstacles and three exits for evacuation. Additionally, based on IndoorGML, the indoor 3D objects were divided into navigablespace and nonnavigablespace, which were used to construct the navigation mesh. The schematic diagram of the indoor 3D model and the navigation mesh are shown in Figure 9. The complexity of this virtual scene can be effectively used to test the efficiency of the evacuation method, and the distributed passages and corridors in the scene can be used to observe and test the crowdedness avoidance situation. In addition, in the layout of this scene, two evacuation exits are close to two stairways, and another exit is farther away. Based on the layout, the exits selection of crowd can be clearly observed and can be used to judge the effects of the algorithms on the evacuation simulation results. navigation mesh are shown in Figure 9. The complexity of this virtual scene can be effectively used to test the efficiency of the evacuation method, and the distributed passages and corridors in the scene can be used to observe and test the crowdedness avoidance situation. In addition, in the layout of this scene, two evacuation exits are close to two stairways, and another exit is farther away. Based on the layout, the exits selection of crowd can be clearly observed and can be used to judge the effects of the algorithms on the evacuation simulation results. Then three-dimensional character models in 3DMax are built for the visual display of crowd simulation. Finally, the fire in the scene is constructed. This paper uses a particle system to simulate Then three-dimensional character models in 3DMax are built for the visual display of crowd simulation. Finally, the fire in the scene is constructed. This paper uses a particle system to simulate the flame [48], and it simulates the spread of the fire by setting coefficients such as the life of the particles and the emission speed.

Process
To verify the effectiveness of the method, the experiment needs to compare the changes in the simulation results before and after adding dynamic environmental factors. Therefore, it is first necessary to verify the effectiveness of the evacuation method without adding environmental factors. We use Pathfinder commercial software for comparison and verification. Pathfinder is a professional evacuation simulation tool. It has good performance in the simulation of emergency evacuation. Although Pathfinder can visualize the effect of fire, it does not support the avoidance of dynamic obstacles. Therefore, in this comparison, the scene has no fire. Import the same scene and character position both in Pathfinder and in this system, set the same exit, set the character's initial speed to 2 m/s, and perform the simulation. The simulation results are shown in Table 4. Compared with the Pathfinder results, there is only a small difference in the evacuation time, and the evacuation results are completely consistent, proving its effectiveness. Based on the results, we establish three fire scenes, which area are shown in Figure 10, and change the position and number of people in the scenes. We use two methods (with and without dynamic environmental factors) to simulate those scenes, record the results and analyze them.
Additionally, in VR, only when the frame rate is stable above 60 fps can the user's smooth experience in the VR scene be guaranteed. For this reason, this article uses the frame rate test to verify the efficiency of the system. Thus, this paper tested and analyzed the frame rate changes during the VR simulations of evacuation with different numbers of virtual people. We performed the tests 20 times for each situation and recorded the results. scenes, which area are shown in Figure 10, and change the position and number of people in the scenes. We use two methods (with and without dynamic environmental factors) to simulate those scenes, record the results and analyze them.  Additionally, in VR, only when the frame rate is stable above 60 fps can the user's smooth experience in the VR scene be guaranteed. For this reason, this article uses the frame rate test to verify the efficiency of the system. Thus, this paper tested and analyzed the frame rate changes during the VR simulations of evacuation with different numbers of virtual people. We performed the tests 20 times for each situation and recorded the results. Furthermore, to further verify the efficiency of the system, this paper adopts an experience survey method, using the public's subjective ratings to evaluate the visual effect of the system. Although Pathfinder cannot be connected to VR and cannot observe simulation results in real time, it includes a function to provide a 3D display of simulation results. Simple interaction can be carried out on the display interface. This paper compared Pathfinder's 3D simulation visualization with the VR real-time simulation experience in this research. We invited 24 people to conduct VR basic operation training and Pathfinder operation training, and conducted experiments after confirming that everyone had learned the systems. The same scene was loaded in our system and in Pathfinder, and we let the participants experience each scene in each system for 3 min. Among them, 12 people experienced our system first, followed by Pathfinder, and the other 12 people experienced the Pathfinder first, followed by our system. After the experience is complete, participants would be mark from the following four indicators: • P1. Fluency (0-5 points), which means there is no lag or delay during the experience. A higher score means better visual fluency. • P2. Interactive experience (0-5 points), which means that users feel comfortable with the interactive methods. A higher score means a better experience. • P3. Visual reliability of human behavior (0-5 points). Users judge whether the movement of people in the scene is realistic. A higher score means more reliable visualization. • P4. Panic (0-5 points). During the evacuation of the crowd, users feel panic. A higher score means a higher degree of panic.

Results and Analysis
The results of comparing the method without considering dynamic environmental factors (F1) and the method considering dynamic environmental factors (F2) are shown in Table 5. In the table, E1, E2 and E3 represent the number of evacuated persons at Exit 1, Exit 2, and Exit 3, respectively; N represents the number of evacuated persons in the scene; and TF1 and TF2 represent the evacuation time obtained after simulation of application method F1 and application method F2, respectively. When the number of people in each scene is the same, the initial distribution of positions of people is the same. After obtaining the simulation results (Table 5), further analyses are performed; the results  are shown Table 6. In Table 6, FlowT represents the human flow of all exits, while FlowR represents the human flow of a single exit.  The larger the value of TF1-TF2 is, the greater the evacuation time gap between the two methods the larger the value of FlowT, the faster the evacuation is completed. The value of FlowR represents the utilization rate of each exit in the evacuation. The analysis shows that in Scene1 and Scene2, when the number of people evacuated is small, the evacuation time of F1 and F2 does not change much with the number of people evacuated at each exit. When the number of evacuees increases to 80 and 160, F2 will save more time for evacuation than F1, and the use of exits in F2 is more sufficient than that in F1. At the same time, the fire location in the two scenarios is close to the exit. When using F2 to simulate the stairway on the second floor, the utilization rate of the exit closer to the fire point is decreased, and the evacuation result is safer. In Scene3, because the fire point occurs near Exit 3, after the flame spreads, only two exits can be selected for the whole scene. There is not much difference between the two methods at this time. A detailed comparison of the two methods in visual performance is shown in Figure 11. In summary, the improved method can be reliably used to simulate evacuation.
As shown in Figure 12, as the number of people gradually increases, the frame rate of the system shown an overall drop. However, it is still stable above 60 FPS, allowing better visualization can be achieved.
to simulate the stairway on the second floor, the utilization rate of the exit closer to the fire point is decreased, and the evacuation result is safer. In Scene3, because the fire point occurs near Exit 3, after the flame spreads, only two exits can be selected for the whole scene. There is not much difference between the two methods at this time. A detailed comparison of the two methods in visual performance is shown in Figure 11. In summary, the improved method can be reliably used to simulate evacuation. As shown in Figure 12, as the number of people gradually increases, the frame rate of the system shown an overall drop. However, it is still stable above 60 FPS, allowing better visualization can be achieved.  In addition, the comparison results of the visual experience are shown in Table 7, which counts the average scores of each indicator after being rated by 24 participants. At the same time, we use samples to perform a paired sample t-test, and the results are shown in Table 8. In Table 8, the Sig of the two indicators of interactive experience and panic is less than 0.01, indicating that there is a statistically significant difference between these two indicators, while the difference between the other two indicators is not obvious. Combined with the scores of the indicators in Table 7, we observe that for the members of the public participating in the test, the interactive experience of VR simulations is better, and they can feel panic in the fire evacuation scene. At the same time, the degree of flow of VR simulation operation and the reliability of human behaviors show no obvious gaps with the Pathfinder simulation results. In summary, this system can present a better visualization effect in VR simulation.  In addition, the comparison results of the visual experience are shown in Table 7, which counts the average scores of each indicator after being rated by 24 participants. At the same time, we use samples to perform a paired sample t-test, and the results are shown in Table 8. In Table 8, the Sig of the two indicators of interactive experience and panic is less than 0.01, indicating that there is a statistically significant difference between these two indicators, while the difference between the other two indicators is not obvious. Combined with the scores of the indicators in Table 7, we observe that for the members of the public participating in the test, the interactive experience of VR simulations is better, and they can feel panic in the fire evacuation scene. At the same time, the degree of flow of VR simulation operation and the reliability of human behaviors show no obvious gaps with the Pathfinder simulation results. In summary, this system can present a better visualization effect in VR simulation.

Conclusions
This article presented a method of VR simulation for crowd evacuation in a multiexit indoor fire environment. Three dynamic environmental factors of the indoor fire scene were determined based on some human behaviors, and the weights of the factors were assigned. The process of crowd evacuation in an indoor fire scene was organized. In addition, semantic classification for virtual scene construction was provided to construct navigation grids in virtual 3D scenes. The experimental results showed that the method can be effectively applied to the VR framework and that the simulation results and visualization effects were reliable. The main contributions of this article are summarized as follows: First, the path finding algorithm of the navigation mesh was expanded based on the dynamic environmental characteristics of multiexit indoor fires. The running rules and process in exit selection or other conditions were clearly described. This method can reduce computational complexity and smoothly realize simultaneous simulation and visualization interaction.
Second, the proposed method is applicable to the VR framework, which means that people can have richer experiences in the evacuation model. Users were allowed to actively evacuate in the VR scene, i.e., act in the VR scene based on their own wishes, and they were also allowed to passively evacuate, i.e., observe and experience when walking along the route specified by the system. Then, they could evaluate their own behavior through comparison and improve their safety awareness. When the designers evaluated the evacuation safety of the building, they were able to participate in the simulated evacuation and experience and view more details. These aspects reveal the potential of this method for application in safety education and design.
In future research, flammable or nonflammable materials will be added to the virtual scene to affect the spread of fire. Spatiotemporal data on the distribution of indoor smoke will be imported, and the concentration of smoke will be used as a new variable to improve the navigation algorithm. Furthermore, future research will add attributes such as age, gender, and identity to the virtual character model, and on this basis, it will explore more behaviors other than escape, such as rescue and assistance, and add them to the existing system as options tool.