CN107158703B - A kind of method and system of AI metope pathfinding - Google Patents
A kind of method and system of AI metope pathfinding Download PDFInfo
- Publication number
- CN107158703B CN107158703B CN201710447539.5A CN201710447539A CN107158703B CN 107158703 B CN107158703 B CN 107158703B CN 201710447539 A CN201710447539 A CN 201710447539A CN 107158703 B CN107158703 B CN 107158703B
- Authority
- CN
- China
- Prior art keywords
- pathfinding
- metope
- dough sheet
- starting point
- feasible path
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- A—HUMAN NECESSITIES
- A63—SPORTS; GAMES; AMUSEMENTS
- A63F—CARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
- A63F13/00—Video games, i.e. games using an electronically generated display having two or more dimensions
- A63F13/55—Controlling game characters or game objects based on the game progress
- A63F13/56—Computing 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)
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a kind of method and system of AI metope pathfinding, this method comprises: load it is pre-generated can pathfinding area information;Judge AI starting point and AI target point whether can be on pathfinding region;If so, calculating AI starting point to the feasible path of AI target point, AI is made to walk by feasible path;The present invention by load it is pre-generated can pathfinding area information, can load be added to metope pathfinding dough sheet can pathfinding region information, so that when calculating feasible path of the AI starting point to AI target point, AI starting point and/or AI target point can be calculated in the feasible path of the wall section of metope pathfinding dough sheet, and the feasible path by wall section can be calculated, realize the AI pathfinding of wall section and the calculating of the feasible path by wall section, the behavior for enriching AI in game enhances game playability.
Description
Technical field
The present invention relates to computer application technology, in particular to a kind of method and system of AI metope pathfinding.
Background technique
With the development of modern society's science and technology, more and more mobile phones or computer game get their way into people's lives.Needle
To (artificial intelligence, the artificial intelligence) pathfinding of AI in game often by Recast Navigation
What mesh was realized, as the various monster AI in game by Recast Navigation project calculate from map a little to another
The feasible path of any outside.
In the prior art, the technology of Recast Navigation project, which is accomplished by, pre-processes map,
According to the height of AI and feasible inclined-plane slope etc. input parameter generate map can pathfinding (feasible) region, the region is by a series of
Two-dimentional convex polygon composition, these convex polygons constitute the area of feasible solutions of one (or multiple) connection;For it is above-mentioned can pathfinding
Any two points (i.e. the AI starting point and AI target point of AI pathfinding) on region, use A* algorithm (A start algorithm)
Polygonal region can pathfinding convex polygon connecting band where polygonal region where first finding out connection starting point and target point;Root
According to the convex polygon connecting band found out, the path of connection a starting point and target point is found out using corner point method, which exists
In this polygon connecting band.
However, in the prior art can pathfinding region do not include wall section so that the AI that cannot achieve wall section is sought
Road, if the AI target point of AI pathfinding or AI starting point can not generate effective feasible path on metope;And it cannot achieve logical
It crosses in the calculating of the feasible path of wall section, that is, the walking process of AI pathfinding, wall section cannot be passed through.Therefore, such as
What can be extended open source projects Recast Navigation, realize the AI pathfinding of wall section and pass through wall section
Feasible path calculating, enrich game in AI behavior, enhance game playability, improve user experience, be to be badly in need of now
It solves the problems, such as.
Summary of the invention
The object of the present invention is to provide a kind of method and system of AI metope pathfinding, to open source projects Recast
Navigation is extended, and realizes the AI pathfinding of wall section and the calculating of the feasible path by wall section, enriches trip
The behavior of AI in play enhances game playability.
In order to solve the above technical problems, the present invention provides a kind of method of AI metope pathfinding, comprising:
What load pre-generated can pathfinding area information;Wherein, it is described can pathfinding area information include being added to metope and seeking
Road surface piece can pathfinding region information;
Judge AI starting point and AI target point whether it is described can be on pathfinding region;
If so, calculating the AI starting point to the feasible path of the AI target point, make AI by the feasible path
Walking.
Optionally, what the load was pre-generated can be before pathfinding area information, further includes:
It can pathfinding area information described in offline generation.
It optionally, can pathfinding area information described in the offline generation, comprising:
The default corresponding metope pathfinding dough sheet of metope is added using AI map visualization editing machine;
Calculate and connect each metope pathfinding dough sheet the upper and lower it is adjacent can pathfinding region, can seek described in generation
The information in road region.
It optionally, can pathfinding area information described in the offline generation, further includes:
Coordinate conversion is carried out to each metope pathfinding dough sheet, obtains horizontal dough sheet;
Generating metope according to the horizontal dough sheet can pathfinding area information.
Optionally, described to calculate the AI starting point to the feasible path of the AI target point, make AI by described feasible
Path walking, comprising:
Judge the AI starting point whether on the metope pathfinding dough sheet;
If the AI starting point on the metope pathfinding dough sheet, does not carry out global pathfinding, the AI starting is calculated
Point arrives the first feasible path of the AI target point, and the AI is made to walk by first feasible path;
If the AI starting point on the metope pathfinding dough sheet, judges whether the AI target point is sought in the metope
Road surface on piece;
If the AI target point not on the metope pathfinding dough sheet, calculates the AI and leaves the AI starting point institute
Metope pathfinding dough sheet dispersal point coordinate;
The corresponding metope of metope pathfinding dough sheet where the AI starting point can pathfinding area information carry out part and seek
Road, calculate the AI starting point to the dispersal point coordinate the second feasible path;
It carries out global pathfinding and calculates the dispersal point coordinate to the third feasible path of the AI target point, make the AI
It walks by second feasible path and third feasible path;
If the AI target point on the metope pathfinding dough sheet, judges the AI target point and the AI starting point is
It is no on identical metope pathfinding dough sheet;
If the AI target point and the AI starting point calculate described in not on identical metope pathfinding dough sheet, executing
The AI leaves the step of dispersal point coordinate of the metope pathfinding dough sheet where the AI starting point;
If the AI target point and the AI starting point are on identical metope pathfinding dough sheet, according to the AI starting point
Metope corresponding with the metope pathfinding dough sheet where the AI target point can pathfinding area information carry out local pathfinding, calculate institute
AI starting point is stated to the 4th feasible path of the AI target point, the AI is made to walk by the 4th feasible path.
In addition, the present invention also provides a kind of systems of AI metope pathfinding, comprising:
Loading module, for load it is pre-generated can pathfinding area information;Wherein, it is described can pathfinding area information include
Be added to metope pathfinding dough sheet can pathfinding region information;
Judgment module, for judge AI starting point and AI target point whether it is described can pathfinding region;
Pathfinding module, if for the AI starting point and the AI target point it is described can pathfinding region, calculate
The AI starting point makes AI walk by the feasible path to the feasible path of the AI target point out.
Optionally, the system further include:
Generation module, being used for can pathfinding area information described in generation offline.
Optionally, the generation module, comprising:
Submodule is added, is sought for adding the default corresponding metope of metope using AI map visualization editing machine
Road surface piece;
First generates submodule, and for calculating and connecting, each metope pathfinding dough sheet the upper and lower are adjacent seeks
Road region, described in generation can pathfinding region information.
Optionally, the generation module, further includes:
Transform subblock obtains horizontal dough sheet for carrying out coordinate conversion to each metope pathfinding dough sheet;
Second generates submodule, can pathfinding area information for generating metope according to the horizontal dough sheet.
Optionally, the pathfinding module, comprising:
First judging submodule, for judging the AI starting point whether in the metope pathfinding dough sheet;
First pathfinding submodule, if carrying out the overall situation not in the metope pathfinding dough sheet for the AI starting point and seeking
Road calculates the AI starting point to the first feasible path of the AI target point, makes the AI by first feasible path
Walking;
Second judgment submodule, if judging the AI mesh in the metope pathfinding dough sheet for the AI starting point
Whether punctuate is on the metope pathfinding dough sheet;
Computational submodule, if for the AI target point not in the metope pathfinding dough sheet, calculate the AI from
Open the dispersal point coordinate of the metope pathfinding dough sheet where the AI starting point;
Second pathfinding submodule, for can pathfinding according to the corresponding metope of metope pathfinding dough sheet where the AI starting point
Area information carries out local pathfinding, calculate the AI starting point to the dispersal point coordinate the second feasible path;
Third pathfinding submodule calculates the dispersal point coordinate to the of the AI target point for carrying out global pathfinding
Three feasible paths make the AI walk by second feasible path and third feasible path;
Third judging submodule, if judging the AI mesh in the metope pathfinding dough sheet for the AI target point
Whether punctuate and the AI starting point are on identical metope pathfinding dough sheet;If the AI target point and the AI starting point do not exist
On identical metope pathfinding dough sheet, then enabling signal is sent to the computational submodule;
4th pathfinding submodule, if for the AI target point and the AI starting point in identical metope pathfinding dough sheet
On, then it can pathfinding area information according to the corresponding metope of metope pathfinding dough sheet where the AI starting point and the AI target point
Local pathfinding is carried out, the AI starting point is calculated to the 4th feasible path of the AI target point, makes the AI by described the
The walking of four feasible paths.
A kind of method of AI metope pathfinding provided by the present invention, comprising: load it is pre-generated can pathfinding area information;
Wherein, it is described can pathfinding area information include be added to metope pathfinding dough sheet can pathfinding region information;Judge AI starting point
With AI target point whether it is described can be on pathfinding region;If so, calculating the AI starting point to the AI target point
Feasible path makes AI walk by the feasible path;
As it can be seen that the present invention by load it is pre-generated can pathfinding area information, can load and be added to metope pathfinding face
Piece can pathfinding region information so that AI can be calculated when calculating feasible path of the AI starting point to AI target point
Starting point and/or AI target point and can calculate in the feasible path of the wall section of metope pathfinding dough sheet and pass through metope
The feasible path in region realizes the AI pathfinding of wall section and the calculating of the feasible path by wall section, enriches trip
The behavior of AI in play, enhances game playability.In addition, the present invention also provides a kind of system of AI metope pathfinding, it is same to have
There is above-mentioned beneficial effect.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below
There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
The embodiment of invention for those of ordinary skill in the art without creative efforts, can also basis
The attached drawing of offer obtains other attached drawings.
Fig. 1 is a kind of flow chart of the method for AI metope pathfinding provided by the embodiment of the present invention;
Fig. 2 is the flow chart of the method for another kind AI metope pathfinding provided by the embodiment of the present invention;
Fig. 3 is the signal of the metope pathfinding dough sheet of the method for another kind AI metope pathfinding provided by the embodiment of the present invention
Figure;
Fig. 4 is the schematic diagram of the horizontal dough sheet of the method for another kind AI metope pathfinding provided by the embodiment of the present invention;
Fig. 5 is a kind of structure chart of the system of AI metope pathfinding provided by the embodiment of the present invention.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Referring to FIG. 1, Fig. 1 is a kind of flow chart of the method for AI metope pathfinding provided by the embodiment of the present invention.The party
Method may include:
Step 101: load it is pre-generated can pathfinding area information;Wherein, can pathfinding area information include be added to wall
Face pathfinding dough sheet can pathfinding region information.
It is understood that in this step it is pre-generated can pathfinding area information, can be the host of online game
Server it is offline in advance or generate online can pathfinding area information, that is, method provided by the present embodiment can also wrap
Including offline generate can pathfinding area information.The present embodiment is unrestricted to this.
It should be noted that in this step can pathfinding area information particular content, can be to be added to metope
Pathfinding dough sheet can pathfinding region information;Or be added to metope pathfinding dough sheet can the information in pathfinding region and each
The corresponding metope of metope pathfinding dough sheet can pathfinding area information;It can also be other content.For can pathfinding area information tool
In vivo hold, can by designer according to practical scene and use demand self-setting, as long as can by can pathfinding region believe
Breath calculates the feasible path by wall section, and the present embodiment is unrestricted to this.
Step 102: judging AI starting point and AI target point whether can be on pathfinding region;If so, entering step
103。
It is understood that the purpose of this step is in order to which whether the position for judging AI starting point and AI target point is normal;
If normal, then the feasible path of AI is calculated by following step;It can then terminate provided by the present embodiment if abnormal,
Method, by that the AI starting point to AI and/or AI target point can be adjusted otherwise, the present embodiment is to this not by any
Limitation.
It should be noted that whether this step can directly judge AI starting point and AI target point can pathfinding region
On;AI starting point can also be judged whether can be on pathfinding region and whether AI target point is can be on pathfinding region respectively.This reality
It is unrestricted to this to apply example.
Step 103: calculating AI starting point to the feasible path of AI target point, AI is made to walk by feasible path.
Wherein, for calculated in this step AI starting point to AI target point feasible path concrete mode, Ke Yizhi
Connect according to can pathfinding area information by the overall situation pathfinding calculated;Since if AI starting point is in metope pathfinding dough sheet, entirely
Office's pathfinding can not generate more accurate feasible path on metope pathfinding dough sheet again, may generate the case where being overlapped such as AI,
The dispersal point coordinate of the metope pathfinding dough sheet where AI starting point can also be left by first calculating AI;Further according to AI starting point institute
The corresponding metope of metope pathfinding dough sheet can pathfinding area information carry out local pathfinding, calculate AI starting point to dispersal point seat
Target feasible path;It finally carries out global pathfinding and calculates dispersal point coordinate to the feasible path of AI target point, make AI by two
The mode of feasible path walking;Other modes can also be used.For calculate AI starting point to AI target point feasible path
Concrete mode, can be by designer according to practical scene and user demand self-setting, the present embodiment is to this not by any
Limitation.
It is understood that method provided by the present embodiment can be adapted for AI pathfinding, as various in FPS online game
The pathfinding of monster AI is readily applicable to the pathfinding of the game object of user's control.The present embodiment is unrestricted to this.
It should be noted that the quantity and AI of feasible path calculated for this step are gone according to feasible path
The process walked can realize using same as the prior art or similar mode, can also by designer's self-setting other
Mode, the present embodiment are unrestricted to this.
In the present embodiment, the embodiment of the present invention by load it is pre-generated can pathfinding area information, addition can be loaded
Metope pathfinding dough sheet can pathfinding region information so that when calculating feasible path of the AI starting point to AI target point,
AI starting point and/or AI target point can be calculated in the feasible path of the wall section of metope pathfinding dough sheet, and can be counted
The feasible path by wall section is calculated, the AI pathfinding of wall section and the meter of the feasible path by wall section are realized
It calculates, enriches the behavior of AI in game, enhance game playability.
Fig. 2, Fig. 3 and Fig. 4 are please referred to, Fig. 2 is the method for another kind AI metope pathfinding provided by the embodiment of the present invention
Flow chart;Fig. 3 is the schematic diagram of the metope pathfinding dough sheet of the method for another kind AI metope pathfinding provided by the embodiment of the present invention;
Fig. 4 is the schematic diagram of the horizontal dough sheet of the method for another kind AI metope pathfinding provided by the embodiment of the present invention.This method can be with
Include:
Step 201: offline generate can pathfinding area information;Wherein, can pathfinding area information include be added to metope pathfinding
Dough sheet can pathfinding region information and the corresponding metope of each metope pathfinding dough sheet can pathfinding area information.
It is understood that for can pathfinding region information specific generating mode, can by using AI map can
Add the default corresponding metope pathfinding dough sheet of metope depending on changing editing machine, calculate and connect each metope pathfinding dough sheet upper layer and
Lower layer it is adjacent can pathfinding region, generate can pathfinding region information mode, the metope that such as AI in Fig. 3 can creep utilize AI
Map visualization editing machine is added into metope pathfinding dough sheet, then by the metope pathfinding dough sheet and adjacent script can pathfinding region
Connection, formed it is new can pathfinding region, generate it is new can pathfinding region information;Also can use other tool generations can pathfinding
The information in region.It can be in pathfinding region, for can pathfinding area as long as the wall section of such as metope pathfinding dough sheet can be added to
The specific generating mode of the information in domain, the present embodiment do not do any restrictions.
It should be noted that for metope can pathfinding area information specific generating mode, can be by each metope
Pathfinding dough sheet carry out coordinate conversion, obtain horizontal dough sheet, according to horizontal dough sheet generate metope can pathfinding area information mode, such as
Metope pathfinding dough sheet in Fig. 3 is subjected to coordinate conversion, obtains horizontal dough sheet as shown in Figure 4, is generated according to the horizontal dough sheet
The metope that can be used for calculating feasible path can pathfinding area information;Metope can also be generated by other means can pathfinding region letter
Breath.As long as can be generated can be used in calculate wall section feasible path metope can pathfinding area information, can for metope
The specific generating mode of pathfinding area information, the present embodiment do not do any restrictions.
Step 202: load can pathfinding area information.
Step 203: judging AI starting point and AI target point whether can be on pathfinding region;If so, entering step
204。
Wherein, step 202 and step 203 are similar to step 101 and step 102, and details are not described herein.
Step 204: judging AI starting point whether on metope pathfinding dough sheet;If it is not, then entering step 205;If so, into
Enter step 206.
It is understood that the purpose of this step is to be judged whether that the overall situation can be carried out according to the position of AI starting point
Pathfinding, if global pathfinding can not generate on metope pathfinding dough sheet more smart again since AI starting point is in metope pathfinding dough sheet
True feasible path may generate the case where being overlapped such as AI, can be calculated more accurate by step 206 to step 209
Feasible path, the case where avoiding AI from being overlapped.
Step 205: carrying out global pathfinding, calculate AI starting point to the first feasible path of AI target point, make AI by the
The walking of one feasible path.
It is understood that this step can be for when AI starting point is not on metope pathfinding dough sheet, directly progress be global
Pathfinding can use mode similar with the prior art, wall can be passed through by directly calculating for the concrete mode of global pathfinding
The feasible path of face pathfinding dough sheet.It, can be with further in order to improve the accuracy of the feasible path on metope pathfinding dough sheet
To by mode similar with mode shown in step 207 and step 208, the metope pathfinding dough sheet that feasible path passes through is carried out
Local pathfinding.The present embodiment is unrestricted to this.
It should be noted that calculating the process of the first feasible path in this step by global pathfinding, step can also be placed on
Before rapid 204, such as first passes through global pathfinding and calculate the first feasible path, then judge AI starting point whether in metope pathfinding dough sheet
On, if it is not, then making AI walk by the first feasible path, if so, entering step 206.The present embodiment is unrestricted to this.
Step 206: judging AI target point whether on metope pathfinding dough sheet;If it is not, then entering step 207;If so, into
Enter step 210.
It is understood that whether the purpose of this step is to next judge AI target point and AI starting point identical
Metope pathfinding dough sheet on prepare.
Step 207: calculating the dispersal point coordinate for the metope pathfinding dough sheet that AI leaves where AI starting point.
Wherein, the purpose of this step is to calculate the dispersal point that AI leaves the metope pathfinding dough sheet where AI starting point
Coordinate can be played specific calculation and process by designer's self-setting as long as can calculate AI and leave AI
The dispersal point coordinate of metope pathfinding dough sheet where initial point, the present embodiment are unrestricted to this.
Step 208: the corresponding metope of metope pathfinding dough sheet where AI starting point can pathfinding area information carry out office
Portion's pathfinding, calculate AI starting point to dispersal point coordinate the second feasible path.
It is understood that the purpose of this step be in order to according to metope can pathfinding area information carry out local pathfinding, meter
Second feasible path of the AI from AI starting point dispersal point coordinate of metope pathfinding dough sheet to where leaving is calculated, for local pathfinding
Detailed process, the region of global pathfinding only can be become by metope pathfinding dough sheet by mode similar with global pathfinding
The corresponding metope of horizontal dough sheet after carrying out coordinate conversion can pathfinding region.The present embodiment is unrestricted to this.
Step 209: carrying out global pathfinding and calculate dispersal point coordinate to the third feasible path of AI target point, make AI by the
Two feasible paths and the walking of third feasible path.
Wherein, the purpose of this step is to calculate the dispersal point coordinate where AI leaves after metope pathfinding dough sheet to AI
The third feasible path of target point reaches from AI so that AI can walk according to the second feasible path and third feasible path
Pathfinding purpose of the initial point to AI target point.
It is understood that step 207 to step 209 can for by calculate metope pathfinding dough sheet dispersal point coordinate,
Reach from AI starting point to dispersal point coordinate again to the pathfinding process of AI target point, improve on metope pathfinding dough sheet can walking along the street
The accuracy of diameter.Method provided by the present embodiment is only illustrated to be detached on the metope pathfinding dough sheet of AI starting point place
Point coordinate calculates and the process of local pathfinding, the metope pathfinding dough sheet passed through for global pathfinding can also by with aforesaid way
It is unrestricted to this to calculate more accurate feasible path, the present embodiment on metope pathfinding dough sheet for similar mode.
Step 210: judging AI target point and AI starting point whether on identical metope pathfinding dough sheet;If it is not, then entering
Step 207;If so, entering step 211.
It is understood that whether the purpose of this step is in order to by judging AI target point and AI starting point identical
On metope pathfinding dough sheet, thus judge whether can feasible path directly to AI starting point to AI target point carry out part and seek
Road.
Step 211: the corresponding metope of metope pathfinding dough sheet where AI starting point and AI target point can pathfinding region
Information carries out local pathfinding, calculates AI starting point to the 4th feasible path of AI target point, makes AI by the 4th feasible path row
It walks.
It should be noted that the purpose of this step is to work as AI target point and AI starting point in identical metope pathfinding face
On piece, directly according to the corresponding metope of metope pathfinding dough sheet can pathfinding area information carry out local pathfinding, calculate the metope
AI starting point further improves the feasible path on metope pathfinding dough sheet to the feasible path of AI target point on pathfinding dough sheet
Accuracy.
It is understood that method provided by the present embodiment is only on the metope pathfinding dough sheet where AI starting point
The calculating of feasible path has carried out detailed displaying, the metope pathfinding dough sheet that feasible path calculated for global pathfinding passes through
It can also side similar with the calculating of feasible path on the metope pathfinding dough sheet where AI starting point provided by the present embodiment
It is unrestricted to this to calculate more accurate feasible path, the present embodiment on metope pathfinding dough sheet for formula.
In the present embodiment, the embodiment of the present invention leaves the de- of metope pathfinding dough sheet where AI starting point by calculating AI
From a coordinate, available AI leaves the coordinate points of metope pathfinding dough sheet;By according to the metope pathfinding face where AI starting point
The corresponding metope of piece can pathfinding area information carry out local pathfinding, calculating AI starting point can walking along the street to the second of dispersal point coordinate
Diameter can calculate the more accurate feasible path that AI leaves metope pathfinding dough sheet, further improve on metope pathfinding dough sheet
The accuracy that feasible path calculates, enriches the behavior of AI in game, enhances game playability.
Referring to FIG. 5, Fig. 5 is a kind of structure chart of the system of AI metope pathfinding provided by the embodiment of the present invention, this is
System may include:
Loading module 100, for load it is pre-generated can pathfinding area information;Wherein, can pathfinding area information include
Be added to metope pathfinding dough sheet can pathfinding region information;
Judgment module 200, for judging AI starting point and AI target point whether can pathfinding region;
Pathfinding module 300, if for AI starting point and AI target point can pathfinding region, calculate AI starting point
To the feasible path of AI target point, AI is made to walk by feasible path.
Optionally, which can also include:
Generation module, can pathfinding area information for generating offline.
Optionally, generation module may include:
Submodule is added, for adding the default corresponding metope pathfinding face of metope using AI map visualization editing machine
Piece;
First generate submodule, for calculate and connect each metope pathfinding dough sheet the upper and lower it is adjacent can pathfinding area
Domain, generate can pathfinding region information.
Optionally, generation module can also include:
Transform subblock obtains horizontal dough sheet for carrying out coordinate conversion to each metope pathfinding dough sheet;
Second generates submodule, can pathfinding area information for generating metope according to horizontal dough sheet.
Optionally, pathfinding module 300 may include:
First judging submodule, for judging AI starting point whether in metope pathfinding dough sheet;
First pathfinding submodule, if carrying out global pathfinding not in metope pathfinding dough sheet for AI starting point, calculating
AI starting point makes AI walk by the first feasible path to the first feasible path of AI target point;
Second judgment submodule, if judging AI target point whether in wall in metope pathfinding dough sheet for AI starting point
On face pathfinding dough sheet;
Computational submodule, if calculating AI not in metope pathfinding dough sheet for AI target point and leaving AI starting point institute
Metope pathfinding dough sheet dispersal point coordinate;
Second pathfinding submodule, for can pathfinding region according to the corresponding metope of metope pathfinding dough sheet where AI starting point
Information carries out local pathfinding, calculate AI starting point to dispersal point coordinate the second feasible path;
Third pathfinding submodule, for carry out global pathfinding calculate dispersal point coordinate can walking along the street to the third of AI target point
Diameter makes AI walk by the second feasible path and third feasible path;
Third judging submodule, if judging AI target point and AI starting in metope pathfinding dough sheet for AI target point
Whether point is on identical metope pathfinding dough sheet;If AI target point and AI starting point not on identical metope pathfinding dough sheet,
Enabling signal is sent to computational submodule;
4th pathfinding submodule, if for AI target point and AI starting point in identical metope pathfinding dough sheet, basis
The corresponding metope of metope pathfinding dough sheet where AI starting point and AI target point can pathfinding area information carry out local pathfinding, calculate
AI starting point makes AI walk by the 4th feasible path to the 4th feasible path of AI target point out.
In the present embodiment, the embodiment of the present invention by the load of loading module 100 it is pre-generated can pathfinding area information, can
With load be added to metope pathfinding dough sheet can pathfinding region information so that by pathfinding module 300 calculate AI starting
When point arrives the feasible path of AI target point, AI starting point and/or AI target point can be calculated in the metope of metope pathfinding dough sheet
The feasible path in region, and the feasible path by wall section can be calculated, realize wall section AI pathfinding and
By the calculating of the feasible path of wall section, the behavior of AI in game is enriched, enhances game playability.
Each embodiment is described in a progressive manner in specification, the highlights of each of the examples are with other realities
The difference of example is applied, the same or similar parts in each embodiment may refer to each other.For system disclosed in embodiment
Speech, since it is corresponded to the methods disclosed in the examples, so being described relatively simple, related place is referring to method part illustration
?.
Professional further appreciates that, unit described in conjunction with the examples disclosed in the embodiments of the present disclosure
And algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, in order to clearly demonstrate hardware and
The interchangeability of software generally describes each exemplary composition and step according to function in the above description.These
Function is implemented in hardware or software actually, the specific application and design constraint depending on technical solution.Profession
Technical staff can use different methods to achieve the described function each specific application, but this realization is not answered
Think beyond the scope of this invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can directly be held with hardware, processor
The combination of capable software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only deposit
Reservoir (ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technology
In any other form of storage medium well known in field.
The method and system of AI metope pathfinding provided by the present invention are described in detail above.It is used herein
A specific example illustrates the principle and implementation of the invention, and the above embodiments are only used to help understand originally
The method and its core concept of invention.It should be pointed out that for those skilled in the art, not departing from this hair
, can be with several improvements and modifications are made to the present invention under the premise of bright principle, these improvement and modification also fall into power of the present invention
In the protection scope that benefit requires.
Claims (6)
1. a kind of method of AI metope pathfinding characterized by comprising
What load pre-generated can pathfinding area information;Wherein, it is described can pathfinding area information include be added to metope pathfinding face
Piece can pathfinding region information;
Judge AI starting point and AI target point whether it is described can be on pathfinding region;
If so, calculating the AI starting point to the feasible path of the AI target point, AI is made to walk by the feasible path;
Wherein, what the load was pre-generated can be before pathfinding area information, further includes:
It can pathfinding area information described in offline generation;Wherein, it is described can pathfinding area information further include each metope pathfinding dough sheet
Corresponding metope can pathfinding area information;
Wherein, described to calculate the AI starting point to the feasible path of the AI target point, make AI by the feasible path row
It walks, comprising:
Judge the AI starting point whether on the metope pathfinding dough sheet;
If the AI starting point on the metope pathfinding dough sheet, does not carry out global pathfinding, calculates the AI starting point and arrive
First feasible path of the AI target point makes the AI walk by first feasible path;
If whether the AI starting point on the metope pathfinding dough sheet, judges the AI target point in the metope pathfinding face
On piece;
If the AI target point not on the metope pathfinding dough sheet, calculates where the AI leaves the AI starting point
The dispersal point coordinate of metope pathfinding dough sheet;
The corresponding metope of metope pathfinding dough sheet where the AI starting point can pathfinding area information carry out local pathfinding, meter
Calculate the AI starting point to the dispersal point coordinate the second feasible path;
It carries out global pathfinding and calculates the dispersal point coordinate to the third feasible path of the AI target point, make the AI by institute
State the second feasible path and the walking of third feasible path;
If the AI target point on the metope pathfinding dough sheet, judge the AI target point and the AI starting point whether
On identical metope pathfinding dough sheet;
If the AI target point and the AI starting point not on identical metope pathfinding dough sheet, calculate described described in execution
AI leaves the step of dispersal point coordinate of the metope pathfinding dough sheet where the AI starting point;
If the AI target point and the AI starting point are on identical metope pathfinding dough sheet, according to the AI starting point and institute
State the corresponding metope of metope pathfinding dough sheet where AI target point can pathfinding area information carry out local pathfinding, calculate the AI
Starting point makes the AI walk by the 4th feasible path to the 4th feasible path of the AI target point.
2. the method for AI metope pathfinding according to claim 1, which is characterized in that can pathfinding area described in the offline generation
Domain information, comprising:
The default corresponding metope pathfinding dough sheet of metope is added using AI map visualization editing machine;
Calculate and connect each metope pathfinding dough sheet the upper and lower it is adjacent can pathfinding region, can pathfinding area described in generation
The information in domain.
3. the method for AI metope pathfinding according to claim 1, which is characterized in that can pathfinding area described in the offline generation
Domain information, further includes:
Coordinate conversion is carried out to each metope pathfinding dough sheet, obtains horizontal dough sheet;
Generating the metope according to the horizontal dough sheet can pathfinding area information.
4. a kind of system of AI metope pathfinding characterized by comprising
Loading module, for load it is pre-generated can pathfinding area information;Wherein, it is described can pathfinding area information include addition
Metope pathfinding dough sheet can pathfinding region information;
Judgment module, for judge AI starting point and AI target point whether it is described can pathfinding region;
Pathfinding module, if for the AI starting point and the AI target point it is described can pathfinding region, calculate institute
AI starting point is stated to the feasible path of the AI target point, AI is made to walk by the feasible path;
Wherein, the system further include:
Generation module, being used for can pathfinding area information described in generation offline;Wherein, it is described can pathfinding area information further include each
The corresponding metope of metope pathfinding dough sheet can pathfinding area information;
Wherein, the pathfinding module, comprising:
First judging submodule, for judging the AI starting point whether in the metope pathfinding dough sheet;
First pathfinding submodule is counted if carrying out global pathfinding not in the metope pathfinding dough sheet for the AI starting point
The AI starting point is calculated to the first feasible path of the AI target point, the AI is made to walk by first feasible path;
Second judgment submodule, if judging the AI target point in the metope pathfinding dough sheet for the AI starting point
Whether on the metope pathfinding dough sheet;
Computational submodule, if calculating the AI not in the metope pathfinding dough sheet for the AI target point and leaving institute
State the dispersal point coordinate of the metope pathfinding dough sheet where AI starting point;
Second pathfinding submodule, for can pathfinding region according to the corresponding metope of metope pathfinding dough sheet where the AI starting point
Information carries out local pathfinding, calculate the AI starting point to the dispersal point coordinate the second feasible path;
Third pathfinding submodule, for carry out global pathfinding calculate the dispersal point coordinate can to the third of the AI target point
Walking along the street diameter makes the AI walk by second feasible path and third feasible path;
Third judging submodule, if judging the AI target point in the metope pathfinding dough sheet for the AI target point
With the AI starting point whether on identical metope pathfinding dough sheet;If the AI target point and the AI starting point be not identical
Metope pathfinding dough sheet on, then to the computational submodule send enabling signal;
4th pathfinding submodule, if for the AI target point and the AI starting point in identical metope pathfinding dough sheet,
The corresponding metope of metope pathfinding dough sheet where the AI starting point and the AI target point can the progress of pathfinding area information
Local pathfinding calculates the AI starting point to the 4th feasible path of the AI target point, makes the AI can by the described 4th
The walking of walking along the street diameter.
5. the system of AI metope pathfinding according to claim 4, which is characterized in that the generation module, comprising:
Submodule is added, for adding the default corresponding metope pathfinding face of metope using AI map visualization editing machine
Piece;
First generate submodule, for calculate and connect each metope pathfinding dough sheet the upper and lower it is adjacent can pathfinding area
Domain, described in generation can pathfinding region information.
6. the system of AI metope pathfinding according to claim 4, which is characterized in that the generation module, further includes:
Transform subblock obtains horizontal dough sheet for carrying out coordinate conversion to each metope pathfinding dough sheet;
Second generates submodule, can pathfinding area information for generating the metope according to the horizontal dough sheet.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710447539.5A CN107158703B (en) | 2017-06-14 | 2017-06-14 | A kind of method and system of AI metope pathfinding |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710447539.5A CN107158703B (en) | 2017-06-14 | 2017-06-14 | A kind of method and system of AI metope pathfinding |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107158703A CN107158703A (en) | 2017-09-15 |
CN107158703B true CN107158703B (en) | 2018-12-04 |
Family
ID=59818740
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710447539.5A Active CN107158703B (en) | 2017-06-14 | 2017-06-14 | A kind of method and system of AI metope pathfinding |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107158703B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111840998A (en) * | 2020-06-30 | 2020-10-30 | 完美世界(北京)软件科技发展有限公司 | Operation control method and apparatus, storage medium, and electronic apparatus |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101241507A (en) * | 2008-01-17 | 2008-08-13 | 腾讯科技(深圳)有限公司 | Map road-seeking method and system |
CN101634568A (en) * | 2008-07-25 | 2010-01-27 | 纳夫特克北美有限责任公司 | Open area maps |
CN102306106A (en) * | 2011-08-30 | 2012-01-04 | 盛趣信息技术(上海)有限公司 | Method and system for automatically generating navigation chart in virtual space, and pathfinding method and system |
CN103957224A (en) * | 2014-05-21 | 2014-07-30 | 腾讯科技(深圳)有限公司 | Method and system for moving character in online game |
CN107067475A (en) * | 2017-03-30 | 2017-08-18 | 北京乐动卓越科技有限公司 | A kind of the scene management system and its implementation of 3D game |
-
2017
- 2017-06-14 CN CN201710447539.5A patent/CN107158703B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101241507A (en) * | 2008-01-17 | 2008-08-13 | 腾讯科技(深圳)有限公司 | Map road-seeking method and system |
CN101634568A (en) * | 2008-07-25 | 2010-01-27 | 纳夫特克北美有限责任公司 | Open area maps |
CN102306106A (en) * | 2011-08-30 | 2012-01-04 | 盛趣信息技术(上海)有限公司 | Method and system for automatically generating navigation chart in virtual space, and pathfinding method and system |
CN103957224A (en) * | 2014-05-21 | 2014-07-30 | 腾讯科技(深圳)有限公司 | Method and system for moving character in online game |
CN107067475A (en) * | 2017-03-30 | 2017-08-18 | 北京乐动卓越科技有限公司 | A kind of the scene management system and its implementation of 3D game |
Also Published As
Publication number | Publication date |
---|---|
CN107158703A (en) | 2017-09-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN103077701B (en) | A kind of accuracy in pitch assessment method, device and system | |
US20220226728A1 (en) | Route navigation system within a game application environment | |
US11423629B2 (en) | Automatic rendering of 3D sound | |
CN108568112A (en) | A kind of generation method of scene of game, device and electronic equipment | |
CN102999932A (en) | Chart animation | |
WO2020186934A1 (en) | Method, apparatus, and electronic device for generating animation containing dynamic background | |
JP2007041814A (en) | Image generation program, storage medium, image processing method and image processing apparatus | |
CN112927332B (en) | Bone animation updating method, device, equipment and storage medium | |
US20230177755A1 (en) | Predicting facial expressions using character motion states | |
CN110879850A (en) | Method, device and equipment for acquiring jitter parameters and storage medium | |
CN107158703B (en) | A kind of method and system of AI metope pathfinding | |
Balogh et al. | CodeMetrpolis—A minecraft based collaboration tool for developers | |
CN109240674A (en) | A kind of game developing system | |
US8730246B2 (en) | Real-time goal space steering for data-driven character animation | |
CN109999500A (en) | A kind of method and electronic equipment of the load of language fluency based on programming map | |
CN113274732A (en) | Reconstruction method and device of navigation grid and storage medium | |
US8933940B2 (en) | Method and system for creating animation with contextual rigging | |
CN104881230A (en) | Method and equipment for performing man-machine interaction on touch control terminal | |
KR100947439B1 (en) | System and method for morphing item according to change of form in real time | |
Matthews et al. | Procedural generation of story-driven maps | |
JP4706965B2 (en) | Image generation program and image generation apparatus | |
CN110728750B (en) | Intelligent driving environment live-action modeling method, system, terminal and storage medium | |
JP2009251887A (en) | Image generation system, program, and information storage medium | |
CN106815344B (en) | A kind of the amplification method of cutting out and device of electronic map | |
KR20080067892A (en) | Apparatus and method of modeling for game |
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 |