Abstract:

Automated content generation is used in game industry to reduce costs and improve replayability of games. Many classic and modern games have their levels, terrains, quests, and items procedurally generated. Answer set programming is a declarative problem solving paradigm which can be used for generating game content. In answer set programming, the problem is modeled as a set of rules. This encoding is fed to the solver program, which traverses the search space and outputs answer sets complying with all the given rules. The resulting answer sets are finally interpreted as solutions to the problem.

In this thesis, answer set programming techniques are applied to design and implement a level generator for Portal, a series of 3D puzzle games where the player solves each level by using objects in a certain order. All the levels in Portal games are built by human level designers. In this work, the main aspects of Portal physics and several basic game objects are modeled using answer set programming. Two alternative encoding are provided. The full encoding of the generator tracks reachability of the objects and provides a solution plan for the level. In the simplified encoding the reachability concept and the solution plan are omitted, making the generator less reliable but more efficient at creating larger levels.

Both of the encodings are able to make different looking puzzles by utilizing randomization and controlling the search for answer sets via parameters such as the amount of elevations and objects in the level or the minimum and maximum number of timesteps for solving the puzzle. The effects of varying these and other parameters and changing the frequency for randomized choices in the solver program \emph{clingo} are studied. One of the generated levels was reviewed and tested by several Portal players, receiving mostly positive ratings.