A Game Map Complexity Measure Based on Hamming Distance Yan Li, Pan Su, and Wenliang Li

Similar documents
Beyond A*: Speeding up pathfinding through hierarchical abstraction. Daniel Harabor NICTA & The Australian National University

Picture Maze Generation by Repeated Contour Connection and Graph Structure of Maze

Power Load Forecasting Based on ABC-SA Neural Network Model

Privacy-Preserving of Check-in Services in MSNS Based on a Bit Matrix

Map Abstraction with Adjustable Time Bounds

A Partition Method for Graph Isomorphism

Research Article Path Planning Using a Hybrid Evolutionary Algorithm Based on Tree Structure Encoding

Bidirectional search and Goal-directed Dijkstra

The Application of K-medoids and PAM to the Clustering of Rules

Autonomous robot motion path planning using shortest path planning algorithms

Application of Geometry Rectification to Deformed Characters Recognition Liqun Wang1, a * and Honghui Fan2

Research on Design and Application of Computer Database Quality Evaluation Model

Use of Shape Deformation to Seamlessly Stitch Historical Document Images

Preliminary Research on Distributed Cluster Monitoring of G/S Model

Search and Games. Adi Botea. ANU Summer Schools in Logic and Learning February, 2009

Basic Motion Planning Algorithms

AN APPROACH OF SEMIAUTOMATED ROAD EXTRACTION FROM AERIAL IMAGE BASED ON TEMPLATE MATCHING AND NEURAL NETWORK

Routability-Driven Bump Assignment for Chip-Package Co-Design

ScienceDirect. Plan Restructuring in Multi Agent Planning

Graph and A* Analysis

A Rapid Automatic Image Registration Method Based on Improved SIFT

K-coverage prediction optimization for non-uniform motion objects in wireless video sensor networks

AN EFFECTIVE ALGORITHM OF SHORTEST PATH PLANNING IN A STATIC ENVIRONMENT

Solving Sokoban Optimally using Pattern Databases for Deadlock Detection

Instant Prediction for Reactive Motions with Planning

Three-Dimensional Off-Line Path Planning for Unmanned Aerial Vehicle Using Modified Particle Swarm Optimization

Reversible Image Data Hiding with Local Adaptive Contrast Enhancement

Efficient Path Finding Method Based Evaluation Function in Large Scene Online Games and Its Application

Complementary Graph Coloring

Research Article Optimization of Access Threshold for Cognitive Radio Networks with Prioritized Secondary Users

A Fuzzy C-means Clustering Algorithm Based on Pseudo-nearest-neighbor Intervals for Incomplete Data

Permutation, no-wait, no-idle flow shop problems

Mobile Robot Path Planning in Static Environments using Particle Swarm Optimization

A motion planning method for mobile robot considering rotational motion in area coverage task

CIS UDEL Working Notes on ImageCLEF 2015: Compound figure detection task

Formations in flow fields

Improving Image Segmentation Quality Via Graph Theory

Shortest Path Algorithm

Midterm Examination CS540-2: Introduction to Artificial Intelligence

Finetuning Randomized Heuristic Search For 2D Path Planning: Finding The Best Input Parameters For R* Algorithm Through Series Of Experiments

SHORTENING THE OUTPUT PATH OF A* ALGORITHM: OMNI- DIRECTIONAL ADAPTIVE A*

Hierarchical Path-finding Theta*: Combining Hierarchical A* with Theta*

Analysis of Biological Networks. 1. Clustering 2. Random Walks 3. Finding paths

A Method Based Genetic Algorithm for Pipe Routing Design

Mobile Robots Path Planning using Genetic Algorithms

A Method of Generating Calligraphy of Japanese Character using Deformable Contours

A reversible data hiding based on adaptive prediction technique and histogram shifting

Centralities (4) By: Ralucca Gera, NPS. Excellence Through Knowledge

Some questions of consensus building using co-association

Similarities in Source Codes

Research on Evaluation Method of Product Style Semantics Based on Neural Network

FSRM Feedback Algorithm based on Learning Theory

Combining Abstract Images using Texture Transfer

Path Planning. Marcello Restelli. Dipartimento di Elettronica e Informazione Politecnico di Milano tel:

Video Inter-frame Forgery Identification Based on Optical Flow Consistency

Sung-Eui Yoon ( 윤성의 )

Queuing theory based service performance evaluation under H2H and M2M blending traffic arriving

Computer Aided Drafting, Design and Manufacturing Volume 26, Number 2, June 2016, Page 34

Link Prediction for Social Network

Application of Improved Discrete Particle Swarm Optimization in Logistics Distribution Routing Problem

PATH-FINDING FOR LARGE SCALE MULTIPLAYER COMPUTER GAMES

HEURISTIC OPTIMIZATION USING COMPUTER SIMULATION: A STUDY OF STAFFING LEVELS IN A PHARMACEUTICAL MANUFACTURING LABORATORY

A Comparative Study of LOWESS and RBF Approximations for Visualization

UNIVERSITY OF NORTH CAROLINA AT CHARLOTTE

CHAPTER 4 DETECTION OF DISEASES IN PLANT LEAF USING IMAGE SEGMENTATION

Graph Sampling Approach for Reducing. Computational Complexity of. Large-Scale Social Network

Parallel Similarity Join with Data Partitioning for Prefix Filtering

Optimal Segmentation and Understanding of Motion Capture Data

ET-based Test Data Generation for Multiple-path Testing

Implementation of Parallel CASINO Algorithm Based on MapReduce. Li Zhang a, Yijie Shi b

2.1 Optimized Importance Map

INFORMATION-THEORETIC OUTLIER DETECTION FOR LARGE-SCALE CATEGORICAL DATA

Pathfinding in partially explored games environments

AUV Cruise Path Planning Based on Energy Priority and Current Model

Network Routing Protocol using Genetic Algorithms

Available online at ScienceDirect. Procedia Engineering 99 (2015 )

In cloud computing, IaaS approach is to

Proceedings of the 2012 International Conference on Industrial Engineering and Operations Management Istanbul, Turkey, July 3 6, 2012

CS248. Game Mechanics

Hybridization EVOLUTIONARY COMPUTING. Reasons for Hybridization - 1. Naming. Reasons for Hybridization - 3. Reasons for Hybridization - 2

Midterm Examination CS 540-2: Introduction to Artificial Intelligence

Clustering and Recommending Services based on ClubCF approach for Big Data Application

Fractals: a way to represent natural objects

Image Segmentation Based on Watershed and Edge Detection Techniques

Efficient Interpolated Path Planning of Mobile Robots based on Occupancy Grid Maps

Design and Development of a High Speed Sorting System Based on Machine Vision Guiding

Online Dial-A-Ride Problem with Time Windows: an exact algorithm using status vectors

Two Algorithms of Image Segmentation and Measurement Method of Particle s Parameters

BI-OBJECTIVE EVOLUTIONARY ALGORITHM FOR FLEXIBLE JOB-SHOP SCHEDULING PROBLEM. Minimizing Make Span and the Total Workload of Machines

AN IMPLEMENTATION OF PATH PLANNING ALGORITHMS FOR MOBILE ROBOTS ON A GRID BASED MAP

A Tool for Automatic Routing of Auxiliary Circuits in Ships

A Combined Encryption Compression Scheme Using Chaotic Maps

Journal of Asian Scientific Research FEATURES COMPOSITION FOR PROFICIENT AND REAL TIME RETRIEVAL IN CBIR SYSTEM. Tohid Sedghi

CHAPTER 2 TEXTURE CLASSIFICATION METHODS GRAY LEVEL CO-OCCURRENCE MATRIX AND TEXTURE UNIT

Digital Image Steganography Techniques: Case Study. Karnataka, India.

polygonal approximations

Improvement of SURF Feature Image Registration Algorithm Based on Cluster Analysis

Enhancing Forecasting Performance of Naïve-Bayes Classifiers with Discretization Techniques

Image Segmentation Based on. Modified Tsallis Entropy

Outlier Detection Using Unsupervised and Semi-Supervised Technique on High Dimensional Data

Transcription:

Physics Procedia 22 (2011) 634 640 2011 International Conference on Physics Science and Technology (ICPST 2011) A Game Map Complexity Measure Based on Hamming Distance Yan Li, Pan Su, and Wenliang Li Collage of Mathematics and Computer, Hebei University, Baoding, Hebei, China (supan1986@yahoo.com; polyuliyan@yahoo.com.cn; hbueducn@126.com) Abstract With the booming of PC game market, Game AI has attracted more and more researches. The interesting and difficulty of a game are relative with the map used in game scenarios. Besides, the path-finding efficiency in a game is also impacted by the complexity of the used map. In this paper, a novel complexity measure based on Hamming distance, called the Hamming complexity, is introduced. This measure is able to estimate the complexity of binary tileworld. We experimentally demonstrated that Hamming complexity is highly relative with the efficiency of A* algorithm, and therefore it is a useful reference to the designer when developing a game map. 2011 Published by by Elsevier Elsevier B.V. Ltd. Selection Selection and/or and/or peer-review peer-review under under responsibility responsibility of Garry of [name Lee. organizer] Keywords: complexity measure, game map, tileword complexity, Hamming distance, game AI 1 Introduction Computer game has become an important part of the IT industry. As the computing speed of hardware has greatly increased, an excellent commercial PC game is no longer simply judged by visual effect, memory usage, and other hardware-related criterion. The degree of humanness and players game experience are gained more attention [1, 2]. Therefore, the interaction and the control of difficulty play an important role in game design. Game map is the platform where players interact with non-player-controlled characters (NPCs). In the classic game PAC-MAN (as shown in Fig. 1), for example, a game player controls the pac-man moving through a maze to collect the beans on the roadway. At the same time, 4 ghosts are searching the map to catch it. The player fails if the pac-man has a collision with anyone of the ghosts. In such a game with seemingly simple rules, the complexity of the map mainly influences the difficulty of the game. In addition, both the pac-man and the ghosts need to continuously find paths to hide and chase. In computer memory, a map used in PAC-MAN game can be represented by a binary matrix whose element is either 0 or 1, where 0 means the corresponding place in the map is free to walk through 1875-3892 2011 Published by Elsevier B.V. Selection and/or peer-review under responsibility of Garry Lee. doi:10.1016/j.phpro.2011.11.098

Yan Li et al. / Physics Procedia 22 (2011) 634 640 635 while 1 means it is blocked. For example, the map of Fig. 1 can be represented by the matrix shown in Fig. 2. In this paper, we proposed a complexity measure to calculate how complex a game map is. And experimentally demonstrated that Hamming Complexity is highly relative with the A * algorithm efficiency. In other words, the higher Hamming complexity a map has, the more difficult to find a path on it. This paper is structured as follows: Section 2 outlines the relative works. Section 3 introduces the definition of Hamming Complexity. Section 4 experimentally shows that the proposed complexity measure is correlated with the efficiency of A *. 2 Related Work As a classic heuristic path-finding algorithm, A * has been applied in a large number of commercial games. Since using A * to do path-finding on large-scale map is time-consuming, many algorithms prefer to use abstract structure to improve it. Such as: HPA * [3], quadtree [4], probabilistic roadmap [5], and so on. However, the size of a map does not fully represent its complexity. An extreme example is a 10000 10000 game map without any obstacle in it. Obviously, creating an abstract structure for such a map is unwanted. Therefore, the complexity of the map measure is not only related with the feeling of the game players (such as interesting, difficulty, etc.), but also helpful to game designers to choose appropriate path-finding algorithms. A game map can be seen as a topographic map or a graph containing nodes and edges. From the perspective of geography, Alan M. MacEachren proposed complexity measures for topographic map and contour map. The measures he defined evaluate that how difficult a particular map is for human to understand [6]. In addition, some scholars defined indexes to qualify the complexity of raster images and graphs, such as: The Landscape Shape Index, The Fractal Dimension and so on [7]. Entropy is a classic measure of disorder in information theory. A.Mowshowitz has used entropy to qualify the relative complexity of a graph [8]. Fig. 1 The screenshot of PAC-MAN.

636 Yan Li et al. / Physics Procedia 22 (2011) 634 640 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 0 1 1 1 0 1 1 0 1 1 1 0 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 1 0 1 1 0 0 0 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 1 1 1 1 1 0 1 1 1 0 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 0 1 0 0 0 0 0 0 0 0 1 0 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 1 0 1 0 0 0 0 1 0 1 0 1 1 1 1 1 1 1 1 0 1 0 1 1 1 1 1 1 0 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 1 1 0 1 1 0 1 1 1 1 0 1 1 0 1 1 0 1 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 0 1 0 0 0 1 1 1 1 1 1 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0 0 0 1 1 0 1 1 1 1 1 1 0 1 1 0 1 1 1 1 1 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Fig. 2 The binary matrix of a game map. Since these measures are designed for topographic maps which contain many regions with winding boundary or graphs consist of points and edges, most of the definitions are based on surface, point, edge and other geometrical concepts. Though game maps can be transformed into raster images or graphs, it is inconvenient to use them in computer games to do path-finding. Therefore, we proposed a complexity measure based on binary data calculation. 3 Hamming Complexity of Game Map In game programming, maps are usually stored as a 2-dimensional array. Each variable in the array stores terrain states of the corresponding coordinates. Given that the game terrain has only two states: traversable and blocked, then each variable is a binary one and occupies a bit in memory. There are many types of definition to measure the distance between two bit-strings, of which two are commonly used. Hamming distance is widely used in information theory. It is applied in telecommunication to estimate error, therefore is sometimes called the signal distance. The Jaccard index [9] (also known as the Jaccard Similarity Coefficient) is a statistic used for comparing the similarity and diversity of sample sets. It is also used in comparison of chromosomes. Given that A and B are two bit-strings with same number of variables. pp is number of variables that are 1 for both bit-strings; pn is number of variables that 1 for A and 0 for B; np is number of variables that 0 for A and 1 for B; nn is number of variables that 0 for both A and B. The Hamming Distance and Jaccard Index are defined as follows respectively. 1) Hamming Distance: HammingDist( A, B) = pn + np (1) 2) Jaccard Index: pp JaccardIndex( A, B) = (2) pp + pn + np For example: A=00101, B=11100, then pp=1, pn=1, np=2, nn=1, HammingDist(A, B)=3, JaccardIndex(A, B) =0.25. Jaccard Index does not cover the situation where both of the bit-strings are all 0. But sometimes in computer game maps, two adjacent rows (columns) do not contain any blocks. Therefore, the proposed complexity measure is based on Hamming distance.

Yan Li et al. / Physics Procedia 22 (2011) 634 640 637 As Fig. 2 shows, a game map can be expressed as a matrix, denoted by M. M=(a 1, a 2,,a m ), where m is the number of rows, a 1 is a bit-string consist of all variables in the i-th column of M. n is the number of variables in a i. The definition of x-hamming Complexity is: m x_hc( ) = HammingDist( ai, ai 1) M (3) i= 2 e.g. the sum of Hamming Distance between any two adjacent columns. In the game scenario, if a character moves from a place in a 1 to a place in a m, it passes through all the columns between a 1 and a m. If the blocks in the adjacent columns are distributed similarly, the characters are easy to move from a 1 to a m. Similarly, if a character moves from the top of a map to the bottom, it passes through all the rows. The definition of y-hamming Complexity is: T y_hc( M) = x_hc( M ) (4) e.g. the matrix M is transposed, and each row in M is deemed to be a bit-string. As shown in Fig. 3, it is easier for the pac-man to move horizontally than move vertically. Considered that the characters move direction is unpredictable, we use the Fig. 3 A game map of low x-hc and high y-hc.

638 Yan Li et al. / Physics Procedia 22 (2011) 634 640 Fig. 4 The selection of start points and end points. average value of x-hamming Complexity and y-hamming Complexity to measure the general complexity of a game map. x_hc( M) + y_hc( M) HC( M ) = (5) 2 It can be seen from the definition that the value of Hamming Complexity is not directly dependent on the size of the map or the number of blocks. It depends on the distribution of blocks. The computation of Hamming Complexity is simple. It can be calculated by one traversal of the map and its time complexity is O(mn). 4 Experiments and results In the experiment, A * algorithm [10] is selected as the benchmark path-finding algorithm. When searching a path, the candidate points are placed in a priority queue, e.g. the open list. In each iteration, A * picks up the optimal point from the open list and places it in closed list, then, add its neighbor points in the open list. If the target point is placed in the close list, the search process is finished. Therefore, for a particular path-finding task, the more candidate points were placed in the open list and closed list, the more points are searched to find a path. We use the quotient of total number of searched nodes divided by the length of the shortest path to represent the efficiency of A * algorithm. E.g.: Number of nodes in CloseList and OpenList ( A* ) E = (6) the length of the shortest path In real games, since the movements of game characters are massive and in most of the time the move direction is unpredictable, a particular path-finding task does not reflect the efficiency of A * on the map. Therefore, we use the average efficiency of 2 (m 2 +n 2 ) or less path-finding tasks on each map. The selection of start points and end points is shown in Fig. 4. While using point (1, 1) as the start point, (m, 1), (m, 2),, (m, n) are selected as target points. Then we reverse the start and the end. So, 2n pairs of start and end are selected. There are a total of n points in the very left column; therefore 2n 2 path-finding tasks are horizontal. Similarly, 2m 2 path-finding tasks are vertical. If there is no path between a pair of those points, the result from that path-finding task is discarded. We also generated 2500 game maps, and the size ranges from 31 31 to 50 50. Each group of size has 125 samples. The blocked points are randomly placed in each map. And the complex maps and simple ones are studied together. For the convenience of observation, we sorted those maps by their Hamming Complexity. As it is shown in Fig. 5, about 3/5 of the experimental maps have Hamming Complexity between 34 and 100. Fig. 6 indicates the average A * efficiency observed on these maps. By contrasting the two figures, there is a significant linear relation between Hamming Complexity and average A * efficiency (correlation coefficient > 0.97), and they have the same changing tendency. This demonstrated that Hamming Complexity can well predict the difficulty of path-finding on a game map. As the Hamming Complexity becomes higher, the observed average A * efficiency fluctuates more drastically. This is because some maps are divided into isolated parts by the blocks. In that case, the A * efficiency value cannot be calculated. And the observed average value rests with a small number of path-finding tasks, which makes the result unstable. In addition,we generated 100 maps which satisfy x_hc y_hc >25, and studied their x-hamming Complexity and y-hamming Complexity respectively. The results are shown in Table 1.

Yan Li et al. / Physics Procedia 22 (2011) 634 640 639 Fig. 5 The distribution of Hamming Complexity. Fig. 6 The distribution of average A* efficiency. TABLE I CORRELATION COEFFICIENTS BETWEEN HAMMING DISTANCE AND A* EFFICIENCY Move Direction x_hc y_hc HC Left-Right 0.96 0.63 0.83 Up-Down 0.67 0.95 0.85 All 0.94 0.94 0.96 The results in Table 1 validate the assumption in Section 3, e.g. if the characters often move horizontally (vertically), then x_hc (y_hc) is more accurate. Accordingly, if the movements of characters can be predicted, we suggest using a generalized form of Hamming Complexity: HC( M) = λ x_hc( M) + (1 λ) y_hc( M ) (7) where λ [0,1], can be given by game designers. 5 Conclusion In this paper, we defined a game map complexity measure based on the Hamming Distance between two adjacent columns (rows) in a binary matrix. The value of Hamming Complexity can be obtained by O(mn) time. Experimental results show that it is highly correlated with the efficiency of A * path-finding. It can be used by game designers to analysis the interesting, difficulty, and path-finding efficiency of a game. It should be noted that Hamming Complexity makes sense only when evaluating average A * efficiency. It should not be used to predict the difficulty of a particular path-finding task. References [1] A. Nareyek, Artificial Intelligence in Computer Games-State of the Art and Future Directions, ACM Queue, vol. 10, 2004, pp. 58-65.

640 Yan Li et al. / Physics Procedia 22 (2011) 634 640 [2] A.Nareyek, Game AI Is Dead. Long Live Game AI! IEEE Intelligent Systems, vol. 22, No. 1, 2007, pp. 9-11. [3] A. Botea, M. Muller and J.Shaeffer, Near Optimal Hierarchical Path-Finding, Journal of Game Development, 2004, pp. 7-28. [4] H. Samet, The Quadtree and Related Hierarchical Data Structures, ACM Computer Survival, vol.16, No. 2, 1984, pp. 187-260. [5] P. Pettersson and P. Doherty, Probabilistic Roadmap Based Path Planning for an Autonomous Unmanned Helicopter, Journal of Intelligent and Fuzzy Systems, vol. 17, 2006, pp. 395-405. [6] A. MacEachren, Map Complexity: Comparison and Measure- ment, The American Cartographer, vol. 9, No. 1, 1982, pp. 31-46. [7] F. David, Measuring Map Complexity, Cartographic Journal, vol. 43, No. 3, 2006, pp. 224-238. [8] A. Mowshowitz, Entropy and the complexity of graphs: I. An index of the relative complexity of a graph, Bulletin of Mathematical Biology vol. 30, No. 1, 1968, pp. 175-204. [9] P. Jaccard, Étude comparative de la distribution florale dans une portion des Alpes et des Jura, Bulletin de la Société Vaudoise des Sciences Naturelles, vol. 37, 1901, pp. 547-579. [10] E. Hart, J. Nilsson and B. Raphael, A Formal Basis for the Heuristic Determination of Minimum Cost Paths, IEEE Transactions on Systems Science and Cybernetics, vol. 4, No. 2, 1968, pp. 100-107.