{"tab":"ai","section":"generateEncounters","title":"Encounters","summary":"Fires when framing an encounter. Low priority: `encounterElements` in Other provides the source palette. Use custom to set difficulty mix, creature behavior rules, and non-combat resolution conditions.","kind":"schema","uiLocation":"AI Tasks → Encounters","uiSubtitle":"\"Encounters Instructions\"","editor":"Graphical form (labeled textareas)","related":[{"section":"encounterElements","note":"the palette of encounter components this task draws from"}],"wikiUrl":"/ai/generateEncounters","schema":null,"sizeLimits":[{"id":"aiInstructionIndividual","group":"AI Instructions Limits","label":"Each string leaf under a task (`aiInstructions.<task>.<key>`)","measure":"rawChars","enforced":5000,"display":5000,"sections":["ai/aiInstructions","ai/generateStory","ai/generateInitialStart","ai/generateCharacterBackground","ai/generateNPCDetails","ai/generateNPCUpdates","ai/generateLocationDetails","ai/generateRegionDetails","ai/generateFactionDetails","ai/generateEncounters","ai/generateItemGenerationAndUsage","ai/generateActionInfo","ai/generateNPCIntents","ai/generateNewNPC","ai/generateLearnedAbilities"]},{"id":"aiInstructionPerTask","group":"AI Instructions Limits","label":"Per task (`aiInstructions.<task>` total, sum of instruction chars)","measure":"rawChars","enforced":20000,"display":20000,"sections":["ai/aiInstructions","ai/generateStory","ai/generateInitialStart","ai/generateCharacterBackground","ai/generateNPCDetails","ai/generateNPCUpdates","ai/generateLocationDetails","ai/generateRegionDetails","ai/generateFactionDetails","ai/generateEncounters","ai/generateItemGenerationAndUsage","ai/generateActionInfo","ai/generateNPCIntents","ai/generateNewNPC","ai/generateLearnedAbilities"]}],"blocks":[{"type":"example","lang":"json","code":"{\n  \"aiInstructions\": {\n    \"generateEncounters\": {\n      \"custom\": \"## Structure\\nFrame encounters as situations, not ambushes. Give the player a moment to observe before committing. Every encounter has a non-combat resolution path.\\n\\n## Mix\\nTwo of five options should involve conflict or danger. Three should offer interaction, exploration, or opportunity.\"\n    }\n  }\n}"},{"type":"prose","md":"## Fields\n\n### custom\n\nThe only key — free-form encounter-framing rules. The `encounterElements` section supplies the raw palette this task draws from."},{"type":"prose","md":"## Authoring pattern\n\nCover in `custom`:\n\n- Difficulty tiers and how they map to enemy strength or environmental danger in your setting.\n- Creature type behavior rules for the monster categories in your world.\n- Non-combat resolution conditions that are specific to your world's tone and genre.\n- Encounter mix guidance — the ratio of dangerous to non-dangerous options appropriate for your world."}],"body":"## Example\n\n```json\n{\n  \"aiInstructions\": {\n    \"generateEncounters\": {\n      \"custom\": \"## Structure\\nFrame encounters as situations, not ambushes. Give the player a moment to observe before committing. Every encounter has a non-combat resolution path.\\n\\n## Mix\\nTwo of five options should involve conflict or danger. Three should offer interaction, exploration, or opportunity.\"\n    }\n  }\n}\n```\n\n## Fields\n\n### custom\n\nThe only key — free-form encounter-framing rules. The `encounterElements` section supplies the raw palette this task draws from.\n\n## Authoring pattern\n\nCover in `custom`:\n\n- Difficulty tiers and how they map to enemy strength or environmental danger in your setting.\n- Creature type behavior rules for the monster categories in your world.\n- Non-combat resolution conditions that are specific to your world's tone and genre.\n- Encounter mix guidance — the ratio of dangerous to non-dangerous options appropriate for your world."}