CN112699208B - Map way finding method, device, equipment and medium - Google Patents

Map way finding method, device, equipment and medium Download PDF

Info

Publication number
CN112699208B
CN112699208B CN202110321635.1A CN202110321635A CN112699208B CN 112699208 B CN112699208 B CN 112699208B CN 202110321635 A CN202110321635 A CN 202110321635A CN 112699208 B CN112699208 B CN 112699208B
Authority
CN
China
Prior art keywords
node
path
hop
point
searched
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110321635.1A
Other languages
Chinese (zh)
Other versions
CN112699208A (en
Inventor
钱海江
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202110321635.1A priority Critical patent/CN112699208B/en
Publication of CN112699208A publication Critical patent/CN112699208A/en
Application granted granted Critical
Publication of CN112699208B publication Critical patent/CN112699208B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/20Input arrangements for video game devices
    • A63F13/21Input arrangements for video game devices characterised by their sensors, purposes or types
    • A63F13/216Input arrangements for video game devices characterised by their sensors, purposes or types using geographical information, e.g. location of the game device or player using GPS
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/907Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/909Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using geographical or spatial information, e.g. location
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • G06Q10/047Optimisation of routes or paths, e.g. travelling salesman problem
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T17/00Three dimensional [3D] modelling, e.g. data description of 3D objects
    • G06T17/05Geographic models

Abstract

The application discloses a map path finding method, a map path finding device, map path finding equipment and map path finding media, and relates to the technical field of path finding. The method comprises the following steps: determining a current node to be searched in a map; searching along the candidate searching direction of the current node to obtain a jumping point in the candidate searching direction, wherein the jumping point is a candidate corner node in the path-finding path, and the corner node is a node with a changed path advancing direction; determining a father node of the jump point, wherein the father node comprises a corner node which reaches the jump point in a path finding path; after the end node of the routing path is searched, the parent node is traced back hop by hop from the end node to generate the routing path. The method and the device can improve the speed of the way searching and determine the optimal way searching path.

Description

Map way finding method, device, equipment and medium
Technical Field
The present application relates to the field of path finding technologies, and in particular, to a method, an apparatus, a device, and a medium for map path finding.
Background
Obstacles usually exist in the map, such as enemy forts appearing in the game map, and tables and chairs encountered by the sweeping robot when walking.
In order to enable a moving object on the grid map to avoid an obstacle and reach a specified position, a route searching is required to be carried out on the grid map. Taking the example of an enemy fort appearing on a grid map in the game, a character controlled by the player needs to bypass the enemy fort to reach a target position, and at this time, a path for the player to bypass a node where the enemy fort is located needs to be provided. Taking a grid map constructed by regular hexagons as an example, in the related technology, an initial node is taken as the initial current node, and path searching is performed on all nodes adjacent to the current node, so that a path searching path is finally determined. The path-finding path is a moving path for a moving object to reach the terminating node from the originating node avoiding the obstacle.
Under the condition that the number of nodes in the grid map is large, the server needs to search the nodes with large number, so that the speed of route searching is reduced, the finally determined route searching path is not the optimal path, and the condition of detour is easy to occur.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a medium for searching a map, which can search a way based on jumping points, avoid searching the way for all nodes and further improve the speed of searching the way. The technical scheme is as follows.
According to an aspect of the present application, there is provided a map way-finding method, including:
determining a current node to be searched in a map;
searching along the candidate searching direction of the current node to obtain a jumping point in the candidate searching direction, wherein the jumping point is a candidate corner node in the path-finding path, and the corner node is a node with a changed path advancing direction;
determining a father node of the jump point, wherein the father node comprises a corner node which reaches the jump point in the path finding path;
after the end node of the routing path is searched, the parent node is traced back hop by hop from the end node to generate the routing path.
According to an aspect of the present application, there is provided a map routing apparatus, the apparatus including:
the determining module is used for determining a current node to be searched in a map;
the searching module is used for searching along the candidate searching direction of the current node to obtain a jumping point in the candidate searching direction, wherein the jumping point is a candidate corner node in the path-finding path, and the corner node is a node with a changed path advancing direction;
the determining module is further used for determining a father node of the hop, wherein the father node comprises a corner node which reaches the hop in the routing path;
and the generating module is used for jumping back to the father node from the terminating node after the terminating node of the routing path is searched to generate the routing path.
According to one aspect of the present application, there is provided a computer device comprising a processor and a memory, the memory having stored therein at least one program code, the program code being loaded by the processor and performing the map routing method as described above.
According to an aspect of the present application, there is provided a computer-readable storage medium having at least one program code stored therein, the program code being loaded and executed by a processor to implement the map routing method as described above.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
by searching for a hop along the candidate search direction of the current node, a parent node of each hop is determined for recording based on the searched hop and the current node. After the end node is searched, one or more parent nodes are traced back hop by hop from the end node to generate a routing path. The optimal path finding path can be generated by determining the corner nodes in the path finding path, the number of nodes required to be searched in the path finding search process is reduced, the path finding search is not required to be performed on all the nodes, and therefore the speed of the path finding search is improved; the optimal path-finding path generated by the corner node is helpful for avoiding the bypass situation.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic structural diagram of a terminal provided in an exemplary embodiment of the present application;
FIG. 2 is a block diagram of a computer system provided in an exemplary embodiment of the present application;
FIG. 3 is a flowchart of a map routing method provided by an exemplary embodiment of the present application;
FIG. 4 is a coordinate system of a regular hexagonal grid map provided by an exemplary embodiment of the present application;
FIG. 5 is a coordinate system of a regular hexagonal grid map provided by an exemplary embodiment of the present application;
FIG. 6 is a coordinate system of a regular hexagonal grid map provided by an exemplary embodiment of the present application;
FIG. 7 is a coordinate system of a regular hexagonal grid map provided by an exemplary embodiment of the present application;
FIG. 8 is a coordinate system of a regular hexagonal grid map provided by an exemplary embodiment of the present application;
FIG. 9 is a coordinate system of a regular hexagonal grid map provided by an exemplary embodiment of the present application;
FIG. 10 is a coordinate system of a regular hexagonal grid map provided by an exemplary embodiment of the present application;
FIG. 11 is a coordinate system of a regular hexagonal grid map provided by an exemplary embodiment of the present application;
FIG. 12 is a flowchart of a map routing method provided by an exemplary embodiment of the present application;
FIG. 13 is a flowchart of a map routing method provided by an exemplary embodiment of the present application;
FIG. 14 is a flowchart of a map routing method provided by an exemplary embodiment of the present application;
FIG. 15 is a schematic diagram of a wayfinding path provided by an exemplary embodiment of the present application;
FIG. 16 is a block diagram of a map routing device provided in an exemplary embodiment of the present application;
fig. 17 is a block diagram of a terminal provided in an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
First, terms referred to in the embodiments of the present application will be described.
Regular hexagonal grid map: refers to a grid map composed of a plurality of regular hexagons. Illustratively, in a regular hexagonal grid map, the cost of one node moving one grid to an axially adjacent node is 1, and the cost of moving one grid to a diagonal direction is 2.
Path finding: generally, a moving path is found for a moving object according to a rule in a grid map. The grid map may be a grid map constructed based on a regular quadrangle, may also be a grid map constructed based on a regular hexagon, and may also be other types of grid maps.
First set of nodes (OpenList): the node set formed by the nodes to be searched in the routing process can also be called as an open list.
Second node set (CloseList): the node set formed by the nodes searched in the routing process can also be called a closing list.
And (3) node: refers to the grid on the grid map and is the minimum unit of the way-finding search. The current node, the neighbor node, the diagonal node, the blocking node, the jumping point, the forced neighbor, the intermediate jumping point, the father node and the like related in the application are all one of the nodes. Taking a grid map constructed based on regular hexagons as an example, each node is a regular hexagon node. The specific meaning of the above nodes will be specifically explained below.
Artificial Intelligence (AI): the method is a theory, method, technology and application system for simulating, extending and expanding human intelligence by using a digital computer or a machine controlled by the digital computer, sensing the environment, acquiring knowledge and obtaining the best result by using the knowledge. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The map way-finding method provided by the embodiment of the application can be used in the determination process of the travel path of an intelligent machine, the determination process of a driving path or the determination process of other paths based on a regular hexagonal grid map. Illustratively, the map way-finding method provided by the embodiment of the present application may also be placed on a block chain for use.
The method provided by the application can be applied to the application program with the virtual environment and the virtual role. Illustratively, an application that supports a virtual environment is one in which a user can control the movement of a virtual character within the virtual environment. By way of example, the methods provided herein may be applied to: any one of a Virtual Reality (VR) application program, an Augmented Reality (AR) program, a three-dimensional map program, a military Simulation program, a Virtual Reality Game, an Augmented Reality Game, a First-Person shooter Game (FPS), a Third-Person shooter Game (TPS), a Multiplayer Online tactical sports Game (MOBA), and a strategic Game (SLG).
Illustratively, a game in the virtual environment is composed of one or more maps of game worlds, the virtual environment in the game simulates a scene of a real world, a user can control a virtual character in the game to perform actions such as walking, running, jumping, shooting, fighting, driving, attacking other virtual characters by using virtual weapons, and the like in the virtual environment, the interactivity is strong, and a plurality of users can form a team on line to perform a competitive game.
In some embodiments, the application may be a shooting game, a racing game, a role playing game, an adventure game, a sandbox game, a tactical competition game, a military simulation program, or the like. The client can support at least one operating system of a Windows operating system, an apple operating system, an android operating system, an IOS operating system and a LINUX operating system, and the clients of different operating systems can be interconnected and intercommunicated. In some embodiments, the client is a program adapted to a mobile terminal having a touch screen.
In some embodiments, the client is an application developed based on a three-dimensional engine, such as the three-dimensional engine being a Unity engine.
The terminal in the present application may be a desktop computer, a laptop computer, a mobile phone, a tablet computer, an e-book reader, an MP3 (Moving Picture Experts Group Audio Layer III, mpeg compression standard Audio Layer 3) player, an MP4 (Moving Picture Experts Group Audio Layer IV, mpeg compression standard Audio Layer 4) player, and so on. The terminal is installed and operated with a client supporting a virtual environment, such as a client of an application supporting a three-dimensional virtual environment. The application program may be any one of a Battle Royal (BR) game, a virtual reality application program, an augmented reality program, a three-dimensional map program, a military simulation program, a third person shooter game, a first person shooter game, and a multiplayer online tactic competition game. Alternatively, the application may be a stand-alone application, such as a stand-alone 3D game program, or may be a network online application.
Fig. 1 is a schematic structural diagram of a terminal provided in an exemplary embodiment of the present application, where the terminal includes a processor 101, a touch screen 102, and a memory 103.
The processor 101 may be at least one of a single-core processor, a multi-core processor, an embedded chip, and a processor having instruction execution capabilities.
The touch screen 102 includes a general touch screen or a pressure sensitive touch screen. The normal touch screen can measure a pressing operation or a sliding operation applied to the touch screen 102; a pressure sensitive touch screen can measure the degree of pressure exerted on the touch screen 102.
The memory 103 stores an executable program of the processor 101. Illustratively, the memory 103 stores a virtual environment program a, an application program B, an application program C, a touch (and pressure) sensing module 18, and a kernel layer 19 of an operating system. The virtual environment program a is an application program developed based on the three-dimensional virtual environment module 17. Optionally, the virtual environment program a includes, but is not limited to, at least one of a game program, a virtual reality program, a three-dimensional map program, and a three-dimensional presentation program developed by a three-dimensional virtual environment module (also referred to as a virtual environment module) 17. For example, when the operating system of the terminal adopts an android operating system, the virtual environment program a is developed by adopting Java programming language and C # language; for another example, when the operating system of the terminal is the IOS operating system, the virtual environment program a is developed using the Object-C programming language and the C # language.
The three-dimensional Virtual environment module 17 is a module supporting multiple operating system platforms, and schematically, the three-dimensional Virtual environment module may be used for program development in multiple fields, such as a game development field, a Virtual Reality (VR) field, and a three-dimensional map field, and the specific type of the three-dimensional Virtual environment module 17 is not limited in the embodiment of the present application, and in the following embodiment, the three-dimensional Virtual environment module 17 is a module developed by using a Unity engine as an example.
The touch (and pressure) sensing module 18 is a module for receiving a touch event (and a pressure touch event) reported by the touch screen driver 191, and optionally, the touch sensing module may not have a pressure sensing function and does not receive a pressure touch event. The touch event includes: the type of touch event and the coordinate values, the type of touch event including but not limited to: a touch start event, a touch move event, and a touch down event. The pressure touch event comprises the following steps: a pressure value and a coordinate value of the pressure touch event. The coordinate value is used for indicating a touch position of the pressure touch operation on the display screen. Optionally, an abscissa axis is established in the horizontal direction of the display screen, and an ordinate axis is established in the vertical direction of the display screen to obtain a two-dimensional coordinate system.
Illustratively, the kernel layer 19 includes a touch screen driver 191 and other drivers 192. The touch screen driver 191 is a module for detecting a pressure touch event, and when the touch screen driver 191 detects the pressure touch event, the pressure touch event is transmitted to the touch (and pressure) sensing module 18.
Other drivers 192 may be drivers associated with the processor 101, drivers associated with the memory 103, drivers associated with network components, drivers associated with sound components, and the like.
Optionally, the terminal may also control the movement of the virtual character in the virtual environment through the game controller, and there is no need to set a processing module corresponding to the touch screen included in the memory 103 of the touch screen 102. Those skilled in the art will appreciate that the foregoing is merely a general illustration of the structure of the terminal. A terminal may have more or fewer components in different embodiments. For example, the terminal may further include a gravitational acceleration sensor, a gyro sensor, a power supply, and the like.
Fig. 2 shows a block diagram of a computer system provided in an exemplary embodiment of the present application, where the computer system 200 includes: terminal 210, server cluster 220.
The terminal 210 is installed and operated with a client 211 supporting a virtual environment, and the client 211 may be an application supporting a virtual environment. For example, client 211 is running a gaming application that supports a regular hexagonal grid map. When the terminal runs the client 211, a user interface of the client 211 is displayed on the screen of the terminal 210. The client can be any one of an FPS game, a TPS game, a military simulation program, an MOBA game, a tactical competitive game and an SLG game. The terminal 210 is a terminal used by the first user 212, and the first user 212 uses the terminal 210 to control a first virtual character located in the virtual environment to perform an activity, and the first virtual character may be referred to as a first virtual character of the first user 212. The activities of the first avatar include, but are not limited to: adjusting at least one of body posture, crawling, walking, running, riding, flying, jumping, driving, picking up, shooting, attacking, throwing. Illustratively, the first avatar is a first avatar, such as a simulated persona or an animated persona.
The device types of the terminal 210 include: at least one of a smartphone, a tablet, an e-book reader, an MP3 player, an MP4 player, a laptop portable computer, and a desktop computer.
Only one terminal is shown in fig. 2, but there are a plurality of other terminals 240 in different embodiments. In some embodiments, there is at least one other terminal 240 corresponding to the developer, a development and editing platform of the client of the virtual environment is installed on the other terminal 240, the developer can edit and update the client on the other terminal 240, and transmit the updated client installation package to the server cluster 220 through a wired or wireless network, and the terminal 210 can download the client installation package from the server cluster 220 to update the client.
The terminal 210 and the other terminals 240 are connected to the server cluster 220 through a wireless network or a wired network.
The server cluster 220 includes at least one of a server, a plurality of servers, a cloud computing platform, and a virtualization center. Server cluster 220 is used to provide background services for clients that support a three-dimensional virtual environment. Optionally, the server cluster 220 undertakes primary computing work and the terminals undertake secondary computing work; or, the server cluster 220 undertakes the secondary computing work, and the terminal undertakes the primary computing work; or, the server cluster 220 and the terminal perform cooperative computing by using a distributed computing architecture.
Optionally, the terminal and the server are both computer devices.
In one illustrative example, server cluster 220 includes servers 221 and 226, where servers 221 include a processor 222, a user account database 223, a combat service module 224, and a user-oriented Input/Output Interface (I/O Interface) 225. The processor 222 is configured to load an instruction stored in the server 221, and process data in the user account database 223 and the combat service module 224; the user account database 223 is used for storing data of user accounts used by the terminal 210 and other terminals 240, such as head images of the user accounts, nicknames of the user accounts, fighting capacity indexes of the user accounts, and service areas where the user accounts are located; the fight service module 224 is used for providing a plurality of fight rooms for the users to fight against; the user-facing I/O interface 225 is used to establish communication with the terminal 210 through a wireless network or a wired network to exchange data.
In conjunction with the above description of the virtual environment and the description of the implementation environment, as schematically shown in fig. 3, an embodiment of the present application provides a map routing method, which is applied in a server. The path searching method provided by the embodiment of the application comprises the following steps.
Step 302: determining a current node to be searched in the map.
Illustratively, the first node set includes at least one node to be searched.
The current node refers to a node which is performing a way-finding search. Illustratively, the current node is one of the nodes to be searched in the map, and the node set formed by the nodes to be searched is referred to as a first node set. Accordingly, the set of nodes formed by the searched nodes is referred to as a second set of nodes.
The following description will be made by taking the example of the current node included in the first node set.
Illustratively, after the path search of the current node is finished, the node is taken out from the first node set and put into the second node set. In addition, when the first node set is empty, that is, when there is no node to be searched, the path searching is finished. In the regular hexagonal grid map for performing the way-finding search, a path cannot be found from a start node to reach a termination node, wherein the start node is a node where a path start point is located, and the termination node is a node where a path end point is located.
In the process of way finding, it is common to start from the starting node. Therefore, the start node needs to be placed in the first node set before step 302 is performed.
Step 304: and searching along the candidate searching direction of the current node to obtain the jumping point in the candidate searching direction.
Illustratively, a hop is a corner node of a candidate of a routing path, and the corner node is a node in which the path forwarding direction changes.
Illustratively, taking the application of the map way-finding method provided by the embodiment of the present application to a regular hexagonal grid map as an example, the candidate search direction refers to at least one of an axial direction and a diagonal direction of a regular hexagon. The axial direction of the regular hexagon is a straight line direction formed by the center of the regular hexagon and the midpoint of one of the six opposite angles, and the opposite angle direction is a straight line direction formed by the center of the regular hexagon and one of the six opposite angles. Illustratively, a regular hexagon includes six axial directions and six diagonal directions.
The route searching path refers to a route from a starting node to a terminating node obtained by route searching, and the jumping point is a candidate corner node possibly existing in the route searching path.
For example, the path finding path sequentially passes through the node a, the node b, the node c, and the node d, and none of the four nodes is one of the start node and the end node. The direction from the node a to the node b is a horizontal direction to the right, the forward direction from the node b to the next node c is an upward vertical direction, and the forward direction from the node c to the next node d is a diagonal direction to the right and upward. Where nodes b and c are hops. Therefore, the jumping point has a relatively important meaning in the routing path, and when the jumping point is not included in the first node set, the jumping point needs to be added into the first node set to become one of the nodes to be searched.
Illustratively, a hop comprises at least one of the following nodes: an originating node, a terminating node, a node with a forced neighbor, a node with an intermediate hop. Considering a node with forced neighbors as a first hop and a node with an intermediate hop as a second hop, the first and second hops are explained below in connection with a regular hexagonal grid map.
First, fig. 4 to 6 show a partial coordinate system of a regular hexagonal grid map. According to different arrangement modes of the regular hexagons, different coordinate systems can be adopted. In the embodiment of the present application, a coordinate system is taken as a Cube coordinate system (Cube coordinates) as an example. Schematically, the coordinate axes x, y, z are at an angle of 60 °. Wherein, one grid in the coordinate system is equivalent to one node in the grid map, and the coordinate of each grid is (x, y, z), wherein the coordinate of each grid satisfies x + y + z =0, and the node marked with (x, y, z) coordinate in fig. 4 is the origin of the coordinate system. In addition, in the coordinate system, the directions of the coordinate axes are axial directions, and a diagonal direction is formed between the two coordinate axes. That is, with respect to a regular hexagon, each side corresponds to one axial direction, and each diagonal corresponds to one diagonal direction.
The neighbor node refers to a node adjacent to a certain node. That is, when two nodes share one edge, the two nodes are neighbor nodes of each other. As shown in fig. 5, the node a has six adjacent nodes, and the six adjacent nodes are all neighbor nodes of the node a, and the node a is also a neighbor node of the six nodes. A diagonal node is a node where a node moves one lattice in the diagonal direction. Schematically, as shown in fig. 6, node B is obtained by moving node a one frame diagonally upward and rightward. Node B and node a may be considered diagonal nodes to each other. Illustratively, the nodes C, D, E, F, G are all diagonal nodes to each other from node a.
1. A first jumping point: a node with forced neighbors.
The forced neighbor refers to a node which is adjacent to the hop and the blocking node, namely, the hop, the blocking node and the forced neighbor appear at the same time and are mutually neighbor nodes. The neighbors are forced to be in front of the search direction or in front of the path's heading.
As schematically shown in fig. 7, the node p is a current node, the direction indicated by the arrow is a search direction, the search direction is a rightward axis direction, the black node is a blocking node, and the node x is found in the search direction of the node p. The node x, the node n and the blocking node are neighbor nodes, the node n is located in front of the searching direction, and at the moment, the length of a path from the node p to the node n through the node x is shorter than that of any path not passing through the node x. It can be considered that node n is a forced neighbor of node x, which is a hop of node n.
2. And a second jumping point: a node with a middle hop.
The intermediate jump point refers to a node having a forced neighbor searched in any one of two axis directions adjacent to the diagonal direction when the search direction is the diagonal direction. As shown in fig. 8, a node p is a current node, a node y is a diagonal node of the node p, a thick arrow is a search direction of the node y, and two axis directions adjacent to the candidate search direction of the node y are directions pointed by d1 and d2 arrows, respectively. If the node f1 is found to be a node with a forced neighbor in the direction d1, and the node f2 is found to be a node with a forced neighbor in the direction d2, it can be considered that the node f1 and the node f2 are intermediate hop points of the node y; when either of the node f1 and the node f2 exists, the node y is a node having an intermediate hop.
According to the foregoing, the current node is one of the start node, the end node, the first hop point, and the second hop point. In the way finding method provided in the embodiment of the present application, the search directions are different according to the difference of the current nodes, and the following determination rule of the search directions is specifically followed.
(1) In the case that the current node is the start node.
Searching in six axial directions and six diagonal directions is required, and searching in the axial direction is performed first, and then searching in the diagonal directions is performed.
Schematically, as shown in fig. 9, the node p is the current node, the solid arrow is the axial direction, and the dotted arrow is the diagonal direction.
(2) In case the current node is the first hop.
The candidate search direction of the first jumping point includes two types, one type is the original search direction of the first jumping point, and the other type is the axial direction of the forced neighbor and the diagonal direction between the original search direction and the axial direction of the forced neighbor.
As shown in fig. 10, a node x is a first hop point, a black node is a blocking node, both the node n1 and the node n2 are forced neighbors of the node x, a solid arrow is an original search direction for searching the node x, and a dotted arrow is an axial direction of the node n1, a diagonal direction between an axial direction of the node n1 and the original search direction, an axial direction of the node n2, and a diagonal direction between an axial direction of the node n2 and the original search direction from top to bottom. At this time, if the node x becomes the current node, the search direction includes five directions indicated by solid line arrows and dotted line arrows in the figure, and the search in the axial direction is performed first, and then the search in the diagonal direction is performed.
(3) When the current node is the second hop.
The candidate searching direction of the second jumping point comprises two types, one type is the original searching direction of the second jumping point, and the other type is the axial direction of the middle jumping point.
As shown in fig. 11, a node y is a first hop point, a black node is a blocking node, a node f1 is a middle hop point of the node y, a solid arrow is an original search direction of the searched node y, and a dotted arrow is an axial direction of the node f 1. At this time, if the node y becomes the current node, the search direction includes two directions indicated by a solid arrow and a dotted arrow in the figure, and the search in the axial direction is performed first, and then the search in the diagonal direction is performed.
Step 306: a parent node of the hop is determined.
Illustratively, the parent node comprises a corner node before the hop in the routing path.
The parent node is the previous corner node to reach the hop point. For example, the routing path sequentially passes through a node a, a node b, and a node c, and none of the nodes is one of the start node and the end node. The direction in which the node a reaches the node b is the horizontal direction to the right, and the direction in which the node b advances to the next node c is the vertical direction to the upper side. Wherein node b is a hop and node a is a parent node of node b.
Illustratively, adding a hop to the first set of nodes, either simultaneously with or after determining the parent node of the hop, is equivalent to updating the first set of nodes so that the hop becomes one of the nodes to be searched.
Step 308: after the end node of the routing path is searched, the parent node is traced back hop by hop from the end node to generate the routing path.
According to the above, the father node is the corner node before the jump point in the route searching path, and the route searching path can be obtained by connecting the father node. Specifically, after the end node is searched, the back tracing is performed from the end node until the start node is found, and a connection line traced back from the end node to the start node is the routing path.
In the coordinate system of the regular hexagonal grid map, it is considered that a moving object moves in the axial direction and cannot move in the diagonal direction, and therefore, an intermediate point needs to be inserted between two diagonal nodes. Wherein the intermediate point is a neighbor node adjacent to both diagonal nodes. As shown in fig. 6, node a and node B are diagonal nodes, and if a moving object needs to move from node a to node B, one of node (+ 1, 0, -1) and node (+ 1, -1, 0) needs to be added to the routing path. At this time, the node information of the formed routing path includes node a, node (+ 1, 0, -1), node B, or includes node a, node (+ 1, -1, 0), node B.
Illustratively, the way-finding method provided by the embodiment of the present application may be used in any regular hexagonal grid map, including but not limited to at least one of the following maps: a game map and a walking map of the intelligent machine.
In the grid map, the obstacle information stored in each node also changes for different moving objects, that is, different blocking nodes exist for different moving objects. For example, a certain obstacle exists on the grid map, and the following information is stored in a node where the obstacle exists: the node is a node where the obstacle is located for the first moving object, and is not a node where the obstacle is located for the second moving object. The path searching method provided by the embodiment of the application can perform real-time updating and dynamic judgment according to the dynamic change of the blocking node so as to support the requirement of a moving object on the dynamic change of the blocking node. Specifically, after one path searching is finished, the server updates the dynamic change of the blocking node in real time, and then performs the next path searching.
In summary, in the map routing method provided in the embodiment of the present application, the jumping points are searched along at least one of the axial direction or the diagonal direction of the regular hexagon, the parent node of each jumping point is determined based on the searched jumping points and the current node, and one or more parent nodes are traced back hop by hop from the terminating node to generate the routing path. In the path searching method, the optimal path searching path can be generated by determining the corner nodes in the path searching path, the number of nodes required to be searched in the path searching process is reduced, the path searching is not required to be carried out on all the nodes, and therefore the speed of the path searching is increased.
In the way finding search, the candidate search direction of the current node includes at least one of an axial direction or a diagonal direction of a regular hexagon, and the obtained skip points are different in different candidate search directions, which will be specifically explained below for different candidate search directions.
As shown schematically in fig. 12, a map routing method provided in an embodiment of the present application includes the following steps.
Step 402: and determining the current node according to the weight value of the node to be searched.
Illustratively, the weight value of the node to be searched is the sum of the length of the path from the starting node to the node to be searched and the length of the predicted path from the node to be searched to the ending node. That is, the weight value of the node to be searched is the sum of two path lengths, where the two path lengths are the length of the path from the start node to the node to be searched and the estimated path from the node to be searched to the end node, respectively. The estimated path is an estimated cost of the node to be searched for reaching the terminating node, and may be a straight path of two nodes, or an estimated path calculated based on a correlation function, and the estimated path is calculated by using a heuristic function as an example below.
Illustratively, the node with the smallest weight value is set as the current node.
Specifically, the weight value of the node n can be regarded as f (n) = g (n) + h (n). Illustratively, g (n) is the length of the path from the start node to the node n, and h (n) is the predicted path from the node n to the end node.
In the coordinate system of the regular hexagonal grid map, the length of a path is regarded as the sum of distances from nodes to nodes, the distance from one node to a neighbor node is 1, and the distance from one node to a diagonal node is 2. Schematically, as shown in fig. 7, the distance from the node p to the neighbor node x is 1, and the distance from the node p to the diagonal node n is 2.
Where g (n) is the distance traveled by the start node to reach node n. For example, the starting node reaches the node n through a plurality of nodes, where g (n) corresponds to the sum of the distances between every two nodes.
h (n) is the distance that node n may travel to reach the terminating node, referred to as the expected cost of node n to reach the terminating node, and may be calculated using a heuristic function. Assuming that the coordinate value of the node n is (x 1, y1, z 1) and the coordinate value of the end node is (x 2, y2, z 2), the following equation can be obtained according to the heuristic function:
g(n)= (abs(x2-x1) + abs(y2-y1)+abs(z2-z1))/2 ,
wherein the abs (i) function is an absolute value function.
For example, if the coordinate value of node n is (1, 2, -3) and the coordinate value of the terminating node is (0, -3, 3), g (n) = (abs (0-1) + abs ((-3) -2) + abs (3- (-3)))/2 is calculated, and g (n) has a value of 6.
Step 403: and searching along the candidate searching direction of the current node to obtain the jumping point in the candidate searching direction.
The jumping point is a candidate corner node in the path-finding path, and the corner node is a node with a changed path advancing direction.
For illustration, reference may be made to the content in step 304 for describing candidate search directions, skip points, and corner nodes, which are not described herein again.
The resulting hop points are also different due to different candidate search directions.
When the candidate search direction includes the axis direction, performing step 4041; when the candidate search direction includes a diagonal direction, step 4042 is performed. Illustratively, steps 4041 and 4042 may be performed in only one or both steps. Optionally, in the case that both steps are performed, step 4041 is performed first, and then step 4042 is performed.
Two types of candidate search directions, i.e., the axial direction and the diagonal direction, will be described below.
Firstly, the candidate searching direction of the current node comprises an axial direction.
Step 4041: and searching along the axis direction of the current node to obtain a first jumping point.
Illustratively, the first hop point is a node having a forced neighbor, the forced neighbor is a node adjacent to the first hop point and the blocking node, the forced neighbor is located in front of the axis direction, and the blocking node is a node where the obstacle is located.
After the first hop is searched, the way search in the search direction is ended. For example, after the node a searches for the first hop in the rightward axial direction, the node a will not continue to perform the route search in the rightward axial direction any more, and the search direction is determined according to the next current node.
According to the foregoing, the first hop is a corner node that may exist in the routing path. Therefore, the first hop needs to be set as one of the nodes to be searched for performing the route search, and at this time, it is necessary to determine whether the first hop is one of the nodes to be searched for, which may also be considered as whether the first hop exists in the first node set. According to the judgment result, the following two optional execution steps are provided.
Step 405: in response to the first hop not being one of the nodes to be searched, the current node is determined to be a parent node of the first hop.
For example, a first hop point is searched in the rightward axis direction of the node a, the first hop point does not exist in the first node set, the node a is determined as a parent node of the first hop point, and the first hop point is added into the first node set.
Step 406: in response to the first hop being one of the nodes to be searched, a parent node of the first hop is determined from the first path and the second path.
Illustratively, the first path is a path in which a start node of the path finding path reaches the first hop point through the current node, and the second path is a path in which the start node reaches the first hop point without passing through the current node.
At this time, the parent node of the first hop point is different according to the difference between the lengths of the first path and the second path, and specifically, step 406 has the following two optional implementation manners.
In response to the length of the first path being less than the length of the second path, determining a corner node before the first hop as a parent node of the first hop;
and in response to the length of the first path not being less than the length of the second path, determining the current node as a parent node of the first hop.
When the moving object moves in the grid map, the longer the path is, the more nodes are walked. In order to obtain an optimal path-finding path, a path with a longer forwarding route should be selected; if the lengths of the multiple paths are the same, paths with fewer corner nodes should be selected, and other paths may be used as alternative paths. In the embodiment of the application, if the lengths of the two paths are the same, the path passing through the current node is preferred, so that multiple routing searches for other paths are reduced.
Accordingly, after the first hop point is searched, if the length of the first path is shorter, which is equivalent to the length of the path from the start node to the first hop point through the current node is shorter, and since the first hop point is located in the first node set, the corner node before the first hop point can be found. Therefore, the corner node preceding the first hop is determined as the parent node. If the length of the first path is long, which is equivalent to the length of the path from the start node to the first hop point through the current node, a shorter path length can be obtained through the current node. Thus, the current node is determined to be the parent node of the first hop.
For example, a first hop point is searched in the rightward axis direction of the node a, the node a is included in the first node set, and the following is calculated: and the length of the path from the starting node to the first hop point through the node a is 7, and the length of the path from the starting node to the first hop point through the node a is 5, so that the node a is determined as the father node of the first hop point.
When the candidate search direction of the current node is the axis direction, since the grid map is bounded, after each node is successively searched in the axis direction, if the first jumping point cannot be found, it is equivalent to that there is no first jumping point in the axis direction. As shown schematically in fig. 7, a way search is performed in the rightward direction from the current node p, and it can be seen that the first hop point cannot be found in the direction. At this time, the seek search in the axis direction is ended. Accordingly, the map way-finding method provided by the embodiment of the application further comprises the following steps.
Step 407: in the case that the first hop point is not searched, another node to be searched is acquired as the current node, and the execution is started from step 403 again.
Equivalently, searching along the candidate searching direction of another node to be searched to obtain the jumping point in the candidate searching direction. Illustratively, the node to be searched is obtained from the first set of nodes. At this time, the candidate search direction of another node to be searched may be an axial direction or a diagonal direction, and when the candidate search direction includes both the axial direction and the diagonal direction, the way search in the axial direction is performed first, and then the way search in the diagonal direction is performed.
Illustratively, step 405, step 406 and step 407 can be executed only in one place, and not simultaneously.
And secondly, the candidate searching direction of the current node comprises a diagonal direction.
Step 4042: and searching along the diagonal direction of the current node to obtain a second jumping point.
Illustratively, the second hop point is a node having a middle hop point, the middle hop point is a node having a forced neighbor searched in any one of two axis directions adjacent to the second hop point in a diagonal direction, the forced neighbor is a node adjacent to both the middle hop point and the blocking node, the forced neighbor is located in front of the current search direction, and the blocking node is a node where the obstacle is located.
When the candidate search direction of the current node is a diagonal direction, since the moving object cannot move in the diagonal direction, in the route searching method provided in the embodiment of the present application, the search in the diagonal direction is divided into searches in two axis directions.
Illustratively, the step "search in the diagonal direction of the current node" has the following implementation: and respectively searching along two axis directions adjacent to the diagonal direction of the current node. As shown in fig. 8, the candidate search direction of the node y is an upper right diagonal direction, and during the way-finding search, the upper right diagonal direction is divided into two axis directions, namely a d1 direction and a d2 direction, which are adjacent to the upper right diagonal direction.
After the second skip point is searched, the way search in the search direction is ended. For example, after the node a searches for the second hop in the diagonal direction to the right, the node a will not continue to perform the route search in the diagonal direction to the right, and the search direction is determined according to the next current node.
According to the foregoing, the second hop is a corner node that may exist in the seek path. Therefore, the second hop needs to be set as one of the nodes to be searched for performing the way finding search, at this time, it needs to be determined whether the second hop exists in the first node set, and according to the determination result, the following optional execution steps are provided.
Step 408: in response to the second hop not being one of the nodes to be searched, the current node is determined to be a parent node of the second hop.
For example, a second hop point is searched in a diagonal direction of the node a to the right, the second hop point does not exist in the first node set, the node a is determined as a parent node of the second hop point, and the second hop point is added into the first node set.
Step 409: and in response to the second hop being one of the nodes to be searched, determining a parent node of the second hop according to the third path and the fourth path.
Illustratively, the third path is a path in which the start node of the seek path reaches the second hop point through the current node, and the fourth path is a path in which the start node reaches the second hop point without passing through the current node.
At this time, the parent node of the second hop point is different according to the difference between the lengths of the third path and the fourth path, and specifically, step 409 has the following two optional implementations.
In response to the length of the third path being less than the length of the fourth path, determining a corner node before the second hop as a parent node of the second hop;
and in response to the length of the third path not being less than the length of the fourth path, determining the current node as a parent node of the second hop.
Similar to the explanation of the first hop point, after the second hop point is searched, if the length of the third path is shorter, the length of the path from the start node to the second hop point through the current node is equivalent to shorter, and since the second hop point is located in the first node set, the corner node before the second hop point can be found. Therefore, the corner node preceding the second hop is determined as the parent node. If the length of the third path is long, which is equivalent to the length of the path from the starting node to the second hop point through the current node, the shorter path length can be obtained through the current node. Thus, the current node is determined to be the parent node of the second hop.
For example, a second hop point is searched in a diagonal direction of a node a to the right, the node a is included in the first node set, and the following is calculated: and the length of the path from the starting node to the second hop point through the node a is 5, and the length of the path from the starting node to the second hop point without the node a is 7, and then the previous corner node reaching the second hop point is determined as the father node of the second hop point.
Similar to the case where the candidate search direction of the current node is the axis direction, since the grid map is bounded, after each node is successively searched in the diagonal direction, if the second jumping point cannot be found, it is equivalent to that there is no second jumping point in the diagonal direction of the current node, and at this time, the path search of the current node in the diagonal direction is ended. Accordingly, the map way-finding method provided by the embodiment of the application further includes two optional execution steps, namely step 410 and step 411.
Step 410: in the case that the second hop is not searched, the diagonal node of the current node is updated to a new current node, and the process is started again from step 4042.
The diagonal node is a node of which the original current node moves by one grid in the diagonal direction. Equivalently, the node which is performing the way searching is moved to the diagonal direction by one grid to obtain the diagonal node of the node which is performing the way searching, and the searching is performed again along the diagonal direction of the diagonal node. As shown in fig. 8, a node p is a current node, a direction of a bold arrow is a search direction, the node p does not search for a second hop in a diagonal direction on the upper right, and at this time, the node p moves by one lattice in the diagonal direction on the upper right to obtain a node y, and starting from the node y, the search is performed again in the diagonal direction on the upper right.
Since the current node moves one frame in the diagonal direction, the diagonal node may not be found, or the diagonal node is a blocking node. Illustratively, the way searching method provided by the embodiment of the present application further includes the following steps.
In the case where the diagonal node does not exist or the diagonal node is a blocking node, another node to be searched for is acquired as the current node, and execution is resumed from step 403. Illustratively, the node to be searched is obtained from the first set of nodes.
Step 411: in the case that the second skip point is not searched, another node to be searched is acquired as the current node, and the execution is started from step 403 again.
Equivalently, searching is carried out along the candidate searching direction of another node to be searched in the first node set, and jumping points in the candidate searching direction are obtained. Illustratively, the node to be searched is obtained from the first set of nodes. At this time, the candidate search direction of another node to be searched may be a diagonal direction or a diagonal direction, and when the diagonal direction and the diagonal direction are included at the same time, the way search in the diagonal direction is performed first, and then the way search in the diagonal direction is performed.
Illustratively, step 408, step 409, step 410 and step 411 can be executed only in one place, and cannot be executed simultaneously.
Step 412: after the end node of the routing path is searched, the parent node is traced back hop by hop from the end node to generate the routing path.
Since the candidate search direction of the way finding search tends to the position of the termination node, no matter whether the search direction is an axial direction or a diagonal direction, when the termination node is searched, the way finding ends, and the way finding path is generated by tracing back one or more parent nodes from the termination node.
Illustratively, step 412 is the same as step 308, and reference may be made thereto, which is not described herein again.
In summary, according to the difference of the candidate search directions of the current node, the embodiments of the present application provide a method for determining a parent node of multiple hop points, so that the parent node is determined to tend to be an optimal selection, and thus the generated routing path can become an optimal path.
Fig. 13 is a flowchart of another method of the map route finding method provided in the embodiment of the present application, which may be used in a Massive Multiplayer Online Game (MMO) and a strategy Game (SLG) that use a regular hexagonal grid map as a scene to increase a route finding speed in a map in such a Game, so as to quickly and accurately provide a moving path from a start node to an end node for a player. Taking the example that the current node is included in the first node set, the map routing method provided by the embodiment of the application includes the following steps.
Step 501: and adding the starting node into the first node set and setting a candidate search direction.
The starting node is a node where the starting point is located, and the candidate search directions of the starting node include six axis directions and six diagonal directions.
Step 502: and judging whether the first node set is empty or not.
The first node set is empty, which is equivalent to no node to be searched; the first set of nodes is not empty, which corresponds to the presence of at least one node to be searched. Under the condition that the first node set is empty, the path finding is finished; in case the first set of nodes is not empty, step 503 is performed.
Step 503: and under the condition that the first node set is not empty, determining the current node according to the weight value of the node.
For example, the content of step 402 can be referred to for determining the current node, and details thereof are not repeated here.
Step 504: and judging whether the current node is a termination node or not.
Step 505: and in the case that the current node is a termination node, generating a routing path according to the parent node and the termination node.
Step 506: and in the case that the current node is not the termination node, performing the way searching along the candidate searching direction of the current node.
When the candidate search direction of the current node includes both an axial direction and a diagonal direction, the candidate search direction is first searched in the axial direction and then in the diagonal direction. No matter in which direction the search is carried out, the way searching in the direction is ended when a jump point is searched, or a boundary or a blocking node is encountered, and the way searching is continued in other directions.
Step 507: and searching along the axial direction of the current node.
Step 508: and judging whether the first jumping point is searched.
Illustratively, in case the first skip point is searched, step 509 is executed; in the case where the first skip point is not searched, step 502 is performed.
Step 509: and in the case that the first jumping point is searched, setting the first jumping point or the second jumping point as a new jumping point.
Step 510: the search is performed in a diagonal direction of the current node.
Step 511: and judging whether a second jumping point is searched.
Illustratively, in case that the second skip point is searched, step 509 is executed; in the case that the second skip point is not searched, step 512 is executed.
Step 512: and under the condition that the second jumping point is not searched, determining the diagonal node as the current node until the diagonal node does not exist or the diagonal node is a blocking node.
Specifically, step 510 is performed when the diagonal node exists, and step 502 is performed when the diagonal node does not exist or the diagonal node is a blocking node.
Illustratively, the two groups formed by the steps 507 and 508, the steps 510, 511 and 512 may be executed only one, and may not be executed at the same time; if both sets of steps exist, step 507 and step 508 are executed first, and then step 510, step 511 and step 512 are executed.
Step 513: it is determined whether a new hop has been searched.
In case a new hop has been searched, step 502 is performed; in the case where the new hop has not been searched, step 514 is performed.
Step 514: it is determined whether the new hop is in the first set of nodes.
Step 515: and under the condition that the new hop point is not in the first node set, determining the current node as the parent node of the new hop point, and adding the new hop point into the first node set.
Step 516: and under the condition that the new hop point is in the first node set, determining a father node according to a path that the starting node passes or does not pass through the current node to reach the new hop point.
The specific method for determining the parent node in step 515 and step 516 may refer to the foregoing contents, and is not described herein again.
Illustratively, step 502 is re-executed after step 515 or step 516 is executed.
As schematically shown in fig. 14, the present application provides one exemplary embodiment of a way-finding method. The node 1 is a starting node, the node z is a terminating node, the black node is a blocking node, and the nodes filled by the dot matrix are searched nodes. According to the cubic coordinate system, the coordinate value of the node 1 is (-2, 1, 1), and the coordinate value of the node z is (3, -2, -1).
Accordingly, the way search of the way path from the node 1 to the node z includes the following steps.
First, node 1 is added to the first node set, and the candidate search directions for node 1 are set to six axis directions and six diagonal directions.
Step 1: and determining a current node, searching along the candidate searching direction of the node 1, and determining the searched jump point and the father node of the jump point.
At this time, only node 1 is in the first node set, and node 1 is set as the current node.
With reference to the first regular hexagonal grid in fig. 14, starting from node 1, a path search is performed along six axis directions, and node 2 and node 3 are obtained as first hop points; and then carrying out path searching along six diagonal directions, and not finding a second jumping point. According to the cubic coordinate system, the coordinate value of the node 2 is (-2, 0, 2), and the coordinate value of the node 3 is (1, 1, -2).
Neither node 2 nor node 3 is in the first set of nodes, and therefore, the current node is determined to be a parent node of nodes 2 and 3, and nodes 2 and 3 are added to the first set of nodes. That is, the parent nodes of hop 2 and hop 3 are both node 1.
Step 2: and re-determining the current node, searching along the candidate searching direction of the current node, and determining the searched jump point and the father node of the jump point.
At this time, there are node 2 and node 3 in the first node set, and according to the above, the weight value of node n can be obtained by the formula f (n) = g (n) + h (n). The calculation can obtain:
f(2)=1+ (abs(3-(-2)) + abs((-2)-0)+abs((-1)-2))/2=6,
f(3)=3+(abs(3-1) + abs((-2)-1)+abs((-1)-(-2)))/2=6。
and when the weight values of the two nodes are the same, the distance from the current node to the jump point is considered. That is, if f (n) is the same, the node having the larger value of g (n) is preferentially selected. From this, the node 3 is determined as a new current node.
In conjunction with the first and second regular hexagonal grids of fig. 14, the original search direction for node 3 is the upper right axial direction, and node 4 is a forced neighbor of node 3. When the node 3 becomes the current node, the search direction thereof includes the original search direction, the axial direction in which the forced neighbor is located, and the diagonal direction between the original search direction and the axial direction in which the forced neighbor is located. That is, the candidate search directions of the node 3 include: an axial direction to the upper right, an axial direction horizontally to the right, and a diagonal direction to the upper right.
Firstly, searching a path in the axial direction to obtain a node 4 as a first jumping point; and then path searching in the diagonal direction is carried out, and the second jumping point is not found. According to the cubic coordinate system, the coordinate values of the node 4 are (2, 0, -2).
Node 4 is not in the first set of nodes, and therefore node 4 is added to the first set of nodes with the current node being the parent of node 4. That is, the parent node of node 4 is node 3.
And step 3: and determining the current node again, searching along the candidate searching direction of the current node, and determining the searched jump point and the father node of the jump point.
At this time, there are node 2 and node 4 in the first node set, and according to the above, the weight value of node n can be obtained by the formula f (n) = g (n) + h (n). The calculation can obtain:
f(2)=1+ (abs(3-(-2)) + abs((-2)-0)+abs((-1)-2))/2=6,
f(4)=4+(abs(3-2) + abs((-2)-0)+abs((-1)-(-2)))/2=6。
and when the weight values of the two nodes are the same, the distance from the current node to the jump point is considered. That is, if f (n) is the same, the node having the larger value of g (n) is preferentially selected. From this, the node 4 is determined as the new current node.
Combining the second and third regular hexagonal grids in fig. 14, the original search direction of node 4 is the horizontal rightward axis direction, and node 5 is the forced neighbor of node 4. When the node 4 becomes the current node, the search direction thereof includes the original search direction, the axial direction in which the forced neighbor is located, and the diagonal direction between the original search direction and the axial direction in which the forced neighbor is located. That is, the candidate search directions of the node 4 include: horizontal right axial direction, right down axial direction, and right down diagonal direction.
Firstly, searching a path in the axial direction to obtain a node 6 as a first jumping point; and then, path searching in the diagonal direction is carried out, and the node z as a second jumping point can be obtained. Node 6 and node z are not in the first set of nodes, and therefore the current node is taken as the parent node for node 6 and node z. That is, the parent node of node 6 and node z is node 4.
At this time, since the searched hop includes the terminating node z, the node information of the routing path may be generated from the determined plurality of parent nodes including the node 1, the node 3, and the node 4 and the terminating node (i.e., the node z). The distance from the node 1 to the node 3 is 3, the distance from the node 3 to the node 4 is 1, and the distance from the node 4 to the node z is 2, then the distance from the node 1 to the node z is 6, and it can be considered that the length of the routing path is 6.
Since node 4 and node z are diagonal nodes, an intermediate point needs to be inserted between the two diagonal nodes. Schematically shown in fig. 15, two neighboring nodes that are adjacent to each other in common to the node 4 and the node z are the node 5 and the node 7, respectively. At this time, the following two seek paths may be generated.
The thick lines shown in fig. 15 (a) are the first seek paths: the moving object starts from node 1 and reaches node z via node 3, node 4 and node 7.
The thick lines shown in fig. 15 (b) are the second seek path: the moving object starts from node 1 and reaches node z via node 3, node 4 and node 5.
In summary, the embodiments of the present application provide a map way-finding method, which generates an optimal path of a way-finding path by jumping back to a parent node from a terminating node one by one, reduces the number of nodes to be searched in a way-finding search process, and improves the speed of way-finding search.
In the following, embodiments of the apparatus of the present application are referred to, and for details not described in detail in the embodiments of the apparatus, the above-described embodiments of the method can be referred to.
FIG. 16 is a block diagram of a map routing apparatus provided in an embodiment of the present application, which includes a determination module 1620, a search module 1640, and a generation module 1660;
a determining module 1620, configured to determine a current node to be searched in the map;
the search module 1640 is configured to search along a candidate search direction of a current node to obtain a hop in the candidate search direction, where the hop is a candidate corner node in a route finding path, and the corner node is a node whose path forwarding direction changes;
the determining module 1620 is further configured to determine a parent node of the hop, where the parent node includes a corner node before the hop in the routing path;
a generating module 1660, configured to, after searching for the terminating node of the routing path, jump back to the parent node from the terminating node to generate the routing path.
In one possible implementation of the present application, the search module 1640 is to: searching along the axial direction of the current node to obtain a first jumping point; the first jumping point is a node with a forced neighbor, the forced neighbor is a node adjacent to the first jumping point and the blocking node, the forced neighbor is located in front of the axis direction, and the blocking node is a node where the obstacle is located.
In a possible implementation manner of the present application, the determining module 1620 is configured to: in response to the first hop not being one of the nodes to be searched, the current node is determined to be a parent node of the first hop.
In a possible implementation manner of the present application, the determining module 1620 is configured to: in response to the first hop being one of the nodes to be searched, determining a parent node of the first hop according to the first path and the second path; the first path is a path from the start node of the path finding path to the first hop point through the current node, and the second path is a path from the start node to the first hop point through the current node.
In a possible implementation manner of the present application, the determining module 1620 is configured to: and in response to the length of the first path being less than the length of the second path, determining a corner node before the first hop as a parent node of the first hop.
In a possible implementation manner of the present application, the determining module 1620 is configured to: and in response to the length of the first path not being less than the length of the second path, determining the current node as a parent node of the first hop.
In one possible implementation of the present application, the search module 1640 is further configured to: and under the condition that the first jumping point is not searched, acquiring another node to be searched as the current node, searching along the candidate searching direction of the current node again, and starting to execute the step of obtaining the jumping point in the candidate searching direction.
In one possible implementation of the present application, the search module 1640 is to: searching along the diagonal direction of the current node to obtain a second jumping point; the second jumping point is a node with a middle jumping point, the middle jumping point is a node which is searched in any one direction of two axis directions adjacent to the diagonal direction of the second jumping point and is provided with a forced neighbor, the forced neighbor is a node which is adjacent to the middle jumping point and a blocking node together, the forced neighbor is located in front of the current searching direction, and the blocking node is a node where an obstacle is located.
In a possible implementation manner of the present application, the determining module 1620 is configured to: in response to the second hop not being one of the nodes to be searched, the current node is determined to be a parent node of the second hop.
In a possible implementation manner of the present application, the determining module 1620 is configured to: in response to the second hop being one of the nodes to be searched, determining a parent node of the second hop according to the third path and the fourth path; the third path is a path from the start node of the path finding path to the second hop point through the current node, and the fourth path is a path from the start node to the second hop point through the current node.
In a possible implementation manner of the present application, the determining module 1620 is configured to: and in response to the length of the third path being less than the length of the fourth path, determining a corner node before the second hop as a parent node of the second hop.
In a possible implementation manner of the present application, the determining module 1620 is configured to: and in response to the length of the third path not being less than the length of the fourth path, determining the current node as a parent node of the second hop.
In one possible implementation of the present application, the search module 1640 is further configured to: and under the condition that the second skip point is not searched, updating the diagonal node of the current node into a new current node, and searching along the diagonal direction of the current node again to obtain the second skip point, wherein the diagonal node is a node of which the original current node moves by one grid in the diagonal direction.
In one possible implementation of the present application, the search module 1640 is further configured to: and under the condition that the second jumping point is not searched, acquiring another node to be searched as the current node, and searching along the candidate searching direction of the current node again to obtain the jumping point in the candidate searching direction.
In a possible implementation manner of the present application, the determining module 1620 is configured to: and determining the current node according to the weight value of the node to be searched, wherein the weight value of the node to be searched is the sum of the length of the path from the starting node to the node to be searched and the length of the estimated path from the node to be searched to the ending node.
Fig. 17 shows a block diagram of a terminal 20000 according to an exemplary embodiment of the present application. The terminal 2000 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. Terminal 2000 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, and the like.
In general, terminal 2000 includes: a processor 2001 and a memory 2002.
The processor 2001 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so on. The processor 2001 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 2001 may also include a main processor and a coprocessor, the main processor being a processor for Processing data in an awake state, also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 2001 may be integrated with a GPU (Graphics Processing Unit) that is responsible for rendering and drawing the content that the display screen needs to display. In some embodiments, the processor 2001 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
The memory 2002 may include one or more computer-readable storage media, which may be non-transitory. The memory 2002 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 2002 is used to store at least one instruction for execution by processor 2001 to implement the control method for virtual characters provided by method embodiments herein.
In some embodiments, terminal 2000 may further optionally include: a peripheral interface 2003 and at least one peripheral. The processor 2001, memory 2002 and peripheral interface 2003 may be connected by buses or signal lines. Various peripheral devices may be connected to peripheral interface 2003 through a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 2004, touch display 2005, camera assembly 2006, audio circuitry 2007, positioning assembly 2008, and power supply 2009.
The peripheral interface 2003 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 2001 and the memory 2002. In some embodiments, the processor 2001, memory 2002 and peripheral interface 2003 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 2001, the memory 2002, and the peripheral interface 2003 may be implemented on separate chips or circuit boards, which are not limited in this embodiment.
The Radio Frequency circuit 2004 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuit 2004 communicates with a communication network and other communication devices via electromagnetic signals. The radio frequency circuit 2004 converts an electric signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electric signal. Optionally, the radio frequency circuit 2004 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuit 2004 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the rf circuit 2004 may further include NFC (Near Field Communication) related circuits, which are not limited in this application.
The touch display screen 2005 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. The touch display screen 2005 also has the ability to capture touch signals at or above the surface of the touch display screen 2005. The touch signal may be input to the processor 2001 as a control signal for processing. At this point, the touch display 2005 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the touch display screen 2005 can be one, providing the front panel of the terminal 2000; in other embodiments, the touch display screens 2005 can be at least two, respectively disposed on different surfaces of the terminal 2000 or in a folded design; in still other embodiments, touch display 2005 may be a flexible display disposed on a curved surface or on a folded surface of terminal 2000. Even more, the touch display screen 2005 can be arranged in a non-rectangular irregular figure, i.e., a shaped screen. The touch Display screen 2005 can be made of a material such as an LCD (Liquid Crystal Display), an OLED (Organic Light-Emitting Diode), and the like.
Camera assembly 2006 is used to capture images or video. Optionally, camera assembly 2006 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each of the rear cameras is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and a VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, camera assembly 2006 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The audio circuitry 2007 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 2001 for processing or inputting the electric signals to the radio frequency circuit 2004 so as to realize voice communication. For the purpose of stereo sound collection or noise reduction, a plurality of microphones may be provided at different positions of the terminal 2000. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 2001 or the radio frequency circuit 2004 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, the audio circuitry 2007 may also include a headphone jack.
The positioning component 2008 is configured to locate a current geographic Location of the terminal 2000 to implement navigation or LBS (Location Based Service). The Positioning component 2008 may be a Positioning component based on a Global Positioning System (GPS) in the united states, a beidou System in china, or a galileo System in russia.
Power supply 2009 is used to power the various components in terminal 2000. The power supply 2009 may be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 2009 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 2000 also includes one or more sensors 2010. The one or more sensors 2010 include, but are not limited to: acceleration sensor 2011, gyro sensor 2012, pressure sensor 2013, fingerprint sensor 2014, optical sensor 2015, and proximity sensor 2016.
The acceleration sensor 2011 can detect the magnitude of acceleration on three coordinate axes of the coordinate system established with the terminal 2000. For example, the acceleration sensor 2011 may be used to detect components of the gravitational acceleration in three coordinate axes. The processor 2001 may control the touch display screen 2005 to display a user interface in a landscape view or a portrait view according to the gravitational acceleration signal acquired by the acceleration sensor 2011. The acceleration sensor 2011 may also be used for acquisition of motion data of a game or a user.
The gyroscope sensor 2012 can detect the body direction and the rotation angle of the terminal 2000, and the gyroscope sensor 2012 and the acceleration sensor 2011 can cooperate to acquire the 3D motion of the user on the terminal 2000. The processor 2001 may implement the following functions according to the data collected by the gyro sensor 2012: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensors 2013 may be disposed on the side bezel of terminal 2000 and/or underlying touch screen display 2005. When the pressure sensor 2013 is disposed on the side frame of the terminal 2000, the holding signal of the user to the terminal 2000 can be detected, and the processor 2001 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 2013. When the pressure sensor 2013 is disposed at a lower layer of the touch display screen 2005, the processor 2001 controls the operability control on the UI interface according to the pressure operation of the user on the touch display screen 2005. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 2014 is used for collecting fingerprints of the user, and the processor 2001 identifies the identity of the user according to the fingerprints collected by the fingerprint sensor 2014, or the fingerprint sensor 2014 identifies the identity of the user according to the collected fingerprints. Upon identifying that the user's identity is a trusted identity, the processor 2001 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying for and changing settings, etc. The fingerprint sensor 2014 may be disposed on the front, back, or side of the terminal 2000. When a physical key or vendor Logo is provided on the terminal 2000, the fingerprint sensor 2014 may be integrated with the physical key or vendor Logo.
The optical sensor 2015 is used to collect ambient light intensity. In one embodiment, the processor 2001 may control the display brightness of the touch display 2005 according to the ambient light intensity collected by the optical sensor 2015. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 2005 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 2005 is turned down. In another embodiment, the processor 2001 may also dynamically adjust the shooting parameters of the camera assembly 2006 according to the ambient light intensity collected by the optical sensor 2015.
The proximity sensor 2016, also known as a distance sensor, is typically disposed on a front panel of the terminal 2000. The proximity sensor 2016 is used to collect a distance between a user and a front surface of the terminal 2000. In one embodiment, the touch display 2005 is controlled by the processor 2001 to switch from a bright screen state to a dark screen state when the proximity sensor 2016 detects that the distance between the user and the front surface of the terminal 2000 is gradually reduced; when the proximity sensor 2016 detects that the distance between the user and the front surface of the terminal 2000 is gradually increasing, the touch display 2005 is controlled by the processor 2001 to switch from a rest screen state to a bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 17 is not intended to be limiting of terminal 2000 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
The application also provides a computer device, which comprises a processor and a memory, wherein at least one program code is stored in the memory, and the program code is loaded by the processor and executed to realize the map routing method.
The present application also provides a computer-readable storage medium having at least one program code stored therein, the program code being loaded and executed by a processor to implement the map routing method as above.
The present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to execute the map routing method provided in the above-mentioned alternative implementation.
It should be understood that reference to "a plurality" herein means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the present application and should not be taken as limiting, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (13)

1. A map way-finding method is applied to a regular hexagonal grid map, wherein moving objects in the regular hexagonal grid map move along the axis direction of regular hexagons, and the method comprises the following steps:
determining a current node to be searched in a map;
searching along the candidate searching direction of the current node to obtain a jumping point in the candidate searching direction, wherein the jumping point is a candidate corner node in a path-finding path, and the corner node is a node with a changed path advancing direction;
determining a father node of the jump point, wherein the father node comprises a corner node before the jump point is reached in the routing path;
after a terminal node of the routing path is searched, the parent node is traced back hop by hop from the terminal node to generate the routing path;
the searching along the candidate searching direction of the current node to obtain the jumping point in the candidate searching direction includes: searching along the diagonal direction of the current node to obtain a second jump point, wherein the second jump point is a node with a middle jump point, the middle jump point is a node which is searched in any one direction of two axis directions adjacent to the diagonal direction of the second jump point and is provided with a forced neighbor, the forced neighbor is a node which is adjacent to the middle jump point and a blocking node together, the forced neighbor is positioned in front of the current searching direction, and the blocking node is a node where an obstacle is positioned;
the method further comprises the following steps: in the case that two adjacent parent nodes are diagonal nodes, adding an intermediate point to form a path of the two parent nodes, wherein the intermediate point is a neighbor node adjacent to both the two parent nodes, the diagonal node is used for indicating a node that one node moves by one grid in a diagonal direction, and the neighbor node is used for indicating a node that shares one edge with one node.
2. The method of claim 1,
the searching along the candidate searching direction of the current node to obtain the jumping point in the candidate searching direction includes:
searching along the axial direction of the current node to obtain a first jumping point;
the first jumping point is a node with a forced neighbor, the forced neighbor is a node adjacent to the first jumping point and a blocking node, the forced neighbor is located in front of the axis direction, and the blocking node is a node where an obstacle is located.
3. The method of claim 2, wherein the determining the parent node of the hop comprises:
determining the current node as a parent node of the first hop in response to the first hop not being one of the nodes to be searched.
4. The method of claim 2, wherein the determining the parent node of the hop comprises:
in response to the first hop being one of the nodes to be searched, determining a parent node of the first hop according to a first path and a second path;
wherein the first path is a path from a start node of the seek path to the first hop point via the current node, and the second path is a path from the start node to the first hop point without passing through the current node.
5. The method of claim 2, further comprising:
and under the condition that the first jumping point is not searched, acquiring another node to be searched as the current node, searching from the candidate searching direction of the current node again, and starting to execute the step of obtaining the jumping point in the candidate searching direction.
6. The method of claim 1, wherein the determining the parent node of the hop comprises:
determining the current node as a parent node of the second hop in response to the second hop not being one of the nodes to be searched.
7. The method of claim 1, wherein the determining the parent node of the hop comprises:
in response to the second hop being one of the nodes to be searched, determining a parent node of the second hop according to a third path and a fourth path;
wherein the third path is a path from the start node of the seek path to the second hop point via the current node, and the fourth path is a path from the start node to the second hop point without passing through the current node.
8. The method of claim 1, further comprising:
and under the condition that the second skip point is not searched, updating the diagonal node of the current node to be a new current node, and searching along the diagonal direction of the current node again to obtain the second skip point, wherein the diagonal node is a node of which the current node moves by one grid in the diagonal direction.
9. The method of claim 1, further comprising:
and under the condition that the second jumping point is not searched, acquiring another node to be searched as the current node, searching from the candidate searching direction of the current node again, and starting to execute the step of obtaining the jumping point in the candidate searching direction.
10. The method according to any one of claims 1 to 9, wherein the determining a current node to be searched in the map comprises:
determining a current node according to the weight value of the node to be searched, wherein the weight value of the node to be searched is the sum of the length of a path from the starting node to the node to be searched and the length of an estimated path from the node to be searched to the ending node.
11. A map way-finding device, which is applied to a regular hexagonal grid map in which moving objects move in the axial direction of regular hexagons, the device comprising:
the determining module is used for determining a current node to be searched in the map;
the searching module is used for searching along the candidate searching direction of the current node to obtain a jumping point in the candidate searching direction, wherein the jumping point is a candidate corner node in a path-finding path, and the corner node is a node with a changed path advancing direction;
the determining module is further configured to determine a parent node of the hop, where the parent node includes a corner node before the route finding path reaches the hop;
the generating module is used for tracing back the father node from the termination node hop by hop to generate the routing path after the termination node of the routing path is searched;
the search module is configured to search in a diagonal direction of the current node to obtain a second hop point, where the second hop point is a node with a middle hop point, the middle hop point is a node with a forced neighbor searched in any one of two axis directions adjacent to the diagonal direction of the second hop point, the forced neighbor is a node where the middle hop point and a blocking node are adjacent to each other, the forced neighbor is located in front of the current search direction, and the blocking node is a node where an obstacle is located;
the generating module is configured to add an intermediate point to form a path of two parent nodes when the two adjacent parent nodes are diagonal nodes, where the intermediate point is a neighbor node adjacent to both the two parent nodes, the diagonal node is used to indicate a node where one node moves by one lattice in a diagonal direction, and the neighbor node is used to indicate a node that shares one edge with one node.
12. A computer device, characterized in that it comprises a processor and a memory, in which at least one program code is stored, which is loaded and executed by the processor to implement the map routing method according to any one of claims 1 to 10.
13. A computer-readable storage medium, having at least one program code stored therein, the program code being loaded and executed by a processor to implement the map routing method according to any one of claims 1 to 10.
CN202110321635.1A 2021-03-25 2021-03-25 Map way finding method, device, equipment and medium Active CN112699208B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110321635.1A CN112699208B (en) 2021-03-25 2021-03-25 Map way finding method, device, equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110321635.1A CN112699208B (en) 2021-03-25 2021-03-25 Map way finding method, device, equipment and medium

Publications (2)

Publication Number Publication Date
CN112699208A CN112699208A (en) 2021-04-23
CN112699208B true CN112699208B (en) 2021-06-25

Family

ID=75515708

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110321635.1A Active CN112699208B (en) 2021-03-25 2021-03-25 Map way finding method, device, equipment and medium

Country Status (1)

Country Link
CN (1) CN112699208B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116764225A (en) * 2023-06-09 2023-09-19 广州三七极梦网络技术有限公司 Efficient path-finding processing method, device, equipment and medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020443A (en) * 2012-12-08 2013-04-03 大连创达技术交易市场有限公司 Method for map training
CN103021258A (en) * 2012-12-08 2013-04-03 大连创达技术交易市场有限公司 Speed-optimized map way-finding algorithm
CN103198234A (en) * 2013-04-25 2013-07-10 腾讯科技(深圳)有限公司 Routing method and routing device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103020443A (en) * 2012-12-08 2013-04-03 大连创达技术交易市场有限公司 Method for map training
CN103021258A (en) * 2012-12-08 2013-04-03 大连创达技术交易市场有限公司 Speed-optimized map way-finding algorithm
CN103198234A (en) * 2013-04-25 2013-07-10 腾讯科技(深圳)有限公司 Routing method and routing device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
A* 寻路算法;KillerAery;《cnblog》;20180630;第1页 *
JPS/JPS+ 寻路算法;KillerAery;《cnblog》;20200627;第1页 *

Also Published As

Publication number Publication date
CN112699208A (en) 2021-04-23

Similar Documents

Publication Publication Date Title
US11565181B2 (en) Virtual object control method and apparatus, computer device, and storage medium
US11224810B2 (en) Method and terminal for displaying distance information in virtual scene
US11256384B2 (en) Method, apparatus and device for view switching of virtual environment, and storage medium
CN111589142B (en) Virtual object control method, device, equipment and medium
CN111414080B (en) Method, device and equipment for displaying position of virtual object and storage medium
CN111013142B (en) Interactive effect display method and device, computer equipment and storage medium
CN110141859B (en) Virtual object control method, device, terminal and storage medium
CN112494955B (en) Skill releasing method, device, terminal and storage medium for virtual object
CN111589130B (en) Virtual object control method, device, equipment and storage medium in virtual scene
CN108536295B (en) Object control method and device in virtual scene and computer equipment
CN111921197A (en) Method, device, terminal and storage medium for displaying game playback picture
CN111596838B (en) Service processing method and device, computer equipment and computer readable storage medium
TWI802978B (en) Method and apparatus for adjusting position of widget in application, device, and storage medium
CN112891931A (en) Virtual role selection method, device, equipment and storage medium
CN112121422A (en) Interface display method, device, equipment and storage medium
CN113058264A (en) Virtual scene display method, virtual scene processing method, device and equipment
CN111589141B (en) Virtual environment picture display method, device, equipment and medium
CN112169330B (en) Method, device, equipment and medium for displaying picture of virtual environment
CN111672102A (en) Virtual object control method, device, equipment and storage medium in virtual scene
CN110833695B (en) Service processing method, device, equipment and storage medium based on virtual scene
CN112915541B (en) Jumping point searching method, device, equipment and storage medium
CN112755517B (en) Virtual object control method, device, terminal and storage medium
CN114404972A (en) Method, device and equipment for displaying visual field picture
CN112274936B (en) Method, device, equipment and storage medium for supplementing sub-props of virtual props
CN112699208B (en) Map way finding method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40042456

Country of ref document: HK