Procedural generation is a popular and exciting part of modern game development, for both game designers and players. Yet despite this, resources to help people get started in or get better at procedural generation are rare, and a lot of them rely on copying code down rather than understanding how procedural generation works and how generators can be controlled to achieve goals. We’re developing a tool called Danesh to help experts and newcomers alike get more out of procedural generation and find new ways of working with this exciting technology.

Danesh is a plugin tool for the popular Unity game development tool, and integrates directly with procedural generators written in Unity projects. Setting up Danesh to work with a new project is as easy as adding a few lines of code to the generator, so that Danesh knows how to execute your generator and how to visualise the output. We use metaprogramming techniques to automatically find and use the generator’s code, so that once Danesh is set up the user doesn’t need to dive back into the code while they work.

Visualising and Tweaking Parameters

Once set up, Danesh can quickly perform simple tasks like generating and displaying newly generated content, or letting the user tweak parameters and then quickly view output from the generator to confirm their changes. When we interviewed developers, we found that over three-quarters of the people we asked use this method as their only way of tweaking and improving a generator. We wanted to build on this simple functionality so that Danesh can give developers more options when working with procedural generators.

Analysing Content Quickly With Metrics

Danesh also allows the user to specify metrics that record something about generated content – like the length of a generated maze’s solution, or how powerful a generated weapon is, or how many rare gems there are in the walls of a generated cave. These metrics are useful in their own right – they are calculated each time a new piece of content is generated, and displayed on the tool’s interface so the user can assess a piece of content instantly. The real power of metrics, however, is how Danesh can use them to automatically improve and visualise a procedural generator’s possibility space.

Targeted and Randomise Expressive Range Analysis

Expressive range analysis, first proposed by Gillian Smith and Jim Whitehead, is a way of repeatedly sampling content from a procedural generator and plotting results on a histogram to see the distribution of content. Danesh automates this process of building ERA histograms, creating interactive ERAs that can show examples of content from different regions of the expressive space. It can also switch between metrics dynamically, allowing the user to analyse a generator along different axes very quickly.

We’ve also developed the notion of a randomised expressive range analysis, which samples the total potential of the procedural generator and displays it in the same visual space as a regular ERA. This allows the user to compare and contrast the current performance of their generator with its potential performance, which can help give a sense of what a generator is capable of with parameter modification, and what is impossible without modifying the code directly. These tools give a much stronger confirmation of design goals than simple parameter tweaking.

Automated Optimisation of Procedural Generators

Our current focus for the tool is increasing its ability to take on work for itself and be an active participant in the design process. Rather than the user repeatedly using ERAs and randomised ERAs to tweak and change a generator towards a particular goal, they can instead define a target state for the generator and ask Danesh to automatically optimise generator parameters towards that goal. Danesh uses a combination of AI techniques to iteratively improve its parameter estimation, backed up by data from ERAs, and can quickly find a parameterisation that meets user requirements (if one exists). We want to expand features like this in the future so that Danesh can take a more active role in the process of exploring and experimenting with a procedural generator.

 

What To Read Next

Towards The Automatic Optimisation Of Procedural Content Generators [PDF]
Computational Intelligence in Games (CIG), 2016

Danesh: Helping bridge the gap between procedural generators and their output [PDF]
Procedural Generation Workshop at FDG, 2016