--- id: wiki-2026-0508-ai-and-narrative title: AI and Narrative category: 10_Wiki/Topics status: verified canonical_id: self aliases: [AI μ„œμ‚¬, AI storytelling, generative narrative, interactive fiction, dynamic story, LLM-driven storytelling] duplicate_of: none source_trust_level: B confidence_score: 0.85 verification_status: conceptual tags: [storytelling, narrative, generative-ai, interactive-fiction, game-narrative, screenwriting, llm-creative] raw_sources: [] last_reinforced: 2026-05-09 github_commit: pending inferred_by: Claude Opus 4.7 (manual cleanup 2026-05-09) tech_stack: language: TS / Python framework: LLM API / AI Dungeon-style / Inworld AI / Convai --- # AI and Narrative ## πŸ“Œ ν•œ 쀄 톡찰 (The Karpathy Summary) > **LLM 의 long-context + creative generation 이 narrative 의 κ³ μ „ framework (Hero's journey, 3-act structure) + interactive (player choice) 의 κ²°ν•© 의 κ°€λŠ₯ ν•˜κ²Œ**. AI Dungeon β†’ Inworld β†’ modern LLM narrative game. **Author 의 replacement X, λ§€ author 의 toolkit ↑**. ## πŸ“– κ΅¬μ‘°ν™”λœ 지식 (Synthesized Content) ### AI 의 narrative 의 role #### 1. Generative author - λ§€ prompt 의 short story / scene / dialogue. - Genre adherence (fantasy, romance, sci-fi). - Style transfer (λ§€ author 의 voice mimic). - λ§€ chapter 의 outline + draft. #### 2. Structure analyzer - λ§€ thousand book 의 pattern. - "Hero's Journey" (Campbell) / "Save the Cat" (Snyder) / 3-act / Pixar 22 rules. - λ§€ plot 의 structural critique. - λ§€ weak point 의 detect. #### 3. Dynamic storyteller (interactive) - λ§€ player choice 의 real-time response. - Branching narrative. - NPC 의 dynamic dialogue. - Persistent world (player action 의 long-term effect). #### 4. World-building assistant - Lore generation. - λ§€ character 의 backstory. - λ§€ location 의 description. - Naming (character, place). #### 5. Editor / co-author - λ§€ draft 의 critique. - Continuity check. - Consistency (λ§€ character 의 voice). - Pacing analysis. ### Narrative theory 의 reference #### Hero's Journey (Campbell) 1. Ordinary world. 2. Call to adventure. 3. Refusal. 4. Mentor. 5. Crossing threshold. 6. Tests. 7. Approach. 8. Ordeal. 9. Reward. 10. Road back. 11. Resurrection. 12. Return with elixir. β†’ λ§€ LLM 의 prompt 의 reference. #### 3-Act Structure - Act 1: Setup (25%). - Act 2: Confrontation (50%). - Act 3: Resolution (25%). #### Save the Cat (Snyder, screenwriting) - 15 beat structure. - Opening Image, Theme Stated, Setup, Catalyst, Debate, Break into Two, ... #### Pixar 22 Rules of Storytelling - Emma Coats. - λ§€ rule 의 modern principle. β†’ λ§€ framework 의 LLM 의 system prompt. ### λ§€ application #### Game (RPG / interactive) - AI Dungeon (μ˜› GPT-2/3 era). - Modern: λ§€ game 의 LLM-driven NPC dialogue. - Inworld AI / Convai (game 의 production). - Ubisoft Sam, Roblox AI characters. #### Screenwriting / scriptwriting - ChatGPT / Claude 의 plot ideation. - Sudowrite (novelist tool). - Final Draft AI. - λ§€ writers' strike (2023) 의 AI 의 limit 의 contract. #### Novel / literary - NovelAI (long-form fiction). - Sudowrite. - λ§€ self-publish 의 AI assist. #### Education / training - λ§€ historical scenario 의 simulation. - λ§€ medical patient interview practice. - λ§€ language learning context. #### Marketing / advertising - λ§€ brand story. - λ§€ customer journey 의 narrative. ### λ§€ technical challenge #### 1. Long context / consistency - λ§€ 100k+ token 의 narrative 의 maintain. - λ§€ character 의 voice 의 consistency. - λ§€ timeline / continuity. β†’ Modern: Claude Opus 200k context 의 도움. λ§€ plot seed 의 system prompt. #### 2. Branching state - λ§€ player choice 의 effect 의 track. - λ§€ world state 의 mutation. - λ§€ cycle 의 manageable. β†’ State machine + LLM 의 hybrid. #### 3. Quality vs creativity - λ§€ LLM 의 generic / cliche. - λ§€ author 의 voice 의 unique. - λ§€ fine-tune / prompting 의 distinct. #### 4. Conflict / tension - λ§€ narrative 의 conflict 의 essential. - λ§€ LLM 의 default 의 conflict-avoidant (helpful, harmless). - λ§€ prompt 의 explicit conflict instruction. #### 5. Hallucination 의 narrative 의 fit - λ§€ fact-based (history) = bug. - λ§€ fiction = feature. ### Modern tools #### Inworld AI - λ§€ game NPC 의 dialogue. - λ§€ character 의 personality + memory. - Unity / Unreal 톡합. #### Convai - λ§€ NPC 의 voice + animation. - Real-time conversation. #### Sudowrite - Novelist 의 collaboration tool. - Style 의 maintain. - Beat sheet generation. #### NovelCrafter - λ§€ novel 의 long-form structure. - Character / world tracking. #### Charisma.ai - Interactive narrative scripting. ### λ§€ author 의 perspective #### "AI 의 author replace" 의 myth - λ§€ generic LLM output 의 cliche. - λ§€ unique voice / experience 의 human. - λ§€ emotional truth 의 lived experience. #### "AI 의 author augment" 의 reality - λ§€ brainstorm 의 speed. - λ§€ draft 의 boilerplate. - λ§€ research / world-building. - λ§€ tedious continuity check. β†’ Mollick "Co-Intelligence" 식. ### λ§€ ethical question #### μ €μž‘κΆŒ / IP - λ§€ LLM 의 training 의 copyrighted text. - λ§€ generated text 의 attribution. - λ§€ country 의 different (US human authorship requirement). #### 노동 / displacement - WGA strike (2023) 의 contract. - λ§€ freelance writer 의 market change. #### Authenticity / disclosure - λ§€ AI-generated 의 label. - λ§€ reader 의 informed. #### Bias 의 narrative - λ§€ LLM 의 training data 의 bias. - λ§€ stereotype 의 perpetuate. - λ§€ underrepresented voice 의 absence. ## πŸ’» νŒ¨ν„΄ (Code + Prompts) ### Beat sheet generator ```python def generate_beat_sheet(genre, premise): prompt = f""" Generate a 15-beat sheet for a {genre} story. Premise: {premise} Use Save the Cat structure: 1. Opening Image 2. Theme Stated 3. Setup (3 character, world) 4. Catalyst (inciting incident) 5. Debate 6. Break into Two 7. B Story 8. Fun and Games 9. Midpoint 10. Bad Guys Close In 11. All Is Lost 12. Dark Night of the Soul 13. Break into Three 14. Finale 15. Final Image Format: numbered list, 1-2 sentences each. """ return llm.complete(prompt) ``` ### NPC dynamic dialogue ```typescript class NPC { personality: string; memory: string[] = []; relationships: Map = new Map(); async respond(playerInput: string, context: GameState): Promise { const systemPrompt = ` You are ${this.name}, a ${this.personality} character in ${context.location}. Your memories: ${this.memory.slice(-10).join('. ')} Your feeling toward player: ${this.relationships.get('player') ?? 0}/100. Reply in 1-3 sentences. Stay in character. React to player tone. `; const response = await llm.complete({ system: systemPrompt, user: playerInput, }); // Update memory this.memory.push(`Player said: ${playerInput}. I replied: ${response}`); this.updateRelationship(playerInput, response); return response; } } ``` ### Branching narrative state machine ```ts interface StoryNode { id: string; text: string; choices: Choice[]; state_changes: Partial; } interface Choice { text: string; next: string; requires?: (state: WorldState) => boolean; } class StoryEngine { private currentNode: StoryNode; private state: WorldState = {}; async advance(choice: Choice) { Object.assign(this.state, this.currentNode.state_changes); // λ§€ dynamic = LLM κ°€ choose 미리 μ •μ˜ X 의 case if (choice.dynamic) { const next = await this.generateDynamicNode(choice); this.currentNode = next; } else { this.currentNode = this.nodes[choice.next]; } } async generateDynamicNode(choice: Choice): Promise { const prompt = ` Continue this story. Current state: ${JSON.stringify(this.state)} Player chose: ${choice.text} Generate next scene (200 words) + 3 player choices. Format: JSON { text, choices: [{ text, next }] } `; return JSON.parse(await llm.complete(prompt)); } } ``` ### Long-context consistency (RAG) ```ts // λ§€ chapter 의 vector embed const chapters = await Promise.all( chapters.map(async c => ({ id: c.id, summary: await llm.summarize(c.text), embedding: await embed(c.summary), })) ); // λ§€ μƒˆ chapter 의 generation μ‹œ relevant λ§€ retrieval async function generateNextChapter(prompt: string) { const relevant = await vectorSearch(prompt, chapters, k=5); const context = relevant.map(c => c.summary).join('\n\n'); return llm.complete({ system: `Continue the novel. Relevant prior chapters:\n${context}`, user: prompt, }); } ``` ### Character voice consistency ```ts const characterVoices = { alice: { style: 'verbose, academic, uses Latin phrases', examples: ['Nevertheless, I posit that...', 'Mutatis mutandis, ...'], }, bob: { style: 'terse, sarcastic, working-class', examples: ['Yeah, sure, whatever.', 'Tell me something I don't know.'], }, }; function generateDialogue(character: string, situation: string) { const voice = characterVoices[character]; return llm.complete({ system: `${character} speaks: ${voice.style}. Examples: ${voice.examples.join(' / ')}`, user: `Situation: ${situation}. ${character}'s response:`, }); } ``` ### Conflict injection ```python def inject_conflict(scene_description): prompt = f""" Scene: {scene_description} This scene is too peaceful. Add ONE concrete conflict: - Internal (character doubt) - Interpersonal (disagreement) - External (threat, obstacle) Rewrite the scene with the conflict integrated naturally. """ return llm.complete(prompt) ``` β†’ LLM 의 default 의 conflict-avoidance 의 fix. ### Style transfer (author voice) ```python def write_in_style(content, style_examples): prompt = f""" Style examples (mimic the voice): {chr(10).join(style_examples)} Now rewrite this in the same style: {content} """ return llm.complete(prompt) ``` ### Plot hole detector ```python def detect_plot_holes(synopsis): prompt = f""" Read this story synopsis and identify plot holes / inconsistencies. {synopsis} Format: numbered list of issues. For each: Where? What's the issue? How to fix? """ return llm.complete(prompt) ``` ## πŸ€” μ˜μ‚¬κ²°μ • κΈ°μ€€ (Decision Criteria) | μž‘μ—… | μΆ”μ²œ | |---|---| | Game NPC dialogue | Inworld / Convai / custom LLM | | Novel writing | Sudowrite / NovelCrafter | | Screenwriting | ChatGPT / Claude (with structure prompt) | | Branching narrative | State machine + LLM hybrid | | Long story consistency | RAG + chapter summaries | | Character voice | Few-shot example + style transfer | | Worldbuilding | LLM ideation + human curation | **κΈ°λ³Έκ°’**: Author 의 brainstorm + draft + edit 의 round-trip. λ§€ final = human. ## ⚠️ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & Updates) - **AI 의 narrative 의 cliche tendency**: λ§€ default κ°€ generic. λ§€ prompt engineering + curation ν•„μš”. - **Long context 의 consistency**: λ§€ model 의 context window 의 ν•œκ³„. RAG / summary 의 essential. - **Branching의 explosion**: λ§€ choice = 2x state. λ§€ manageable design ν•„μš”. - **Author 의 voice vs efficiency**: λ§€ unique 의 ↑ = manual ↑. - **Copyright / training data**: λ§€ LLM 의 training 의 lawsuit. - **WGA / writer 의 contract**: λ§€ industry change. ## πŸ”— 지식 μ—°κ²° (Graph) - λΆ€λͺ¨: [[Generative-AI]] - λ³€ν˜•: [[Interactive-Fiction]] ## πŸ€– LLM ν™œμš© 힌트 (How to Use This Knowledge) **μ–Έμ œ 이 지식을 μ“°λŠ”κ°€:** - λ§€ game 의 narrative system design. - λ§€ author 의 LLM-augmented workflow. - λ§€ interactive fiction 의 architecture. - λ§€ NPC dialogue system. - λ§€ worldbuilding pipeline. **μ–Έμ œ μ“°λ©΄ μ•ˆ λ˜λŠ”κ°€:** - λ§€ author 의 full replacement (cliche risk). - Specific copyright / legal advice. - λ§€ highly specific (ghost writing for celebrity). - λ§€ sensitive topic (trauma, mental health) 의 AI-only. ## ❌ μ•ˆν‹°νŒ¨ν„΄ (Anti-Patterns) - **AI generate 의 raw publish**: cliche / quality ↓. - **No human edit**: voice 의 generic. - **Long context 의 raw dump**: λ§€ token 폭발 + quality ↓. RAG / summary. - **Branching 의 unmanaged explosion**: λ§€ path 의 unmanageable. - **Character voice 의 inconsistent**: λ§€ reader 의 immersion break. - **No conflict / tension**: λ§€ LLM default 의 boring story. - **Plot hole 의 review skip**: λ§€ inconsistency 의 reader confusion. - **Disclosure λΆ€μ‘±**: λ§€ AI use 의 transparency. ## πŸ§ͺ 검증 μƒνƒœ (Validation) - **정보 μƒνƒœ:** verified (concept-level). - **좜처 신뒰도:** B (Joseph Campbell, Blake Snyder, Brandon Sanderson 의 lectures, OpenAI / Anthropic creative writing docs). - **κ²€ν†  이유:** Manual cleanup. Narrative theory κ°€ μ•ˆμ •. AI tool κ°€ evolving. ## 🧬 쀑볡 검사 (Duplicate Check) - **κΈ°μ‘΄ μœ μ‚¬ λ¬Έμ„œ:** [[Storytelling]] (parent), [[Game-Narrative]] (related), [[Generative-AI]] (parent). - **처리 방식:** KEEP (specific intersection 의 AI + narrative). - **처리 이유:** Distinct intersection. ## πŸ•“ λ³€κ²½ 이λ ₯ (Changelog) | λ‚ μ§œ | λ³€κ²½ λ‚΄μš© | 처리 방식 | 신뒰도 | |------|-----------|-----------|--------| | 2026-05-08 | P-Reinforce Phase 1 μ •κ·œν™” | UPDATE | A | | 2026-05-09 | Manual cleanup β€” narrative framework + code + tools + 윀리 + μ•ˆν‹°νŒ¨ν„΄ μΆ”κ°€ | UPDATE | B | ## πŸ”— κ΄€λ ¨ λ¬Έμ„œ (μžλ™ μ—°κ²°) - [[Agency and Player Autonomy]] - [[Post-Modernist Literature in Gaming]] - [[μœ νŠœλΈŒλΆ„μ„ 상상을 ν˜„μ‹€λ‘œ λ§Œλ“œλŠ” AI ꡬ글 OMNI μ™„λ²½ κ°€μ΄λ“œ l EP.3 ꡬ글 I-O μ‹€λ¦¬μ½˜λ°Έλ¦¬[AIμ™•κΈ°μ΄ˆ] 2026-05-20]]