CN112473142A - Progressive way-finding method, system, electronic device and storage medium - Google Patents

Progressive way-finding method, system, electronic device and storage medium Download PDF

Info

Publication number
CN112473142A
CN112473142A CN202011233462.XA CN202011233462A CN112473142A CN 112473142 A CN112473142 A CN 112473142A CN 202011233462 A CN202011233462 A CN 202011233462A CN 112473142 A CN112473142 A CN 112473142A
Authority
CN
China
Prior art keywords
target point
routing
point
game object
starting point
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.)
Pending
Application number
CN202011233462.XA
Other languages
Chinese (zh)
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.)
Hangzhou Electronic Soul Network Technology Co Ltd
Original Assignee
Hangzhou Electronic Soul Network Technology 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 Hangzhou Electronic Soul Network Technology Co Ltd filed Critical Hangzhou Electronic Soul Network Technology Co Ltd
Priority to CN202011233462.XA priority Critical patent/CN112473142A/en
Publication of CN112473142A publication Critical patent/CN112473142A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • 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/50Controlling the output signals based on the game progress
    • A63F13/53Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game
    • A63F13/537Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen
    • A63F13/5378Controlling the output signals based on the game progress involving additional visual information provided to the game scene, e.g. by overlay to simulate a head-up display [HUD] or displaying a laser sight in a shooting game using indicators, e.g. showing the condition of a game character on screen for displaying an additional top view, e.g. radar screens or maps
    • 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/70Game security or game management aspects
    • A63F13/77Game security or game management aspects involving data related to game devices or game servers, e.g. configuration data, software version or amount of memory
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/53Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers details of basic data processing
    • A63F2300/531Server assignment

Abstract

The application relates to a method, a system, an electronic device and a storage medium for progressive route searching, wherein the method for progressive route searching comprises the following steps: the method comprises the steps of carrying out route finding on an area of a game object between a first starting point and a first target point of a route finding map according to a route finding algorithm, further finding a new lattice to obtain different lattices, forming a set by a plurality of lattices capable of being passed through, if the size of the set exceeds a preset maximum step parameter, selecting a lattice which is closest to the target point from the set, judging whether the closest lattice is the target point, if so, successfully finding, indicating the game object to reach the target point, finishing the route finding, and if not, finishing the route finding until reaching the target point. Through the method and the device, the problem that CPU resource consumption is large and uncontrollable under the condition that the topographic complex routing calculation amount is large is solved, the CPU resource consumption can be effectively controlled, and the game experience of a user is improved.

Description

Progressive way-finding method, system, electronic device and storage medium
Technical Field
The present application relates to the field of computers, and more particularly, to a method, system, electronic device, and storage medium for progressive routing.
Background
With the rapid development of information technology, the development of the game industry is also faster and faster, and the artificial intelligence technology is applied to game development to improve the playability of games and the reality of game experience, wherein a routing algorithm based on artificial intelligence is more prominent in game development, for example, an a-x search algorithm is one of shortest path search algorithms widely applied in routing algorithms, and can traverse a plurality of places in a short time and find out the shortest path. In a game, no matter a virtual character controlled by a player or a monster character controlled by a system completes a task, a way-finding algorithm is very important and is related to the game experience of a user.
In the related art, the path-finding algorithm has a large calculation amount, so that the CPU performance consumption is large, and the consumed CPU resources are more and less, and particularly, logic jamming occurs under the condition of complex terrain, so that the user experience is poor.
At present, no effective solution is provided for the problem that in the related art, under the condition of a complex terrain and a large path-finding calculation amount, CPU resource consumption is large and uncontrollable.
Disclosure of Invention
The embodiment of the application provides a method, a system, an electronic device and a storage medium for gradual path finding, which at least solve the problems of large CPU resource consumption and uncontrollable under the condition of large topographic complex path finding calculation amount in the related art.
In a first aspect, an embodiment of the present application provides a method for progressive routing, where the method includes:
carrying out routing on an area of a game object between a first starting point and a first target point of a routing map according to a routing algorithm to obtain different grids, wherein a plurality of accessible grids form a first set;
comparing a preset maximum step parameter with the size of the first set, and judging whether the game object can reach the first target point from the first starting point;
under the condition that the first target point cannot be reached, screening grids closest to the first target point from the first set;
taking the nearest grid as a second starting point, and performing routing on an area between the second starting point and the first target point to obtain different grids, wherein a plurality of the grids which can be communicated form a second set;
comparing the preset maximum step parameter with the size of the second set, and judging whether the game object can reach the first target point from the second starting point;
and instructing the game object to move to the first target point when the first target point is judged to be reachable.
In some embodiments, after the grid closest to the first target point is screened from the first set in the case that the first target point is determined not to be reachable, and before the routing is performed on the area between the second starting point and the first target point, the method includes:
instructing the game object to move to the nearest grid.
In some embodiments, after the taking the nearest lattice as the second starting point, the method includes:
after the first target point is changed into a second target point, routing an area between the second starting point and the second target point to obtain different grids, and forming a third set by a plurality of grids which can be communicated;
comparing the preset maximum step parameter with the size of the third set, and judging whether the game object can reach the second target point from the second starting point;
and instructing the game object to move to the second target point when the second target point is judged to be reachable.
In some embodiments, configuring the preset maximum step parameter comprises:
and configuring the preset maximum step parameter to be larger than a first preset threshold value and smaller than a second preset threshold value.
In a second aspect, an embodiment of the present application provides a system for progressive routing, where the system includes:
a first routing module for routing the area of the game object between a first starting point and a first target point of a routing map according to a routing algorithm to obtain different grids, a first set is formed by a plurality of passable grids,
comparing a preset maximum step parameter with the size of the first set, determining whether the game object can reach the first target point from the first starting point,
under the condition that the first target point cannot be reached, screening grids closest to the first target point from the first set;
a second routing module, configured to route an area from the second starting point to the first destination point using the nearest lattice as a second starting point to obtain different lattices, wherein a plurality of the traversable lattices form a second set,
comparing the preset maximum step parameter with the size of the second set, determining whether the game object can reach the first target point from the second starting point,
and instructing the game object to move to the first target point when the first target point is judged to be reachable.
In some embodiments, the first routing module is configured to, in a case that it is determined that the first target point cannot be reached, instruct the game object to move to the closest grid after the grid closest to the first target point is screened from the first set and before routing is performed on an area between the second starting point and the first target point.
In some of these embodiments, the system further comprises a third routing module,
the third routing module is configured to route an area from the second starting point to a second destination point after the nearest lattice is used as the second starting point and the first destination point is changed to the second destination point, so as to obtain different lattices, and a third set is formed by a plurality of feasible lattices,
comparing the preset maximum step parameter with the size of the third set, determining whether the game object can reach the second target point from the second starting point,
and instructing the game object to move to the second target point when the second target point is judged to be reachable.
In some embodiments, configuring the preset maximum step parameter comprises:
the first path searching module configures that the preset maximum step parameter is larger than a first preset threshold and smaller than a second preset threshold.
In a third aspect, an embodiment of the present application provides an electronic apparatus, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the computer program to perform the progressive routing method described in any one of the above.
In a fourth aspect, the present application provides a storage medium, in which a computer program is stored, where the computer program is configured to execute the progressive way-finding method described in any one of the above items when the computer program runs.
Compared with the prior art, the progressive way-finding method provided by the embodiment of the application finds the way of the area of the game object between the first starting point and the first target point of the way-finding map according to the way-finding algorithm to obtain different lattices, and the plurality of passable lattices form a first set; comparing the preset maximum step parameter with the size of the first set, and judging whether the game object can reach a first target point from a first starting point or not; under the condition that the first target point cannot be reached, screening grids closest to the first target point from the first set; taking the nearest lattice as a second starting point, carrying out routing on an area between the second starting point and a first target point to obtain different lattices, and forming a second set by a plurality of operable lattices; comparing the preset maximum step parameter with the size of the second set, and judging whether the game object can reach the first target point from the second starting point; under the condition that the game object can reach the first target point, the game object is indicated to move to the first target point, the problems that CPU resource consumption is large and uncontrollable under the condition that terrain complex routing calculation amount is large are solved, accurate routing is changed into fuzzy routing, CPU resource consumption is reduced, the CPU resource consumed by routing is controllable, and game experience of a user is improved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a schematic diagram of an application environment of a method for progressive routing according to an embodiment of the present application;
FIG. 2 is a flow chart of a progressive way-finding method according to an embodiment of the present application;
fig. 3 is a routing diagram of a routing algorithm according to an embodiment of the present application;
FIG. 4 is a schematic way-finding diagram of a first way-finding according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a second seek according to an embodiment of the present application;
FIG. 6 is a schematic diagram of a grid nearest to a first target point reached by a game object after a first seek according to an embodiment of the present application;
FIG. 7 is a block diagram of a progressive routing system according to an embodiment of the present application;
FIG. 8 is a block diagram of another configuration of a progressive routing system according to an embodiment of the present application;
fig. 9 is an internal structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments provided in the present application without any inventive step are within the scope of protection of the present application. Moreover, it should be appreciated that in the development of any such actual implementation, as in any engineering or design project, numerous implementation-specific decisions must be made to achieve the developers' specific goals, such as compliance with system-related and business-related constraints, which may vary from one implementation to another.
Reference in the specification to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the specification. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. Those of ordinary skill in the art will explicitly and implicitly appreciate that the embodiments described herein may be combined with other embodiments without conflict.
Unless defined otherwise, technical or scientific terms referred to herein shall have the ordinary meaning as understood by those of ordinary skill in the art to which this application belongs. Reference to "a," "an," "the," and similar words throughout this application are not to be construed as limiting in number, and may refer to the singular or the plural. The present application is directed to the use of the terms "including," "comprising," "having," and any variations thereof, which are intended to cover non-exclusive inclusions; for example, a process, method, system, article, or apparatus that comprises a list of steps or modules (elements) is not limited to the listed steps or elements, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. Reference to "connected," "coupled," and the like in this application is not intended to be limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. Reference herein to "a plurality" means greater than or equal to two. "and/or" describes an association relationship of associated objects, meaning that three relationships may exist, for example, "A and/or B" may mean: a exists alone, A and B exist simultaneously, and B exists alone. Reference herein to the terms "first," "second," "third," and the like, are merely to distinguish similar objects and do not denote a particular ordering for the objects.
The progressive way finding method provided by the present application can be applied to an application environment shown in fig. 1, where fig. 1 is an application environment schematic diagram of the progressive way finding method according to an embodiment of the present application, as shown in fig. 1, where a system of the application environment includes a server 10 and an intelligent terminal device 11, and the method is specifically implemented as follows: the server 10 searches a route of a game object in an area between a first starting point and a first target point of a route searching map according to a route searching algorithm to obtain different lattices, and a first set is formed by a plurality of passable lattices; then comparing the preset maximum step parameter with the size of the first set, and judging whether the game object can reach a first target point from a first starting point or not; under the condition that the first target point cannot be reached, the grids closest to the first target point are screened from the first set, and path finding is continued; then taking the nearest lattice as a second starting point, carrying out routing on an area between the second starting point and a first target point to obtain different lattices, and forming a second set by a plurality of operable lattices; judging whether the game object can reach the first target point from the second starting point or not by comparing the preset maximum step parameter with the size of the second set; under the condition that the game object can reach the first target point, the game object is indicated to move to the first target point, and the path finding is finished, so that the problems of large CPU resource consumption and uncontrollable path finding under the condition of large topographic complex path finding calculation amount are solved, the accurate path finding is changed into the fuzzy path finding, the CPU resource consumption is reduced, the CPU resource consumed by path finding is controllable, and the game experience of a user is improved.
The present embodiment provides a method for progressive routing, and fig. 2 is a flowchart of a method for progressive routing according to an embodiment of the present application, and as shown in fig. 2, the flowchart includes the following steps:
step S201, performing routing for the area of the game object between the first starting point and the first target point of the routing map according to a routing algorithm to obtain different grids, and forming a first set by a plurality of traversable grids, wherein the routing is an important part in the game, not only the game AI but also the character object operated by the user need to be automatically routed, the routing means finding a traversable path from a certain starting point to a certain end point, because in practical situations, the straight line direction between the starting point and the end point often has obstacles, and needs to be solved by a routing algorithm for searching, the routing algorithm has many kinds, such as an a routing algorithm, fig. 3 is a routing diagram of an a routing algorithm according to an embodiment of the present application, as shown in fig. 3, optionally, the present embodiment adopts an a routing algorithm, and the routing is performed for the area of the game object between the first starting point and the first target point of the routing map according to the a routing algorithm, obtaining different grids, wherein 9 grids form a first set (grid with grid lines in fig. 3), and the black grid represents an obstacle, namely the grid is not passable, wherein the routing map comprises grids with equal size and different attributes, the grids cannot be subdivided into smaller grids which are the minimum complete units on the map, the position of the grid in the map is a coordinate, and the coordinate is continuous rather than discrete in order to ensure that the existing grid can describe a complete area;
step S202, comparing the preset maximum step parameter with the size of the first set, determining whether the game object can reach the first target point from the first starting point, screening the grid nearest to the first target point from the first set in case of determining that the first target point cannot be reached, determining whether the AI object in the game and the task object operated by the user can reach the first target point from the first starting point by comparing the preset maximum step parameter with the size of the first set, screening the grid nearest to the first target point from the first set in case of determining that the first target point cannot be reached, wherein if the preset maximum step parameter is greater than the first set number, determining that the game object can reach the first target point from the first starting point, otherwise, if the preset maximum step parameter is less than the first set number, determining that the game object cannot reach the first target point from the first starting point, optionally, assuming that the preset maximum step parameter in this embodiment is set to 5, the first aggregate number is 9, and fig. 4 is a schematic diagram of the path finding for the first path finding according to the embodiment of the present application, as shown in fig. 4, since the preset maximum step parameter is smaller than the first aggregate number, the game object cannot reach the first target point from the first starting point, so that the first path finding finds 5 grids (grids of the checkered pattern in fig. 4) in the first aggregate, screens out the grids closest to the first target point, and continues to find the path, in this embodiment, the preset maximum step parameter is adopted, the total number of grids that need to be found is split, the number of grids for each path finding is adjusted, so as to reduce the calculation amount for each path, control the CPU consumption for each path finding, and reduce the CPU consumption for single path finding;
step S203, taking the nearest lattice as a second starting point, performing routing on an area between the second starting point and the first destination point to obtain different lattices, and forming a second set by a plurality of passable lattices, fig. 5 is a routing diagram of second routing according to the embodiment of the present application, as shown in fig. 5, optionally, taking the nearest lattice as the second starting point, performing routing on an area between the second starting point and the first destination point to obtain different lattices, and forming the second set by 4 passable lattices (the lattices with vertical lines in fig. 5);
step S204, comparing the preset maximum step parameter with the size of the second set, judging whether the game object can reach the first target point from the second starting point, and indicating the game object to move to the first target point and finishing the path searching under the condition of judging that the game object can reach the first target point. Optionally, in this embodiment, by comparing the preset maximum step parameter with the size of the second set, it is determined whether the game object can reach the first target point from the second starting point, and in a case that it is determined that the game object can reach the first target point, the game object is instructed to move to the first target point, where if the preset maximum step parameter is greater than the second set number, it is determined that the game object can reach the first target point from the second starting point, and otherwise, if the preset maximum step parameter is less than the second set number, it is determined that the game object cannot reach the first target point from the second starting point. According to fig. 5, the second set number 4 is smaller than the preset maximum step parameter 5, and the game object can reach the first target point from the second starting point, so the second seek searches the 4 vertical stripes in the second set to indicate that the game object moves to the first target point. In the embodiment, one path searching from the starting point to the target point is divided into multiple paths, so that the target point is reached through multiple path searching in a limited step, the calculation amount of single path searching is reduced, the CPU resource consumed by path searching is controllable, and the CPU resource consumption is effectively reduced.
Through the steps S201 to S204, compared to the prior art, the routing algorithm has a large calculation amount, which causes a large CPU performance consumption, and consumes a large amount of CPU resources, and the CPU resources are consumed in a short time, especially in a complicated terrain, which causes a problem of poor user experience, large CPU resource consumption, and uncontrollable performance. The embodiment adopts a method for setting maximum step parameters, and carries out route finding on an area of a game object between a first starting point and a first target point of a route finding map according to a route finding algorithm to obtain different grids, wherein a plurality of grids which can be passed form a first set; then comparing the preset maximum step parameter with the size of the first set, and judging whether the game object can reach a first target point from a first starting point or not; under the condition that the first target point cannot be reached, the grids closest to the first target point are screened from the first set, and path finding is continued; then taking the nearest lattice as a second starting point, carrying out routing on an area between the second starting point and a first target point to obtain different lattices, and forming a second set by a plurality of operable lattices; judging whether the game object can reach the first target point from the second starting point or not by comparing the preset maximum step parameter with the size of the second set; under the condition that the game object can reach the first target point, the game object is indicated to move to the first target point, and path finding is finished, so that the problems that CPU resource consumption is large and uncontrollable under the condition that the topographic complex path finding calculation amount is large in the prior art are solved, accurate path finding is changed into fuzzy path finding, the consumption of CPU resources is reduced, the CPU resource consumed by path finding is controllable, and the game experience of a user is improved.
In some embodiments, in the case where it is determined that the first target point cannot be reached, the game object is instructed to move to the closest grid after the grid closest to the first target point is screened from the first set and before a seek is made to an area between the second start point and the first target point. Fig. 6 is a schematic diagram of a grid closest to the first target point reached by the game object after the first way finding according to the embodiment of the present application, and as shown in fig. 6, alternatively, in this embodiment, in a case that it is determined that the first target point cannot be reached, after the grid closest to the first target point is screened from the first set, and before the way finding is performed on the area between the second starting point and the first target point, the game object is instructed to move to the grid closest to the first target point (the grid with the line in fig. 6).
In some embodiments, after the nearest grid is used as the second starting point, after the first target point is changed into the second target point, the route searching is performed on the area between the second starting point and the second target point to obtain different grids, a third set is formed by a plurality of grids capable of being passed through, the preset maximum step parameter and the size of the third set are compared, whether the game object can reach the second target point from the second starting point or not is judged, and in the case that the game object can reach the second target point, the game object is instructed to move to the second target point. Optionally, in this embodiment, after the nearest grid is used as the second starting point, after the first target point is changed to the second target point, routing is performed on an area between the second starting point and the second target point, so as to obtain different grids, a third set is formed by a plurality of grids capable of being passed through, a preset maximum step parameter is compared with the size of the third set, and whether the game object can reach the second target point from the second starting point is determined, wherein if the preset maximum step parameter is greater than the number of the third set, it is determined that the game object can reach the second target point from the second starting point, otherwise, if the preset maximum step parameter is less than the number of the third set, it is determined that the game object cannot reach the third target point from the second starting point, in case that it is determined that the game object can reach the second target point, the game object is instructed to move to the second target point, and in case that it is determined that the game object cannot, and (5) selecting the grid closest to the second target point from the third set, taking the closest grid as a third starting point, and repeating the steps S202 and S203 until the final target point is reached. The embodiment can adjust the target point of the path searching at any time through the maximum step parameter, reduce CPU consumption and improve the efficiency of the server.
In some of these embodiments, configuring the preset maximum step parameter comprises: the preset maximum step parameter is configured to be greater than a first preset threshold and smaller than a second preset threshold, where the first preset threshold and the second preset threshold are set according to a path finding need in an actual game, optionally, the preset maximum parameter step configured in this embodiment is greater than the first preset threshold, that is, the number of lattices traversed by a single path finding cannot be too small, otherwise, the path finding effect is not good, and meanwhile, the preset maximum parameter step is smaller than the second preset threshold, that is, the lattices traversed by a single path finding cannot be too large, which results in a large calculation amount of a single path finding, excessive CPU consumption, especially, logic stagnation may occur when a terrain is complex, and poor user experience is caused. The embodiment can effectively control the CPU resource consumed by single path searching through the step of configuring the preset maximum parameter, and improve the path searching effect and good user experience.
It should be noted that the steps illustrated in the above-described flow diagrams or in the flow diagrams of the figures may be performed in a computer system, such as a set of computer-executable instructions, and that, although a logical order is illustrated in the flow diagrams, in some cases, the steps illustrated or described may be performed in an order different than here.
The embodiment also provides a system for progressive path finding, which is used for implementing the foregoing embodiments and preferred embodiments, and the description of the system that has been already made is omitted. As used hereinafter, the terms "module," "unit," "subunit," and the like may implement a combination of software and/or hardware for a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 7 is a block diagram of a progressive routing system according to an embodiment of the present application, and as shown in fig. 7, the system includes a first routing module 71 and a second routing module 72:
the first routing module 71 is configured to route a game object in an area between a first starting point and a first target point of a routing map according to a routing algorithm to obtain different grids, where multiple grids that can be passed through form a first set, compare a preset maximum step parameter with a size of the first set, determine whether the game object can reach the first target point from the first starting point, and if it is determined that the game object cannot reach the first target point, screen out a grid closest to the first target point from the first set, and continue routing; the second routing module 72 is configured to take the nearest cell as a second starting point, route the area from the second starting point to the first target point to obtain different cells, form a second set by a plurality of cells that can be run, compare the preset maximum step parameter with the size of the second set, determine whether the game object can reach the first target point from the second starting point, instruct the game object to move to the first target point when it is determined that the game object can reach the first target point, and end routing.
Through the system, the first path searching module 71 adopts the preset maximum step parameter, splits the total number of lattices needing path searching according to the maximum step parameter, screens out the lattices closest to the target point, continues path searching, reduces the calculation amount of each time by adjusting the number of the lattices searching each time, controls the CPU consumption of each path searching, and reduces the CPU consumption of single path searching; the second path-finding module 72 continues to find the path from the second starting point, and divides one path-finding from the starting point to the target point into a plurality of times, so that the path-finding reaches the target point through the plurality of path-finding in a limited step, thereby reducing the calculation amount of the single path-finding, controlling the CPU resource consumed by the path-finding, and effectively reducing the CPU resource consumption. The whole system solves the problems of large CPU resource consumption and uncontrollable under the condition of complex topographic routing calculation amount, changes the accurate routing into fuzzy routing, reduces the consumption of CPU resources, enables the CPU resources consumed by routing to be controllable, and improves the routing effect and the game experience of users.
In some embodiments, the first routing module 71 is further configured to instruct the game object to move to the nearest grid after the grid closest to the first target point is screened from the first set and before routing the area between the second starting point and the first target point if it is determined that the first target point cannot be reached. Optionally, in this embodiment, when it is determined that the first target point cannot be reached, after the grid closest to the first target point is screened from the first set and before the area between the second starting point and the first target point is routed, the game object is instructed to move to the grid closest to the first target point (the grid with the dotted lines in fig. 6).
In some embodiments, the system further includes a third routing module, fig. 8 is another structural block diagram of the progressive routing system according to the embodiment of the present application, and as shown in fig. 8, the system includes a first routing module 81 and a third routing module 82, the third routing module 82 is configured to, after a nearest grid is used as a second starting point, perform routing on an area between the second starting point and the second target point after the first target point is changed to the second target point, obtain different grids, form a third set by a plurality of accessible grids, compare a preset maximum step parameter with a size of the third set, determine whether the game object can reach the second target point from the second starting point, and instruct the game object to move to the second target point in case that the second target point is determined to be reached. Optionally, in this embodiment, after the nearest grid is used as the second starting point, after the first target point is changed to the second target point, routing is performed on an area between the second starting point and the second target point, so as to obtain different grids, a third set is formed by a plurality of grids capable of being passed through, a preset maximum step parameter is compared with the size of the third set, and whether the game object can reach the second target point from the second starting point is determined, wherein if the preset maximum step parameter is greater than the number of the third set, it is determined that the game object can reach the second target point from the second starting point, otherwise, if the preset maximum step parameter is less than the number of the third set, it is determined that the game object cannot reach the third target point from the second starting point, in case that it is determined that the game object can reach the second target point, the game object is instructed to move to the second target point, and in case that it is determined that the game object cannot, and (5) selecting the grid closest to the second target point from the third set, taking the closest grid as a third starting point, and repeating the steps S202 and S203 until the final target point is reached. The embodiment can adjust the target point of the path searching at any time through the maximum step parameter, reduce CPU consumption and improve the efficiency of the server.
In some embodiments, the first routing module 71 is further configured to configure the preset maximum step parameter, including: the preset maximum step parameter is configured to be greater than a first preset threshold and smaller than a second preset threshold, where the first preset threshold and the second preset threshold are set according to a path finding need in an actual game, optionally, the preset maximum parameter step configured in this embodiment is greater than the first preset threshold, that is, the number of lattices traversed by a single path finding cannot be too small, otherwise, the path finding effect is not good, and meanwhile, the preset maximum parameter step is smaller than the second preset threshold, that is, the lattices traversed by a single path finding cannot be too large, which results in a large calculation amount of a single path finding, excessive CPU consumption, especially, logic stagnation may occur when a terrain is complex, and poor user experience is caused. The embodiment can effectively control the CPU resource consumed by single path searching through the step of configuring the preset maximum parameter, and improve the path searching effect and good user experience.
The present invention will be described in detail with reference to the following application scenarios.
The invention aims to provide a method and a system for progressive path finding, and the flow steps of the technical scheme of the progressive path finding in the embodiment comprise:
s1, according to A-x algorithm, the path of the game object is found in the area between the first starting point and the first target point of the path finding map, and a new lattice is further found to obtain different lattices;
s2, forming the obtained operable lattices into a set S, and if the size of the set S exceeds a preset maximum step parameter N, selecting a lattice which is closest to a target point from the set S;
s3, judging whether the nearest grid is the target point, if so, finding successfully, indicating the game object to reach the target point, and ending the path finding; otherwise, go to step S1, repeat steps S1 to S3 until reaching the target point, and end the way finding.
The present embodiment also provides an electronic device comprising a memory having a computer program stored therein and a processor configured to execute the computer program to perform the steps of any of the above method embodiments.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
In addition, in combination with the progressive way-finding method in the foregoing embodiments, the embodiments of the present application may provide a storage medium to implement. The storage medium having stored thereon a computer program; the computer program, when executed by a processor, implements any one of the progressive routing methods of the above embodiments.
In an embodiment, fig. 9 is a schematic internal structure diagram of an electronic device according to an embodiment of the present application, and as shown in fig. 9, there is provided an electronic device, which may be a server, and its internal structure diagram may be as shown in fig. 9. The electronic device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile 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 an operating system and computer programs in the non-volatile storage medium. The database of the electronic device is used for storing data. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement a method of progressive routing.
Those skilled in the art will appreciate that the configuration shown in fig. 9 is a block diagram of only a portion of the configuration relevant to the present application, and does not constitute a limitation on the electronic device to which the present application is applied, and a particular electronic device may include more or less components than those shown in the drawings, or combine certain components, or have a different arrangement of components.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It should be understood by those skilled in the art that various features of the above-described embodiments can be combined in any combination, and for the sake of brevity, all possible combinations of features in the above-described embodiments are not described in detail, but rather, all combinations of features which are not inconsistent with each other should be construed as being within the scope of the present disclosure.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of progressive routing, the method comprising:
carrying out routing on an area of a game object between a first starting point and a first target point of a routing map according to a routing algorithm to obtain different grids, wherein a plurality of accessible grids form a first set;
comparing a preset maximum step parameter with the size of the first set, and judging whether the game object can reach the first target point from the first starting point;
under the condition that the first target point cannot be reached, screening grids closest to the first target point from the first set;
taking the nearest grid as a second starting point, and performing routing on an area between the second starting point and the first target point to obtain different grids, wherein a plurality of the grids which can be communicated form a second set;
comparing the preset maximum step parameter with the size of the second set, and judging whether the game object can reach the first target point from the second starting point;
and instructing the game object to move to the first target point when the first target point is judged to be reachable.
2. The method of claim 1, wherein after the grid closest to the first target point is screened from the first set and before the area between the second starting point and the first target point is routed if the first target point is determined not to be reachable, the method comprises:
instructing the game object to move to the nearest grid.
3. The method according to claim 1 or 2, wherein after taking the nearest lattice as a second starting point, the method comprises:
after the first target point is changed into a second target point, routing an area between the second starting point and the second target point to obtain different grids, and forming a third set by a plurality of grids which can be communicated;
comparing the preset maximum step parameter with the size of the third set, and judging whether the game object can reach the second target point from the second starting point;
and instructing the game object to move to the second target point when the second target point is judged to be reachable.
4. The method of claim 1, wherein configuring the preset maximum step parameter comprises:
and configuring the preset maximum step parameter to be larger than a first preset threshold value and smaller than a second preset threshold value.
5. A system for progressive routing, the system comprising:
a first routing module for routing the area of the game object between a first starting point and a first target point of a routing map according to a routing algorithm to obtain different grids, a first set is formed by a plurality of passable grids,
comparing a preset maximum step parameter with the size of the first set, determining whether the game object can reach the first target point from the first starting point,
under the condition that the first target point cannot be reached, screening grids closest to the first target point from the first set;
a second routing module, configured to route an area from the second starting point to the first destination point using the nearest lattice as a second starting point to obtain different lattices, wherein a plurality of the traversable lattices form a second set,
comparing the preset maximum step parameter with the size of the second set, determining whether the game object can reach the first target point from the second starting point,
and instructing the game object to move to the first target point when the first target point is judged to be reachable.
6. The system according to claim 5, wherein the first routing module is configured to instruct the game object to move to the closest grid after the grid closest to the first target point is screened from the first set and before routing the area from the second starting point to the first target point in the case that the first target point is determined not to be reached.
7. The system of claim 5 or 6, further comprising a third routing module,
the third routing module is configured to route an area from the second starting point to a second destination point after the nearest lattice is used as the second starting point and the first destination point is changed to the second destination point, so as to obtain different lattices, and a third set is formed by a plurality of feasible lattices,
comparing the preset maximum step parameter with the size of the third set, determining whether the game object can reach the second target point from the second starting point,
and instructing the game object to move to the second target point when the second target point is judged to be reachable.
8. The system of claim 5, wherein configuring the preset maximum step parameter comprises:
the first path searching module configures that the preset maximum step parameter is larger than a first preset threshold and smaller than a second preset threshold.
9. An electronic device comprising a memory and a processor, wherein the memory has stored therein a computer program, and the processor is configured to execute the computer program to perform the method of progressive routing according to any one of claims 1 to 4.
10. A storage medium having stored thereon a computer program, wherein the computer program is arranged to perform the method of progressive routing according to any one of claims 1 to 4 when executed.
CN202011233462.XA 2020-11-06 2020-11-06 Progressive way-finding method, system, electronic device and storage medium Pending CN112473142A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011233462.XA CN112473142A (en) 2020-11-06 2020-11-06 Progressive way-finding method, system, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011233462.XA CN112473142A (en) 2020-11-06 2020-11-06 Progressive way-finding method, system, electronic device and storage medium

Publications (1)

Publication Number Publication Date
CN112473142A true CN112473142A (en) 2021-03-12

Family

ID=74928888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011233462.XA Pending CN112473142A (en) 2020-11-06 2020-11-06 Progressive way-finding method, system, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN112473142A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113827973A (en) * 2021-09-27 2021-12-24 网易(杭州)网络有限公司 Map path finding method, device, terminal and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110721472A (en) * 2019-10-08 2020-01-24 上海莉莉丝科技股份有限公司 Path finding method, device, equipment and recording medium
CN110755848A (en) * 2019-11-06 2020-02-07 网易(杭州)网络有限公司 Path finding method in game, terminal and readable storage medium
CN110812844A (en) * 2019-11-06 2020-02-21 网易(杭州)网络有限公司 Path finding method in game, terminal and readable storage medium
CN111177291A (en) * 2019-12-23 2020-05-19 腾讯科技(深圳)有限公司 Object moving method, device, equipment and medium
CN111714892A (en) * 2020-06-29 2020-09-29 天津亚克互动科技有限公司 Game way finding method and device, storage medium and computer equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110721472A (en) * 2019-10-08 2020-01-24 上海莉莉丝科技股份有限公司 Path finding method, device, equipment and recording medium
CN110755848A (en) * 2019-11-06 2020-02-07 网易(杭州)网络有限公司 Path finding method in game, terminal and readable storage medium
CN110812844A (en) * 2019-11-06 2020-02-21 网易(杭州)网络有限公司 Path finding method in game, terminal and readable storage medium
CN111177291A (en) * 2019-12-23 2020-05-19 腾讯科技(深圳)有限公司 Object moving method, device, equipment and medium
CN111714892A (en) * 2020-06-29 2020-09-29 天津亚克互动科技有限公司 Game way finding method and device, storage medium and computer equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113827973A (en) * 2021-09-27 2021-12-24 网易(杭州)网络有限公司 Map path finding method, device, terminal and storage medium

Similar Documents

Publication Publication Date Title
CN110490309B (en) Operator fusion method for neural network and related product thereof
CN111371603A (en) Service instance deployment method and device applied to edge computing
CN108566660A (en) A kind of method for switching network, device and computer readable storage medium
CN113342409B (en) Delay sensitive task unloading decision method and system for multi-access edge computing system
CN104613976A (en) Path determination method and device
CN112436971B (en) Global instruction control network cooperative topology generation method based on Monte Carlo tree search
CN111181792B (en) SDN controller deployment method and device based on network topology and electronic equipment
US20200195502A1 (en) Network control system, method and program
CN113645637B (en) Method and device for unloading tasks of ultra-dense network, computer equipment and storage medium
CN112473142A (en) Progressive way-finding method, system, electronic device and storage medium
CN110933723A (en) Roaming switching control method and device and wireless AP
CN110536326B (en) Network load balancing method and device based on small-step fast-running algorithm
CN107766528A (en) Data load method, terminal and the computer-readable recording medium of the waterfall stream page
Laboni et al. A hyper heuristic algorithm for efficient resource allocation in 5G mobile edge clouds
CN116894469B (en) DNN collaborative reasoning acceleration method, device and medium in end-edge cloud computing environment
Huang et al. Server placement and task allocation for load balancing in edge-computing networks
CN114783215B (en) Unmanned aerial vehicle clustering method and device and electronic equipment
CN110224861A (en) The implementation method of adaptive dynamic heterogeneous network selection policies based on study
CN113485848B (en) Deep neural network deployment method and device, computer equipment and storage medium
CN114428984A (en) Wall processing method and device in model, computer equipment and storage medium
Stai et al. Socially-inspired topology improvements in wireless multi-hop networks
Sangwan et al. Uivh-algorithm for seamless mobility in heterogeneous wireless network
Munoz et al. Design of an Unstructured and Free Geo-Coordinates Information Brokerage System for Sensor Networks using Directional Random Walks.
US11507812B2 (en) Neural network operational method and apparatus, and related device
CN111640043A (en) Power distribution network reconstruction method and device, computer equipment and storage 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