mirror of
https://github.com/Memo-2023/mana-monorepo.git
synced 2026-05-15 18:59:40 +02:00
- Integrate worldream (text-first world-building platform) into games/ - Configure as @worldream/web workspace package - Remove standalone git repo, now part of monorepo 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
845 lines
30 KiB
Markdown
845 lines
30 KiB
Markdown
# Character Autopilot - Detaillierte Planung
|
||
|
||
## Executive Summary
|
||
|
||
Character Autopilot ist ein KI-gesteuertes System, das Charaktere basierend auf ihren definierten Eigenschaften autonom in Szenen agieren lässt. Es generiert realistische Dialoge, Handlungen und Reaktionen, die konsistent mit der Persönlichkeit, Geschichte und den Beziehungen des Charakters sind.
|
||
|
||
## 🎯 Kernziele
|
||
|
||
1. **Konsistenz**: Charaktere verhalten sich immer gemäß ihrer Definition
|
||
2. **Kreativität**: Überraschende aber plausible Aktionen und Dialoge
|
||
3. **Interaktivität**: Echtzeit-Reaktionen auf Story-Entwicklungen
|
||
4. **Lernfähigkeit**: Verhalten entwickelt sich basierend auf Erfahrungen
|
||
5. **Kontrolle**: Autoren behalten volle Kontrolle über finale Entscheidungen
|
||
|
||
## 📊 Systemarchitektur
|
||
|
||
### Komponenten-Übersicht
|
||
|
||
```
|
||
┌─────────────────────────────────────────────────────┐
|
||
│ User Interface │
|
||
├─────────────────────────────────────────────────────┤
|
||
│ Autopilot Engine │
|
||
├──────────────┬────────────────┬────────────────────┤
|
||
│ Character │ Context │ Decision │
|
||
│ Analyzer │ Processor │ Engine │
|
||
├──────────────┼────────────────┼────────────────────┤
|
||
│ Memory │ Relationship │ Emotion │
|
||
│ Manager │ Graph │ Simulator │
|
||
├──────────────┴────────────────┴────────────────────┤
|
||
│ AI Provider Layer │
|
||
│ (OpenAI / Anthropic / Local Models) │
|
||
└─────────────────────────────────────────────────────┘
|
||
```
|
||
|
||
### Datenmodell-Erweiterungen
|
||
|
||
```typescript
|
||
// Neue Felder für content_nodes (kind='character')
|
||
interface CharacterAutopilotData {
|
||
// Persönlichkeit
|
||
personality: {
|
||
traits: PersonalityTrait[]; // Big Five + Custom
|
||
values: Value[]; // Was ist dem Charakter wichtig
|
||
fears: string[]; // Ängste und Phobien
|
||
desires: string[]; // Wünsche und Ziele
|
||
quirks: string[]; // Eigenarten und Ticks
|
||
};
|
||
|
||
// Verhaltensmuster
|
||
behavior_patterns: {
|
||
stress_response: 'fight' | 'flight' | 'freeze' | 'fawn';
|
||
decision_style: 'impulsive' | 'analytical' | 'intuitive' | 'cautious';
|
||
social_style: 'dominant' | 'influential' | 'steady' | 'conscientious';
|
||
conflict_style: 'competing' | 'accommodating' | 'avoiding' | 'compromising' | 'collaborating';
|
||
};
|
||
|
||
// Wissensstand
|
||
knowledge: {
|
||
known_facts: string[]; // Was der Charakter weiß
|
||
false_beliefs: string[]; // Falsche Annahmen
|
||
secrets_known: string[]; // Geheimnisse anderer
|
||
skills: Skill[]; // Fähigkeiten mit Levels
|
||
};
|
||
|
||
// Emotionaler Zustand
|
||
emotional_state: {
|
||
current_mood: Mood;
|
||
stress_level: number; // 0-100
|
||
energy_level: number; // 0-100
|
||
recent_emotions: EmotionEvent[];
|
||
};
|
||
|
||
// Erinnerungen
|
||
memories: {
|
||
core_memories: Memory[]; // Prägende Erlebnisse
|
||
recent_events: Memory[]; // Letzte Interaktionen
|
||
relationships_history: Map<string, RelationshipEvent[]>;
|
||
};
|
||
}
|
||
|
||
interface PersonalityTrait {
|
||
name: string;
|
||
value: number; // -100 to 100
|
||
manifestations: string[];
|
||
}
|
||
|
||
interface Skill {
|
||
name: string;
|
||
level: 'novice' | 'intermediate' | 'expert' | 'master';
|
||
experience_points: number;
|
||
}
|
||
|
||
interface Memory {
|
||
id: string;
|
||
timestamp: Date;
|
||
importance: number; // 1-10
|
||
emotional_impact: number; // -10 to 10
|
||
description: string;
|
||
participants: string[]; // slugs
|
||
location?: string; // slug
|
||
tags: string[];
|
||
}
|
||
```
|
||
|
||
## 🧠 Kernfunktionalitäten
|
||
|
||
### 1. Situations-Reaktion ("Was würde X tun?")
|
||
|
||
```typescript
|
||
interface SituationResponse {
|
||
situation: {
|
||
description: string;
|
||
location?: string;
|
||
participants: string[];
|
||
mood: 'tense' | 'relaxed' | 'urgent' | 'mysterious' | 'romantic';
|
||
stakes: 'low' | 'medium' | 'high' | 'life-death';
|
||
};
|
||
|
||
analysis: {
|
||
character_motivation: string;
|
||
relevant_memories: Memory[];
|
||
emotional_response: Emotion;
|
||
stress_impact: number;
|
||
};
|
||
|
||
possible_actions: Action[];
|
||
recommended_action: Action;
|
||
confidence: number; // 0-100
|
||
|
||
explanation: string; // Warum würde der Charakter so handeln
|
||
}
|
||
|
||
interface Action {
|
||
type: 'speak' | 'act' | 'think' | 'react' | 'leave';
|
||
description: string;
|
||
dialogue?: string;
|
||
internal_monologue?: string;
|
||
consequences: string[];
|
||
personality_alignment: number; // Wie gut passt das zum Charakter
|
||
}
|
||
```
|
||
|
||
### 2. Dialog-Generator
|
||
|
||
```typescript
|
||
interface DialogueGeneration {
|
||
context: {
|
||
speaker: string; // character slug
|
||
listeners: string[]; // character slugs
|
||
previous_lines: DialogueLine[];
|
||
scene_description: string;
|
||
emotional_context: string;
|
||
};
|
||
|
||
options: DialogueOption[];
|
||
}
|
||
|
||
interface DialogueOption {
|
||
text: string;
|
||
tone: 'aggressive' | 'friendly' | 'neutral' | 'sarcastic' | 'fearful' | 'flirty';
|
||
subtext: string; // Was wirklich gemeint ist
|
||
personality_fit: number; // 0-100
|
||
relationship_impact: Map<string, number>; // Wie es Beziehungen beeinflusst
|
||
reveals_information: string[]; // Welche Infos preisgegeben werden
|
||
triggers: string[]; // Mögliche Reaktionen anderer
|
||
}
|
||
```
|
||
|
||
### 3. Beziehungs-Dynamik
|
||
|
||
```typescript
|
||
interface RelationshipDynamics {
|
||
character_a: string;
|
||
character_b: string;
|
||
|
||
current_state: {
|
||
trust: number; // -100 to 100
|
||
affection: number; // -100 to 100
|
||
respect: number; // -100 to 100
|
||
tension: number; // 0 to 100
|
||
};
|
||
|
||
history: RelationshipEvent[];
|
||
|
||
predicted_interactions: {
|
||
likely_conflicts: ConflictScenario[];
|
||
bonding_opportunities: BondingScenario[];
|
||
power_dynamics: 'a_dominant' | 'b_dominant' | 'equal' | 'shifting';
|
||
};
|
||
|
||
conversation_starters: string[];
|
||
tension_points: string[];
|
||
common_ground: string[];
|
||
}
|
||
```
|
||
|
||
### 4. Gruppen-Dynamik
|
||
|
||
```typescript
|
||
interface GroupDynamics {
|
||
participants: string[]; // character slugs
|
||
|
||
analysis: {
|
||
leader: string | null;
|
||
alliances: Alliance[];
|
||
outsiders: string[];
|
||
mediators: string[];
|
||
instigators: string[];
|
||
};
|
||
|
||
group_mood: Mood;
|
||
conflict_potential: number; // 0-100
|
||
cohesion: number; // 0-100
|
||
|
||
likely_scenarios: GroupScenario[];
|
||
}
|
||
|
||
interface Alliance {
|
||
members: string[];
|
||
strength: number; // 0-100
|
||
basis: 'friendship' | 'mutual_benefit' | 'against_common_enemy' | 'shared_values';
|
||
}
|
||
```
|
||
|
||
## 🎨 User Interface Design
|
||
|
||
### Hauptansicht - Autopilot Control Panel
|
||
|
||
```
|
||
┌──────────────────────────────────────────────────────────┐
|
||
│ Character Autopilot - Mira Schatten │
|
||
├──────────────────────────────────────────────────────────┤
|
||
│ │
|
||
│ ┌─── Aktuelle Szene ──────────────────────────────┐ │
|
||
│ │ 📍 Neo Station - Untere Ebenen │ │
|
||
│ │ 👥 Anwesend: Timo, Kira, Wächter #3 │ │
|
||
│ │ 🎭 Stimmung: Angespannt │ │
|
||
│ │ ⚡ Einsatz: Mittel │ │
|
||
│ └─────────────────────────────────────────────────┘ │
|
||
│ │
|
||
│ ┌─── Miras Zustand ───────────────────────────────┐ │
|
||
│ │ 😊 Stimmung: Misstrauisch │ │
|
||
│ │ 🔋 Energie: ████████░░ 78% │ │
|
||
│ │ 😰 Stress: ██████░░░░ 62% │ │
|
||
│ │ 💭 Denkt an: "Fluchtweg planen" │ │
|
||
│ └─────────────────────────────────────────────────┘ │
|
||
│ │
|
||
│ ┌─── Autopilot Vorschläge ────────────────────────┐ │
|
||
│ │ │ │
|
||
│ │ 🗣️ Dialog-Optionen: │ │
|
||
│ │ ┌────────────────────────────────────────┐ │ │
|
||
│ │ │ "Wir sollten uns aufteilen. Ich nehme │ │ │
|
||
│ │ │ den linken Gang." │ │ │
|
||
│ │ │ 😈 Täuschung (85% Fit) │ │ │
|
||
│ │ └────────────────────────────────────────┘ │ │
|
||
│ │ ┌────────────────────────────────────────┐ │ │
|
||
│ │ │ "Timo, du kennst dich hier aus. │ │ │
|
||
│ │ │ Was schlägst du vor?" │ │ │
|
||
│ │ │ 🤝 Kooperativ (65% Fit) │ │ │
|
||
│ │ └────────────────────────────────────────┘ │ │
|
||
│ │ │ │
|
||
│ │ 🎬 Handlungs-Optionen: │ │
|
||
│ │ • Unauffällig Ausgang scannen (92% Fit) │ │
|
||
│ │ • Waffe ziehen (15% Fit) │ │
|
||
│ │ • Nervös mit Amulett spielen (78% Fit) │ │
|
||
│ │ │ │
|
||
│ └─────────────────────────────────────────────┘ │
|
||
│ │
|
||
│ [🎲 Zufällig] [✏️ Anpassen] [✅ Übernehmen] │
|
||
│ │
|
||
└──────────────────────────────────────────────────────────┘
|
||
```
|
||
|
||
### Beziehungs-Explorer
|
||
|
||
```
|
||
┌──────────────────────────────────────────────────────────┐
|
||
│ Beziehungs-Dynamik: Mira ↔️ Timo │
|
||
├──────────────────────────────────────────────────────────┤
|
||
│ │
|
||
│ Vertrauen: ██████░░░░░░░░░░ 35% │
|
||
│ Zuneigung: ████████████░░░░ 72% │
|
||
│ Respekt: ████████░░░░░░░░ 48% │
|
||
│ Spannung: ██████████████░░ 86% │
|
||
│ │
|
||
│ 📊 Verlauf (letzte 5 Interaktionen): │
|
||
│ ┌─────────────────────────────────────────────┐ │
|
||
│ │ 100 ┤ │ │
|
||
│ │ 75 ┤ ╱╲ ╱╲ │ │
|
||
│ │ 50 ┤ ╱╲ ╱ ╲ ╱ ╲ │ │
|
||
│ │ 25 ┤ ╱ ✕ ╲╱ ╲ ╱╲ │ │
|
||
│ │ 0 └────────────────────────── │ │
|
||
│ │ -5 -4 -3 -2 -1 Jetzt │ │
|
||
│ └─────────────────────────────────────────────┘ │
|
||
│ │
|
||
│ 🔥 Konfliktpotential: │
|
||
│ • Mira verbirgt Information über das Amulett │
|
||
│ • Timo spürt, dass sie etwas verheimlicht │
|
||
│ • Unterschiedliche Loyalitäten zur Gilde │
|
||
│ │
|
||
│ 💚 Gemeinsame Basis: │
|
||
│ • Beide wollen Kira beschützen │
|
||
│ • Geteilte Vergangenheit in den Slums │
|
||
│ • Misstrauen gegenüber der Oberwelt │
|
||
│ │
|
||
│ 💬 Vorgeschlagene Gesprächsthemen: │
|
||
│ • "Erinnerst du dich an unseren ersten Auftrag?" │
|
||
│ • "Was hältst du wirklich von Kiras Plan?" │
|
||
│ • "Die Gilde wird langsam misstrauisch..." │
|
||
│ │
|
||
└──────────────────────────────────────────────────────────┘
|
||
```
|
||
|
||
### Gruppen-Simulator
|
||
|
||
```
|
||
┌──────────────────────────────────────────────────────────┐
|
||
│ Gruppen-Dynamik Simulator │
|
||
├──────────────────────────────────────────────────────────┤
|
||
│ │
|
||
│ Teilnehmer: [Mira] [Timo] [Kira] [Viktor] [+] │
|
||
│ │
|
||
│ ┌─── Soziale Struktur ─────────────────────────┐ │
|
||
│ │ Kira │ │
|
||
│ │ ↙️ ↘️ │ │
|
||
│ │ Mira ←→ Timo │ │
|
||
│ │ ↘️ ↙️ │ │
|
||
│ │ Viktor │ │
|
||
│ │ │ │
|
||
│ │ 👑 Anführer: Kira (Charisma) │ │
|
||
│ │ 🤝 Allianz: Mira-Timo (72%) │ │
|
||
│ │ 😤 Außenseiter: Viktor │ │
|
||
│ │ 🕊️ Vermittler: Timo │ │
|
||
│ └───────────────────────────────────────────────┘ │
|
||
│ │
|
||
│ Szenarien-Vorhersage: │
|
||
│ │
|
||
│ Bei Bedrohung (85% Wahrscheinlichkeit): │
|
||
│ • Kira übernimmt Kommando │
|
||
│ • Mira und Timo arbeiten zusammen │
|
||
│ • Viktor handelt eigenmächtig │
|
||
│ │
|
||
│ Bei Beutverteilung (73% Wahrscheinlichkeit): │
|
||
│ • Konflikt zwischen Viktor und Rest │
|
||
│ • Timo versucht zu vermitteln │
|
||
│ • Mira unterstützt Kiras Entscheidung │
|
||
│ │
|
||
│ [🎬 Szene simulieren] [📊 Details] [💾 Speichern] │
|
||
│ │
|
||
└──────────────────────────────────────────────────────────┘
|
||
```
|
||
|
||
## 🤖 KI-Integration
|
||
|
||
### Prompt Engineering Framework
|
||
|
||
```typescript
|
||
class AutopilotPromptBuilder {
|
||
buildCharacterPrompt(character: CharacterNode): string {
|
||
return `
|
||
# Character Profile: ${character.title}
|
||
|
||
## Core Identity
|
||
${character.content.appearance}
|
||
${character.content.voice_style}
|
||
|
||
## Personality Traits
|
||
${this.formatPersonalityTraits(character.autopilot.personality.traits)}
|
||
|
||
## Values & Beliefs
|
||
Values: ${character.autopilot.personality.values.join(', ')}
|
||
Fears: ${character.autopilot.personality.fears.join(', ')}
|
||
Desires: ${character.autopilot.personality.desires.join(', ')}
|
||
|
||
## Behavioral Patterns
|
||
- Stress Response: ${character.autopilot.behavior_patterns.stress_response}
|
||
- Decision Style: ${character.autopilot.behavior_patterns.decision_style}
|
||
- Social Style: ${character.autopilot.behavior_patterns.social_style}
|
||
- Conflict Style: ${character.autopilot.behavior_patterns.conflict_style}
|
||
|
||
## Current State
|
||
Mood: ${character.autopilot.emotional_state.current_mood}
|
||
Stress: ${character.autopilot.emotional_state.stress_level}%
|
||
Energy: ${character.autopilot.emotional_state.energy_level}%
|
||
|
||
## Recent Memories
|
||
${this.formatRecentMemories(character.autopilot.memories.recent_events)}
|
||
|
||
## Knowledge & Beliefs
|
||
Known: ${character.autopilot.knowledge.known_facts.join('; ')}
|
||
False Beliefs: ${character.autopilot.knowledge.false_beliefs.join('; ')}
|
||
|
||
IMPORTANT: Stay completely in character. React based on what THIS character knows and believes, not on omniscient knowledge.
|
||
`;
|
||
}
|
||
|
||
buildSituationPrompt(situation: Situation, character: CharacterNode): string {
|
||
return `
|
||
${this.buildCharacterPrompt(character)}
|
||
|
||
# Current Situation
|
||
Location: ${situation.location}
|
||
Present: ${situation.participants.join(', ')}
|
||
Atmosphere: ${situation.mood}
|
||
Stakes: ${situation.stakes}
|
||
|
||
Description: ${situation.description}
|
||
|
||
# Task
|
||
Based on this character's personality, current emotional state, and knowledge:
|
||
1. How would they emotionally react to this situation?
|
||
2. What would they most likely do or say?
|
||
3. What are they thinking but not saying?
|
||
4. How does this relate to their past experiences?
|
||
|
||
Provide 3 different but plausible responses, ranked by likelihood.
|
||
Format as JSON with structure: {responses: [{action, dialogue, internal_thought, likelihood_score, reasoning}]}
|
||
`;
|
||
}
|
||
}
|
||
```
|
||
|
||
### Multi-Model Support
|
||
|
||
```typescript
|
||
interface AIProvider {
|
||
generateResponse(prompt: string, config: AIConfig): Promise<string>;
|
||
streamResponse(prompt: string, config: AIConfig): AsyncGenerator<string>;
|
||
}
|
||
|
||
class AutopilotAIManager {
|
||
providers: Map<string, AIProvider> = new Map([
|
||
['openai-gpt4', new OpenAIProvider('gpt-4-turbo')],
|
||
['claude-3', new AnthropicProvider('claude-3-opus')],
|
||
['local-llama', new LocalProvider('llama-3-70b')]
|
||
]);
|
||
|
||
async generateCharacterResponse(
|
||
character: CharacterNode,
|
||
situation: Situation,
|
||
provider: string = 'openai-gpt4'
|
||
): Promise<CharacterResponse> {
|
||
const prompt = this.promptBuilder.buildSituationPrompt(situation, character);
|
||
const aiProvider = this.providers.get(provider);
|
||
|
||
const response = await aiProvider.generateResponse(prompt, {
|
||
temperature: this.getTemperatureForCharacter(character),
|
||
max_tokens: 1000,
|
||
response_format: { type: 'json_object' }
|
||
});
|
||
|
||
return this.parseAndValidateResponse(response, character);
|
||
}
|
||
|
||
getTemperatureForCharacter(character: CharacterNode): number {
|
||
// Impulsive characters get higher temperature
|
||
const impulsiveness =
|
||
character.autopilot.behavior_patterns.decision_style === 'impulsive' ? 0.3 : 0;
|
||
const creativity =
|
||
character.autopilot.personality.traits.find((t) => t.name === 'openness')?.value / 200 || 0;
|
||
|
||
return 0.5 + impulsiveness + creativity; // Range: 0.5 - 1.0
|
||
}
|
||
}
|
||
```
|
||
|
||
## 📈 Lern- und Anpassungssystem
|
||
|
||
### Feedback Loop
|
||
|
||
```typescript
|
||
interface CharacterLearning {
|
||
recordInteraction(interaction: Interaction): void {
|
||
// Speichere als Erinnerung
|
||
this.addMemory(interaction)
|
||
|
||
// Update Beziehungen
|
||
this.updateRelationships(interaction)
|
||
|
||
// Lerne neue Fakten
|
||
this.updateKnowledge(interaction)
|
||
|
||
// Passe Persönlichkeit minimal an (Character Development)
|
||
this.evolvePersonality(interaction)
|
||
}
|
||
|
||
evolvePersonality(interaction: Interaction): void {
|
||
// Traumatische Ereignisse können Persönlichkeit ändern
|
||
if (interaction.trauma_level > 8) {
|
||
this.adjustTrait('neuroticism', +10)
|
||
this.adjustTrait('trust', -15)
|
||
}
|
||
|
||
// Positive Erfahrungen stärken Selbstvertrauen
|
||
if (interaction.success_level > 8) {
|
||
this.adjustTrait('confidence', +5)
|
||
this.adjustTrait('openness', +3)
|
||
}
|
||
}
|
||
}
|
||
```
|
||
|
||
### Konsistenz-Tracking
|
||
|
||
```typescript
|
||
class ConsistencyValidator {
|
||
validateAction(character: CharacterNode, proposedAction: Action): ValidationResult {
|
||
const inconsistencies: Inconsistency[] = [];
|
||
|
||
// Prüfe gegen Persönlichkeit
|
||
if (this.isOutOfCharacter(character, proposedAction)) {
|
||
inconsistencies.push({
|
||
type: 'personality',
|
||
severity: 'high',
|
||
description: 'Action conflicts with established personality traits'
|
||
});
|
||
}
|
||
|
||
// Prüfe gegen Wissen
|
||
if (this.usesUnknownInformation(character, proposedAction)) {
|
||
inconsistencies.push({
|
||
type: 'knowledge',
|
||
severity: 'critical',
|
||
description: "Character acts on information they shouldn't know"
|
||
});
|
||
}
|
||
|
||
// Prüfe gegen physische Fähigkeiten
|
||
if (this.exceedsCapabilities(character, proposedAction)) {
|
||
inconsistencies.push({
|
||
type: 'capability',
|
||
severity: 'high',
|
||
description: "Action exceeds character's physical/mental capabilities"
|
||
});
|
||
}
|
||
|
||
return {
|
||
isValid: inconsistencies.length === 0,
|
||
inconsistencies,
|
||
confidenceScore: this.calculateConfidence(inconsistencies)
|
||
};
|
||
}
|
||
}
|
||
```
|
||
|
||
## 🔧 Technische Implementation
|
||
|
||
### API Endpoints
|
||
|
||
```typescript
|
||
// Character Autopilot API Routes
|
||
|
||
// Generate character response
|
||
POST /api/autopilot/respond
|
||
{
|
||
character_slug: string
|
||
situation: Situation
|
||
options?: {
|
||
provider?: string
|
||
creativity?: number
|
||
include_alternatives?: boolean
|
||
}
|
||
}
|
||
|
||
// Simulate dialogue between characters
|
||
POST /api/autopilot/dialogue
|
||
{
|
||
participants: string[]
|
||
context: DialogueContext
|
||
turns: number
|
||
}
|
||
|
||
// Predict character behavior
|
||
POST /api/autopilot/predict
|
||
{
|
||
character_slug: string
|
||
scenario: Scenario
|
||
time_frame: 'immediate' | 'short_term' | 'long_term'
|
||
}
|
||
|
||
// Analyze group dynamics
|
||
POST /api/autopilot/group-dynamics
|
||
{
|
||
characters: string[]
|
||
situation: Situation
|
||
}
|
||
|
||
// Train character from examples
|
||
POST /api/autopilot/train
|
||
{
|
||
character_slug: string
|
||
examples: InteractionExample[]
|
||
}
|
||
```
|
||
|
||
### Datenbank-Schema Erweiterungen
|
||
|
||
```sql
|
||
-- Autopilot-spezifische Tabellen
|
||
|
||
CREATE TABLE character_autopilot_configs (
|
||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||
character_id UUID REFERENCES content_nodes(id),
|
||
personality_data JSONB NOT NULL,
|
||
behavior_patterns JSONB NOT NULL,
|
||
knowledge_base JSONB NOT NULL,
|
||
created_at TIMESTAMPTZ DEFAULT NOW(),
|
||
updated_at TIMESTAMPTZ DEFAULT NOW()
|
||
);
|
||
|
||
CREATE TABLE character_memories (
|
||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||
character_id UUID REFERENCES content_nodes(id),
|
||
memory_type TEXT CHECK (memory_type IN ('core', 'recent', 'learned')),
|
||
importance INTEGER CHECK (importance BETWEEN 1 AND 10),
|
||
emotional_impact INTEGER CHECK (emotional_impact BETWEEN -10 AND 10),
|
||
content JSONB NOT NULL,
|
||
occurred_at TIMESTAMPTZ,
|
||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||
);
|
||
|
||
CREATE TABLE character_relationships (
|
||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||
character_a_id UUID REFERENCES content_nodes(id),
|
||
character_b_id UUID REFERENCES content_nodes(id),
|
||
trust_level INTEGER CHECK (trust_level BETWEEN -100 AND 100),
|
||
affection_level INTEGER CHECK (affection_level BETWEEN -100 AND 100),
|
||
respect_level INTEGER CHECK (respect_level BETWEEN -100 AND 100),
|
||
tension_level INTEGER CHECK (tension_level BETWEEN 0 AND 100),
|
||
history JSONB DEFAULT '[]'::jsonb,
|
||
updated_at TIMESTAMPTZ DEFAULT NOW(),
|
||
UNIQUE(character_a_id, character_b_id)
|
||
);
|
||
|
||
CREATE TABLE autopilot_interactions (
|
||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||
session_id UUID,
|
||
character_id UUID REFERENCES content_nodes(id),
|
||
situation JSONB NOT NULL,
|
||
generated_response JSONB NOT NULL,
|
||
selected_response JSONB,
|
||
user_feedback JSONB,
|
||
consistency_score DECIMAL(3,2),
|
||
created_at TIMESTAMPTZ DEFAULT NOW()
|
||
);
|
||
|
||
-- Indizes für Performance
|
||
CREATE INDEX idx_memories_character ON character_memories(character_id);
|
||
CREATE INDEX idx_memories_importance ON character_memories(importance DESC);
|
||
CREATE INDEX idx_relationships_characters ON character_relationships(character_a_id, character_b_id);
|
||
CREATE INDEX idx_interactions_session ON autopilot_interactions(session_id);
|
||
CREATE INDEX idx_interactions_character ON autopilot_interactions(character_id);
|
||
```
|
||
|
||
### React Components
|
||
|
||
```typescript
|
||
// CharacterAutopilot.svelte
|
||
<script lang="ts">
|
||
import { AutopilotEngine } from '$lib/autopilot/engine'
|
||
import { CharacterCard } from '$lib/components/CharacterCard.svelte'
|
||
import { ResponseOptions } from '$lib/components/ResponseOptions.svelte'
|
||
import { EmotionalState } from '$lib/components/EmotionalState.svelte'
|
||
|
||
export let character: CharacterNode
|
||
export let situation: Situation
|
||
|
||
let engine = new AutopilotEngine(character)
|
||
let responses = $state<Response[]>([])
|
||
let loading = $state(false)
|
||
let selectedResponse = $state<Response | null>(null)
|
||
|
||
async function generateResponses() {
|
||
loading = true
|
||
try {
|
||
responses = await engine.generateResponses(situation)
|
||
} finally {
|
||
loading = false
|
||
}
|
||
}
|
||
|
||
function applyResponse(response: Response) {
|
||
selectedResponse = response
|
||
// Update story with selected response
|
||
dispatch('apply-response', response)
|
||
}
|
||
</script>
|
||
|
||
<div class="autopilot-container">
|
||
<CharacterCard {character} />
|
||
|
||
<EmotionalState
|
||
state={character.autopilot.emotional_state}
|
||
on:update={updateEmotionalState}
|
||
/>
|
||
|
||
{#if loading}
|
||
<div class="loading-spinner">
|
||
Analysiere Charakterverhalten...
|
||
</div>
|
||
{:else if responses.length > 0}
|
||
<ResponseOptions
|
||
{responses}
|
||
on:select={applyResponse}
|
||
on:regenerate={generateResponses}
|
||
/>
|
||
{:else}
|
||
<button on:click={generateResponses}>
|
||
Autopilot aktivieren
|
||
</button>
|
||
{/if}
|
||
|
||
{#if selectedResponse}
|
||
<div class="applied-response">
|
||
<h4>Angewendet:</h4>
|
||
<p>{selectedResponse.action}</p>
|
||
{#if selectedResponse.dialogue}
|
||
<blockquote>{selectedResponse.dialogue}</blockquote>
|
||
{/if}
|
||
</div>
|
||
{/if}
|
||
</div>
|
||
```
|
||
|
||
## 🎮 Erweiterte Features
|
||
|
||
### 1. Autopilot Battles
|
||
|
||
Lasse zwei Charaktere in verschiedenen Szenarien gegeneinander antreten:
|
||
|
||
- Verbale Duelle
|
||
- Strategische Planungen
|
||
- Verhandlungen
|
||
- Überlebenssituationen
|
||
|
||
### 2. Character Evolution Trees
|
||
|
||
Zeige mögliche Entwicklungspfade basierend auf Entscheidungen:
|
||
|
||
- Persönlichkeitsveränderungen
|
||
- Skill-Entwicklung
|
||
- Beziehungsverläufe
|
||
- Moralische Ausrichtung
|
||
|
||
### 3. Ensemble Casts
|
||
|
||
Simuliere komplexe Gruppen-Interaktionen:
|
||
|
||
- Dinner-Party Simulator
|
||
- Ratssitzungen
|
||
- Teambildung unter Stress
|
||
- Meuterei-Szenarien
|
||
|
||
### 4. Emotional Contagion
|
||
|
||
Modelliere wie Emotionen sich in Gruppen ausbreiten:
|
||
|
||
- Panik in Menschenmengen
|
||
- Inspirationsreden
|
||
- Mob-Mentalität
|
||
- Gruppendepression
|
||
|
||
## 📊 Metriken & Analytics
|
||
|
||
### Performance KPIs
|
||
|
||
- **Response Time**: < 2 Sekunden für Einzelcharakter
|
||
- **Consistency Score**: > 85% für generierte Aktionen
|
||
- **User Acceptance Rate**: > 70% der Vorschläge übernommen
|
||
- **Character Depth Score**: Anzahl genutzter Persönlichkeitsaspekte
|
||
|
||
### Quality Metrics
|
||
|
||
- **Dialogue Naturalness**: NLP-basierte Bewertung
|
||
- **Action Plausibility**: User-Feedback Score
|
||
- **Character Growth**: Persönlichkeitsentwicklung über Zeit
|
||
- **Relationship Complexity**: Anzahl und Tiefe der Beziehungsdynamiken
|
||
|
||
## 🚀 Rollout-Plan
|
||
|
||
### Phase 1: Foundation (Woche 1-2)
|
||
|
||
- [ ] Datenmodell-Erweiterungen
|
||
- [ ] Basis-UI Components
|
||
- [ ] Einfache Prompt-Templates
|
||
- [ ] OpenAI Integration
|
||
|
||
### Phase 2: Core Features (Woche 3-4)
|
||
|
||
- [ ] Situations-Response Generator
|
||
- [ ] Dialog-Generator
|
||
- [ ] Beziehungs-Tracking
|
||
- [ ] Konsistenz-Validator
|
||
|
||
### Phase 3: Advanced (Woche 5-6)
|
||
|
||
- [ ] Gruppen-Dynamik
|
||
- [ ] Lern-System
|
||
- [ ] Multi-Model Support
|
||
- [ ] Emotional Contagion
|
||
|
||
### Phase 4: Polish (Woche 7-8)
|
||
|
||
- [ ] Performance-Optimierung
|
||
- [ ] UI/UX Verfeinerung
|
||
- [ ] Analytics Dashboard
|
||
- [ ] Dokumentation
|
||
|
||
## 💰 Monetarisierung
|
||
|
||
### Pricing Tiers
|
||
|
||
- **Basic**: 100 Autopilot-Aktionen/Monat
|
||
- **Pro**: 1000 Aktionen/Monat + erweiterte Modelle
|
||
- **Studio**: Unbegrenzt + Custom Training + API Access
|
||
|
||
### Premium Features
|
||
|
||
- GPT-4 / Claude-3 Modelle
|
||
- Custom Character Training
|
||
- Batch-Simulation
|
||
- Export für Game Engines
|
||
|
||
## 🔒 Datenschutz & Ethik
|
||
|
||
### Schutzmaßnahmen
|
||
|
||
- Keine Generierung von schädlichen Inhalten
|
||
- Altersgerechte Inhaltsfilter
|
||
- Opt-in für Charakterdaten-Training
|
||
- Transparenz über KI-Nutzung
|
||
|
||
### Ethische Richtlinien
|
||
|
||
- Respektvolle Darstellung von Minderheiten
|
||
- Keine Verstärkung von Stereotypen
|
||
- Trigger-Warnungen für sensible Themen
|
||
- User-Kontrolle über Charakterverhalten
|
||
|
||
## 📝 Zusammenfassung
|
||
|
||
Character Autopilot transformiert statische Charakterbeschreibungen in lebendige, autonome Persönlichkeiten. Durch die Kombination von fortschrittlicher KI, psychologischen Modellen und narrativen Strukturen entsteht ein System, das Autoren dabei unterstützt, konsistente und überzeugende Charakterinteraktionen zu erschaffen.
|
||
|
||
Die modulare Architektur ermöglicht schrittweise Verbesserungen und Anpassungen basierend auf User-Feedback. Mit dem Fokus auf Konsistenz, Kreativität und Kontrolle wird Character Autopilot zum unverzichtbaren Werkzeug für jeden ernsthaften Weltenbauer und Geschichtenerzähler.
|