Route search program, route search method, and route search device
By creating a second graph from selected nodes and using the Multi-Mutual Dijkstra method, the route search method addresses the computational inefficiencies of A* in game environments, enabling faster and more efficient pathfinding.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- KOEI TECMO GAMES CO LTD
- Filing Date
- 2024-12-12
- Publication Date
- 2026-06-24
AI Technical Summary
The A* algorithm for route search is computationally expensive and time-consuming when applied to graph-based pathfinding in game environments, leading to server overload.
A route search method that creates a second graph from selected nodes of a first graph, searches for a provisional route on this second graph, and then finds partial routes on the first graph to the destination, using techniques like the Multi-Mutual Dijkstra method to reduce computational complexity.
This approach significantly reduces the time required for route search by simplifying the graph and optimizing the search process, allowing real-time pathfinding in game environments.
Smart Images

Figure 2026103716000001_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to a route search program, a route search method, and a route search device.
Background Art
[0002] Non-Patent Document 1 describes that "A* is one of the popular algorithms for searching the shortest path, and it is a method of sequentially searching for the nearest target position on the way to the target. There are also several other path search algorithms, but if such calculations are performed for each individual enemy NPC, the server will be overloaded."
Prior Art Documents
Non-Patent Documents
[0003]
Non-Patent Document 1
Summary of the Invention
Problems to be Solved by the Invention
[0004] As a general algorithm for searching the shortest path, the A* (A-star) algorithm is known (for example, see Non-Patent Document 1). However, when attempting to search for the shortest path to the destination on the graph to be searched, there is a problem that the calculation cost is high and the time required for route search becomes long.
[0005] Therefore, an object of the present disclosure is to provide a program, a method, and a device that can shorten the time required for route search as compared with the case of searching for the shortest path to the destination on the graph to be searched. [Means for solving the problem]
[0006] The route search program according to the first embodiment causes the computer to create a second graph consisting of a plurality of second nodes which are part of a plurality of first nodes that constitute a first graph to be searched, to search for a simplified provisional route on the second graph, and to search for a partial route on the first graph which is part of the route to the destination, starting from a first node which is the starting point of the plurality of first nodes, and ending at a first node that satisfies predetermined conditions for the second nodes included in the provisional route.
[0007] The route search program according to the second embodiment, in the route search program according to the first embodiment, causes the computer to search for a route as a provisional route from the starting node, which is the second node closest to the starting point among the plurality of second nodes, to the destination node, which is the second node closest to the destination.
[0008] The route search program according to the third embodiment is a route search program according to the second embodiment, wherein the computer is instructed to search for the partial route with the first node corresponding to the intermediate node, which is the second node that first exceeds a predetermined search range from the starting node, as the endpoint.
[0009] The route search program according to the fourth embodiment is a route search program according to the third embodiment, which causes the computer to repeatedly perform the search for the partial route while changing the first node which is the starting point and the first node which is the ending point, and to construct at least a part of the route to the destination by connecting multiple partial routes.
[0010] The route search program according to the fifth embodiment causes the computer to modify the partial route in the route search program according to the third embodiment, by setting the first node, which is moved back a predetermined number of times from the first node corresponding to the intermediate node towards the starting point, as the endpoint.
[0011] The route search program according to the sixth embodiment is a route search program according to the fifth embodiment, which causes the computer to repeatedly perform the search for a partial route and the modification of the partial route while changing the first node which is the starting point and the first node which is the ending point, and to construct at least a part of the route to the destination by connecting multiple modified partial routes obtained by modifying the partial route.
[0012] The route search program according to the seventh embodiment causes the computer to construct at least a portion of the route to the destination by connecting the partial route and the provisional route from the intermediate node to the target node, in the route search program according to the third embodiment.
[0013] The route search program according to the eighth embodiment is a route search program according to any one of the first to seventh embodiments, which causes the computer to create the second graph by simultaneously starting the search for adjacent nodes from the plurality of second nodes.
[0014] The pathfinding program according to the ninth embodiment is a pathfinding program according to any one of the first to eighth embodiments, which causes the computer to move an object in a virtual space according to the partial path.
[0015] The pathfinding program according to the tenth embodiment is a pathfinding program according to the ninth embodiment, wherein the virtual space is a game space and the object is a character that can move in the game space.
[0016] The route search method according to the 11th embodiment involves a computer creating a second graph composed of a plurality of second nodes which are part of a plurality of first nodes that constitute a first graph to be searched, searching for a simplified provisional route on the second graph, and searching for a partial route on the first graph which is part of the route to the destination, starting from a first node which is the starting point of the plurality of first nodes, and ending at a first node that satisfies predetermined conditions for the second nodes included in the provisional route.
[0017] The path search device according to the 12th embodiment includes a processor, the processor creates a second graph consisting of a plurality of second nodes which are part of a plurality of first nodes which constitute a first graph to be searched, searches for a simplified provisional path on the second graph which is a simplified path to the destination, and searches for a partial path which is part of the path to the destination on the first graph, starting from a first node which is the starting point of the plurality of first nodes and ending at a first node which satisfies predetermined conditions for the second nodes included in the provisional path.
[0018] According to the route search program, route search method, and route search device described herein, the time required for route search can be reduced compared to searching for the shortest route to the destination on a graph to be searched. [Brief explanation of the drawing]
[0019] [Figure 1] This figure shows an example of a schematic configuration of the game system 10 according to this embodiment. [Figure 2] This figure shows an example of the hardware configuration of the pathfinding device 100 according to this embodiment. [Figure 3] This figure shows an example of the functional configuration of the route search device 100 according to this embodiment. [Figure 4] This figure shows an example of the operation flow of the route search device 100 according to this embodiment, which creates a second graph. [Figure 5] This figure shows an example of a first graph acquired by the pathfinding device 100 according to this embodiment. [Figure 6] This figure shows the result of the route search device 100 according to this embodiment selecting a second node. [Figure 7] This figure shows the result of the path search device 100 according to this embodiment calculating the path between the second node. [Figure 8] This figure shows an example of a second graph created by the pathfinding device 100 according to this embodiment. [Figure 9]This figure shows an example of the first stage of the MMD method employed by the pathfinding device 100 according to this embodiment. [Figure 10] This figure shows an example of the second stage of the MMD method employed by the pathfinding device 100 according to this embodiment. [Figure 11] This figure shows an example of the third stage of the MMD method employed by the pathfinding device 100 according to this embodiment. [Figure 12] This figure shows an example of the fourth stage of the MMD method employed by the pathfinding device 100 according to this embodiment. [Figure 13] This figure shows an example of the fifth stage of the MMD method employed by the pathfinding device 100 according to this embodiment. [Figure 14] This figure shows an example of the operation flow of the route search device 100 according to this embodiment in which a route search is performed. [Figure 15] This figure shows the route searched by the route search device 100 according to this embodiment in the first example. [Figure 16] This figure shows a second example of the operation flow of the route search device 100 according to this embodiment in which a route search is performed. [Figure 17] This figure shows the route searched by the route search device 100 according to this embodiment in the second example. [Figure 18] This figure shows a third example of the operation flow of the route search device 100 according to this embodiment in which a route search is performed. [Figure 19] This figure shows the route searched by the route search device 100 according to this embodiment in the third example. [Modes for carrying out the invention]
[0020] Hereinafter, an example of an embodiment of this disclosure will be described with reference to the drawings. In each drawing, the same or equivalent components and parts are given the same reference numerals. Also, the dimensional ratios in the drawings are exaggerated for illustrative purposes and may differ from the actual ratios.
[0021] Figure 1 shows an example of the schematic configuration of the game system 10 according to this embodiment. Here, a game is a collection of activities and rules for playing or competing. A game is played, for example, by players using strategies and techniques to achieve a specific objective. Games are played to achieve various objectives, such as competitive objectives like winning a championship, combat objectives like defeating an enemy, educational objectives like learning, and narrative objectives like completing the progression of a scenario. A game may be in a competitive format or a non-competitive format.
[0022] The game system 10 comprises a communication means 20, a server device 30, and a terminal device 40. For the purposes of this explanation, we will describe an example of an object 50 that is to be moved, specifically the case of moving a PC (Player Character) from a starting point S to a destination G in the game space (world map, etc.). However, the object 50 that is to be moved is not limited to a PC; it may be any moving object that can move in the game space, such as an NPC (Non-Player Character) or an item.
[0023] The communication means 20 connects multiple computers in a way that enables communication. In this figure, the communication means 20 connects the server device 30 and the terminal device 40. The communication means 20 may be the internet, for example. However, the communication means 20 may be any means that can connect multiple computers in a way that enables communication, such as a LAN, WAN, or intranet.
[0024] The server device 30 sends and receives data with the terminal device 40, executes processing in response to the player's operations, and provides the execution results to the terminal device 40. More specifically, the server device 30 may perform processes such as downloading programs (applications) to the terminal device 40, logging in to the player, and managing various databases.
[0025] The server device 30 may be implemented, for example, by cloud computing. In this figure, the case where the server device 30 is a single device is shown as an example, but the server device 30 may distribute the above processing among multiple devices. Also, in this figure, the case where the game to be played is provided as a so-called online game is shown as an example, but it is not limited to this. If the game to be played can be played offline, the game system 10 does not need to have a server device 30. In other words, the server device 30 is not an essential configuration in this disclosure.
[0026] Terminal device 40 is a device for the player to play the game they choose to play. In this figure, terminal device 40 is shown as an example of a smartphone. However, terminal device 40 may be any device capable of playing the game the player chooses to play, such as a mobile phone, tablet device, laptop computer, all-in-one PC, tablet PC, or portable game console.
[0027] Hereafter, we will describe the case where the terminal device 40 is the route search device 100 according to this embodiment as an example. However, we are not limited to this, and the server device 30 may also be the route search device 100 according to this embodiment. Furthermore, both the terminal device 40 and the server device 30 may be the route search device 100 according to this embodiment. In other words, the route search according to this embodiment may be processed on the terminal side, on the network side, or in a distributed manner on both the terminal side and the network side.
[0028] Figure 2 shows an example of the hardware configuration of the route search device 100 according to this embodiment. The route search device 100 includes a processor 101, a ROM (Read Only Memory) 102, a RAM (Random Access Memory) 103, storage 104, a communication interface 105, and a user interface 106. These components are connected to each other so as to be able to communicate with one another via a bus 107.
[0029] The processor 101 executes various programs and controls each component. The ROM 102 stores various programs and data. The RAM 103 temporarily stores programs or data as a working area. The storage 104 is composed of, for example, an HDD (Hard Disk Drive) or SSD (Solid State Drive) and stores various programs and data, including the operating system.
[0030] In the pathfinding device 100 according to this embodiment, the pathfinding program 108 is stored in ROM 102 or storage 104. In this figure, the case in which the pathfinding program 108 is stored in storage 104 is shown as an example. The processor 101 reads the pathfinding program 108 from ROM 102 or storage 104 and executes it using RAM 103 as a work area, thereby performing control of each configuration and various calculation processes according to the pathfinding program 108.
[0031] The communication interface 105 is an interface for the route search device 100 to communicate with other devices. The user interface 106 is an input / output interface for the route search device 100 to exchange information with a user (in this case, a player). The user interface 106 may include a touch panel, keyboard, and microphone as input devices, and a monitor and speaker as output devices.
[0032] Figure 3 shows an example of the functional configuration of the route search device 100 according to this embodiment. The route search device 100 includes a creation unit 110, a condition setting unit 120, a provisional route search unit 130, a partial route search unit 140, a final route search unit 150, and a movement control unit 160. These functional configurations may be implemented in the route search device 100 by the processor 101 reading the route search program 108 from the ROM 102 or storage 104, expanding it into the RAM 103, and executing it.
[0033] The creation unit 110 is a functional unit that creates the second graph. The condition setting unit 120 is a functional unit that sets the search conditions. The provisional path search unit 130 is a functional unit that searches for a provisional path. The partial path search unit 140 is a functional unit that searches for a partial path. The final path search unit 150 is a functional unit that searches for the final path. The movement control unit 160 is a functional unit that controls the movement of object 50.
[0034] A route search device 100 equipped with such functional components searches for a simplified provisional route to the destination on a second graph, and then searches for a partial route, which is a part of the route to the destination, on a first graph based on the provisional route. Before describing the route search process performed by the route search device 100, the process by which the route search device 100 creates the second graph will be described in detail.
[0035] Figure 4 shows an example of the operation flow of the pathfinding device 100 according to this embodiment in which the pathfinding device 100 creates a second graph. This flow may be started when the processor 101 reads the pathfinding program 108 from the ROM 102 or storage 104, loads it into the RAM 103, and executes it. The pathfinding device 100 may execute this flow each time the game situation changes. That is, the pathfinding device 100 may recreate the second graph in response to a change in the game situation. Examples of changes in the game situation include when an obstacle is placed on the path making it impassable, or when the battle situation changes and the destination is changed.
[0036] In step S210, the processor 101, as the creation unit 110, acquires the first graph. Here, the first graph is the graph to be searched, and refers to the graph in so-called graph theory. In games, the traversable locations on the map are usually represented by a navigation polygon mesh (called a "navigation mesh"). Therefore, the processor 101 may create the first graph from the navigation mesh. However, it is not limited to this. The processor 101 may also acquire a created first graph from another device. Refer to Figure 5 here.
[0037] Figure 5 shows an example of a first graph acquired by the pathfinding device 100 according to this embodiment. The first graph is composed of a plurality of first nodes. In this figure, circles indicate first nodes. That is, in this figure, a first graph composed of first nodes N0 to N20 is shown as an example. Also, in this figure, solid lines indicate edges connecting first nodes. Object 50 can move between first nodes connected by edges. Returning to the explanation of Figure 4.
[0038] In step S220, the processor 101, as the creation unit 110, selects the second node. For example, the processor 101 selects multiple nodes from among the multiple first nodes that constitute the first graph acquired in step S210 as the second node. As an example, the processor 101 may randomly select multiple nodes from the first nodes N0 to N20 as the second node. However, it is not limited to this. The processor 101 can select the second node within a range that has a computational cost reduction effect. Alternatively, the second node may be selected artificially. Now, refer to Figure 6.
[0039] Figure 6 shows the result of the route search device 100 according to this embodiment selecting a second node. In this figure, as an example, the case in which first nodes N2, N9, N13, N15, and N18 from the first nodes N0 to N20 are selected as second nodes L0 to L4, respectively. In this case, the second graph will be composed of the selected second nodes L0 to L4. Here, the second node is also called a landmark. Returning to the explanation of Figure 4.
[0040] In step S230, the processor 101, as the creation unit 110, calculates the path between the second nodes. For example, the processor 101 calculates the path between the second nodes based on the cost of traveling between the second nodes selected in step S220. Refer to Figure 7 here.
[0041] Figure 7 shows the result of the pathfinding device 100 according to this embodiment calculating the path between the second nodes. In this figure, the dotted line indicates the calculated path. This figure shows that the path between the second nodes L0 and L1 was calculated to pass through the first nodes N4, N6, and N7. Similarly, it shows that the path between the second nodes L1 and L2 was calculated to pass through the first node N11. Similarly, it shows that the path between the second nodes L1 and L3 was calculated to pass through the first node N10. Similarly, it shows that the path between the second nodes L2 and L4 was calculated to pass through the first node N16. Similarly, it shows that the path between the second nodes L3 and L4 was calculated to pass through the first node N17. Returning to the explanation of Figure 4.
[0042] In step S240, the processor 101, as the creation unit 110, creates a second graph. For example, the processor 101 may create the second graph according to the path calculated in step S230. Refer to Figure 8 here.
[0043] Figure 8 shows an example of a second graph created by the pathfinding device 100 according to this embodiment. The second graph is also called a landmark graph. In this figure, circles indicate second nodes. That is, in this figure, a second graph composed of second nodes L0 to L4 is shown as an example. Also in this figure, dotted lines indicate edges connecting second nodes. The pathfinding device 100 can search for a path between second nodes connected by edges as a provisional path.
[0044] Here, the edges connecting the second nodes may each have the cost of the path calculated in step S230 as a weight. For example, the edge connecting the second nodes L0 to L1 may have the cost of moving from the second node L0 to the second node L1 via the first nodes N4, N6, and N7 as a weight. Similarly, the edge connecting the second nodes L1 to L2 may have the cost of moving from the second node L1 to the second node L2 via the first node N11 as a weight. Similarly, the edge connecting the second nodes L1 to L3 may have the cost of moving from the second node L1 to the second node L3 via the first node N10 as a weight. Similarly, the edge connecting the second nodes L2 to L4 may have the cost of moving from the second node L2 to the second node L4 via the first node N16 as a weight. Similarly, the edge connecting the second node L3 to L4 may have a weight representing the cost of moving from the second node L3 to the second node L4 via the first node N17.
[0045] The processor 101 can, for example, create a second graph (for example, the graph shown in Figure 8) composed of multiple second nodes L0 to L4, which are some of the multiple first nodes N0 to N20 that make up the first graph to be searched (for example, the graph shown in Figure 5). In this case, the processor 101 may create the second graph using a method (which we will call the "MMD (Multi-Mutual Dijkstra) method") that starts the search simultaneously from multiple initial nodes and gradually expands the range. This will be explained step by step using Figures 9 to 13.
[0046] In Figures 9 to 13, the left figure shows the graph from which the calculation is based, and the right figure shows the second graph that is created. In the left figure, for the sake of explanation, a grid graph is shown as an example in which all sides of each grid are connected with a cost of 1. Also, each grid is given row i and column j and G i,j This will be the definition.
[0047] FIG. 9 is a diagram showing an example of the first stage of the MMD method adopted by the path search device 100 according to the present embodiment. Here, in the grid G 1,1 the second node Lx, in the grid G 3,4 the second node Ly, and in the grid G 5,5 the second node Lz are respectively arranged as initial nodes.
[0048] In the first stage, in the set Q of nodes to be searched, the initial nodes, here the second nodes Lx, Ly, and Lz, are arranged in the grids G 1,1 , G 3,4 , and G 5,5 are input with a cost of 0. At this stage, no edges are added to the second graph.
[0049] The MMD method is a Dijkstra method that starts searching simultaneously from a plurality of initial nodes. That is, the processor 101 extracts the node with the maximum cost from the set Q of nodes, adds the cost of the edge (1 in the case of the grid graph), and adds the examined node to the set Q of nodes. This will be specifically described below.
[0050] FIG. 10 is a diagram showing an example of the second stage of the MMD method adopted by the path search device 100 according to the present embodiment. In the second stage, the processor 101 extracts the nodes with the maximum cost from the set Q of nodes, here the grids G 1,1 , G 3,4 , and G 5,5 with a cost of 0. Then, the processor 101 adds 1, which is the cost of the edge, to the nodes adjacent to any of these, and adds the examined nodes to the set Q of nodes. Here, the processor 101 adds the grids G 1,2 , G 2,1 , G 2,4 , G 3,3 , G 3,5 , G 4,4 , G 4,5 , and G 5,4 to the set Q of nodes with a cost of 1.
[0051] Note that the vertical and horizontal lines in this diagram visualize the corresponding initial nodes. In this diagram, Grid G 1,2 and G 2,1 This is associated with the second node Lx, and grid G 2,4 , G 3,3 , G 3,5 , and G 4,4 This is associated with the second node Ly, and grid G 4,5 and G 5,4 This shows an example where the node is associated with the second node Lz. Processor 101 also adds such associations with initial nodes to the node set Q.
[0052] Figure 11 shows an example of the third stage of the MMD method employed by the pathfinding device 100 according to this embodiment. In the third stage, the processor 101 selects the node with the maximum cost from the node set Q, in this case grid G with cost = 1. 1,2 , G 2,1 , G 2,4 , G 3,3 , G 3,5 , G 4,4 , G 4,5 , and G 5,4 The processor extracts the edge G. Then, the processor 101 adds the edge cost of 1 to the node adjacent to any of these and adds the examined node to the node set Q. Here, the processor 101 adds the grid G to the node set Q. 1,3 , G 1,4 , G 2,2 , G 2,3 , G 2,5 , G 3,1 , G 3,2 , G 4,3 , and G 5,3 Add it with a cost of 2.
[0053] If a node already exists at the location being investigated that is associated with another initial node, the processor 101 does not add that node to the node set Q, but instead adds an edge to the second graph. For example, grid G 3,5 Grid G adjacent to it below 4,5 Upon investigation, Grid G 4,5Let's assume that it was associated with the second node Lz. In this case, processor 101 is, grid G 4,5 Do not add it with a cost of 2.
[0054] Instead, processor 101 adds an edge between the initial node to which the current node is associated and the initial node to which the investigated node is associated, with a cost equal to the sum of the cost of the current node, the cost of the node being investigated, and the cost of the edge between the current node and the node being investigated. For example, processor 101, grid G 3,5 The cost is 1, grid G 4,5 The cost is 1, and grid G 3,5 ~G 4,5 An edge with a cost of 3 (1, which is the cost of the edge in between) is placed on grid G. 3,5 The second node Ly and grid G are associated with each other. 4,5 This is added between the associated second node Lz and the current node.
[0055] If an edge already exists between the second nodes, the processor 101 will overwrite it with the one with the lower cost. For example, the processor 101 may add an edge with cost = 3 between the second nodes Ly and Lz in the second graph in this manner.
[0056] Figure 12 shows an example of the fourth stage of the MMD method employed by the pathfinding device 100 according to this embodiment. In the fourth stage, the processor 101 selects the node with the highest cost from the node set Q, in this case grid G with cost = 2. 1,3 , G 1,4 , G 2,2 , G 2,3 , G 2,5 , G 3,1 , G 3,2 , G 4,3 , and G 5,3 The processor extracts the edge G. Then, the processor 101 adds the edge cost of 1 to the node adjacent to any of these and adds the examined node to the node set Q. Here, the processor 101 adds the grid G to the node set Q. 1,5 , G4,1 , G 4,2 , and G 5,2 Add it with a cost of 3.
[0057] Also, for example, processor 101 is grid G 1,3 Grid G adjacent to the right of 1,4 Upon investigation, Grid G 1,4 Let's assume that it was associated with the second node Ly. In this case, processor 101 is associated with grid G 1,4 Do not add it with a cost of 3.
[0058] Instead, Grid G 1,3 The cost is 2, grid G 1,4 The cost is 2, and grid G 1,3 ~G 1,4 An edge with a cost of 5 (1 added to the cost of the edge in between) is placed on grid G. 1,3 The second node Lx and grid G are associated with each other. 1,4 An edge is added between the associated second node Lx and Ly. The processor 101 may, for example, add an edge with cost = 5 between the second node Lx and Ly in the second graph in this way.
[0059] Figure 13 shows an example of the fifth stage of the MMD method employed by the pathfinding device 100 according to this embodiment. In the fifth stage, the processor 101 selects the node with the highest cost from the node set Q, in this case grid G with cost = 3. 1,5 , G 4,1 , G 4,2 , and G 5,2 The processor extracts the edge G. Then, the processor 101 adds the edge cost of 1 to the node adjacent to any of these and adds the examined node to the node set Q. Here, the processor 101 adds the grid G to the node set Q. 5,1 Add it with a cost of 4.
[0060] Also, for example, processor 101 is grid G 5,2 Grid G adjacent to the left of 5,1 Upon investigation, Grid G5,1 is associated with the second node Lx. In this case, the processor 101 does not associate the grid G 5,1 with the second node Lz.
[0061] Instead, the processor 101 adds the cost of grid G 5,2 which is 3, the cost of grid G 5,1 which is 4, and the cost of 1 of the edge between grid G 5,2 ~G 5,1 to obtain 8 as the cost, and adds an edge with this cost between the second node Lz associated with grid G 5,2 and the second node Lx associated with grid G 5,1 . For example, in this way, the processor 101 may add an edge with a cost of 8 between the second nodes Lz~Lx in the second graph.
[0062] For example, in this way, the processor 101 can create the second graph shown in FIG. 8 by simultaneously starting the search for adjacent nodes from a plurality of second nodes. When using the MMD method, the computational complexity of creating the second graph is as follows. When the graph is connected, that is, when there is a path between any two points, the "computational complexity" in terms of O notation may be considered equivalent. However, as described above, when there is a node associated with another initial node among the investigated destinations, the computational complexity may be added. On the other hand, when the graph is not connected, it is equivalent to the computational complexity when performing Dijkstra's method without specifying a goal for each connected component of the graph. For example, assume there is a graph connected to nodes a-b, c-d, e-f-g-h. In this case, the processor 101 can search the entire graph by performing calculations for Dijkstra's method starting from node a, Dijkstra's method starting from node c, and Dijkstra's method starting from node e, respectively. Therefore, the processor 101 can be accelerated to the extent that the creation process of the second graph can be executed in real time during the game.
[0063] Furthermore, the processor 101 can naturally select the nodes that should be connected by using the MMD method. Therefore, the created second graph may include nodes that are not directly connected, such as between the second nodes L0 and L2, L0 and L3, L0 and L4, and L1 and L4. This means that the processor 101 does not need to maintain edges between all nodes, thus saving memory.
[0064] The pathfinding device 100 may recreate this second graph whenever the game situation changes. The pathfinding device 100 then searches for a simplified temporary path to the destination on the second graph created in this way, and based on the temporary path, searches for a partial path, which is a part of the path to the destination, on the first graph. This will be explained in detail.
[0065] Figure 14 shows a first example of the operation flow of the route search device 100 according to this embodiment in which a route search is performed. This flow may be started when the processor 101 reads the route search program 108 from the ROM 102 or storage 104, loads it into the RAM 103, and executes it. It is assumed that the route search device 100 has already created a second graph prior to this flow.
[0066] In step S310, the processor 101 sets the destination G and the search range D as the condition setting unit 120. Destination G is the final destination of the path to be searched. For example, the processor 101 may set the location of the target NPC as destination G. Here, it is assumed that the first node N20 is set as destination G.
[0067] The search range D is a parameter that defines the range of the search. The search range D can be any value that the developer can freely determine. The search range D may be 0, but it is preferable that it be greater than the average distance between edges in the second graph, and slightly larger than the range in which the accuracy of the path should be maintained. Preferably, the search range D should be several times greater than the distance that object 50 moves during the interval in which the path search is repeated.
[0068] In step S320, the processor 101 sets a starting point S. The starting point S is the starting point of the path to be explored. For example, the processor 101 may set the position of object 50 as the starting point S. Here, we assume that the first node N0 is set as the starting point S.
[0069] In step S330, the processor 101, acting as a provisional pathfinding unit 130, determines the starting node LS and the target node LG. The starting node LS is the second node closest to the starting node S set in step S320, among the multiple second nodes that make up the second graph. Here, it is assumed that the second node L0 is set as the starting node LS.
[0070] The target node LG is the second node closest to the destination G set in step S310, among the multiple second nodes that make up the second graph. Here, it is assumed that the second node L4 is set as the target node LG.
[0071] In step S340, the processor 101, acting as a provisional path search unit 130, searches for a provisional path. For example, the processor 101 may search for a provisional path on the second graph that is a simplified version of the path to destination G. A provisional path that is a simplified version of the path to destination G may be, for example, a path from the starting node LS to the target node LG. Here, it is assumed that the processor 101 has searched for a provisional path LRoute0 that goes from the second node L0, which is the starting node LS, through the second nodes L1 and L2 to the second node L4, which is the target node LG.
[0072] In step S350, the processor 101, acting as a partial path search unit 140, searches for a partial path. For example, the processor 101 may search on the first graph for a partial path that is part of the path to destination G, starting from a first node that is the starting point among a plurality of first nodes, and ending at a first node that satisfies predetermined conditions for second nodes included in the hypothetical path.
[0073] More specifically, the processor 101 may set the second node that first exceeds the search range D from the starting node LS as the intermediate node LM among the multiple second nodes included in the hypothetical path. Then, the processor 101 may search for a subpath on the first graph with the first node corresponding to the intermediate node LM as the endpoint.
[0074] Here, the starting point is the first node, node N0. The second nodes included in the hypothetical route LRoute0 are the second nodes L0, L1, L2, and L4. Of these, the second node L1 is set as the intermediate node LM. In this case, the processor 101 may search for a route as a sub-route Route0 that goes from the starting point S, the first node N0, through the first nodes N3, N5, and N7 to the first node N9, which corresponds to the intermediate node LM, the second node L1.
[0075] Accordingly, the processor 101, as a movement control unit 160, may move the object 50 in the virtual space according to the partial path Route 0. Here, the virtual space may be, for example, a game space, and the object 50 may be, for example, a character that can move in the game space.
[0076] In step S360, the processor 101 determines whether a predetermined condition is met. Such conditions may include, for example, whether the object 50 has moved a predetermined distance, or whether a predetermined amount of time has elapsed since the object 50 was moved.
[0077] If it is determined that the predetermined conditions are not met (No), the processor 101 returns to step S360 and continues the flow. On the other hand, if it is determined that the predetermined conditions are met (Yes), the processor 101 proceeds to step S370.
[0078] In step S370, the processor 101 determines whether the intermediate node LM matches the target node LG. Here, the intermediate node LM is the second node L1, and the target node LG is the second node L4. In this case, the processor 101 determines that they do not match. If it is determined that they do not match (No), the processor 101 returns to step S320 and continues the flow.
[0079] Here, assume that object 50 has already moved to the first node N9 according to the partial path Route0. In this case, in step S320, processor 101 may set the first node N9, which is the current position of object 50, as the new starting point S.
[0080] In step S330, the processor 101 may set the second node L1 as the new starting node LS. The destination node LG may remain the second node L4.
[0081] In step S340, the processor 101 may determine a path as a provisional path LRoute1 that reaches the destination node LG, which is the second node L4, via the second node L2, starting from the starting node LS.
[0082] In step S350, the processor 101 may set the second node L4, one of the second nodes L1, L2, and L4 included in the provisional route LRoute1, as the intermediate node LM. Then, the processor 101 may search for a route as a partial route Route1 that starts from the first node N9, which is the starting point S, and reaches the first node N18, which corresponds to the second node L4, which is the intermediate node LM, via the first nodes N11, N12, N14, and N16.
[0083] Accordingly, the processor 101 may move the object 50 in the virtual space according to the partial path Route 1 until it determines in step S360 that a predetermined condition is met.
[0084] In step S370, the processor 101 determines whether the intermediate node LM matches the target node LG. Here, the intermediate node LM is the second node L4, and the target node LG is also the second node L4. In this case, the processor 101 determines that they match. If it is determined that they match (Yes), the processor 101 proceeds to step S380.
[0085] In step S380, the processor 101, acting as the final path search unit 150, searches for the final path. For example, the processor 101 may search for the path from the current position of object 50 to destination G on the first graph as the final path.
[0086] Here, let's assume that object 50 has already moved to the first node N18 following the partial route Route1. In this case, processor 101 may search the first graph for a final route RouteF from the first node N18 to the destination G, which is the first node N20. Processor 101 can search for a route to destination G in this way, for example.
[0087] Figure 15 shows the route searched by the route search device 100 according to this embodiment in the first example. In this figure, the dashed line indicates a hypothetical route.
[0088] In this diagram, the thick solid lines represent the partial and final routes. The route from the first node N0→N3→N5→N7→N9 corresponds to partial route Route 0, the route from the first node N9→N11→N12→N14→N16→N18 corresponds to partial route Route 1, and the route from the first node N18→N20 corresponds to the final route Route F.
[0089] In the first example, the processor 101 can determine the route to destination G by connecting the partial route Route0, partial route Route1, and final route RouteF. The processor 101 may, for example, repeatedly perform the search for partial routes while changing the starting first node and the ending first node, and construct at least a part of the route to destination G by connecting multiple partial routes.
[0090] Figure 16 shows a second example of the operation flow of the route search device 100 according to this embodiment in which a route search is performed. This flow may also be started by the processor 101 reading the route search program 108 from the ROM 102 or storage 104, loading it into the RAM 103, and executing it. Furthermore, it is assumed that the route search device 100 has already created the second graph prior to this flow.
[0091] Steps S410 to S450 may be the same as steps S310 to S350, so a detailed explanation will be omitted. Here, it is assumed that processor 101 has already searched for a path from the first node N0 to the first node N9 via the first nodes N3, N5, and N7, which is called partial path Route0.
[0092] In step S460, the processor 101, acting as a subpath search unit 140, modifies the subpath. For example, the processor 101 may modify the subpath by setting the endpoint to a first node that is moved back a predetermined number of n (where n is a positive integer) from the first node corresponding to the intermediate node LM towards the starting point S.
[0093] As an example, suppose n is set to 1. In this case, since the subroutine Route0 is 1st node N0→N3→N5→N7→N9, the processor 101 may correct the endpoint of the subroutine Route0 by moving it back one node from 1st node N9 to 1st node N7, making it 1st node N0→N3→N5→N7, and designate this as the corrected subroutine Route0'.
[0094] In step S470, the processor 101 determines whether the intermediate node LM matches the target node LG. Here, the intermediate node LM is the second node L1, and the target node LG is the second node L4. In this case, the processor 101 determines that they do not match. If it is determined that they do not match (No), the processor 101 returns to step S420 and continues the flow.
[0095] In step S420 following step S470, the processor 101 may set the endpoint of the modified subroute as the new starting point S. Here, since the endpoint of the modified subroute Route 0' is the first node N7, the processor 101 may set the first node N7 as the new starting point S.
[0096] In this case, in step S430, the processor 101 may set the second node L1 as the new starting node LS. The destination node LG may remain as the second node L4.
[0097] In step S440, the processor 101 may determine a path from the starting node LS, which is the second node L1, through the second node L2 to the destination node LG, which is the second node L4, as a provisional path LRoute1.
[0098] In step S450, the processor 101 may set the second node L4, one of the second nodes L1, L2, and L4 included in the provisional route LRoute1, as the intermediate node LM. Then, the processor 101 may search for a route as a partial route Route1 that starts from the first node N7, which is the starting point S, and reaches the first node N18, which corresponds to the second node L4, which is the intermediate node LM, via the first nodes N11, N12, N14, and N16.
[0099] In step S460, the processor 101 may change the endpoint of the partial route Route 1 back one node from the first node N18 to the first node N16, changing it to first node N7→N11→N12→N14→N16, and designate this as the corrected partial route Route 1'.
[0100] In step S470, the processor 101 determines whether the intermediate node LM matches the target node. Here, the intermediate node LM is the second node L4, and the target node LG is also the second node. In this case, the processor 101 determines that they match. If it is determined that they match (Yes), the processor 101 proceeds to step S480.
[0101] In step S480, the processor 101, acting as the final path search unit 150, searches for the final path. For example, the processor 101 may search for the path from the endpoint of the last modified partial path to the destination G on the first graph as the final path.
[0102] Here, the endpoint of the last modified partial route Route1' is the first node N16. In this case, the processor 101 may search the first graph for a final route RouteF from the first node N16 to the destination G, which is the first node N20. Here, we assume that the processor 101 has searched for a final route RouteF that goes from the first node N16 to the first node N20 via the first node N18. The processor 101 can search for a route to the destination G in this way, for example.
[0103] Figure 17 shows the route searched by the route search device 100 according to this embodiment in the second example. In this figure, the dashed line indicates a hypothetical route.
[0104] Furthermore, in this figure, the thick solid lines indicate the corrected partial routes and the final routes. The route from the first node N0→N3→N5→N7 corresponds to the corrected partial route Route0', the route from the first node N7→N11→N12→N14→N16 corresponds to the corrected partial route Route1', and the route from the first node N16→N18→N20 corresponds to the final route RouteF.
[0105] In the second example, the processor 101 can determine the route to destination G by connecting the modified sub-route Route0', modified sub-route Route1', and the final route RouteF. The processor 101 can repeatedly perform sub-route search and modification while changing the starting first node and the ending first node, and can construct at least a part of the route to destination G by connecting multiple modified sub-routes.
[0106] In the second example, the processor 101 may move object 50 in the virtual space after searching for the final route RouteF, that is, after searching for all routes to destination G. Alternatively, the processor 101 may move object 50 in the virtual space at any point after searching for the partial route Route0 but before searching for the final route RouteF.
[0107] Furthermore, in the above explanation, the case in which the processor 101 determines No in step S470 and then re-searches for a provisional path in the following step S440 was described as an example. However, the processor 101 may also search for a provisional path only once in step S440 following step S410. In this case, the processor 101 does not need to reset the starting node LS in step S430.
[0108] Figure 18 shows a third example of the operation flow of the route search device 100 according to this embodiment in which a route search is performed. This flow may also be started by the processor 101 reading the route search program 108 from the ROM 102 or storage 104, loading it into the RAM 103, and executing it. Furthermore, it is assumed that the route search device 100 has already created the second graph prior to this flow.
[0109] Steps S510 to S550 may be the same as steps S310 to S350, so a detailed explanation will be omitted. Here, it is assumed that processor 101 has already searched for a path from the first node N0 to the first node N9 via the first nodes N3, N5, and N7, which is called partial path Route0.
[0110] In step S560, the processor 101, as a provisional path search unit 130, searches for a partial provisional path. For example, the processor 101 may search for a partial provisional path on the second graph that simplifies a part of the path to destination G. A partial provisional path that simplifies a part of the path to destination G may be, for example, the path from the intermediate node LM to the target node LG. That is, since the intermediate node LM is the second node L1, the processor 101 may search for a partial provisional path on the second graph that simplifies the path from the second node L1 to the target node LG, which is the second node L4. Here, it is assumed that the processor 101 has searched for a path from the second node L1 to the second node L4 via the second node L2 as a partial provisional path LRoute'.
[0111] In step S570, the processor 101, acting as the final path search unit 150, searches for the final path. For example, the processor 101 may search for the path from the endpoint of a partial provisional path to the destination G on the first graph as the final path.
[0112] Here, the endpoint of the partial provisional route LRoute' is the second node L4, i.e., the first node N18. In this case, the processor 101 may search the first graph for a path from the first node N18 to the destination G, which is the first node N20, and call this the final path RouteF. The processor 101 can search for a path to destination G in this way, for example.
[0113] Figure 19 shows the route searched by the route search device 100 according to this embodiment in the third example. In this figure, the thick dashed lines indicate partial hypothetical routes.
[0114] In this diagram, the thick solid lines represent the partial route and the final route. The route from the first node N0→N3→N5→N7→N9 corresponds to the partial route Route 0, and the route from the first node N18→N20 corresponds to the final route Route F.
[0115] In the third example, the processor 101 can determine the route to destination G by connecting the partial route Route0, the partial provisional route LRoute', and the final route RouteF. The processor 101 can, for example, construct at least a part of the route to destination G by connecting the partial route and the provisional route from the intermediate node LM to the destination node LG.
[0116] In the third example as well, the processor 101 may move object 50 in the virtual space after searching for the final route RouteF, that is, after searching for all routes to destination G. Alternatively, the processor 101 may move object 50 in the virtual space at any point after searching for the partial route Route0 but before searching for the final route RouteF.
[0117] Furthermore, the partial hypothetical path explored in the third example was not explored on the first graph, but on the second graph. Therefore, the partial hypothetical path does not guarantee that object 50 can move along that path.
[0118] Therefore, such partial provisional paths are merely temporary solutions until the next path search can be performed. However, by searching for such partial provisional paths, the processor 101 can roughly indicate the direction in which to move object 50 next. Furthermore, the processor 101 can estimate the remaining distance traveled along the path to destination G and the time required for that travel.
[0119] As described above, the route search device 100 according to this embodiment creates a second graph composed of a plurality of second nodes, which are part of a plurality of first nodes that constitute the first graph to be searched, searches for a simplified provisional route on the second graph, and searches for a partial route on the first graph, which is a part of the route, starting from a first node that is the starting point among the plurality of first nodes, and ending at a first node that satisfies predetermined conditions for the second nodes included in the provisional route. As a result, the route search device 100 according to this embodiment can shorten the time required for route search compared to searching for the shortest route to the destination on the graph to be searched.
[0120] In particular, in games, it is common practice to discard the path and re-search when the situation changes. Therefore, it is often not advisable to thoroughly search the entire path to the destination. In contrast, the pathfinding device 100 according to this embodiment can limit the detailed path used for controlling the movement of object 50 to only a certain range from the starting point. As a result, the pathfinding device 100 according to this embodiment can further reduce computational costs compared to thoroughly searching the entire path to the destination.
[0121] Non-patent document 1 also discloses a method for constructing a route table for each region divided by a grid (Hierarchical Neighborhood Lookingup-Table). However, this method requires that a route table be constructed in advance for each region divided by a grid. In this case, it cannot handle situations where the situation may change dynamically, such as in a game.
[0122] In contrast, the pathfinding device 100 according to this embodiment can recreate the second graph in response to changes in the game situation. As a result, the pathfinding device 100 according to this embodiment can flexibly respond to changes in the game situation.
[0123] While the embodiments described above are examples of possible implementations, this disclosure is not limited to those described above, and it is of course possible to implement it in various modified forms without departing from its spirit.
[0124] Furthermore, in the above embodiments, the term "processor" refers to a broad type of processor, including general-purpose processors (e.g., CPU: Central Processing Unit, etc.) and dedicated processors (e.g., GPU: Graphics Processing Unit, ASIC: Application Specific Integrated Circuit, FPGA: Field Programmable Gate Array, programmable logic device, etc.).
[0125] Furthermore, the operation of the processor in the above embodiments may not be performed by a single processor, but may be performed by multiple processors located in physically separate locations working together. Also, the order of the processor operations is not limited to the order described in each of the above embodiments, but may be changed as appropriate.
[0126] Furthermore, although the pathfinding device 100 in this embodiment is described as being composed of a single device, it may also be composed of multiple devices.
[0127] Furthermore, the processing performed by the route search device 100 according to the above embodiment may be performed by software, by hardware, or by a combination of both. In addition, the processing performed by each part of the route search device 100 may be stored as a program on a storage medium and distributed.
[0128] Furthermore, the program described herein can be provided as a program product. A program product includes any form of product for providing a program. For example, a program product includes a program provided via a network such as the Internet, and non-temporary computer-readable recording media such as CD-ROMs and DVDs on which the program is stored. [Explanation of symbols]
[0129] 10 Game Systems 20 Communication methods 30 Server Devices 40 Terminal devices 50 objects 100 Pathfinding device 101 Processors 102 ROM 103 RAM 104 storage 105 Communication Interface 106 User Interface 107 Bus 108 Route Search Programs 110 Creation Department 120 Condition Setting Section 130 Provisional route search unit 140 Partial Pathfinding Unit 150 Final Path Search Unit 160 Movement Control Unit
Claims
1. On the computer, Create a second graph consisting of multiple second nodes, which are some of the multiple first nodes that make up the first graph to be explored. A simplified hypothetical route to the destination is searched on the second graph. Starting from the first node that is the starting point among the plurality of first nodes, a partial route, which is part of the route to the destination, is searched on the first graph, with the endpoint being a first node that satisfies predetermined conditions for the second nodes included in the provisional route. A pathfinding program.
2. The computer is instructed to search for a hypothetical path from the starting node, which is the second node closest to the starting point among the plurality of second nodes, to the destination node, which is the second node closest to the destination. The pathfinding program according to claim 1.
3. The computer is instructed to search for the subpath, with the first node corresponding to the intermediate node, which is the first node that exceeds a predetermined search range from the starting node, as the endpoint. The pathfinding program according to claim 2.
4. To the aforementioned computer, The search for the partial path is repeatedly performed while changing the first node that serves as the starting point and the first node that serves as the ending point. Connecting multiple of the aforementioned partial routes to construct at least a portion of the route to the destination, The pathfinding program according to claim 3.
5. The computer is instructed to modify the partial path by setting the first node, which is a predetermined number of nodes back towards the starting point from the first node corresponding to the intermediate node, as the endpoint. The pathfinding program according to claim 3.
6. To the aforementioned computer, The process of searching for a partial path and modifying the partial path is repeatedly performed while changing the first node that serves as the starting point and the first node that serves as the ending point. Multiple modified partial routes, obtained by correcting the aforementioned partial routes, are connected to construct at least a portion of the route to the destination. The pathfinding program according to claim 5.
7. The computer is instructed to connect the partial path and the temporary path from the intermediate node to the destination node to construct at least a portion of the path to the destination. The pathfinding program according to claim 3.
8. The computer is instructed to create the second graph by simultaneously starting the search for adjacent nodes from the plurality of second nodes. A pathfinding program according to any one of claims 1 to 7.
9. The computer moves an object in a virtual space according to the aforementioned partial path. A pathfinding program according to any one of claims 1 to 7.
10. The virtual space is a game space, and the object is a character that can move within the game space. The pathfinding program according to claim 9.
11. Computers A second graph is created, which consists of multiple second nodes that are some of the multiple first nodes that make up the first graph to be explored. A simplified hypothetical route to the destination is searched on the second graph, Starting from the first node that is the starting point among the plurality of first nodes, a partial route, which is part of the route to the destination, is searched on the first graph, with the endpoint being a first node that satisfies predetermined conditions for the second nodes included in the provisional route. Route search method.
12. The processor comprises, A second graph is created, which consists of multiple second nodes that are some of the multiple first nodes that make up the first graph to be explored. A simplified hypothetical route to the destination is searched on the second graph, Starting from the first node that is the starting point among the plurality of first nodes, a partial route, which is part of the route to the destination, is searched on the first graph, with the endpoint being a first node that satisfies predetermined conditions for the second nodes included in the provisional route. Route search device.