Font Size: a A A

The Research And Implementation Of Game Pathfinding Algorithm Based On Cocos2d-x Engine

Posted on:2018-02-04Degree:MasterType:Thesis
Country:ChinaCandidate:J J ZhuFull Text:PDF
GTID:2348330512493144Subject:Computer technology
Abstract/Summary:PDF Full Text Request
With the vigorous development of mobile Internet and the steady improvement of hardware and software level,the rapid development of the game industry,the mobile phone as the new age carrier of the game,mobile games show explosive growth trend.Now the market demand for game products gradually increased,the user's demand for game products also greatly improved.How to quickly and efficiently develop an interesting and user-friendly game is a matter of concern for the game industry.This topic is mainly based on Cocos2d-x game engine,then carry out various aspects of related technology research,game project implementation and pathfinding algorithm improvement.Through developing an XianXia class mobile game project,to master and apply the relevant technologies involves in the overall architecture of the engine,the collision detection technology,the finite state machine,the pathfinding algorithm and so on.From the perspective of the whole game project,with the development of software engineering idea,the project requirement analysis,function design,function implementation,packaging operation,testing,maintenance and a series of process operation have been completed.This paper focuses on the research and improvement of the shortcomings of A*algorithm in map game.The F value of the node in the A*algorithm represents the cost of reaching the target node from the initial node via the node,and the open list holds all nodes that have been generated without investigation.According to the following problem in the game to find the minimum F value node time-consuming,the longer the map size is,the slower the route is found and not considering the barrier distribution optimization,two optimization scheme is proposed:Firstly,for pathfinding process frequently access the open list,to find the minimum F value node time-consuming problem,putting forward with the method of minimum binary heap to optimize the open list,it is more efficient to select the minimum F value node and maintain the order of the list;Secondly,the problem of large scale and unevenly distributed obstacles in the map,the time and space consumption is too large,proposed to use map hierarchical search method to be improved,the map is divided into unequal sub-areas and constitute a complete abstract map,according to the distribution of obstacles to choose a different pathfinding algorithm for routing,in order to shorten the routing time and reduce the number of access nodes.In this paper,the standard A*algorithm and the improved A*algorithm are compared in the simulation experiment and the game project respectively,the results show that the improved A*algorithm has improved the search efficiency,the problem of search performance has been proved to be solved.It has achieved the goal of shortening the game development cycle,improving the quality of the game and increasing the user experience,it's a very meaningful subject study.
Keywords/Search Tags:Mobile Game, Cocos2d-x Engine, Pathfinding Algorithm, A~*Algorithm, Minimum Binary Heap, Map Delamination
PDF Full Text Request
Related items