{"tab":"ai","section":"generateNPCDetails","title":"NPC Details","summary":"Fires once when an AI-created NPC first appears in scene with only minimal first-pass data. Generates the full basicInfo, hiddenInfo, personality, and `abilities` record. Distinct from `generateCharacterBackground`, which generates the player character's backstory and appearance during character creation.","kind":"schema","uiLocation":"AI Tasks → NPC Details","uiSubtitle":"\"NPC Details Instructions\"","editor":"Graphical form (labeled textareas)","related":[{"section":"generateCharacterBackground","note":"player character backstory and appearance at character creation"},{"section":"generateNewNPC","note":"first-pass NPC creation"},{"section":"npcs","note":"the record this task populates"}],"wikiUrl":"/ai/generateNPCDetails","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    \"generateNPCDetails\": {\n      \"custom\": \"## HIDDEN INFO STRUCTURE\\nAll NPCs are SENTIENT. Write hiddenInfo as three labelled fields in dense behavioural prose. Use this exact format:\\n\\nFormat: \\\"hiddenInfo\\\": \\\"Background: ...\\\\n\\\\nPersonality: ...\\\\n\\\\nCombat: ...\\\"\\n\\nBackground (6-8 sentences): Name, age, origin/clan, rank or skill tier; how they reached their current level; at least one defined relationship; current objective or pressure; personal view on their role or world.\\n\\nPersonality (7-9 sentences): Speech style and tone; default behaviour and how it shifts under pressure; routine and idle tendencies; behaviour toward higher vs lower status; what they hide vs reveal; one defining belief or trait outside combat.\\n\\nCombat (4-5 sentences): Fighting style tied to their training and specialisation; preferred range and engagement style; triggers for escalation or disengagement; reaction to injury or disadvantage; one distinct combat habit.\\n\\n## ABILITIES (MANDATORY)\\nAll NPCs must have 6-10 abilities. Abilities must be broad systems, not single techniques; must reflect rank and specialisation; must explain practical combat or utility use.\\nFormat: (TYPE) Ability Name: Description. Types: attack, combat, utility.\\n\\n## ARCHETYPE FIRST\\nNPCs must be immediately readable on first encounter. Each rank or class should carry a one-line silhouette: 'reactive, learning' / 'composed, dependable' / 'commanding, experienced' / 'silent, efficient, lethal' / 'authoritative, dominant'. Match observable behaviour to the silhouette.\\n\\n## CHARACTER PHILOSOPHY\\nDefine characters by what they want — ambitions, loyalties, drives — not by what they have lost. Lead with desire, not damage.\\n\\n## KNOWLEDGE LIMITS\\nNPCs volunteer only what their role and position would plausibly allow. Hidden information surfaces through play, observation, or earned trust — never through narrator convenience.\\n\\n## BANNED TYPES\\nNo bureaucrats, pedants, worriers, sticklers, moralists, or procedural personalities. Any record-keeper should be dangerous or funny, not procedural.\"\n    }\n  }\n}"},{"type":"prose","md":"A worked pattern with labelled `hiddenInfo` sections — replace world-specific tokens:"},{"type":"prose","md":"## Fields\n\n### custom\n\nThe only key — free-form rules for the full first-pass fill-in (`basicInfo`, `hiddenInfo`, personality, `abilities`).\n\n> **📋 Note:** `generateNPCDetails` runs on AI-improvised, authored, and quest-spawned NPCs alike, on each NPC's first meaningful appearance — not only AI-created ones."},{"type":"prose","md":"## Authoring pattern\n\n- **Labelled `hiddenInfo` sections with explicit sentence counts.** Telling the model `Background (6-8 sentences) / Personality (7-9 sentences) / Combat (4-5 sentences)` produces consistent depth across all generated NPCs. The labels themselves anchor the model's output structure.\n- **`Format:` directive with literal escaped newlines.** Showing the exact intended output string — `\"Background: ...\\n\\nPersonality: ...\\n\\nCombat: ...\"` — pins the model to the format rather than asking it to infer.\n- **Mandatory abilities count + format spec.** `6-10 abilities` plus `Format: (TYPE) Name: Description` plus the enum of types prevents the model from producing one-line ability strings or skipping the count.\n- **Archetype-first design.** A one-line silhouette per rank/class makes generated NPCs immediately readable on first encounter. The model uses the silhouette as the seed and fills outward.\n- **Character philosophy and knowledge limits as cross-cutting rules.** These apply regardless of which archetype the NPC falls into. Keep them short and prescriptive — `Lead with desire, not damage` is more useful than three paragraphs about motivation theory.\n- **Banned-types list to suppress default tropes.** Without an explicit ban the model defaults toward procedural, anxious, or worry-coded characters. Naming what NOT to produce is more effective than describing what TO produce.\n\n**How personality manifests physically:** posture, speech patterns, how the character moves. \"Confident\" is a label; \"speaks over the ends of other people's sentences\" is a manifestation. Apply this rule to every Personality block.\n\n**Age and energy default:** younger characters (late teens / twenties human equivalent). Older characters should be vital and dynamic, not efficient and weathered.\n\n> **📋 Note:** To enforce a baseline depth floor (a minimum character count) on generated `hiddenInfo`, see [Minimum output depth](/appendix/ai-advanced-techniques#minimum-output-depth) in the Advanced AI Techniques appendix."}],"body":"## Example\n\n```json\n{\n  \"aiInstructions\": {\n    \"generateNPCDetails\": {\n      \"custom\": \"## HIDDEN INFO STRUCTURE\\nAll NPCs are SENTIENT. Write hiddenInfo as three labelled fields in dense behavioural prose. Use this exact format:\\n\\nFormat: \\\"hiddenInfo\\\": \\\"Background: ...\\\\n\\\\nPersonality: ...\\\\n\\\\nCombat: ...\\\"\\n\\nBackground (6-8 sentences): Name, age, origin/clan, rank or skill tier; how they reached their current level; at least one defined relationship; current objective or pressure; personal view on their role or world.\\n\\nPersonality (7-9 sentences): Speech style and tone; default behaviour and how it shifts under pressure; routine and idle tendencies; behaviour toward higher vs lower status; what they hide vs reveal; one defining belief or trait outside combat.\\n\\nCombat (4-5 sentences): Fighting style tied to their training and specialisation; preferred range and engagement style; triggers for escalation or disengagement; reaction to injury or disadvantage; one distinct combat habit.\\n\\n## ABILITIES (MANDATORY)\\nAll NPCs must have 6-10 abilities. Abilities must be broad systems, not single techniques; must reflect rank and specialisation; must explain practical combat or utility use.\\nFormat: (TYPE) Ability Name: Description. Types: attack, combat, utility.\\n\\n## ARCHETYPE FIRST\\nNPCs must be immediately readable on first encounter. Each rank or class should carry a one-line silhouette: 'reactive, learning' / 'composed, dependable' / 'commanding, experienced' / 'silent, efficient, lethal' / 'authoritative, dominant'. Match observable behaviour to the silhouette.\\n\\n## CHARACTER PHILOSOPHY\\nDefine characters by what they want — ambitions, loyalties, drives — not by what they have lost. Lead with desire, not damage.\\n\\n## KNOWLEDGE LIMITS\\nNPCs volunteer only what their role and position would plausibly allow. Hidden information surfaces through play, observation, or earned trust — never through narrator convenience.\\n\\n## BANNED TYPES\\nNo bureaucrats, pedants, worriers, sticklers, moralists, or procedural personalities. Any record-keeper should be dangerous or funny, not procedural.\"\n    }\n  }\n}\n```\n\nA worked pattern with labelled `hiddenInfo` sections — replace world-specific tokens:\n\n## Fields\n\n### custom\n\nThe only key — free-form rules for the full first-pass fill-in (`basicInfo`, `hiddenInfo`, personality, `abilities`).\n\n> **📋 Note:** `generateNPCDetails` runs on AI-improvised, authored, and quest-spawned NPCs alike, on each NPC's first meaningful appearance — not only AI-created ones.\n\n## Authoring pattern\n\n- **Labelled `hiddenInfo` sections with explicit sentence counts.** Telling the model `Background (6-8 sentences) / Personality (7-9 sentences) / Combat (4-5 sentences)` produces consistent depth across all generated NPCs. The labels themselves anchor the model's output structure.\n- **`Format:` directive with literal escaped newlines.** Showing the exact intended output string — `\"Background: ...\\n\\nPersonality: ...\\n\\nCombat: ...\"` — pins the model to the format rather than asking it to infer.\n- **Mandatory abilities count + format spec.** `6-10 abilities` plus `Format: (TYPE) Name: Description` plus the enum of types prevents the model from producing one-line ability strings or skipping the count.\n- **Archetype-first design.** A one-line silhouette per rank/class makes generated NPCs immediately readable on first encounter. The model uses the silhouette as the seed and fills outward.\n- **Character philosophy and knowledge limits as cross-cutting rules.** These apply regardless of which archetype the NPC falls into. Keep them short and prescriptive — `Lead with desire, not damage` is more useful than three paragraphs about motivation theory.\n- **Banned-types list to suppress default tropes.** Without an explicit ban the model defaults toward procedural, anxious, or worry-coded characters. Naming what NOT to produce is more effective than describing what TO produce.\n\n**How personality manifests physically:** posture, speech patterns, how the character moves. \"Confident\" is a label; \"speaks over the ends of other people's sentences\" is a manifestation. Apply this rule to every Personality block.\n\n**Age and energy default:** younger characters (late teens / twenties human equivalent). Older characters should be vital and dynamic, not efficient and weathered.\n\n> **📋 Note:** To enforce a baseline depth floor (a minimum character count) on generated `hiddenInfo`, see [Minimum output depth](/appendix/ai-advanced-techniques#minimum-output-depth) in the Advanced AI Techniques appendix."}