πŸ—ΊοΈ 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.