CN112076478A - Game path generation method and device - Google Patents

Game path generation method and device Download PDF

Info

Publication number
CN112076478A
CN112076478A CN202011025110.5A CN202011025110A CN112076478A CN 112076478 A CN112076478 A CN 112076478A CN 202011025110 A CN202011025110 A CN 202011025110A CN 112076478 A CN112076478 A CN 112076478A
Authority
CN
China
Prior art keywords
path
node
layers
connection
game
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.)
Granted
Application number
CN202011025110.5A
Other languages
Chinese (zh)
Other versions
CN112076478B (en
Inventor
曾莉珊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202011025110.5A priority Critical patent/CN112076478B/en
Publication of CN112076478A publication Critical patent/CN112076478A/en
Application granted granted Critical
Publication of CN112076478B publication Critical patent/CN112076478B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for generating a game path. Wherein, the method comprises the following steps: acquiring path node data of each path layer in a plurality of path layers of a game path; determining any connecting path between every two adjacent path layers in the plurality of path layers according to the path node data; the game path is generated based on any one of the connection paths between every two adjacent path layers among the plurality of path layers. The invention solves the technical problem that the mode of generating the random game path in the prior art cannot give consideration to the calculation efficiency.

Description

Game path generation method and device
Technical Field
The invention relates to the technical field of games, in particular to a method and a device for generating a game path.
Background
The exploration game is one of important themes in the game, belongs to a game type with high degree of freedom, and can enable a player to freely search resources in the game world to explore and move forward. Among them, the game of Roguelike type is a branch of the research-like game that is very classic, and in the game of Roguelike type, the design of random stage path is very important. The game break-through playing method gives a starting point and a terminal point, a plurality of nodes are arranged in the middle to provide certain supply and adventure consumption for a player, the playing method has more than one path leading to the terminal point, each node has various optional branches, and the player needs to comprehensively consider the income of each path, so that the player can experience the fun of exploring the optimal path.
How to design a random checkpoint path under the condition of considering calculation efficiency and quickly obtaining a non-repetitive random path map when a player starts a playing method, so that the player has enough interest and belongs to a very key design link in the game design.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a method and a device for generating a game path, which are used for at least solving the technical problem that the mode of generating a random game path in the prior art cannot give consideration to the calculation efficiency.
According to an aspect of an embodiment of the present invention, there is provided a game path generation method, including: acquiring path node data of each path layer in a plurality of path layers of a game path; determining any connecting path between every two adjacent path layers in the plurality of path layers according to the path node data; the game path is generated based on any one of the connection paths between every two adjacent path layers among the plurality of path layers.
According to another aspect of the embodiments of the present invention, there is also provided a game path generation apparatus, including: the game system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring path node data of each path layer in a plurality of path layers of a game path; a determining module, configured to determine, according to the path node data, any one connection path between every two adjacent path layers in the multiple path layers; and the generating module is used for generating the game path based on any one of the connection paths between every two adjacent path layers in the plurality of path layers.
According to another aspect of the embodiments of the present invention, there is also provided a non-volatile storage medium, where the non-volatile storage medium includes a stored program, and when the program runs, the apparatus where the non-volatile storage medium is located is controlled to execute any one of the above game path generation methods.
According to another aspect of the embodiments of the present invention, there is also provided a processor, configured to execute a program stored in a memory, where the program executes any one of the above-mentioned game path generation methods.
In the embodiment of the invention, the path node data of each path layer in a plurality of path layers of the game path is acquired; determining any connecting path between every two adjacent path layers in the plurality of path layers according to the path node data; the game path is generated based on any one of the connection paths between every two adjacent path layers in the path layers, and the purpose of efficiently generating the random game path is achieved, so that the technical effect of considering the calculation efficiency when the random game path is generated is achieved, and the technical problem that the calculation efficiency cannot be considered in the mode of generating the random game path in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow chart of a method of generating a game path according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of an alternative 4-3 level game path according to an embodiment of the present invention;
FIG. 3 is a flow chart of an alternative method of generating a game path according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative 4-3 level legal link library according to an embodiment of the invention;
FIG. 5 is a schematic diagram of an alternative 3-2 level legal link library according to an embodiment of the invention;
FIG. 6 is a schematic diagram of an alternative 4-3-2 level game path according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of an alternative 9-level game path according to an embodiment of the present invention;
fig. 8 is a schematic structural diagram of a game path generation device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
In accordance with an embodiment of the present invention, there is provided an embodiment of a method for generating a game path, it being noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer-executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
The technical scheme of the method embodiment can be executed in a mobile terminal, a computer terminal or a similar arithmetic device. Taking the example of the Mobile terminal running on the Mobile terminal, the Mobile terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet device (MID for short), a PAD, and the like. The mobile terminal may include one or more processors (which may include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Digital Signal Processing (DSP) chip, a Microprocessor (MCU), a programmable logic device (FPGA), a neural Network Processor (NPU), a Tensor Processor (TPU), an Artificial Intelligence (AI) type processor, etc.) and a memory for storing data. Optionally, the mobile terminal may further include a transmission device, an input/output device, and a display device for a communication function. It will be understood by those skilled in the art that the foregoing structural description is only illustrative and not restrictive of the structure of the mobile terminal. For example, the mobile terminal may also include more or fewer components than described above, or have a different configuration than described above.
The memory may be used to store a computer program, for example, a software program and a module of application software, such as a computer program corresponding to the game screen processing method in the embodiment of the present invention, and the processor executes various functional applications and data processing by running the computer program stored in the memory, that is, implements the game screen processing method described above. The memory may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory may further include memory located remotely from the processor, and these remote memories may be connected to the mobile terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device is used to receive or transmit data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device may be a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner. The technical scheme of the embodiment of the method can be applied to various communication systems, such as: a Global System for Mobile communications (GSM) System, a Code Division Multiple Access (CDMA) System, a Wideband Code Division Multiple Access (WCDMA) System, a General Packet Radio Service (GPRS), a Long Term Evolution (Long Term Evolution, LTE) System, a Frequency Division Duplex (FDD) System, a Time Division Duplex (TDD), a Universal Mobile Telecommunications System (UMTS), a Worldwide Interoperability for Microwave Access (WiMAX) communication System, or a 5G System. Optionally, Device-to-Device (D2D for short) communication may be performed between multiple mobile terminals. Alternatively, the 5G system or the 5G network is also referred to as a New Radio (NR) system or an NR network.
The display device may be, for example, a touch screen type Liquid Crystal Display (LCD) and a touch display (also referred to as a "touch screen" or "touch display screen"). The liquid crystal display may enable a user to interact with a user interface of the mobile terminal. In some embodiments, the mobile terminal has a Graphical User Interface (GUI) with which a user can interact by touching finger contacts and/or gestures on a touch-sensitive surface, where the human-machine interaction function optionally includes the following interactions: executable instructions for creating web pages, drawing, word processing, making electronic documents, games, video conferencing, instant messaging, emailing, call interfacing, playing digital video, playing digital music, and/or web browsing, etc., for performing the above-described human-computer interaction functions, are configured/stored in one or more processor-executable computer program products or readable non-volatile storage media.
Fig. 1 is a flowchart of a method for generating a game path according to an embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
step S102, obtaining path node data of each path layer in a plurality of path layers of the game path;
step S104, determining any connecting path between every two adjacent path layers in the plurality of path layers according to the path node data;
step S106 is to generate the game path based on any one of the connection paths between every two adjacent path layers among the plurality of path layers.
In the embodiment of the invention, the path node data of each path layer in a plurality of path layers of the game path is acquired; determining any connecting path between every two adjacent path layers in the plurality of path layers according to the path node data; the game path is generated based on any one of the connection paths between every two adjacent path layers in the path layers, and the purpose of efficiently generating the random game path is achieved, so that the technical effect of considering the calculation efficiency when the random game path is generated is achieved, and the technical problem that the calculation efficiency cannot be considered in the mode of generating the random game path in the prior art is solved.
Optionally, the game path is a game level path, a game breakthrough path, or the like, and it should be noted that, due to the breakthrough play method of the game exploration map, the path design needs to have a certain playable interest, and the visual display effect of the game path needs to be considered at the same time. According to the above requirements, the generated game path in the embodiment of the present application has a level path with a low node inflow and outflow load and no plane intersection between paths, and the game path is generated at random and fast with consideration to the calculation efficiency.
In order to generate a game breakthrough random path efficiently and abstract a generation scheme of a node path based on a hierarchy, the method for generating a game path in the embodiment of the present application is implemented based on a random path generation algorithm of node traversal and hierarchical concatenation, for example, the method can be split into two stages: the first stage is to generate a connection path library of a hierarchy, control the inflow and outflow loads of nodes based on a node traversal mode, and generate a plurality of connection paths between every two adjacent path layers; and the second stage is layered splicing, wherein the path library generated in the first stage is utilized, after path node data of each path layer in a plurality of path layers of the game path are obtained, any connecting path between every two adjacent path layers in the plurality of path layers is determined according to the path node data, and a random path is generated in a layer-by-layer splicing mode on the basis of any connecting path between every two adjacent path layers in the plurality of path layers.
In an alternative embodiment, obtaining path node data for each of a plurality of path layers of a game path includes:
step S202, acquiring the number of path nodes of each path layer and the path inflow/outflow threshold of each path node in each path layer.
In the game path generation algorithm provided by the embodiment of the application, the total number of passing-through layers L can be determined before the connection path library is generated, wherein the total number of passing-through layers is the layer where the terminal point is located or the number of layers needing passing-through before the terminal point is reached due to the passing-through layers of the passing-through game; the number range of path nodes of each path layer, that is, the maximum number of path nodes N _ Min and the minimum number of path nodes N _ Max, for example, assuming that N _ Min is 5 and N _ Max is 8, that is, the number of path nodes of each path layer is randomly determined between 5 and 8, and optionally, the number of path nodes of each path layer may be determined by taking an average probability or a custom probability; and a path ingress and egress threshold of each path node, that is, the number of ingress and egress paths that can be accommodated by the path node at most, L _ Max, for example, if L _ Max is equal to 3, it indicates that the path node can go to 3 nodes at most in the next layer, and at the same time, the node carries at most 3 paths entering the path node.
As an alternative embodiment, after determining the total number L of gateway violation layers, the maximum number N _ Min of path nodes, the minimum number N _ Max of path nodes, and the path inflow and outflow threshold L _ Max of each path node, the path connection between layers may be generated based on node traversal, as shown in fig. 2, if the first path layer (lower layer) has 4 path nodes, and the second path layer (upper layer) has 3 path nodes, which is referred to as a 4-3 level connection diagram for short, a legal connection path from the first path layer to the second path layer as shown in fig. 2 may be obtained.
It should be noted that, in the embodiment of the present application, the purpose of generating a connection path between every two adjacent path layers in the multiple path layers is to obtain all legal path connection graphs that specify path nodes between the two adjacent path layers, and store the legal path connection graphs in the connection path library.
In an optional embodiment, determining, according to the path node data, any one connection path between every two adjacent path layers of the plurality of path layers includes:
step S302, obtaining a pre-established connection path library, wherein the connection path library is used for storing a plurality of available connection paths between every two adjacent path layers;
step S304, obtaining any one of the connection paths from the plurality of available connection paths according to the number of path nodes and the path ingress/egress threshold.
As an optional embodiment, since a connection path library is pre-established before a game path is generated in the embodiment of the present application, the connection path library is used for storing a plurality of available connection paths between every two adjacent path layers; therefore, after the number of path nodes of each path layer and the path inflow and outflow threshold value of each path node in each path layer are obtained, any one of the connection paths may be obtained from the plurality of available connection paths based on the obtained number of path nodes and the path inflow and outflow threshold value.
In an alternative embodiment, generating the game path based on any one of the connection paths between every two adjacent path layers of the plurality of path layers includes:
step S402, obtaining the number of the path layers and a plurality of adjacent path layers in the path layers;
step S404, determining a plurality of connection paths to be spliced according to the number of the path layers and the plurality of adjacent path layers;
step S406, the game path is obtained by splicing a plurality of the connection paths layer by layer.
In this embodiment of the application, after any one of the connection paths between every two adjacent path layers in the plurality of path layers is obtained, the number of the path layers in the plurality of path layers and the plurality of adjacent path layers existing in the plurality of path layers are obtained, and then the plurality of connection paths to be spliced are determined according to the number of the path layers and the plurality of adjacent path layers, and the plurality of connection paths in different adjacent path layers are spliced layer by layer to obtain the game path.
In an optional embodiment, before obtaining the path node data of each of the plurality of path layers of the game path, the method further includes:
step S502, using a first node of a first path layer of the game path as an initial node, traversing at least one second node to be connected with the first node in a second path layer of the game path, wherein the first path layer and the second path layer are adjacent path layers;
step S504, determine whether the available connection path between the first node and the second node is legal, and store the available connection path in a connection path database;
step S506, traverse a third node to be connected to the first node in the second path layer of the game path until all nodes in the game path complete the traversal.
In the above optional embodiments provided in this application, a first node NowNode in a first path layer of the game path may be used as a start node, and at least one second node TargetNode to be connected to the first node in a second path layer of the game path may be traversed, where the first path layer and the second path layer are adjacent path layers; determining whether a connection path between the first node and the second node is available, wherein the number of inflow and outflow paths of the first node is 0, the path is available, storing the available connection path into a connection path database, and then traversing a third node to be connected with the first node in the second path layer of the game path until all nodes in the game path are traversed.
In the embodiment of the application, whether a connection path between a first node and a second node is legal or not is judged, if so, the connection path is determined to be an available connection path, and the available connection path is stored in a connection path database; because the first node and the second node are respectively the first nodes of the first path layer and the second path layer, and the number of the connection paths of the first node is 0, the connection path is determined to be legal, and the available connection path is put into the connection path database.
In the embodiment of the present application, all nodes of the first path layer and the second path layer (if the first layer has 1 point and the second layer has 3 points, it is necessary to complete traversing the second, third, and fourth nodes) need to be traversed to form all available connection path databases. Then, the available connection paths in the second path layer and the third path layer are searched from the first node of the second layer in the same way as the available connection path database corresponding to the first path layer and the second path layer is generated, and the available connection path database is formed.
In an alternative embodiment, determining an available connection path between the first node and the second node comprises:
step S602, acquiring a first traffic inflow threshold of the first node and a second traffic inflow threshold of the second node;
step S604, determining the available connection path according to the first inflow outflow threshold and the second inflow outflow threshold.
As an optional embodiment, when determining whether the available connection path between the first node and the second node is available, a first path inflow outflow threshold of the first node and a second path inflow outflow threshold of the second node may be obtained first, and then, according to the first path inflow outflow threshold and the second path inflow outflow threshold, it may be determined whether the available connection path may join in a connection path library.
For example, the path node shown in fig. 2 has only 3 incoming and outgoing paths at most, and the B-path node in fig. 2 has exactly 3 incoming and outgoing paths BE, BF, BG, that is, the limit of the incoming and outgoing thresholds is not exceeded, and adds the available connection path to the connection path library by respectively detecting whether the available connection path already exists in the connection path library, in the case that the available connection path does not exist in the connection path library.
In an optional embodiment, after determining the available connection path between the first node and the second node, the method further comprises:
step S702, determining whether the first node is an end node in the first path layer based on the node number of the first node;
step S704, if it is determined that the first node is an end node in the first path layer, determining whether a node next to the second node is an end node in the second path layer;
step S706, if it is determined that the next node is an end node in the second path layer, acquiring the connection path between the first node and the next node.
In the above optional embodiment, after determining the available connection path between the first node and the second node, since each path node has a corresponding node number, it may be determined whether the first node is a tail node in the first path layer based on the node number of the first node; if the first node is judged to be the end node in the first path layer, judging whether the next node of the second node is the end node in the second path layer; and if the next node is judged to be the end node in the second path layer, acquiring the connection path between the first node and the next node.
In an optional embodiment, the method further includes:
step S802, if the first node is judged not to be the end node in the first path layer, detecting whether the number of connection paths with the first node is larger than or equal to a target number;
step S804, if it is detected that the number of the connection paths is greater than or equal to the target number, marking the first node as a traversed node, and traversing the second node to be connected to the next node of the first node in the second path layer by using the next node of the first node as the start node again.
As an alternative embodiment, if it is determined that the first node is not the end node in the first path layer, detecting whether the number of connection paths to the first node is greater than or equal to a target number; if the number of the connection paths is detected to be larger than or equal to the target number, the first node is marked as a traversed node, and a node next to the first node is used as the starting node again to traverse the second node to be connected with the node next to the first node in the second path layer.
As another alternative embodiment, if it is detected that the number of the connection paths is smaller than the target number, determining an available connection path between the first node and a node next to the second node; and storing the available connection paths in the connection path database.
In an alternative embodiment, storing the available connection paths in a connection path database includes:
step S902, detecting whether the connection path exists in the connection path database;
step S904, detecting whether an ingress/egress load of the connection path exceeds a path ingress/egress threshold if it is detected that the connection path does not exist in the connection path database;
in step S906, if it is detected that the inflow/outflow load does not exceed the path inflow/outflow threshold, the connection path is stored in the connection path database.
In this embodiment, when the available connection path is stored in the connection path database, it may be further detected whether the connection path already exists in the connection path database; if the connection path is detected not to exist in the connection path database, detecting whether the inflow and outflow load of the connection path exceeds a path inflow and outflow threshold value; and if the inflow and outflow load is detected not to exceed the path inflow and outflow threshold, storing the connection path into the connection path database.
In an alternative embodiment, as shown in fig. 3, by inputting the node number of the first node, information of all nodes (traversed nodes, non-traversed nodes) of the current layer and the adjacent layer, and a currently obtained connection path set; checking whether the last node of the layer is the first node or whether the next node of the finished nodes of the adjacent layer is larger than or equal to the last node or not, if not, indicating that the nodes are not finished and searching needs to be carried out one by one, and selecting the first node of the next layer as the initial node to start searching and marking the node as a first node CurNode; if yes, the node only needs to traverse the last connecting path, and nodes which are not traversed in the adjacent path layer are searched and marked as TargetNode; if the first node is detected to be the ending node of the layer and the finished nodes of the adjacent layer only have the last node, the last connection path in the current path library is formed by the two nodes, the Link is marked, and whether the Link exists in the obtained legal interception set or not is checked.
If the Link exists in the obtained legal interception set, it is indicated that the Link has been processed before, the current connection path library is a legal connection path library, the current connection path library is directly added into the legal connection path library set, if the Link does not exist in the obtained legal interception set, it is checked whether the first node and the ending node exceed the inflow and outflow load threshold, if any node exceeds the inflow and outflow load threshold, it is indicated that the Link is illegal to directly finish traversal, the illegal Link does not need to be added into the legal connection path library, only the legal connection path traversed before is reserved, if any node does not exceed the inflow and outflow load threshold, it is indicated that the Link is a legal connection path, the legal Link is added into the legal connection path library, and the legal connection path library is added into the legal connection path library set, because the legal connection path library is added into the legal connection path library set, the legal Link can be deleted from the legal connection path library, that is, the release of the legal Link is realized.
In an optional embodiment, after the above steps are performed, a first node of a next layer is selected as an initial node to start searching, and is marked as CurNode, whether the CurNode has an inflow/outflow indication that the connection of the existing path node is not currently connected exists is checked, if the connection indicates that the path node has a connection path, the CurNode can be marked as current CurNode is completed, the next node of the layer performs a recursive process to perform the step of inputting the number of the first node, and the completion mark of the path node is deleted after the completion, if the connection does not exist, the path node which is not traversed in the adjacent path layer is searched and is marked as TargetNode, and if the next path node which is not traversed does not exist, the traversal is indicated to be completed, all connection paths related to the CurNode are directly deleted, and related TargetNode is deleted from the completed path node; if the next non-traversed path node exists, checking whether the TargetNode exceeds an inflow and outflow threshold value, if so, directly deleting all connection paths related to the CurNode, and deleting the related TargetNode from the completed path node; if not, it indicates that the connection between CurNode and TargetNode is legal, adding the connection path between CurNode and TargetNode into the connection path library, marking TargetNode as traversed, entering the recursion process with TargetNode as initial node, and re-executing the step of inputting the number of the first node, because the connection path is formed between CurNode and TargetNode, adding 1 to the outflow load of CurNode, entering the recursion process with TargetNode as new initial node, re-executing the step of inputting the number of the first node, deleting all the connection paths related to CurNode, and deleting related TargetNode from completed node.
A legal link library with 4-3 layers can be generated based on a node traversal algorithm, as shown in FIG. 4, FIG. 4 shows the content completed in the first stage of the algorithm, a link library with a corresponding number of nodes is obtained, and after the link path library in the first stage is obtained, the second stage can be performed, and the nodes are spliced layer by layer. The processing is direct, and the game path can be generated only by randomly taking out 1 from the established connection path library and splicing according to the number of the path nodes in each path layer.
As an alternative embodiment, if a 4-3-2 node hierarchical type (the number of nodes in the first layer is 4, the number of nodes in the second layer is 3, and the number of nodes in the third layer is 2) game path needs to be generated, 1 connection path may be randomly obtained from the multiple connection paths shown in fig. 4 and 5, respectively, and then spliced, so as to obtain a 2-layer game path shown in fig. 6.
Based on the random path generation algorithm for node traversal and layered splicing provided by the embodiment of the application, inflow and outflow loads of each path node can be guaranteed, and the player is provided with more interest during exploration. In addition, the route library of the algorithm is quite rich, for example, 9 layers of exploration levels are taken as examples, except for a starting point, 2-4 random nodes on each layer are assumed, the outflow path of each node is not more than 3, and therefore the algorithm can conveniently generate 640163 random path maps, the repetition rate is low, and the playability is high. It should be noted that, since the total number L of breakthrough layers is predefined in advance, the required random game path can be obtained by L-1 times of layer-by-layer splicing, specifically, taking a 9-layer exploration layer as an example in the game application, and based on the 640163 random path maps stored in the connection path library, a game path at 9 layers as shown in fig. 7 that is generated in advance is randomly obtained.
According to an embodiment of the present invention, there is further provided an embodiment of an apparatus for implementing the method for generating a game path, where the apparatus for generating a game path is described above, fig. 8 is a schematic structural diagram of an apparatus for generating a game path according to an embodiment of the present invention, and as shown in fig. 8, the apparatus for generating a game path includes: an obtaining module 80, a determining module 82, and a generating module 84, wherein:
an obtaining module 80, configured to obtain path node data of each path layer in multiple path layers of the game path; a determining module 82, configured to determine, according to the path node data, any connection path between every two adjacent path layers in the multiple path layers; a generating module 84, configured to generate the game path based on any one of the connection paths between every two adjacent path layers in the plurality of path layers.
It should be noted that the above modules may be implemented by software or hardware, for example, for the latter, the following may be implemented: the modules can be located in the same processor; alternatively, the modules may be located in different processors in any combination.
It should be noted here that the acquiring module 80, the determining module 82 and the generating module 84 correspond to steps S102 to S106 in the method embodiment, and the modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure of the method embodiment. It should be noted that the modules described above may be implemented in a computer terminal as part of an apparatus.
It should be noted that, for alternative or preferred embodiments of the present embodiment, reference may be made to the related description in the method embodiment, and details are not described herein again.
The game path generating device may further include a processor and a memory, and the acquiring module 80, the determining module 82, the generating module 84, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to implement corresponding functions.
The processor comprises a kernel, and the kernel calls a corresponding program unit from the memory, wherein one or more than one kernel can be arranged. The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
According to the embodiment of the application, the embodiment of the nonvolatile storage medium is also provided. Optionally, in this embodiment, the nonvolatile storage medium includes a stored program, and the device where the nonvolatile storage medium is located is controlled to execute the method for generating any game path when the program runs.
Optionally, in this embodiment, the nonvolatile storage medium may be located in any one of a group of computer terminals in a computer network, or in any one of a group of mobile terminals, and the nonvolatile storage medium includes a stored program.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: acquiring path node data of each path layer in a plurality of path layers of a game path; determining any connecting path between every two adjacent path layers in the plurality of path layers according to the path node data; the game path is generated based on any one of the connection paths between every two adjacent path layers among the plurality of path layers.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: and acquiring the number of the path nodes of each path layer and the path inflow and outflow threshold value of each path node in each path layer.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: acquiring a pre-established connection path library, wherein the connection path library is used for storing a plurality of available connection paths between every two adjacent path layers; and acquiring any one of the connection paths from the plurality of available connection paths according to the number of the path nodes and the path inflow and outflow threshold value.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: acquiring the number of the path layers and a plurality of adjacent path layers in the plurality of path layers; determining a plurality of connection paths to be spliced according to the number of the path layers and the adjacent path layers; and splicing a plurality of connection paths layer by layer to obtain the game path.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: traversing at least one second node to be connected with the first node in a second path layer of the game path by taking a first node of the first path layer of the game path as an initial node, wherein the first path layer and the second path layer are adjacent path layers; determining an available connection path between the first node and the second node, and storing the available connection path in a connection path database; and traversing a third node to be connected with the second node in a second path layer of the game path until all nodes in the game path are traversed, wherein the first path layer and the second path layer are adjacent path layers.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: acquiring a first path inflow and outflow threshold value of the first node and a second path inflow and outflow threshold value of the second node; and determining the available connection path according to the first path inflow threshold value and the second path inflow threshold value.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: judging whether the first node is a tail node in the first path layer or not based on the node number of the first node; if the first node is judged to be the end node in the first path layer, judging whether the next node of the second node is the end node in the second path layer; and if the next node is judged to be the end node in the second path layer, acquiring the connection path between the first node and the next node.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: if the first node is judged not to be the end node in the first path layer, detecting whether the number of connection paths with the first node is larger than or equal to a target number; if the number of the connection paths is detected to be larger than or equal to the target number, the first node is marked as a traversed node, and a node next to the first node is used as the starting node again to traverse the second node to be connected with the node next to the first node in the second path layer.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: if the number of the connection paths is detected to be smaller than the target number, determining an available connection path between the first node and a node next to the second node; and storing the available connection paths in the connection path database.
Optionally, the apparatus in which the non-volatile storage medium is controlled to perform the following functions when the program is executed: detecting whether the connection path exists in the connection path database; if the connection path is detected not to exist in the connection path database, detecting whether the inflow and outflow load of the connection path exceeds a path inflow and outflow threshold value; and if the inflow and outflow load is detected not to exceed the path inflow and outflow threshold, storing the connection path into the connection path database.
According to the embodiment of the application, the embodiment of the processor is also provided. Optionally, in this embodiment, the processor is configured to run a program, where the program executes the method for generating any one of the game paths when running.
The embodiment of the application provides an electronic device, wherein the device comprises a processor, a memory and a program which is stored on the memory and can run on the processor, and the processor executes the program to realize the following steps: acquiring path node data of each path layer in a plurality of path layers of a game path; determining any connecting path between every two adjacent path layers in the plurality of path layers according to the path node data; the game path is generated based on any one of the connection paths between every two adjacent path layers among the plurality of path layers.
Optionally, the processor is further configured to implement the following steps when executing the program: and acquiring the number of the path nodes of each path layer and the path inflow and outflow threshold value of each path node in each path layer.
Optionally, the processor is further configured to implement the following steps when executing the program: acquiring a pre-established connection path library, wherein the connection path library is used for storing a plurality of available connection paths between every two adjacent path layers; and acquiring any one of the connection paths from the plurality of available connection paths according to the number of the path nodes and the path inflow and outflow threshold value.
Optionally, the processor is further configured to implement the following steps when executing the program: acquiring the number of the path layers and a plurality of adjacent path layers in the plurality of path layers; determining a plurality of connection paths to be spliced according to the number of the path layers and the adjacent path layers; and splicing a plurality of connection paths layer by layer to obtain the game path.
Optionally, the processor is further configured to implement the following steps when executing the program: traversing at least one second node to be connected with the first node in a second path layer of the game path by taking a first node of the first path layer of the game path as an initial node, wherein the first path layer and the second path layer are adjacent path layers; determining an available connection path between the first node and the second node, and storing the available connection path in a connection path database; and traversing a third node to be connected with the second node in a second path layer of the game path until all nodes in the game path are traversed, wherein the first path layer and the second path layer are adjacent path layers.
Optionally, the processor is further configured to implement the following steps when executing the program: acquiring a first path inflow and outflow threshold value of the first node and a second path inflow and outflow threshold value of the second node; and determining the available connection path according to the first path inflow threshold value and the second path inflow threshold value.
Optionally, the processor is further configured to implement the following steps when executing the program: judging whether the first node is a tail node in the first path layer or not based on the node number of the first node; if the first node is judged to be the end node in the first path layer, judging whether the next node of the second node is the end node in the second path layer; and if the next node is judged to be the end node in the second path layer, acquiring the connection path between the first node and the next node.
Optionally, the processor is further configured to implement the following steps when executing the program: if the first node is judged not to be the end node in the first path layer, detecting whether the number of connection paths with the first node is larger than or equal to a target number; if the number of the connection paths is detected to be larger than or equal to the target number, the first node is marked as a traversed node, and a node next to the first node is used as the starting node again to traverse the second node to be connected with the node next to the first node in the second path layer.
Optionally, the processor is further configured to implement the following steps when executing the program: if the number of the connection paths is detected to be smaller than the target number, determining an available connection path between the first node and a node next to the second node; and storing the available connection paths in the connection path database.
Optionally, the processor is further configured to implement the following steps when executing the program: detecting whether the connection path exists in the connection path database; if the connection path is detected not to exist in the connection path database, detecting whether the inflow and outflow load of the connection path exceeds a path inflow and outflow threshold value; and if the inflow and outflow load is detected not to exceed the path inflow and outflow threshold, storing the connection path into the connection path database.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the above-described division of the units may be a logical division, and in actual implementation, there may be another division, for example, multiple units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable non-volatile storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a non-volatile storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned nonvolatile storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (13)

1. A method for generating a game path, comprising:
acquiring path node data of each path layer in a plurality of path layers of a game path;
determining any connecting path between every two adjacent path layers in the plurality of path layers according to the path node data;
generating the game path based on any one of the connection paths between every two adjacent path layers of the plurality of path layers.
2. The method of claim 1, wherein obtaining path node data for each of a plurality of path layers of the game path comprises:
and acquiring the number of the path nodes of each path layer and the path inflow and outflow threshold value of each path node in each path layer.
3. The method of claim 2, wherein determining any connection path between every two adjacent path layers of the plurality of path layers according to the path node data comprises:
acquiring a pre-established connection path library, wherein the connection path library is used for storing a plurality of available connection paths between every two adjacent path layers;
and acquiring any one of the connection paths from the plurality of available connection paths according to the number of the path nodes and the path inflow and outflow threshold.
4. The method of claim 1, wherein generating the game path based on any one of the connection paths between each two adjacent path layers of the plurality of path layers comprises:
acquiring the number of the path layers of the plurality of path layers and a plurality of adjacent path layers in the plurality of path layers;
determining a plurality of connecting paths to be spliced according to the number of the path layers and the plurality of adjacent path layers;
and splicing the plurality of connection paths layer by layer to obtain the game path.
5. The method of claim 1, prior to obtaining path node data for each of a plurality of path layers of a game path, the method further comprising:
traversing at least one second node to be connected with the first node in a second path layer of the game path by taking a first node of the first path layer of the game path as an initial node, wherein the first path layer and the second path layer are adjacent path layers;
determining an available connection path between the first node and the second node and storing the available connection path in a connection path database;
and traversing a third node to be connected with the first node in a second path layer of the game path until all nodes in the game path are traversed.
6. The method of claim 5, wherein determining the available connection path between the first node and the second node comprises:
acquiring a first path inflow and outflow threshold of the first node and a second path inflow and outflow threshold of the second node;
and determining the available connection path according to the first path inflow threshold value and the second path inflow threshold value.
7. The method of claim 5, wherein after determining the available connection paths between the first node and the second node, the method further comprises:
judging whether the first node is an end node in the first path layer or not based on the node number of the first node;
if the first node is judged to be the end node in the first path layer, judging whether the next node of the second node is the end node in the second path layer;
and if the next node is judged to be the end node in the second path layer, acquiring the connection path between the first node and the next node.
8. The method of claim 7, further comprising:
if the first node is judged to be not the end node in the first path layer, detecting whether the number of connection paths with the first node is larger than or equal to a target number;
if the number of the connection paths is detected to be larger than or equal to the target number, the first node is marked as a traversed node, and a next node of the first node is used as the starting node again to traverse the second node to be connected with the next node of the first node in the second path layer.
9. The method of claim 8, wherein if it is detected that the number of connection paths is less than the target number, determining an available connection path between the first node and a node next to the second node; and storing the available connection paths in the connection path database.
10. The method of claim 5 or 9, wherein storing the plurality of available connection paths in a connection path database comprises:
detecting whether the connection path already exists in the connection path database;
if the connection path is detected not to exist in the connection path database, detecting whether the inflow and outflow load of the connection path exceeds a path inflow and outflow threshold value;
if the inflow and outflow load is detected not to exceed the path inflow and outflow threshold, the connection path is stored in the connection path database.
11. An apparatus for generating a game path, comprising:
the game system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for acquiring path node data of each path layer in a plurality of path layers of a game path;
a determining module, configured to determine, according to the path node data, any one connection path between every two adjacent path layers in the multiple path layers;
a generating module, configured to generate the game path based on any one of the connection paths between every two adjacent path layers in the plurality of path layers.
12. A non-volatile storage medium, comprising a stored program, wherein a device on which the non-volatile storage medium is located is controlled to execute the game path generation method according to any one of claims 1 to 10 when the program runs.
13. A processor for executing a program stored in a memory, wherein the program when executed performs the method of generating a game path according to any one of claims 1 to 10.
CN202011025110.5A 2020-09-25 2020-09-25 Game path generation method and device Active CN112076478B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011025110.5A CN112076478B (en) 2020-09-25 2020-09-25 Game path generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011025110.5A CN112076478B (en) 2020-09-25 2020-09-25 Game path generation method and device

Publications (2)

Publication Number Publication Date
CN112076478A true CN112076478A (en) 2020-12-15
CN112076478B CN112076478B (en) 2024-06-21

Family

ID=73739873

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011025110.5A Active CN112076478B (en) 2020-09-25 2020-09-25 Game path generation method and device

Country Status (1)

Country Link
CN (1) CN112076478B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100097540A (en) * 2009-02-26 2010-09-03 (주)고릴라바나나 System for randomly generating game map using definition of path and method thereof
CN110201394A (en) * 2019-06-05 2019-09-06 网易(杭州)网络有限公司 Generation method, device, storage medium, processor and the terminal of accessory model
CN110420461A (en) * 2019-07-25 2019-11-08 福建省天奕网络科技有限公司 A kind of play trip stratification air navigation aid based on height map
CN110727831A (en) * 2019-09-26 2020-01-24 宁波深擎信息科技有限公司 Full path calculation method, device, computer equipment and storage medium
CN111265877A (en) * 2020-01-20 2020-06-12 网易(杭州)网络有限公司 Method and device for controlling game virtual object, electronic equipment and storage medium
CN111346381A (en) * 2020-03-02 2020-06-30 腾讯科技(深圳)有限公司 Game path control method, device, equipment and computer readable storage medium
CN111375205A (en) * 2020-03-06 2020-07-07 网易(杭州)网络有限公司 Processing method and device for path finding path in game, electronic equipment and storage medium
WO2020143170A1 (en) * 2019-01-07 2020-07-16 平安科技(深圳)有限公司 Predicted path acquisition method and apparatus, computer device, and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100097540A (en) * 2009-02-26 2010-09-03 (주)고릴라바나나 System for randomly generating game map using definition of path and method thereof
WO2020143170A1 (en) * 2019-01-07 2020-07-16 平安科技(深圳)有限公司 Predicted path acquisition method and apparatus, computer device, and storage medium
CN110201394A (en) * 2019-06-05 2019-09-06 网易(杭州)网络有限公司 Generation method, device, storage medium, processor and the terminal of accessory model
CN110420461A (en) * 2019-07-25 2019-11-08 福建省天奕网络科技有限公司 A kind of play trip stratification air navigation aid based on height map
CN110727831A (en) * 2019-09-26 2020-01-24 宁波深擎信息科技有限公司 Full path calculation method, device, computer equipment and storage medium
CN111265877A (en) * 2020-01-20 2020-06-12 网易(杭州)网络有限公司 Method and device for controlling game virtual object, electronic equipment and storage medium
CN111346381A (en) * 2020-03-02 2020-06-30 腾讯科技(深圳)有限公司 Game path control method, device, equipment and computer readable storage medium
CN111375205A (en) * 2020-03-06 2020-07-07 网易(杭州)网络有限公司 Processing method and device for path finding path in game, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN112076478B (en) 2024-06-21

Similar Documents

Publication Publication Date Title
US10866978B2 (en) Techniques to respond to user requests using natural-language machine learning based on branching example conversations
CN105528372B (en) A kind of address search method and equipment
JP2019518257A (en) State control method and apparatus
CN111249736B (en) Code processing method and device
CN110134668A (en) Data migration method, device and equipment applied to block chain
CN112672184A (en) Video auditing and publishing method
CN116167092B (en) Secret state data query method and device, storage medium and electronic equipment
CN109558159B (en) Method and device for updating user interface in game
CN109815238A (en) The dynamic adding method and device of database are realized with strict balanced binary tree
CN112860758B (en) Searching method, searching device, electronic equipment and computer storage medium
CN108509544A (en) The acquisition methods and device of mind map, equipment and readable storage medium storing program for executing
CN109032600A (en) Application interface update method, device, storage medium and electronic equipment
CN112102840A (en) Semantic recognition method, device, terminal and storage medium
CN114218265A (en) Processing method and device of offline model, storage medium and processor
CN110311826B (en) Network equipment configuration method and device
CN112076478B (en) Game path generation method and device
US8655865B1 (en) Method and apparatus for indexing rich internet content using contextual information
CN110008398B (en) Data classification management recommendation method and device
CN106664637B (en) Routing information configuration method and device
CN109429282B (en) Frequency point configuration method and device
CN106686588B (en) Wireless fidelity Wi-Fi connection method and mobile terminal
CN106034119A (en) Encryption mixing method and device for application installation package
CN114723976A (en) Subgraph pattern matching method and device for computational graph
CN104461938A (en) Method and device for reading data
CN108428189B (en) Social resource processing method and device and readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant