The various levels, quests and characters in modern video games play a major role in these games’ engagement and entertainment values. One way to keep things fresh is procedural content generation (PCG), the algorithmic generation of game content using a random process that can produce an unpredictable range of possible gameplay spaces, freeing human game designers from the laborious task of manual content generation.
Recent improvements in machine learning (ML) have spurred interest in applying such techniques to PCG, but research on level generation in 3D games remains limited. In the popular 3D Minecraft game, for example, humans still play a central role in content generation — structures have to be placed manually in a fixed world because the Minecraft World Generator can’t generate new structures on its own.
To fill the gap between the Minecraft World Generator’s PCG and manually created custom structures, a research team from Leibniz University Hannover recently introduced World-GAN, a 3D generative adversarial network (GAN) that can learn and generate structures directly in the Minecraft 3D voxel space.
The team summarizes their contributions as:
- Introduce a 3D Generative Adversarial Network (GAN) architecture for level generation in Minecraft.
- The proposed dense token1 representations using block2vec enable the processing of larger world snippets.
- Editing this representation space allows the application of style changes to generated levels without further training.
- Using a current version of Minecraft (1.16) makes the method widely applicable for practitioners.
- Enable others to generate their own world snippets by releasing the source code.
The proposed World-GAN is one of the first practical PCG via ML (PCGML) applications for Minecraft built on a GAN architecture. The GAN is trained by two adversaries, a generator that attempts to fool the discriminator until it can produce candidates the discriminator thinks are not synthesized. Huge amounts of data are required to train a good generator; otherwise, the discriminator is able to effectively distinguish between the real and fake samples encountered.
SinGAN differs from traditional GANs in that it can generate images from only one sample via a fully convolutional generator and discriminator. SinGAN is however designed to generate natural images, and so the researchers based their work on TOAD-GAN, a modified SinGAN designed to fit token-based games. World-GAN’s overall structure is similar to TOAD-GAN, with several modifications to make it work on the 3D structure of Minecraft levels. For instance, the generator and discriminator now use 3D convolutional filters that can process the k (number of tokens) × D (depth) × H (height) ×W (width) sized slices from the input level.
To address the long-tailed distribution of the number of tokens in the Minecraft problem, the team made World-GAN independent of the number of tokens by applying block2vec — a dense, fixed-size representation of words used in natural language processing (NLP) — to enable the processing of larger world snippets without concerns regarding the long-tailed distribution problem.
The team performed experiments to evaluate the capabilities of the proposed method. They compared block2vec embedding to variants of TOADGAN, which they call TOADGAN 3D and TOAD-GAN 3D*. They used three metrics to evaluate their generated levels: block distribution histograms, the TPKL-Div, and the Levenshtein distance.
In qualitative comparisons, World-GAN was able to generate much richer blocks than TOAD-GAN 3D. The quantitative results meanwhile show that World-GAN can generate content patterns that match the original sample, that the content generated using block2vec has a higher variability on average, and that World-GAN captures a given distribution reasonably well and is also able to generate the most rare tokens.
Overall, the study shows that the proposed World-GAN can enable data-driven PCGML in Minecraft, generate content similar to the inputs with low variability, and handle rare tokens in the inputs.
The source code is available on the project GitHub. The paper World-GAN: a Generative Model for Minecraft Worlds is on arXiv.
Author: Hecate He | Editor: Michael Sarazen, Chain Zhang
We know you don’t want to miss any news or research breakthroughs. Subscribe to our popular newsletter Synced Global AI Weekly to get weekly AI updates.