Automatic Generation and Analysis of Physics-Based Puzzle Games Mohammad Shaker, Mhd Hasan Sarhan, Ola Al Naameh, Noor Shaker and Julian Togelius, Member, IEEE Abstract—In this paper we present a method for the auto- matic generation of content for the physics-based puzzle game Cut The Rope. An evolutionary game generator is implemented which evolves the design of levels based on a context-free gram- mar. We present various measures for analyzing the expressivity of the generator and visualizing the space of content covered. We further perform an experiment on evolving playable content of the game and present and analyze the results obtained. I. I NTRODUCTION The automatic generation of game content is receiving increasing attention due to the advantages it provides in terms of speeding up the content generation process, enabling on-line generation, reducing the development budget and enabling the creation of infinite content variations. Further- more, techniques that explore a wide space of content might possibly be able to create more novel content than humans. Different techniques have been explored to automatically generate different aspects of content and some of them achieved remarkable results in commercial games [1], [2], [3]. The automatic generation of various aspects of game content has been explored relatively extensively recently with many studies reported in the literature on evolving tracks for car racing games [4], the distributed evolution of weapons in a space shooter game [5] and multiobjective evolution of maps for strategy games [6]. The generation of complete playable games has also received some attention [7], [8], [9]. However, to the best of the authors’ knowledge, generating content for physics-based puzzle games is an area that has not been explored yet. This genre of games has recently become very popular, especially on mobile devices – good examples are Angry Birds, Bad Piggies, Tower of Goo and Crayon Physics. Physics-based puzzle games provide an interesting testbed both for content generation and for investigating the applicability of various AI methods. The physics constraints applied and generated by the different components of the game necessitate considering factors when evaluating the content generated other than the ones usually considered for other game genres – it is far from obvious what makes a good level for such a game. Testing for playability is another issue that differentiates this type of games since this needs to be done based on a physics simulator. In this paper we present an approach for automatic gen- eration of content for a clone of Cut the Rope, a popular commercial physics-based puzzle game. We analyze the game and present the evolutionary approach followed to MS, MHS and OAN are with the Faculty of Information Technology Engineering at the University of Damascus, Syria (mohammadshakergtr,mhdhasansarhan,ola.un91@gmail.com). JT and NS are with the Center for Computer Games and Interaction Design at the IT University of Copenhagen (nosh,juto@itu.dk). generate game content. The design of the levels is specified in a context-free grammar employed by Grammatical Evolution (GE). We investigate two fitness functions: in the first one we focus on the physics aspect of the components and their prop- erties while in the second a playability test is incorporated to guide the evolution process towards evolving playable content. The content space explored according to each fitness function is analyzed through a number of dissimilar expres- sive measures defined that allow thorough investigation of the generator’s capabilities and permit illustrative visualization of the content space explored. II. GRAMMATICAL EVOLUTION One of the techniques used to automatically generate con- tent is evolutionary computation (EC). Evolutionary design is one of the areas where EC has demonstrated promising results that are competitive to those created by human experts [10], [11]. Grammatical Evolution (GE) is the result of combining an evolutionary algorithm with a grammatical represen- tation [12]. GE has been used extensively for automatic design [13], [14], [15], a domain where it has been shown to have a number of strengths over more traditional optimization methods; it maintains a simple way of describing the struc- ture of the levels and it enables the design of aesthetically pleasing levels by exploring a wide space of possibilities. The use of GE for the automatic generation of game content was first explored by Shaker et. al. [16], [17] for creating content for Super Mario Bros. A closely related method is recently used for generating playable card games [18]. In this paper we use a similar approach to the one proposed in [16]. A design grammar is defined to describe the possible structures of levels. The grammar is then employed by GE to evolve content according to a predefined fitness function. III. CRUST 2D PHYSICS ENGINE 2.0 The physics engine used for the design and generation of our game is the CRUST 2D Physics Engine 2.0 implemented in C# with XNA for managing runtime environment. The engine is our heavily modified version of Millington’s engine [19]. Our modifications include adapting the engine to work with 2D environment and implementing the spring constraint. In its current state, the engine is able to provide efficient handling for physics simulations. The engine implements impulse force collision modeling to deal with rigid objects. Other physics-based motions such as springs, ropes, and hard constraints can also be simulated in the current version. The engine is also facilitated with a friendly user interface that allows editing objects and their physical properties at run time.