πΊοΈ GOD Map Packages
Drop in a folder. Refresh the wizard. Steer agents through a brand new town.
π English Β·
π δΈζ
---
GOD map packages are local folders under:
```text
agentsociety/custom/maps//
```
Drop a new folder there, restart or refresh the setup wizard, and the map shows up
as a selectable world β no code changes required.
## π¦ Required Layout
```text
/
βββ map.yaml β semantic manifest (locations, interactions, spawn points)
βββ README.md β package overview
βββ ATTRIBUTION.md β credits for tiles, sprites, icons
βββ visuals/
β βββ map.json β Tiled JSON map (orthogonal)
β βββ map_assets/**/*.png β tileset images referenced by the JSON
βββ characters/ β optional: 32Γ32 sprite PNGs
β βββ atlas.json β optional
β βββ *.png
βββ location_assets/ β optional: location icons used by the UI
βββ *.png
```
`map.yaml` is the **semantic manifest** β it describes what locations exist, what
agents can do at each one, and how the world is wired up. `visuals/map.json` is
the **Tiled JSON map** that gives the world its pixel form. Tileset image paths
inside the Tiled JSON must be relative paths that stay inside the package folder.
## π Manifest Fields
A minimal `map.yaml`:
```yaml
schema_version: 1
map_id: your_map_id
display_name: Your Map Name
tiled_map_path: visuals/map.json
tile_size: 32
character_root: characters
spawn_points:
- id: resident_start
location_id: plaza
locations:
- id: plaza
name: Plaza
aliases: [plaza]
anchor_tile: {x: 1, y: 1}
interaction_ids: [wait]
interactions:
- id: wait
name: Wait
allowed_location_ids: [plaza]
```
Recommended optional fields:
| Field | What it does |
| --- | --- |
| `default_location_order` | Preferred fallback order when an agent has no explicit location. |
| `bounds` | `{x, y, w, h}` region covering a location (for clicks, highlights, status). |
| `scene_type` | Compact category such as `home`, `school`, `market`. |
| `visual_asset` | Relative path to an icon in `location_assets/`. |
| `effects` | Interaction output fields: `action`, `status`, `emotion`, `latest_event`, `group_message`. |
Runtime localization is optional and non-breaking. Keep the existing
`display_name`, `name`, and `description` fields as the backend/runtime defaults,
then add `localized.en` and `localized.zh` only for frontend display:
```yaml
localized:
en:
display_name: Your Map Name
zh:
display_name: δ½ ηε°εΎε
locations:
- id: plaza
name: Plaza
localized:
en:
name: Plaza
zh:
name: εΉΏεΊ
interactions:
- id: wait
name: Wait
description: Wait in place.
localized:
en:
name: Wait
description: Wait in place.
zh:
name: ηεΎ
description: εε°ηεΎ
γ
```
## π§± Tiled JSON Rules
v1 supports only orthogonal Tiled JSON maps:
- `orientation` must be `orthogonal`.
- `tilewidth` and `tileheight` should match `tile_size`.
- The map must include a tile layer named **`Collisions`**.
- In `Collisions`, `0` means walkable and any non-zero tile means blocked.
- Tileset images must be PNG files inside the map package folder.
- TMX, external tileset files, remote images, and single-background-image maps
are **not** supported in v1.
## β
Validation
```bash
cd agentsociety
uv run python scripts/validate_map_package.py custom/maps/
```
The validator checks required fields, resource paths, Tiled JSON shape, tileset
images, the `Collisions` layer, location anchors, and interaction references.
The legacy semantic check for The Ville still exists as:
```bash
uv run python scripts/validate_the_ville_map.py
```
## π§° Ready-to-Copy Templates
| Package | Purpose |
| --- | --- |
| [`agentsociety/custom/maps/the_ville/`](../agentsociety/custom/maps/the_ville/README.md) | The complete working example β 10 locations, 65 interactions, real tilesets. |
| [`agentsociety/custom/maps/_template/`](../agentsociety/custom/maps/_template/README.md) | A minimal starter package. Copy, rename, and replace the assets. |
## π Five-Minute Workflow
```bash
# 1. Copy the template
cp -r agentsociety/custom/maps/_template agentsociety/custom/maps/my_town
# 2. Drop in your Tiled JSON, tileset PNGs, and (optionally) character sprites
# Edit map.yaml: change map_id, display_name, locations, interactions
# 3. Validate
cd agentsociety
uv run python scripts/validate_map_package.py custom/maps/my_town
# 4. Restart GOD and pick the new map in the setup wizard
./scripts/god.sh restart
```
That's it β no code changes, no registry edits. The setup wizard discovers every
valid package on every refresh.