EN | 한국어

Zero-shot 3D Map Generation
with LLM Agents

A Dual-Agent Architecture for Procedural Content Generation

*Equal Contribution

Abstract

Procedural Content Generation (PCG) typically requires specialized domain knowledge and complex parameter tuning. We present a novel Zero-shot 3D Map Generation framework leveraging Large Language Model (LLM) agents to democratize 3D terrain creation. Our system employs a Dual-Agent Architecture comprising an Orchestrator, an Actor (creative generator), and a Critic (quality evaluator) to iteratively refine map parameters based on simple natural language prompts.

By integrating a context-aware feedback loop, our approach enables users to generate consistent, high-quality 3D maps without manual parameter adjustment. We demonstrate the system's capability to interpret abstract concepts (e.g., "volcanic island") and translate them into concrete PCG parameters, achieving superior alignment with user intent compared to traditional methods.

System Architecture

The core pipeline consists of a User Prompt processed by an Orchestrator, which coordinates the interaction between context management and the dual-agent system.

Architecture Diagram

Figure 1: The Dual-Agent Architecture flow. The Actor generates parameters (Temp 0.4), and the Critic evaluates them (Temp 0.2) in a feedback loop.

Key Features

Zero-shot Generation

Create complex 3D terrains from simple text descriptions without any prior training or examples.

Dual-Agent System

Actor-Critic architecture ensures high fidelity. The Actor creates, and the Critic refines for quality.

OpenCode Ready

Fully integrated with OpenCode CLI. Generate maps directly from your terminal environment.

Installation

Clone the repository and install the dependencies.

git clone https://github.com/HaD0Yun/zero-shot-3d-map-generation-with-llm-agents.git
cd zero-shot-3d-map-generation-with-llm-agents
pip install -r requirements.txt

# Set your API Key
export ANTHROPIC_API_KEY=your-key-here

Usage

import asyncio
from dual_agent_pcg.orchestrator import Orchestrator, SystemConfig

async def main():
    # Configure the dual-agent system
    config = SystemConfig(
        actor_temperature=0.4,
        critic_temperature=0.2,
        max_iterations=1
    )
    
    # Initialize Orchestrator
    orchestrator = Orchestrator(config=config, llm_provider=llm)
    
    # Generate Map
    result = await orchestrator.execute("Create a mountain terrain...")
    print(result)

if __name__ == "__main__":
    asyncio.run(main())

Quick Start - Just Copy This Prompt!

Too lazy to set everything up?
Just copy the prompt below and paste it into your favorite LLM CLI (Claude, ChatGPT, etc.).
Replace $ARGUMENTS with your map description and you're good to go!

Map.md - Full Prompt
# Dual-Agent PCG Map Generation

You are executing the **Zero-shot Dual-Agent PCG Refinement Protocol** (arXiv:2512.10501).

## User Request (P_user)

**Map Description**: $ARGUMENTS

---

## Protocol

You will alternate between two roles until convergence (max 3 iterations):

### ACTOR ROLE (Semantic Interpreter)
Generate a Parameter Trajectory Sequence as JSON. You must:
- Translate the user's intent into specific PCG tool configurations
- Include concrete parameter values (NO placeholders like "TBD")
- Ground all tool names and parameters in the API Documentation below
- Identify risks and assumptions

### CRITIC ROLE (Static Verifier)  
Review the trajectory against documentation. Apply the 5-dimension framework:
1. **Tool Selection**: Does each tool exist exactly as named?
2. **Parameter Correctness**: All required params present? Values in valid range?
3. **Logic & Sequence**: Generators before modifiers? Dependencies satisfied?
4. **Goal Alignment**: Does trajectory achieve user's requirements?
5. **Completeness**: Any missing steps?

**CONSERVATIVE POLICY**: Only flag issues you're CERTAIN about.

---

## Execution Flow

```
1. [ACTOR] Generate initial trajectory S₀
2. [CRITIC] Review S₀ → produce feedback
3. IF issues found AND iteration < 3:
   [ACTOR] Revise trajectory based on feedback → S₁
   [CRITIC] Review S₁
   ... repeat until approved or max iterations
4. Output final approved trajectory
```

---

## API Documentation (D)

### Generators (must be called before modifiers)

#### CellularAutomataGenerator
Creates organic landmass patterns. Ideal for islands, continents, caves.

**Required Parameters:**
- `width` (int): Grid width [16, 256]
- `height` (int): Grid height [16, 256]  
- `fill_probability` (float): Initial fill [0.0, 1.0]
  - 0.3-0.4: scattered landmasses
  - 0.45-0.55: balanced, connected
  - 0.6-0.7: larger, solid masses
- `iterations` (int): Smoothing passes [1, 10]
- `birth_limit` (int): Birth threshold [0, 8] (typically 4)
- `death_limit` (int): Death threshold [0, 8] (typically 3)

**Optional:** `seed` (int)

#### PerlinNoiseGenerator
Creates smooth heightmaps. Ideal for elevation, mountains, hills.

**Required Parameters:**
- `width` (int): Grid width [16, 512]
- `height` (int): Grid height [16, 512]
- `scale` (float): Noise scale [0.01, 1.0]
  - 0.01-0.03: large, smooth features
  - 0.04-0.08: good for mountains
  - 0.1+: rough, detailed
- `octaves` (int): Detail layers [1, 8]
- `persistence` (float): Amplitude falloff [0.0, 1.0]

**Optional:** `seed` (int), `lacunarity` (float, default 2.0)

### Modifiers (apply after generators)

#### HeightLayerModifier
Creates discrete elevation zones.

**Required Parameters:**
- `layer_count` (int): Number of layers [1, 10]
- `layer_heights` (list[float]): Thresholds, ascending order
- `blend_factor` (float): Transition smoothness [0.0, 0.5]

#### ScatterModifier
Scatters objects on terrain.

**Required Parameters:**
- `object_type` (str): One of "rock", "tree", "grass_clump", "bush", "flower"
- `density` (float): Scatter density [0.0, 1.0]
- `valid_layers` (list[int]): Layer indices to scatter on

#### GrassDetailModifier
Adds grass coverage to a layer.

**Required Parameters:**
- `target_layer` (int): Layer index (0-indexed)
- `coverage` (float): Coverage percentage [0.0, 1.0]

---

## Output Format

Output the FINAL APPROVED trajectory as JSON:

```json
{
  "final_trajectory": {
    "trajectory_summary": "<overview>",
    "tool_plan": [
      {
        "step": 1,
        "objective": "<what this achieves>",
        "tool_name": "<EXACT tool name>",
        "arguments": { ... },
        "expected_result": "<success criteria>"
      }
    ],
    "risks": ["<potential issues>"]
  }
}
```

---

## BEGIN PROTOCOL

Now execute the Dual-Agent refinement for: **$ARGUMENTS**

Start with [ACTOR] generating the initial trajectory S₀.

This is a simplified version. For the full prompt with examples, see Map.md on GitHub.

Citation

If you find this work useful for your research, please cite our paper:

@article{her2025zeroshot3dmap,
  title={Zero-shot 3D Map Generation with LLM Agents: A Dual-Agent Architecture for Procedural Content Generation},
  author={Her, Lim Chien and Yan, Ming and Bai, Yunshu and Li, Ruihao and Zhang, Hao},
  journal={arXiv preprint arXiv:2512.10501},
  year={2025}
}