CN102841974A - Game path searching simplification method - Google Patents

Game path searching simplification method Download PDF

Info

Publication number
CN102841974A
CN102841974A CN2011101723019A CN201110172301A CN102841974A CN 102841974 A CN102841974 A CN 102841974A CN 2011101723019 A CN2011101723019 A CN 2011101723019A CN 201110172301 A CN201110172301 A CN 201110172301A CN 102841974 A CN102841974 A CN 102841974A
Authority
CN
China
Prior art keywords
node
value
algorithm
path
open
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN2011101723019A
Other languages
Chinese (zh)
Inventor
杨际荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Original Assignee
ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD filed Critical ZHENJIANG HUAYANG INFORMATION TECHNOLOGY CO LTD
Priority to CN2011101723019A priority Critical patent/CN102841974A/en
Publication of CN102841974A publication Critical patent/CN102841974A/en
Pending legal-status Critical Current

Links

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a game path searching simplification method which is called A star algorithm, which is characterized in that one path between two points of a map is found. If at least one path is deposited, the A star algorithm can find the shortest path in different path searching algorithms, the algorithm speed is faster than other algorithms, and the method is different from other algorithms. The A star is a directed algorithm, i.e. the algorithm is free from blindly searching the path (such as a mouse in a labyrinth), but is used for estimating one optimum investigation direction, and sometimes the algorithm also backtracks to try other directions. Therefore the A star algorithm is flexible and variable and not limited to one style.

Description

A kind of short-cut method of game path search
Technical field
The present invention relates to a kind of short-cut method of game path search.This method is actual to be a kind of concise and to the point algorithm, in actual play, can search its path fast, and is the shortest.
Background technology
In current cybertimes, recreation grows on trees, but along with the appearance of big game; Computer resource is consumed gradually; How to solve and utilize minimum computer resource to go to accomplish complicated action, such as the game path search, if the not enough preparation meeting of this algorithm causes computer resource and the intact also difficulty of memory consumption to reach its intended purposes; So in game development, the reasonable use that how to solve computer data will become very important task.
Summary of the invention
To above deficiency; The objective of the invention is to propose a kind of short-cut method of game path search; Be a kind of controlled (directed) algorithm, be algorithm searching route (such as the mouse in labyrinth) blindly itself; But estimate the investigation direction an of the best, also recall sometimes and attempt all the other directions.
A* moves at map through the node of creating with the position, and these nodes are used for the record searching progress.Except remaining on the position in the map, each node also has three important attributes, is called f usually, and g and h are referred to as suitability (fitmess) sometimes respectively, target (goal) and (heuristic) that inspire.
G is the cost from start node to this node.Though there are a lot of different paths the position from the starting point node to this node, this node is only represented single-pathway.
H estimates cost from this node to destination node.Here the h meaning is the conjecture (educatedguess) of undergoing training, because and do not know actual cost.
F be g and h with.Conjecture and estimation that the f representative is best to the path of this this node of process, wherein the value of F is more little, thinks that then this paths is good more.
F, the purpose of g and h is to confirm this with quantity to put the quality of a paths.The size of g can be calculated fully, promptly comes the required cost of present node.Because known all nodes of coming present node are so the value of g can accurately be confirmed.Yet h is a diverse thing.Because and do not know how far also have from this node to destination node, we are compelled to guess.When guessing certainly more, the value of f is just more near actual value so, and the speed of A* is also just fast more, just finds target the time that can only take a little.A* keeps two table: Open tables and Closed table in addition.The Open table is made up of the node of not investigating, and the Closed table is made up of the node of having investigated.Checked all nodes that link to each other with certain node when algorithm, calculated their f, the value of g and h, and them into OPEN table, investigate through waiting, claim that then this node is " having investigated ".
Because there is not unique node, so Open table and Closed table are necessary.For example, if begin to move to (0,1) from (0,0), retracting (0,0) so more also is to find no fault with and effectively.Therefore must know clearly that which node is investigated and created, the effect that Here it is Open table and Closed show.
Below be the decomposition of the method:
1) makes P one initial node.
2) f, the value of g and h is composed to P
3) P is added into the Open table.This moment, P was an only node in the Open table.
4) make optimal node (the best meaning is the f value minimum of this node) in the B=Open table
(1) if B is a destination node, then withdraws from.Found a paths this moment.
(2) if the Open table for empty, then withdraws from.Do not find the path this moment.
5) make C equal an effective node that links to each other with B.
(1) f, the value of g and h is composed to C.
(2) inspection C is in the Open table or in the Close table.
1. if in the Close table, check that then whether new route is than original better (the f value is little), if then adopt new path.
2. otherwise be added into Open table to C.
Effective descendants's node to all B repeats the 5th) step.
6) repeated for the 4th step.
Embodiment
At first add initial lattice to and open tabulation.The 2nd, the work that repetition is following: a) seek the minimum grid of F value in the unlatching tabulation, we claim that it is current lattice; B) switch to it and close tabulation; C) in the 8 adjacent lattice each, if * it can not through or in closing tabulation, skip over it.Otherwise as follows.If * it in opening tabulation, does not add it.The father node of current lattice as these lattice.Write down the F of these lattice, G and H value.If * whether it in opening tabulation, uses the G value for better with reference to the new path of inspection.Lower G value means better path.If like this, just make the father node of these lattice into current lattice, and recomputate the G and the F value of these lattice.If you keep your unlatching tabulation by the ordering of F value, you possibly need again to opening list ordering after changing.D) stop, opening tabulation when you * has added the target lattice into, at this time the path is found, and perhaps * does not find the target lattice, and the unlatching tabulation is empty.At this time, the path does not exist.3. storing path.Begin from the target lattice, move up to getting back to initial lattice along the father node of each lattice.Here it is your path.

Claims (2)

1. the short-cut method of game path search: its characteristic comprises that mainly A* moves at map through the node of creating with the position, and these nodes are used for the record searching progress.Except remaining on the position in the map, each node also has three important attributes, is called f usually, and g and h are referred to as suitability (fitmess) sometimes respectively, target (goal) and (heuristic) that inspire.
G is the cost from start node to this node.Though there are a lot of different paths the position from the starting point node to this node, this node is only represented single-pathway.
H estimates cost from this node to destination node.Here the h meaning is the conjecture (educatedguess) of undergoing training, because and do not know actual cost.
F be g and h with.Conjecture and estimation that the f representative is best to the path of this this node of process, wherein the value of F is more little, thinks that then this paths is good more.
F, the purpose of g and h is to confirm this with quantity to put the quality of a paths.The size of g can be calculated fully, promptly comes the required cost of present node.Because known all nodes of coming present node are so the value of g can accurately be confirmed.Yet h is a diverse thing.Because and do not know how far also have from this node to destination node, we are compelled to guess.When guessing certainly more, the value of f is just more near actual value so, and the speed of A* is also just fast more, just finds target the time that can only take a little.
A* keeps two table: Open tables and Closed table in addition.The Open table is made up of the node of not investigating, and the Closed table is made up of the node of having investigated.Checked all nodes that link to each other with certain node when algorithm, calculated their f, the value of g and h, and them into OPEN table, investigate through waiting, claim that then this node is " having investigated ".
2. according to the short-cut method of stating the game path search of claim 1, it is characterized in that storage class of A* needs keeps the node of A* to come and go the data that move, and preserve traditional Open and Closed table.It also returns each table and goes up the minimum node of expense.The selection of this storage container can influence the maximum performance of A* program.
The most marvellous part of general target class is any information that it is keeping being suitable for current A* task.
CN2011101723019A 2011-06-24 2011-06-24 Game path searching simplification method Pending CN102841974A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011101723019A CN102841974A (en) 2011-06-24 2011-06-24 Game path searching simplification method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011101723019A CN102841974A (en) 2011-06-24 2011-06-24 Game path searching simplification method

Publications (1)

Publication Number Publication Date
CN102841974A true CN102841974A (en) 2012-12-26

Family

ID=47369333

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011101723019A Pending CN102841974A (en) 2011-06-24 2011-06-24 Game path searching simplification method

Country Status (1)

Country Link
CN (1) CN102841974A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092207A (en) * 2013-02-27 2013-05-08 东华大学 Robot maze search method
CN104462805A (en) * 2014-12-02 2015-03-25 厦门飞游信息科技有限公司 Map path-searching method and equipment based on A* algorithm and computing terminal
CN107423360A (en) * 2017-06-19 2017-12-01 广东中冶地理信息股份有限公司 A kind of labyrinth method for solving based on path center line
CN109164802A (en) * 2018-08-23 2019-01-08 厦门理工学院 A kind of robot maze traveling method, device and robot

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
李惠哲 等: "《A*算法在游戏寻径中的应用》", 《内蒙古师范大学学报(自然科学汉文版)》 *
杨素琼 等: "《基于A*算法的地图路径搜索的实现》", 《铁路计算机应用》 *
陈和平 等: "《A*算法在游戏地图寻径中的应用于实现》", 《计算机应用与软件》 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092207A (en) * 2013-02-27 2013-05-08 东华大学 Robot maze search method
CN103092207B (en) * 2013-02-27 2015-06-03 东华大学 Robot maze search method
CN104462805A (en) * 2014-12-02 2015-03-25 厦门飞游信息科技有限公司 Map path-searching method and equipment based on A* algorithm and computing terminal
CN104462805B (en) * 2014-12-02 2017-05-31 厦门飞游信息科技有限公司 A kind of map road-seeking method based on A* algorithms, equipment and computing terminal
CN107357581A (en) * 2014-12-02 2017-11-17 厦门飞游信息科技有限公司 A kind of game component and computing terminal
CN107423360A (en) * 2017-06-19 2017-12-01 广东中冶地理信息股份有限公司 A kind of labyrinth method for solving based on path center line
CN109164802A (en) * 2018-08-23 2019-01-08 厦门理工学院 A kind of robot maze traveling method, device and robot

Similar Documents

Publication Publication Date Title
Foead et al. A systematic literature review of A* pathfinding
Ducatelle et al. Communication assisted navigation in robotic swarms: self-organization and cooperation
CN102841974A (en) Game path searching simplification method
Papadopoulos et al. Network mapping by replaying hyperbolic growth
US11886957B2 (en) Artificial intelligence controller that procedurally tailors itself to an application
CN100517346C (en) Path-finding method for optimal path
Nijssen et al. Enhancements for multi-player Monte-Carlo tree search
Björnsson et al. TBA*: Time-Bounded A*.
Gilon et al. Dynamic potential search—a new bounded suboptimal search
CN110457200A (en) A kind of method for generating test case and its equipment, storage medium, electronic equipment
JP2017176690A5 (en)
WO2015095488A1 (en) Systems and methods for a physically intuitive resource-constrained route planning task for enhanced cognition
Buffet et al. Optimistic heuristics for Minesweeper
KR20210092386A (en) Method and apparatus for providig a game with enhanced unexpectedness
Lawrence et al. Taking learning out of real-time heuristic search for video-game pathfinding
JP2022159513A5 (en)
Sinay et al. Maintaining Communication in Multi-Robot Tree Coverage.
Nguyen et al. Applying Monte-Carlo tree search to collaboratively controlling of a ghost team in Ms Pac-Man
Tomai et al. Simulating aggregate player behavior with learning behavior trees
Lu et al. Cooperative enhancement of cost threshold in the spatial n-person snowdrift game
Wang et al. Practical algorithms for STV and ranked pairs with parallel universes tiebreaking
Healey Matchup models for the probability of a ground ball and a ground ball hit
Chiang et al. Efficient exploration in side-scrolling video games with trajectory replay
Santoso et al. Minimax guided reinforcement learning for turn-based strategy games
CN105550215B (en) A kind of storage and the method for quickly retrieving of vehicle diagnosis condition randomness and relevance

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20121226