Game path finding method and device, storage medium and computer equipment
Through preset waypoint planning and dynamic determination of the wayfinding method, combined with navigation mesh and voxel lattice methods, the problems of large performance overhead and poor roadfinding in the existing technology are solved, and flexible wayfinding and equipment of virtual characters in the game are realized Performance balance.
Patent Information
- Application Number
- CN202311607801.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-28
- Publication Date
- 2025-01-10
AI Technical Summary
The existing game pathfinding methods are difficult to find a balance between performance overhead and pathfinding effects, resulting in large equipment performance consumption and uncontrollable pathfinding, which cannot meet the player's experience needs.
By planning the pathfinding path through preset waypoints, splitting the long-distance pathfinding into multiple short distances, using air and ground waypoints for transit, combining navigation grids and voxel grid pathfinding methods, dynamically determine the wayfinding method to adapt to distance and obstacles to ensure controllability and flexibility of routes.
It reduces the overhead of equipment performance, improves the controllability and flexibility of pathfinding, ensures that virtual characters can find pathfinding in the game more flexibly, while avoiding obstacles, improving player experience.
Smart Images

Figure CN119280819A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of game pathfinding technology, and in particular to a game pathfinding method and device, a storage medium, and a computer device. Background Art
[0002] Pathfinding methods are widely used in games to generate paths that meet specific conditions. They are an important basis for controlling the movement of game characters. Commonly used pathfinding methods include waypoint pathfinding, voxel grid pathfinding, and navigation grid pathfinding. Waypoint pathfinding is a computationally simple method. Game characters plan paths according to pre-defined waypoints. The pathfinding path is relatively rigid, and obstacles on the path cannot be avoided, making the pathfinding effect difficult to guarantee. However, both voxel grid pathfinding and navigation grid pathfinding will cause a large performance overhead on the device, and the pathfinding path is uncontrollable. After players choose automatic pathfinding in the game, it is difficult to guarantee that players can experience the scenery on the specified route.
[0003] Currently, there is a lack of a pathfinding method that has a balanced performance cost and pathfinding effect. Summary of the invention
[0004] In view of this, the present application provides a game pathfinding method and device, storage medium, and computer equipment, which use preset waypoints to plan pathfinding points on the pathfinding path, which can ensure that the pathfinding route is roughly controllable. In addition, after determining multiple pathfinding points, the original complete longer distance pathfinding is divided into multiple shorter distance pathfinding segments, reducing the computing consumption of problems such as virtual characters being blocked by obstacles during pathfinding, thereby reducing device performance overhead.
[0005] According to one aspect of the present application, a game pathfinding method is provided, the method comprising:
[0006] In response to the virtual character's path-finding instruction, determining a starting point and a target point indicated by the path-finding instruction;
[0007] In the case where it is determined that the pathfinding mode corresponding to the pathfinding instruction is aerial pathfinding, based on the aerial pathpoints among the plurality of preset pathpoints, at least one waypoint for pathfinding from the starting point to the target point is determined in sequence, so as to form a plurality of pathfinding points starting from the starting point and sequentially passing through the waypoints and reaching the target point;
[0008] Starting from the first pathfinding point, a pathfinding path from each pathfinding point to the next pathfinding point is planned in sequence, and the virtual character is controlled to find the path along each pathfinding path in sequence.
[0009] Optionally, the preset waypoints include ground waypoints and aerial waypoints; after determining the starting point and the target point indicated by the pathfinding instruction, the method further includes:
[0010] Determine a path-finding mode corresponding to the path-finding instruction;
[0011] When the routing method is ground routing, at least one waypoint for routing from the starting point to the target point is determined in sequence among the ground waypoints.
[0012] Optionally, determining a pathfinding mode corresponding to the pathfinding instruction includes:
[0013] Obtaining a routing method indicated by the routing instruction; or,
[0014] When the distance between the starting point and the target point is less than a first preset distance, the path finding method is determined to be ground path finding; and when the distance between the starting point and the target point is greater than or equal to the first preset distance, the path finding method is determined to be aerial path finding.
[0015] Optionally, planning a path from each waypoint to the next waypoint in sequence includes:
[0016] When the waypoint and its corresponding next waypoint are both located on the ground, planning a path from the waypoint to the next waypoint by using a navigation grid pathfinding method;
[0017] In the case where at least one of the wayfinding point and its corresponding next wayfinding point is located in the air, a pathfinding path from the wayfinding point to the next wayfinding point is planned by a voxel grid pathfinding method.
[0018] Optionally, any ground waypoint has a ground jump point mark, wherein the ground jump point mark is used to indicate that an inaccessible position exists within a specific range corresponding to the corresponding ground waypoint; the method further includes:
[0019] In the case where the routing method is ground routing, if any waypoint determined among the ground waypoints has a ground jump point mark, the next waypoint corresponding to any waypoint is determined as the low-altitude flight waypoint corresponding to any waypoint.
[0020] Optionally, the aerial waypoints include low-altitude waypoints and high-altitude waypoints, and the aerial pathfinding includes low-altitude pathfinding and high-altitude pathfinding; when the distance between the starting point and the target point is greater than or equal to a first preset distance, determining that the pathfinding mode is aerial pathfinding includes:
[0021] When the distance between the starting point and the target point is greater than or equal to the first preset distance and less than the second preset distance, determining that the path finding method is low altitude path finding;
[0022] When the distance between the starting point and the target point is greater than a second preset distance, determining that the path finding method is high-altitude path finding;
[0023] Accordingly, when the path finding method is aerial path finding, determining in sequence at least one waypoint from the starting point to the target point in the aerial waypoints includes:
[0024] In the case where the path finding method is low-altitude path finding, at least one waypoint for path finding from the starting point to the target point is determined in sequence among the low-altitude waypoints;
[0025] In the case where the path finding method is high-altitude path finding, at least one waypoint for path finding from the starting point to the target point is determined in sequence among the high-altitude waypoints.
[0026] Optionally, the preset waypoint is marked with a corresponding waypoint attribute, and the waypoint attribute includes a non-skippable waypoint and a skippable waypoint; sequentially determining at least one waypoint for finding a path from the starting point to the target point includes:
[0027] In the case where any waypoint is located within a preset range corresponding to any non-skippable waypoint, the any non-skippable waypoint is determined as the next waypoint corresponding to the any waypoint.
[0028] According to another aspect of the present application, a game path-finding device is provided, the device comprising:
[0029] A target point determination module, for responding to a path-finding instruction of a virtual character and determining a starting point and a target point indicated by the path-finding instruction;
[0030] A waypoint determination module is used to determine, when it is determined that the wayfinding mode corresponding to the wayfinding instruction is aerial wayfinding, at least one waypoint for finding a path from the starting point to the target point in sequence based on the aerial waypoints among the plurality of preset waypoints, so as to form a plurality of waypoints starting from the starting point and sequentially passing through the waypoints and reaching the target point;
[0031] The pathfinding module is used to plan the pathfinding path from each pathfinding point to the next pathfinding point in sequence, starting from the first pathfinding point, and control the virtual character to find the path in sequence according to each pathfinding path.
[0032] Optionally, the preset waypoints include ground waypoints and aerial waypoints; and the waypoint determination module is used to:
[0033] After determining the starting point and the target point indicated by the path-finding instruction, determining a path-finding mode corresponding to the path-finding instruction;
[0034] In the case where the routing method is ground routing, at least one waypoint for routing from the starting point to the target point is determined in sequence among the ground waypoints.
[0035] Optionally, the waypoint determination module is used to:
[0036] Obtaining a routing method indicated by the routing instruction; or,
[0037] When the distance between the starting point and the target point is less than a first preset distance, the path finding method is determined to be ground path finding; and when the distance between the starting point and the target point is greater than or equal to the first preset distance, the path finding method is determined to be aerial path finding.
[0038] Optionally, the pathfinding module is used to:
[0039] In the case where the waypoint and its corresponding next waypoint are both located on the ground, planning a path from the waypoint to the next waypoint by using a navigation grid pathfinding method;
[0040] In the case where at least one of the wayfinding point and its corresponding next wayfinding point is located in the air, a pathfinding path from the wayfinding point to the next wayfinding point is planned by a voxel grid pathfinding method.
[0041] Optionally, any ground waypoint has a ground jump point mark, wherein the ground jump point mark is used to indicate that there is an inaccessible position within a specific range corresponding to the corresponding ground waypoint; the waypoint determination module is used to:
[0042] In the case where the routing method is ground routing, if any waypoint determined among the ground waypoints has a ground jump point mark, the next waypoint corresponding to any waypoint is determined as the low-altitude flight waypoint corresponding to any waypoint.
[0043] Optionally, the aerial waypoints include low-altitude waypoints and high-altitude waypoints, and the aerial pathfinding includes low-altitude pathfinding and high-altitude pathfinding; the pathfinding point determination module is used to:
[0044] When the distance between the starting point and the target point is greater than or equal to the first preset distance and less than the second preset distance, determining that the path finding method is low altitude path finding;
[0045] When the distance between the starting point and the target point is greater than a second preset distance, determining that the path finding method is high-altitude path finding;
[0046] In the case where the path finding method is low-altitude path finding, at least one waypoint for path finding from the starting point to the target point is determined in sequence among the low-altitude waypoints;
[0047] In the case where the path finding method is high-altitude path finding, at least one waypoint for path finding from the starting point to the target point is determined in sequence among the high-altitude waypoints.
[0048] Optionally, the preset waypoint is marked with corresponding waypoint attributes, and the waypoint attributes include non-skippable waypoints and skippable waypoints; the waypoint determination module is used to:
[0049] In the case where any waypoint is located within a preset range corresponding to any non-skippable waypoint, the any non-skippable waypoint is determined as the next waypoint corresponding to the any waypoint.
[0050] According to another aspect of the present application, a storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the above-mentioned game path-finding method is implemented.
[0051] According to another aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor implements the above-mentioned game pathfinding method when executing the program.
[0052] By means of the above technical scheme, the present application provides a game pathfinding method and device, storage medium, and computer equipment. First, the starting point and target point of the pathfinding are determined based on the pathfinding instructions of the virtual character. Secondly, when the pathfinding method is determined to be aerial pathfinding, the waypoints between the starting point and the target point are determined in sequence in the preset aerial waypoints to form multiple pathfinding points that start from the starting point and pass through the waypoints in sequence and reach the target point. Finally, the pathfinding path is segmented and planned between adjacent pathfinding points, and the virtual character is controlled to pathfind according to the planned pathfinding path section by section. The embodiment of the present application uses preset waypoints to plan the pathfinding points on the pathfinding path, which can ensure that the pathfinding route is roughly controllable, and the waypoints can be used as a transfer between the ground and the air to enable the virtual character to pathfind more flexibly in the game. In addition, after determining multiple pathfinding points, the original complete long-distance pathfinding is divided into multiple shorter-distance pathfinding segments, reducing the computational consumption of problems such as the virtual character being blocked by obstacles during pathfinding, thereby reducing the performance overhead of the device.
[0053] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0055] Figure 1 A schematic diagram of a process flow of a game path finding method provided by an embodiment of the present application is shown;
[0056] Figure 2 A schematic diagram showing a flow chart of another game path-finding method provided in an embodiment of the present application is shown;
[0057] Figure 3 A schematic structural diagram of a game path-finding device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0058] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0059] In this embodiment, a game path finding method is provided, such as Figure 1 As shown, the method includes:
[0060] Step 101, in response to a path-finding instruction of a virtual character, determining a starting point and a target point indicated by the path-finding instruction.
[0061] In the embodiment of the present application, the player can trigger the pathfinding instruction for the virtual character in the game in various ways, such as selecting a certain location in the game mini-map to trigger the virtual character to automatically pathfind to the location, selecting a certain task in the game to trigger the virtual character to automatically pathfind to the location indicated by the task, etc. In response to the pathfinding instruction, the current location of the virtual character is used as the starting point, and the pathfinding destination indicated by the pathfinding instruction is used as the target point, and pathfinding is performed from the starting point to the target point.
[0062] Step 102, when it is determined that the routing method corresponding to the routing instruction is aerial routing, based on the aerial waypoints among the multiple preset waypoints, at least one waypoint for routing from the starting point to the target point is determined in sequence, so as to form multiple routing points starting from the starting point, passing through each waypoint in sequence and reaching the target point.
[0063] In the embodiment of the present application, the pathfinding method in the game may include multiple methods, such as ground pathfinding, aerial pathfinding, ground and aerial combined pathfinding, etc. After receiving the pathfinding instruction, the pathfinding method corresponding to the pathfinding instruction can be determined first. Taking the pathfinding method determined to be aerial pathfinding as an example, the pathpoints passed by the pathfinding path are first planned using the preset waypoints constructed in advance, wherein, in the aerial pathfinding method, the waypoints passed when pathfinding from the starting point to the target point are determined in the aerial waypoints in the preset waypoints, so that the itinerary starts from the starting point and passes through each waypoint in turn and finally reaches the target point in order. The first of the multiple wayfinding points is the starting point, the last one is the target point, and the middle wayfinding points are the waypoints. Planning the pathfinding points in the pathfinding path in this way can ensure that the pathfinding route is roughly controllable, and the waypoints can be used as a transfer between the ground and the air to enable the virtual character to find the path more flexibly in the game.
[0064] It should be noted that the preset waypoints in the embodiment of the present application are pre-determined pathfinding waypoints, and the preset waypoints may include ground waypoints and aerial waypoints, wherein the aerial waypoints may be specifically divided into low-altitude waypoints and high-altitude waypoints to meet different pathfinding requirements in the game. The specific method of determining the pathfinding waypoints is not limited here.
[0065] In an embodiment of the present application, optionally, the preset waypoints include ground waypoints and aerial waypoints; after determining the starting point and the target point indicated by the routing instruction, the method further includes: determining a routing method corresponding to the routing instruction; wherein the routing method indicated by the routing instruction is obtained; or, when the distance between the starting point and the target point is less than a first preset distance, determining that the routing method is ground routing; and, when the distance between the starting point and the target point is greater than or equal to the first preset distance, determining that the routing method is aerial routing.
[0066] In this embodiment, the pathfinding method can be specifically specified by the player when issuing the pathfinding instruction, or it can be automatically determined according to the actual environment in the game. In addition, the automatically determined pathfinding method can also be modified by the player. Specifically, if the pathfinding method is indicated in the pathfinding instruction, the pathfinding method specified by the player can be directly used; if the pathfinding method is not indicated in the pathfinding instruction, it can be determined whether at least one of the starting point and the target point is in the air. If at least one is in the air, the pathfinding method can be determined as aerial pathfinding, and if both the starting point and the target point are located on the ground, the pathfinding method can be automatically determined according to the distance between the starting point and the target point. Among them, if the distance between the starting point and the target point is small (less than the first preset distance), the relatively slow ground walking or riding walking can meet the pathfinding requirements, and the pathfinding method can be determined as ground pathfinding; if the distance between the starting point and the target point is large (greater than or equal to the first preset distance), the relatively fast flying method is more suitable for the game environment, and the pathfinding method can be determined as aerial pathfinding. Optionally, the automatically determined pathfinding method can be visually prompted for the player to view, confirm, and modify.
[0067] In addition, in an embodiment of the present application, the aerial waypoints in the preset waypoints can be specifically divided into low-altitude waypoints and high-altitude waypoints (of course, they can also be divided into aerial waypoints at more height levels, which is not limited here). Optionally, the aerial waypoints include low-altitude waypoints and high-altitude waypoints, and the aerial pathfinding includes low-altitude pathfinding and high-altitude pathfinding; when the distance between the starting point and the target point is greater than or equal to the first preset distance, determining that the pathfinding method is aerial pathfinding includes: when the distance between the starting point and the target point is greater than or equal to the first preset distance and less than the second preset distance, determining that the pathfinding method is low-altitude pathfinding; when the distance between the starting point and the target point is greater than the second preset distance, determining that the pathfinding method is high-altitude pathfinding;
[0068] Correspondingly, when the routing method is aerial routing, at least one way point for routing from the starting point to the target point is determined in sequence among the aerial waypoints, including: when the routing method is low-altitude routing, at least one way point for routing from the starting point to the target point is determined in sequence among the low-altitude waypoints; when the routing method is high-altitude routing, at least one way point for routing from the starting point to the target point is determined in sequence among the high-altitude waypoints.
[0069] In this embodiment, the ground pathfinding method is more suitable for short-distance pathfinding in the actual game environment, and for the case where the distance between the starting point and the target point is greater than the ground pathfinding distance (the first preset distance), the distance can be further subdivided. If the distance between the starting point and the target point is greater than the first preset distance but less than the second preset distance, then the pathfinding distance is considered to be "medium distance", and the pathfinding method can be determined as low-altitude pathfinding. If the distance between the starting point and the target point is greater than or equal to the second preset distance, the pathfinding distance can be considered to be "long distance", and the pathfinding method can be determined as high-altitude pathfinding. Accordingly, the aerial waypoints in the preset waypoints can include low-altitude waypoints and high-altitude waypoints. For the low-altitude pathfinding method, the pathfinding waypoints are determined in the low-altitude waypoints, and for the high-altitude pathfinding method, the pathfinding waypoints are determined in the high-altitude waypoints.
[0070] Step 103, starting from the first pathfinding point, planning a pathfinding path from each pathfinding point to the next pathfinding point in sequence, and controlling the virtual character to perform pathfinding in sequence along each pathfinding path.
[0071] In the embodiment of the present application, after the path finding points are planned by using preset path points, the path finding from the starting point to the target point can be divided into the path finding from one path finding point to the next path finding point, and the original complete long distance path finding can be divided into multiple short distance path finding sections, so as to reduce the computational consumption of problems such as the virtual character being blocked by obstacles during path finding, and reduce the device performance overhead. Thus, the virtual character is controlled to path find according to each path finding path in turn, so as to achieve the effect of path finding from the starting point to the target point.
[0072] It should be noted that in the embodiment of the present application, the steps of determining the waypoints and planning the path in sections can be performed simultaneously to improve the pathfinding efficiency. For example, after determining the first waypoint, you can start planning the pathfinding path between the starting point and the first waypoint. After determining the second waypoint, you can start planning the pathfinding path between the first waypoint and the second waypoint, and so on. There is no need to wait until all the waypoints are determined before planning the pathfinding path in sections.
[0073] By applying the technical solution of this embodiment, first, the starting point and target point of the pathfinding are determined based on the pathfinding instructions of the virtual character. Secondly, when the pathfinding method is determined to be aerial pathfinding, the waypoints between the starting point and the target point are determined in sequence in the preset aerial waypoints to form multiple pathfinding points that start from the starting point and pass through the waypoints in sequence and reach the target point. Finally, the pathfinding path is segmented and planned between adjacent pathfinding points, and the virtual character is controlled to pathfind according to the planned pathfinding path section by section. The embodiment of the present application uses preset waypoints to plan the pathfinding points on the pathfinding path, which can ensure that the pathfinding route is roughly controllable, and the waypoints can be used as a transfer between the ground and the air to enable the virtual character to pathfind more flexibly in the game. In addition, after determining multiple pathfinding points, the original complete long-distance pathfinding is divided into multiple shorter-distance pathfinding segments, reducing the computational consumption of problems such as the virtual character being blocked by obstacles during pathfinding, thereby reducing the performance overhead of the device.
[0074] Further, as a refinement and expansion of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another game path finding method is provided, such as Figure 2 As shown, the method includes:
[0075] Step 201, in response to a path-finding instruction of a virtual character, determining a starting point and a target point indicated by the path-finding instruction.
[0076] Step 202, when it is determined that the path finding method is ground path finding, at least one way point for path finding from the starting point to the target point is determined in sequence among the ground way points, so as to form a plurality of path finding points starting from the starting point and passing through each way point in sequence and reaching the target point; wherein any ground way point has a ground jump point mark, and if any way point determined among the ground way points has a ground jump point mark, then the next way point corresponding to the any way point is determined as the low-altitude flight way point corresponding to the any way point.
[0077] In an embodiment of the present application, after receiving a pathfinding instruction for a virtual character, the pathfinding method corresponding to the pathfinding instruction is first determined. Optionally, if the player indicates that the pathfinding method is ground pathfinding, the pathfinding method can be directly determined as ground pathfinding, and if the player does not indicate the pathfinding method, the pathfinding method can be automatically determined. For specific methods of automatically determining the pathfinding method, please refer to the relevant description above. In the case where the pathfinding method is determined to be ground pathfinding, the waypoints for pathfinding from the starting point to the target point can be determined from the ground waypoints included in the preset waypoints, so as to form multiple pathfinding points starting from the starting point and passing through each waypoint in sequence and reaching the target point. In addition, there may be some inaccessible areas on the ground in the game map, such as lakes, lotus ponds, etc. In the process of determining the waypoints one by one, if a certain waypoint is marked with a ground jump point, it means that there may be an inaccessible illegal position around the waypoint, such as a ground jump point at the edge of a lake. At this time, the next waypoint can be determined as the low-altitude flight waypoint corresponding to the waypoint. When the virtual character passes through this position, it can fly at a low altitude to make the path finding smoother and try to avoid the situation where the path is found to the edge of the lake and then detoured because of the need to avoid entering an illegal position. It should be noted that, generally speaking, the ground waypoints marked with ground jump points will have corresponding low-altitude flight waypoints pre-set. If they are not pre-set, the waypoint marked with a ground jump point can be re-planned, or an aerial waypoint can be found in the low-altitude area above the waypoint marked with a ground jump point to replace the waypoint.
[0078] Step 203, starting from the first pathfinding point, planning a pathfinding path from each pathfinding point to the next pathfinding point in sequence, and controlling the virtual character to perform pathfinding in sequence along each pathfinding path.
[0079] In the embodiment of the present application, after the waypoints are determined, the waypoint planning is performed sequentially starting from the first waypoint, and each waypoint is used to guide the virtual character to move from one waypoint to the next.
[0080] In any embodiment of the present application, optionally, the preset waypoint is marked with corresponding waypoint attributes, and the waypoint attributes include non-skippable waypoints and skippable waypoints; at least one waypoint for finding the way from the starting point to the target point is determined in sequence, including: when any waypoint is located within a preset range corresponding to any non-skippable waypoint, determining any non-skippable waypoint as the next waypoint corresponding to any waypoint.
[0081] In this embodiment, in order to ensure that the player can see the events or scenery that the planner wants the player to see when finding the way in the game, the pre-determined preset waypoints can also have waypoint attribute marks, which can be specifically marked as non-skippable waypoints or skippable waypoints, and a corresponding preset range is set for the non-skippable waypoints. The preset range can specifically be other waypoints within a certain range near the non-skippable waypoints (which can be called range waypoints of non-skippable waypoints). In the process of determining the waypoints, if a certain waypoint determined belongs to the range waypoint corresponding to any non-skippable waypoint, then this non-skippable waypoint is used as the next waypoint to ensure that the player does not miss important events, important scenery, etc. in the game as much as possible.
[0082] In any embodiment of the present application, optionally, a path from each waypoint to the next waypoint is planned in sequence, including: when the waypoint and its corresponding next waypoint are both located on the ground, planning the path from the waypoint to the next waypoint by a navigation grid pathfinding method; when at least one of the waypoint and its corresponding next waypoint is located in the air, planning the path from the waypoint to the next waypoint by a voxel grid pathfinding method.
[0083] In this embodiment, when performing path planning, if both path finding points are located on the ground, path planning can be performed using a navigation grid path finding method; if one or both of the two path finding points are located in the air, path planning can be performed using a voxel grid path finding method.
[0084] By applying the technical solution of this embodiment, such a pathfinding method is adopted, firstly, waypoints are used for pathfinding point planning, and then pathfinding path segments are generated according to the waypoints, and waypoints are used as transits to connect the ground and the air, thereby realizing low-overhead ground and air pathfinding, and the main route of the virtual character can be controlled through key non-skippable waypoints, thereby ensuring the controllability of the pathfinding route.
[0085] In addition, as a specific example, the embodiment of the present application further provides a waypoint generation method, where the generated pathfinding waypoints are used as preset waypoints used in the game pathfinding method, wherein the ground pathfinding waypoints are used as ground waypoints in the preset waypoints, and the aerial pathfinding waypoints are used as aerial waypoints in the preset waypoints. The waypoint generation method may include:
[0086] S11, determining a plurality of basic waypoints in the game map, and determining at least one set of basic waypoint pairs based on the plurality of basic waypoints, wherein each basic waypoint pair includes two basic waypoints.
[0087] In the embodiment of the present application, multiple basic waypoints in the game map are determined. The basic waypoints can be drawn by the game developer or randomly generated in the game map according to certain rules. For example, an area is specified in the game map, and one or more basic waypoints are randomly generated on the ground in this area (or in the air in a specified height range, etc.). After obtaining multiple basic waypoints in the game map, the basic waypoints are combined in pairs to obtain basic waypoint pairs, so that new waypoints can be automatically generated between two basic waypoints in the basic waypoint pair.
[0088] S12, for two basic waypoints in any basic waypoint pair, generating a basic waypoint line having connectivity between the two basic waypoints according to the connectivity data corresponding to the game map, and generating intermediate waypoints corresponding to the two basic waypoints on the basic waypoint line.
[0089] In the embodiment of the present application, for two basic waypoints in each basic waypoint pair, the connectivity of the game map is considered, and a basic waypoint line connecting the two basic waypoints is generated. In the game map, starting from one of the basic waypoints along the basic waypoint line, another basic waypoint can be reached. For example, if the basic waypoint line is on the ground of the game map, the game virtual character moves along the basic waypoint line, and there will be no mistakes such as passing through the terrain, passing through obstacles, and walking in the air. For another example, if the basic waypoint line is in the air of the game map, the game virtual character flies along the basic waypoint line, and there will be no mistakes such as crossing obstacles. Further, after obtaining the basic waypoint line, an intermediate waypoint between the two basic waypoints can be generated on the basic waypoint line. According to such a method of automatically generating intermediate waypoints, only a small number of basic waypoints need to be determined in advance, and a large number of intermediate waypoints can be generated between two basic waypoints, which reduces the cumbersome operation of manually marking waypoints, and the generated waypoints can ensure the connectivity between the waypoints, reducing the occurrence of wrong waypoint markings.
[0090] In an embodiment of the present application, optionally, intermediate waypoints corresponding to two basic waypoints are generated on the basic waypoint line, including: determining the positions of the intermediate waypoints on the basic waypoint line according to a preset intermediate waypoint interval, a received designated intermediate waypoint interval, a preset number of intermediate waypoints, or a received designated number of intermediate waypoints, and generating the intermediate waypoints based on the intermediate waypoint positions.
[0091] In this embodiment, when the intermediate waypoints are generated by using the basic waypoint connection line, the intermediate waypoints can be randomly generated on the basic waypoint connection line, or they can be generated according to certain rules. Specifically, the positions of the intermediate waypoints can be evenly determined on the basic waypoint connection line according to the preset intermediate waypoint interval, the user-specified intermediate waypoint interval, the preset number of intermediate waypoints, and the user-specified number of intermediate waypoints, so that the intermediate waypoints are generated at the positions of the intermediate waypoints.
[0092] S13, in response to a waypoint supplementation instruction, determining two waypoints to be supplemented indicated by the waypoint supplementation instruction and waypoint supplementation requirement information, and generating a supplementary waypoint line with connectivity between the two waypoints to be supplemented according to the connectivity data corresponding to the game map.
[0093] S14, generating two supplementary waypoints corresponding to the waypoints to be supplemented on the supplementary waypoint line according to the waypoint supplementation requirement information, wherein the waypoint supplementation requirement information includes a supplementary waypoint interval or a supplementary waypoint quantity.
[0094] In the embodiment of the present application, after the intermediate waypoints are automatically generated, the waypoints can be further adjusted, such as deleting, adding, adjusting the position of the waypoints, etc. If the density of the waypoints is considered to be low, two waypoints can be arbitrarily selected from the basic waypoints and the intermediate waypoints as the waypoints to be supplemented, so as to supplement the waypoints based on the two waypoints to be supplemented, wherein a supplementary waypoint line with connectivity between the two waypoints to be supplemented is generated based on the connectivity data of the game map, and supplementary waypoints are generated on the supplementary waypoint line according to the waypoint supplementation demand information indicated by the user, such as generating supplementary waypoints according to the supplementary waypoint interval, or generating supplementary waypoints according to the number of supplementary waypoints. This achieves further supplementation of the waypoints.
[0095] S15, determining the pathfinding waypoints of the game map according to the basic waypoints, the intermediate waypoints and the supplementary waypoints.
[0096] In the embodiment of the present application, the path finding waypoints of the game map can be finally generated based on the basic waypoints and the generated waypoints (intermediate waypoints, supplementary waypoints).
[0097] By applying the technical solution of this embodiment, after determining multiple basic waypoints in the game map, the basic waypoints are combined in pairs, and the two combined basic waypoints are used to generate a basic waypoint line with connectivity, and an intermediate waypoint is generated on the basic waypoint line. Further, when receiving a waypoint supplementation instruction, two waypoints to be supplemented and waypoint supplementation demand information are determined, thereby generating a supplementary waypoint line with connectivity, and generating supplementary waypoints on the supplementary waypoint line according to the waypoint supplementation demand information, and finally determining the basic waypoints and other generated waypoints as the pathfinding waypoints of the game map. The embodiment of the present application uses a small number of basic waypoints to generate a large number of waypoints with connectivity, which solves the problem of high cost and easy error in annotating a large number of waypoints, and helps to improve the efficiency and accuracy of waypoint annotation. Further, when performing waypoint pathfinding in the game, a large number of waypoints with connectivity help to improve the smoothness of the pathfinding path and can reduce the occurrence of pathfinding failures.
[0098] Further, as a refinement and extension of the specific implementation of the above embodiment, in order to fully illustrate the specific implementation process of this embodiment, another waypoint generation method is provided, which includes:
[0099] S21, determining a plurality of ground-based waypoints in the game map.
[0100] In the embodiment of the present application, in the case of automatically drawing ground waypoints, a plurality of ground basic waypoints in the game map are first determined, where the ground waypoints refer to waypoints located on the ground in the game map.
[0101] In an embodiment of the present application, in order to ensure the accuracy of ground waypoints, optionally, after determining multiple ground basic waypoints in the game map, it can also include: based on the ground data corresponding to the game map, identifying whether there are basic waypoints to be adjusted among the ground basic waypoints that are not located on the ground of the game map; when it is identified that there are basic waypoints to be adjusted, determining the ground height value of the ground position with the same horizontal plane coordinates as the basic waypoint to be adjusted, and adjusting the waypoint height value of the basic waypoint to be adjusted to the ground height value, so that the basic waypoint to be adjusted is adjusted to the ground of the game map.
[0102] In this embodiment, it is possible to check whether each ground basic waypoint is located on the ground in the game map based on the ground data corresponding to the game map. If a ground basic waypoint is not located on the ground, then the waypoint is used as the basic waypoint to be adjusted, and the basic waypoint to be adjusted is further adjusted to a position close to the ground based on the ground data. Specifically, the basic waypoint to be adjusted can be vertically projected onto the ground of the game map, that is, the ground height value of the ground position that is the same as the horizontal plane coordinates of the basic waypoint to be adjusted is determined, and the waypoint height value of the basic waypoint to be adjusted is adjusted to the ground height value, so that the basic waypoint to be adjusted is adjusted to the ground of the game map.
[0103] S22: Determine at least one set of ground basic waypoint pairs based on the ground basic waypoints, wherein the basic waypoint pairs include the ground basic waypoint pairs.
[0104] Optionally, determining at least one group of ground basic waypoint pairs based on the ground basic waypoints includes: when it is identified that there are isolated ground waypoints that are not connected to any other ground basic waypoints among the ground basic waypoints, deleting the isolated ground waypoints and determining at least one group of connected ground basic waypoint pairs based on the remaining ground basic waypoints; when it is identified that there are no isolated ground waypoints among the ground basic waypoints, determining at least one group of connected ground basic waypoint pairs based on the ground basic waypoints.
[0105] In the embodiment of the present application, a plurality of ground basic waypoints are used to determine ground basic waypoint pairs. Specifically, the connectivity data of the game map can be used to first detect whether each ground basic waypoint is an isolated ground waypoint, that is, whether any ground basic waypoint is connected to at least one other ground basic waypoint. An isolated ground waypoint cannot be connected to other ground waypoints and cannot be used as a basis for generating an intermediate waypoint. If there is an isolated ground waypoint, the isolated ground waypoint is deleted, so that after there is no isolated ground waypoint in the ground basic waypoints, the ground basic waypoints with connectivity are combined in pairs to obtain a ground basic waypoint pair.
[0106] S23, for two ground basic waypoints in any ground basic waypoint pair, generate a ground basic waypoint line with connectivity between the two ground basic waypoints according to the connectivity data corresponding to the game map, and generate ground intermediate waypoints corresponding to the two ground basic waypoints on the ground basic waypoint line.
[0107] In the embodiment of the present application, for two ground basic waypoints in any ground basic waypoint pair, a ground basic waypoint line with connectivity is generated between the two ground basic waypoints, so that ground intermediate waypoints are generated on the ground basic waypoint line randomly, according to a preset intermediate waypoint interval, according to a received designated intermediate waypoint interval, according to a preset intermediate waypoint number, or according to a received designated intermediate waypoint number. Wherein, when generating a ground basic waypoint line for two ground basic waypoints, a navigation grid pathfinding algorithm can be specifically used to find a path from one ground basic waypoint to another ground basic waypoint, and the obtained pathfinding path on the ground is used as a ground basic waypoint line with connectivity between the two ground basic waypoints. Of course, other methods can also be used to generate a ground basic waypoint line between two ground basic waypoints, as long as the virtual character in the game can successfully travel from one ground basic waypoint to another ground basic waypoint along the ground basic waypoint line.
[0108] S24, determining ground pathfinding waypoints of the game map according to the ground basic waypoints and the ground intermediate waypoints.
[0109] In the embodiment of the present application, the ground basic waypoints and the generated ground intermediate waypoints are used to determine the ground pathfinding waypoints of the game map. Of course, any two of the ground basic waypoints and the ground intermediate waypoints can be selected to supplement the ground waypoints, and the supplemented ground supplementary waypoints are also used as ground pathfinding waypoints. Wherein, in response to the ground waypoint supplementation instruction, the two ground waypoints to be supplemented indicated by the ground waypoint supplementation instruction and the ground waypoint supplementation demand information are determined, and according to the connectivity data corresponding to the game map, a ground supplementary waypoint connection line with connectivity between the two ground waypoints to be supplemented is generated, and according to the ground waypoint supplementation demand information, two ground supplementary waypoints corresponding to the ground waypoints to be supplemented are generated on the ground supplementary waypoint connection line, wherein the ground waypoint supplementation demand information includes the ground supplementary waypoint interval or the number of ground supplementary waypoints.
[0110] S25, based on the ground data corresponding to the game map, identifying whether there are any inaccessible illegal ground waypoints among the ground path finding waypoints; if the illegal ground waypoints are identified, deleting the illegal ground waypoints.
[0111] In the embodiment of the present application, there may be some impassable areas on the ground in the game map, such as lakes, lotus ponds, etc. After determining the ground path finding waypoints, the legality of the ground path finding waypoints can also be checked. The legality of the ground path finding waypoints means that the ground path finding waypoints are passable. In the case of identifying the existence of illegal ground path finding waypoints that are impassable, the illegal ground path finding waypoints are deleted to avoid the path finding failure caused by the inability to pass the waypoints found during path finding in the game.
[0112] In addition, some ground waypoints near illegal areas can also be marked as ground jump points. For example, if a ground waypoint is located at the edge of an illegal area, the ground waypoint can be marked as a ground jump point, and a low-altitude flight waypoint corresponding to the ground jump point is generated, wherein the height value of the low-altitude flight waypoint is greater than the height value of the ground jump point, and the ground jump point is used to replace the ground jump point included in the planned pathfinding path with the low-altitude flight waypoint. Therefore, when performing pathfinding in the game, if the planned pathfinding path includes a ground jump point, since the ground jump point is an inaccessible position, the ground jump point in the pathfinding path can be replaced with the corresponding low-altitude flight waypoint, and the position of the ground jump point can be passed by by low-altitude flight.
[0113] Furthermore, the embodiment of the present application also provides another waypoint generation method, which includes:
[0114] S31, determining a plurality of aerial basic waypoints in the game map.
[0115] In the embodiment of the present application, the aerial basic waypoints can be generated by direct drawing, random generation, and generation using ground basic waypoints.
[0116] In an embodiment of the present application, optionally, in response to a waypoint type conversion instruction for at least one ground basic waypoint, a first waypoint ascent height value indicated by the waypoint type conversion instruction and a ground basic waypoint to be converted are determined, the height value of the ground basic waypoint to be converted is increased by the first waypoint ascent height value, and the ground basic waypoint to be converted is marked as an aerial basic waypoint; and / or, in response to a waypoint addition instruction for at least one ground basic waypoint, a second waypoint ascent height value indicated by the waypoint addition instruction and a ground basic waypoint to be added are determined, the ground basic waypoint to be added is copied to obtain a ground basic waypoint copy, the height value of the ground basic waypoint copy is increased by the second waypoint ascent height value, and the ground basic waypoint copy is marked as an aerial basic waypoint.
[0117] In this embodiment, the ground basic waypoint can be converted into an aerial basic waypoint by type conversion, and the aerial basic waypoint can also be newly created by adding based on the ground basic waypoint. Specifically, in response to the waypoint type conversion instruction, the ground basic waypoint to be converted and the first waypoint to be ascended are determined, so that the height value of the ground basic waypoint to be converted is increased by the first waypoint ascending height value to obtain the aerial basic waypoint. In response to the waypoint addition instruction, the selected ground basic waypoint and the second waypoint to be ascended are determined. The selected ground basic waypoint is first copied to obtain a ground basic waypoint copy, and then the height value of the ground basic waypoint copy is increased by the second waypoint ascending height value to obtain the aerial basic waypoint.
[0118] Optionally, the aerial basic waypoints include low-altitude basic waypoints and / or high-altitude basic waypoints, and the pathfinding waypoints include at least one of ground pathfinding waypoints, low-altitude pathfinding waypoints and high-altitude pathfinding waypoints. Among them, the aerial basic waypoints may include low-altitude basic waypoints and high-altitude basic waypoints, and then the pathfinding waypoints may include ground pathfinding waypoints, low-altitude pathfinding waypoints and high-altitude pathfinding waypoints. Thereby, it is achieved to enrich the waypoint types, so as to increase the effect of the diversity of pathfinding routes, and provide support for ground pathfinding and space pathfinding. It should be noted that the above-mentioned first waypoint rise height value and the second waypoint rise height value can be obtained by adaptively matching the type of aerial waypoint to be generated indicated by the instruction (low altitude or high altitude), for example, the waypoint rise height value corresponding to the low altitude waypoint type is 1 meter, and the waypoint rise height value corresponding to the high altitude waypoint type is 50 meters.
[0119] S32: Determine at least one set of aerial basic waypoint pairs based on the aerial basic waypoints, wherein the basic waypoint pairs include the aerial basic waypoint pairs.
[0120] Optionally, determining at least one set of aerial basic waypoint pairs based on the aerial basic waypoints includes: when it is identified that the aerial basic waypoints are all connected, determining at least one set of aerial basic waypoint pairs based on the aerial basic waypoints; when it is identified that the aerial basic waypoints are not all connected, outputting waypoint connectivity information of the aerial basic waypoints, and determining at least one set of aerial basic waypoint pairs when it is confirmed that the aerial basic waypoints are modified to be fully connected.
[0121] In the embodiment of the present application, for the aerial basic waypoints, it is necessary to ensure that all the aerial basic waypoints are connected. If it is detected that the aerial basic waypoints are not all connected, the connectivity information of the aerial basic waypoints is output to prompt the user to modify or delete some of the aerial basic waypoints, and after confirming that the aerial basic waypoints are modified to be fully connected, the aerial basic waypoint pairs are regenerated to avoid the subsequent generation of erroneous waypoints due to the two aerial basic waypoints in the aerial basic waypoint pair being not connected.
[0122] S33, for two aerial basic waypoints in any aerial basic waypoint pair, generate an aerial basic waypoint connection line with connectivity between the two aerial basic waypoints according to the connectivity data corresponding to the game map, and generate aerial intermediate waypoints corresponding to the two aerial basic waypoints on the aerial basic waypoint connection line.
[0123] In the embodiment of the present application, for two aerial basic waypoints in any aerial basic waypoint pair, an aerial basic waypoint line with connectivity is generated between the two aerial basic waypoints, so that aerial intermediate waypoints are generated on the aerial basic waypoint line randomly, according to a preset intermediate waypoint interval, according to a received designated intermediate waypoint interval, according to a preset number of intermediate waypoints, or according to a received designated number of intermediate waypoints. Wherein, when generating an aerial basic waypoint line for two aerial basic waypoints, a voxel grid pathfinding algorithm can be specifically used to find a path from one aerial basic waypoint to another aerial basic waypoint, and the obtained aerial pathfinding path is used as an aerial basic waypoint line with connectivity between the two aerial basic waypoints. Of course, other methods can also be used to generate an aerial basic waypoint line between two aerial basic waypoints, as long as the virtual character in the game can successfully fly from one aerial basic waypoint to another aerial basic waypoint along the aerial basic waypoint line.
[0124] S34, determining aerial pathfinding waypoints of the game map according to the aerial basic waypoints and the aerial intermediate waypoints.
[0125] In the embodiment of the present application, the aerial basic waypoints and the generated aerial intermediate waypoints are used to determine the aerial pathfinding waypoints of the game map. Of course, any two of the aerial basic waypoints and the aerial intermediate waypoints can be selected to supplement the aerial waypoints, and the supplemented aerial supplementary waypoints are also used as aerial pathfinding waypoints. Among them, in response to the aerial waypoint supplementation instruction, the two aerial waypoints to be supplemented indicated by the aerial waypoint supplementation instruction and the aerial waypoint supplementation demand information are determined, and according to the connectivity data corresponding to the game map, an aerial supplementary waypoint connection line with connectivity between the two aerial waypoints to be supplemented is generated, and according to the aerial waypoint supplementation demand information, aerial supplementary waypoints corresponding to the two aerial waypoints to be supplemented are generated on the aerial supplementary waypoint connection line, wherein the aerial waypoint supplementation demand information includes the aerial supplementary waypoint interval or the number of aerial supplementary waypoints.
[0126] In any embodiment of the present application, optionally, the method further includes: based on an attribute marking operation on any pathfinding waypoint, marking the any pathfinding waypoint as a non-skippable waypoint or a skippable waypoint, and determining a range waypoint corresponding to the non-skippable waypoint among the pathfinding waypoints, wherein the non-skippable waypoint is used to indicate that the non-skippable waypoint must be passed when the pathfinding path passes through the range waypoint.
[0127] In this embodiment, the pathfinding waypoints can also be set as non-skippable waypoints, so as to ensure that the player can see the events or scenery that the planner wants the player to see when finding the way in the game. When any pathfinding waypoint is marked as a non-skippable waypoint, the pathfinding waypoints can be further queried within a certain range near the non-skippable waypoint, and the queried waypoints are used as the range waypoints corresponding to the non-skippable waypoints. In the process of game pathfinding, if the pathfinding path passes through the range waypoint, then the pathfinding path is required to pass through the non-skippable waypoint.
[0128] In any embodiment of the present application, optionally, the method further comprises: generating ground waypoint network data of the game map according to the ground waypoint; and / or generating aerial waypoint network data of the game map according to the aerial waypoint. In order to improve the efficiency of pathfinding, ground waypoint network data, low-altitude waypoint network data, and high-altitude waypoint network data may also be generated, and the pathfinding waypoints may be saved as waypoint network offline data.
[0129] In any embodiment of the present application, the method may further include: counting the number of pathfinding waypoints, and if the number of pathfinding waypoints is not within a preset number interval, outputting a prompt message to prompt the user that the current number of pathfinding waypoints is too large or too small. Too many pathfinding waypoints will result in excessive performance consumption of the gaming device when the waypoints are subsequently used for pathfinding, while too few pathfinding waypoints will result in poor pathfinding effect. Therefore, by counting the number of pathfinding waypoints, the user may be prompted to control the number of pathfinding waypoints within a reasonable range, so as to achieve a balance between pathfinding effect and performance overhead.
[0130] In any embodiment of the present application, optionally, if the user wants to delete some waypoints, he can directly select the waypoints he wants to delete, or select a certain area to delete all waypoints in the selected area, or select a certain waypoint type to delete all types of waypoints.
[0131] Further, as Figure 1 The specific implementation of the method, the embodiment of the present application provides a game path finding device, such as Figure 3 As shown, the device comprises:
[0132] A target point determination module 31 is used to determine the starting point and the target point indicated by the path-finding instruction in response to the path-finding instruction of the virtual character;
[0133] A waypoint determination module 32 is used to determine, when it is determined that the wayfinding mode corresponding to the wayfinding instruction is aerial wayfinding, at least one waypoint for finding a path from the starting point to the target point based on the aerial waypoints among the plurality of preset waypoints, so as to form a plurality of waypoints starting from the starting point and sequentially passing through the waypoints and reaching the target point;
[0134] The pathfinding module 33 is used to plan a pathfinding path from each pathfinding point to the next pathfinding point in sequence, starting from the first pathfinding point, and control the virtual character to find the path in sequence according to each pathfinding path.
[0135] Optionally, the preset waypoints include ground waypoints and aerial waypoints; the waypoint determination module 32 is used to:
[0136] After determining the starting point and the target point indicated by the path-finding instruction, determining a path-finding mode corresponding to the path-finding instruction;
[0137] When the routing method is ground routing, at least one waypoint for routing from the starting point to the target point is determined in sequence among the ground waypoints.
[0138] Optionally, the waypoint determination module 32 is used to:
[0139] Obtaining a routing method indicated by the routing instruction; or,
[0140] When the distance between the starting point and the target point is less than a first preset distance, the path finding method is determined to be ground path finding; and when the distance between the starting point and the target point is greater than or equal to the first preset distance, the path finding method is determined to be aerial path finding.
[0141] Optionally, the path finding module 33 is used to:
[0142] When the waypoint and its corresponding next waypoint are both located on the ground, planning a path from the waypoint to the next waypoint by using a navigation grid pathfinding method;
[0143] In the case where at least one of the wayfinding point and its corresponding next wayfinding point is located in the air, a pathfinding path from the wayfinding point to the next wayfinding point is planned by a voxel grid pathfinding method.
[0144] Optionally, any ground waypoint has a ground jump point mark, wherein the ground jump point mark is used to indicate that there is an inaccessible position within a specific range corresponding to the corresponding ground waypoint; the waypoint determination module 32 is used to:
[0145] In the case where the routing method is ground routing, if any waypoint determined among the ground waypoints has a ground jump point mark, the next waypoint corresponding to any waypoint is determined as the low-altitude flight waypoint corresponding to any waypoint.
[0146] Optionally, the aerial waypoints include low-altitude waypoints and high-altitude waypoints, and the aerial pathfinding includes low-altitude pathfinding and high-altitude pathfinding; the pathfinding point determination module 32 is used to:
[0147] When the distance between the starting point and the target point is greater than or equal to the first preset distance and less than the second preset distance, determining that the path finding method is low altitude path finding;
[0148] When the distance between the starting point and the target point is greater than a second preset distance, determining that the path finding method is high-altitude path finding;
[0149] In the case where the path finding method is low-altitude path finding, at least one waypoint for path finding from the starting point to the target point is determined in sequence among the low-altitude waypoints;
[0150] In the case where the path finding method is high-altitude path finding, at least one waypoint for path finding from the starting point to the target point is determined in sequence among the high-altitude waypoints.
[0151] Optionally, the preset waypoint is marked with corresponding waypoint attributes, and the waypoint attributes include non-skippable waypoints and skippable waypoints; the waypoint determination module 32 is used to:
[0152] In the case where any waypoint is located within a preset range corresponding to any non-skippable waypoint, the any non-skippable waypoint is determined as the next waypoint corresponding to the any waypoint.
[0153] Furthermore, the embodiment of the present application also provides a waypoint generating device, through which the preset waypoints required by the above-mentioned game path finding device are generated, and the device includes:
[0154] A basic waypoint determination module, used to determine a plurality of basic waypoints in the game map, and determine at least one set of basic waypoint pairs based on the plurality of basic waypoints, wherein each basic waypoint pair includes two basic waypoints;
[0155] An intermediate waypoint generation module is used to generate a basic waypoint connection line with connectivity between two basic waypoints in any basic waypoint pair according to the connectivity data corresponding to the game map, and generate an intermediate waypoint corresponding to the two basic waypoints on the basic waypoint connection line;
[0156] A supplementary waypoint generation module is used to respond to a waypoint supplementation instruction, determine two waypoints to be supplemented and waypoint supplementation requirement information indicated by the waypoint supplementation instruction, generate a supplementary waypoint connection line with connectivity between the two waypoints to be supplemented according to the connectivity data corresponding to the game map; generate supplementary waypoints corresponding to the two waypoints to be supplemented on the supplementary waypoint connection line according to the waypoint supplementation requirement information, wherein the waypoint supplementation requirement information includes a supplementary waypoint interval or a supplementary waypoint quantity;
[0157] A pathfinding waypoint determination module is used to determine the pathfinding waypoints of the game map according to the basic waypoints, the intermediate waypoints and the supplementary waypoints.
[0158] Optionally, the pathfinding waypoint determination module is used to:
[0159] Based on an attribute marking operation on any pathfinding waypoint, the any pathfinding waypoint is marked as a non-skippable waypoint or a skippable waypoint, and a range waypoint corresponding to the non-skippable waypoint is determined among the pathfinding waypoints, wherein the non-skippable waypoint is used to indicate that the non-skippable waypoint must be passed when the pathfinding path passes through the range waypoint.
[0160] Optionally, the intermediate waypoint generation module is used to:
[0161] The intermediate waypoint positions on the basic waypoint line are determined according to a preset intermediate waypoint interval, a received designated intermediate waypoint interval, a preset number of intermediate waypoints, or a received number of designated intermediate waypoints, and the intermediate waypoints are generated based on the intermediate waypoint positions.
[0162] Optionally, the basic waypoint is provided with a waypoint type, and the waypoint type includes a ground basic waypoint and / or an aerial basic waypoint; the basic waypoint determination module is used to:
[0163] Based on the ground basic waypoints, determining at least one set of ground basic waypoint pairs, wherein the basic waypoint pairs include the ground basic waypoint pairs; and / or,
[0164] Based on the aerial basic waypoints, at least one set of aerial basic waypoint pairs is determined, wherein the basic waypoint pairs include the aerial basic waypoint pair.
[0165] Optionally, the basic waypoint determination module is used to:
[0166] In the case of identifying that there are isolated ground waypoints that are not connected to any other ground basic waypoints among the ground basic waypoints, deleting the isolated ground waypoints, and determining at least one group of connected ground basic waypoint pairs based on the remaining ground basic waypoints;
[0167] In the case where it is identified that there are no isolated ground waypoints among the ground basic waypoints, determining at least one group of connected ground basic waypoint pairs according to the ground basic waypoints;
[0168] In the case where it is identified that the aerial basic waypoints are all connected, determining at least one set of aerial basic waypoint pairs based on the aerial basic waypoints;
[0169] When it is identified that the aerial basic waypoints are not fully connected, waypoint connectivity information of the aerial basic waypoints is output, and when it is confirmed that the aerial basic waypoints are modified to be fully connected, at least one set of aerial basic waypoint pairs is determined.
[0170] Optionally, the basic waypoint determination module is used to:
[0171] After determining the plurality of basic waypoints in the game map, identifying whether there are basic waypoints to be adjusted that are not located on the ground of the game map among the ground basic waypoints based on ground data corresponding to the game map;
[0172] When the existence of the basic waypoint to be adjusted is identified, the ground height value of the ground position that is the same as the horizontal plane coordinates of the basic waypoint to be adjusted is determined, and the waypoint height value of the basic waypoint to be adjusted is adjusted to the ground height value, so that the basic waypoint to be adjusted is adjusted to the ground of the game map.
[0173] Optionally, the basic waypoint determination module is used to:
[0174] In response to a waypoint type conversion instruction for at least one ground-based waypoint, determining a first waypoint ascent height value indicated by the waypoint type conversion instruction and a ground-based waypoint to be converted, increasing the height value of the ground-based waypoint to be converted by the first waypoint ascent height value, and marking the ground-based waypoint to be converted as an aerial-based waypoint; and / or,
[0175] In response to a waypoint adding instruction for at least one ground basic waypoint, a second waypoint ascent height value indicated by the waypoint adding instruction and a ground basic waypoint to be added are determined, the ground basic waypoint to be added is copied to obtain a ground basic waypoint copy, an altitude value of the ground basic waypoint copy is increased by the second waypoint ascent height value, and the ground basic waypoint copy is marked as an aerial basic waypoint.
[0176] Optionally, the aerial basic waypoints include low-altitude basic waypoints and / or high-altitude basic waypoints, and the pathfinding waypoints include at least one of ground pathfinding waypoints, low-altitude pathfinding waypoints and high-altitude pathfinding waypoints.
[0177] Optionally, the pathfinding waypoint determination module is used to:
[0178] After determining the pathfinding waypoints of the game map according to the basic waypoints, the intermediate waypoints and the supplementary waypoints, identifying whether there are any inaccessible illegal ground waypoints among the ground pathfinding waypoints based on ground data corresponding to the game map;
[0179] When the illegal ground waypoint is identified, the illegal ground waypoint is deleted.
[0180] Optionally, the pathfinding waypoints include ground pathfinding waypoints and / or aerial pathfinding waypoints; and the pathfinding waypoint determination module is used to:
[0181] Generating ground waypoint network data of the game map according to the ground waypoints; and / or,
[0182] Based on the aerial pathfinding waypoints, aerial waypoint network data of the game map is generated.
[0183] Optionally, the pathfinding waypoint determination module is used to: count the number of pathfinding waypoints, and if the number of pathfinding waypoints is not within a preset number interval, output a prompt message to prompt the user that the current number of pathfinding waypoints is too large or too small.
[0184] It should be noted that for other corresponding descriptions of the functional units involved in the game path-finding device provided in the embodiment of the present application, reference can be made to Figure 1 to Figure 2 The corresponding description in the method will not be repeated here.
[0185] The embodiment of the present application also provides a computer device, which can be a personal computer, a server, a network device, etc. The computer device includes a bus, a processor, a memory and a communication interface, and can also include an input and output interface and a display device. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store location information. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in each method embodiment are implemented.
[0186] Those skilled in the art will appreciate that the structure of the above-mentioned computer device is only a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components, or combine certain components, or have a different arrangement of components.
[0187] In one embodiment, a computer-readable storage medium is provided. The computer-readable storage medium may be non-volatile or volatile, and stores a computer program thereon. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0188] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0189] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0190] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0191] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0192] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A game path-finding method, characterized in that: The method comprises: In response to the virtual character's path-finding instruction, determining a starting point and a target point indicated by the path-finding instruction; In the case where it is determined that the pathfinding mode corresponding to the pathfinding instruction is aerial pathfinding, based on the aerial pathpoints among the plurality of preset pathpoints, at least one waypoint for pathfinding from the starting point to the target point is determined in sequence, so as to form a plurality of pathfinding points starting from the starting point and sequentially passing through the waypoints and reaching the target point; Starting from the first pathfinding point, a pathfinding path from each pathfinding point to the next pathfinding point is planned in sequence, and the virtual character is controlled to find the path along each pathfinding path in sequence.
2. The method according to claim 1, characterized in that The preset waypoints include ground waypoints and aerial waypoints; after determining the starting point and the target point indicated by the pathfinding instruction, the method further includes: Determine a pathfinding method corresponding to the pathfinding instruction; In the case where the routing method is ground routing, at least one waypoint for routing from the starting point to the target point is determined in sequence among the ground waypoints.
3. The method according to claim 2, characterized in that Determining the path-finding mode corresponding to the path-finding instruction includes: Obtaining a routing method indicated by the routing instruction; or, When the distance between the starting point and the target point is less than a first preset distance, the path finding method is determined to be ground path finding; and when the distance between the starting point and the target point is greater than or equal to the first preset distance, the path finding method is determined to be aerial path finding.
4. The method according to claim 2, characterized in that: Plan the path from each waypoint to the next waypoint in sequence, including: In the case where the waypoint and its corresponding next waypoint are both located on the ground, planning a path from the waypoint to the next waypoint by using a navigation grid pathfinding method; In the case where at least one of the wayfinding point and its corresponding next wayfinding point is located in the air, a pathfinding path from the wayfinding point to the next wayfinding point is planned by a voxel grid pathfinding method.
5. The method according to claim 2, characterized in that: Any ground waypoint has a ground jump point mark, wherein the ground jump point mark is used to indicate that there is an inaccessible position within a specific range corresponding to the corresponding ground waypoint; the method further includes: In the case where the routing method is ground routing, if any waypoint determined among the ground waypoints has a ground jump point mark, the next waypoint corresponding to any waypoint is determined as the low-altitude flight waypoint corresponding to any waypoint.
6. The method according to claim 3, characterized in that The aerial waypoints include low-altitude waypoints and high-altitude waypoints, and the aerial pathfinding includes low-altitude pathfinding and high-altitude pathfinding; when the distance between the starting point and the target point is greater than or equal to a first preset distance, determining that the pathfinding mode is aerial pathfinding includes: When the distance between the starting point and the target point is greater than or equal to the first preset distance and less than the second preset distance, determining that the path finding method is low altitude path finding; When the distance between the starting point and the target point is greater than a second preset distance, determining that the path finding method is high-altitude path finding; Correspondingly, when the path finding method is aerial path finding, determining in sequence at least one waypoint from the starting point to the target point in the aerial waypoints includes: In the case where the path finding method is low-altitude path finding, at least one waypoint for path finding from the starting point to the target point is determined in sequence among the low-altitude waypoints; In the case where the path finding method is high-altitude path finding, at least one waypoint for path finding from the starting point to the target point is determined in sequence among the high-altitude waypoints.
7. The method according to any one of claims 1 to 6, characterized in that The preset waypoints are marked with corresponding waypoint attributes, and the waypoint attributes include non-skippable waypoints and skippable waypoints; Determining in sequence at least one waypoint for finding a path from the starting point to the target point, comprising: In the case where any waypoint is located within a preset range corresponding to any non-skippable waypoint, the any non-skippable waypoint is determined as the next waypoint corresponding to the any waypoint.
8. A game path-finding device, characterized in that: The device comprises: A target point determination module, for responding to a path-finding instruction of a virtual character and determining a starting point and a target point indicated by the path-finding instruction; A waypoint determination module is used to determine, when it is determined that the wayfinding mode corresponding to the wayfinding instruction is aerial wayfinding, at least one waypoint for finding a path from the starting point to the target point in sequence based on the aerial waypoints among the plurality of preset waypoints, so as to form a plurality of waypoints starting from the starting point and sequentially passing through the waypoints and reaching the target point; The pathfinding module is used to plan the pathfinding path from each pathfinding point to the next pathfinding point in sequence, starting from the first pathfinding point, and control the virtual character to find the path in sequence according to each pathfinding path.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
10. A computer device comprising a storage medium, a processor, and a computer program stored in the storage medium and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.