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:
- Low-Level Representation (LLR): A comprehensive specification of every block and entity (e.g., items, NPCs) and their exact coordinates.
- 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.
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.
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