Modular Procedural Generation for Voxel Maps

Adarsh Pyarelal, Aditya Banerjee, Kobus Barnard

Abstract

Procedural content generation (PCG) is essential for creating diverse and controllable environments in AI research. This paper presents mcg, an open-source C++ library designed for "top-down" generation of voxel-based maps. Unlike traditional methods that focus solely on block placement, mcg simultaneously generates low-level block data and high-level semantic maps. This dual-representation approach enables the creation of complex, machine-readable task environments specifically tailored for human-AI teaming studies.

Introduction

Minecraft has emerged as a premier sandbox for testing AI agents due to its inherent flexibility. However, the standard practice of manual map creation introduces significant bottlenecks. Researchers face difficulties in precisely controlling experimental variables, managing large binary map files in version control systems, and bridging the "semantic gap" where agents fail to recognize high-level structures like rooms or hallways. Furthermore, the tight coupling between generation tools and the game engine often slows development cycles. To address these issues, we introduce mcg, a decoupled library that treats environment generation as a programmatic, declarative process.

Methodology: Top-Down Generation

The mcg library employs a top-down approach centered on Axis-Aligned Bounding Boxes (AABBs). Rather than placing individual blocks, developers define volumes that represent high-level structures. These volumes can be nested, transformed, and moved programmatically.

A key feature of the library is the synchronized production of two distinct outputs:

  1. Low-Level Representation (LLR): A comprehensive specification of every block and entity (e.g., items, NPCs) and their exact coordinates.
  2. High-Level Representation (HLR): A semantic map describing the spatial hierarchy and relationships, such as room connectivity and the presence of specific objectives.

Key Insights

Environment as Code

By defining maps through code, researchers can leverage standard software engineering tools like Git for version control and reproducibility. This allows for precise tracking of environment changes across experimental trials.

Parametric Iteration and Scaling

The programmatic nature of mcg allows for rapid scaling of environments. A single parameter change can expand a simple 4x4 grid of rooms into a complex 8x8 or larger layout, significantly accelerating the experimental design process.

Demonstration of parametric scaling and randomization: (a) 4x4 grid and (b) 8x8 grid generated with different random seeds.

Semantic Hooks

Because the HLR is generated alongside the physical blocks, AI agents gain immediate access to human-centric concepts. This eliminates the need for complex inference or computer vision to identify rooms and connections, providing "semantic hooks" for agent reasoning and planning.

Key Results

The mcg library enables rapid prototyping of complex environments. For example, a few lines of C++ can generate intricate "Dungeon" layouts featuring randomized loot, monsters, and connecting corridors.

Procedurally generated dungeon environments showcasing randomized room placement, corridors, and semantic entities.

The library's outputs have been successfully integrated into various AI systems, including:

  • LocationMonitors: Tracking agent movement through semantic areas.
  • PyGL-FoV: Calculating real-time field-of-view for agents.
  • Planning Systems: Automatically generating formal logic predicates for pathfinding and task management based on the HLR.

Limitations and Future Work

Currently, the system is constrained to rectilinear geometry due to its reliance on AABBs, making the generation of organic or curved structures challenging. Additionally, the requirement for C++ programming may present a barrier for researchers without a strong technical background. Future work will focus on implementing more diverse AABB-based algorithms to support richer and more varied virtual environments.

Summary updated

Abstract

Task environments developed in Minecraft are becoming increasingly popular for artificial intelligence (AI) research. However, most of these are currently constructed manually, thus failing to take advantage of procedural content generation (PCG), a capability unique to virtual task environments. In this paper, we present mcg, an open-source library to facilitate implementing PCG algorithms for voxel-based environments such as Minecraft. The library is designed with human-machine teaming research in mind, and thus takes a 'top-down' approach to generation, simultaneously generating low and high level machine-readable representations that are suitable for empirical research. These can be consumed by downstream AI applications that consider human spatial cognition. The benefits of this approach include rapid, scalable, and efficient development of virtual environments, the ability to control the statistics of the environment at a semantic level, and the ability to generate novel environments in response to player actions in real time.
BibTeX
@inproceedings{pyarelal2021modular,
  author = {Adarsh Pyarelal and Aditya Banerjee and Kobus Barnard},
  title = {{Modular Procedural Generation for Voxel Maps}},
  booktitle = {ToM for Teams},
  year = {2021},
  doi = {10.1007/978-3-031-21671-8\_6},
}
Figure