Narrative System
Narrative System
Section titled “Narrative System”Narrative Data Structure
Section titled “Narrative Data Structure”Story Framework Design
Section titled “Story Framework Design”Create structured narrative system for dialogue and story delivery:
Struct_Narrative Components
Section titled “Struct_Narrative Components”- Narrative Text: Story content for display
- Simple Structure: Single text field for straightforward implementation
NPC Camera Integration
Section titled “NPC Camera Integration”Enhance NPC characters with cinematic narrative presentation:
Camera Setup for NPCs
Section titled “Camera Setup for NPCs”Modify bp_character_npc with camera components:
- Camera Boom: Target arm length -150, Z location 70
- Follow Camera: Z rotation 180°, Y rotation -12.5°
- Cinematic Angle: Creates engaging conversation view
Narrative UI Implementation
Section titled “Narrative UI Implementation”W_Narrative Widget Design
Section titled “W_Narrative Widget Design”Create immersive dialogue interface:
Widget Structure
Section titled “Widget Structure”- Size Box: 800x250 for substantial text display
- Background Image: Black background, 90% alpha for readability
- Text Block: 770x190 text area with 16pt font
- Auto Wrap Text: Enable for proper line breaking
- Button Controls: Next and Close buttons
Visual Polish
Section titled “Visual Polish”- Background Treatment: Dark overlay for text readability
- Text Positioning: 15-pixel margins for comfortable reading
- Button Placement: Next button bottom-right, Close button top-right
Narrative Interface System
Section titled “Narrative Interface System”Create communication system between NPCs and narrative UI:
// Narrative Interface FunctionsInterface_Widget_Narrative_Toggle() {// Show/hide narrative widgetif (Widget.IsVisible()) {Widget.SetVisibility(Hidden);} else {Widget.SetVisibility(Visible);}}
Interface_Widget_Narrative_Load(DataTable) {current_narrative_table = DataTable;narrative_index = 0; // Reset to first entryDisplayCurrentNarrativeEntry();}
Camera System Integration
Section titled “Camera System Integration”View Target Switching
Section titled “View Target Switching”Create cinematic dialogue experience:
Player Character Interface
Section titled “Player Character Interface”- Interface_Load_Narrative: Receive narrative data from NPCs
- Interface_Reset_View_Blend: Return camera control to player
Camera Transition Implementation
Section titled “Camera Transition Implementation”// Narrative Camera ControlOnLoadNarrative(NarrativeDataTable) {// Switch camera to NPC for cinematic dialogueplayer_controller = GetPlayerController();player_controller.SetViewTargetWithBlend(NPC_Character, 0.5);
// Hide player character during dialogueSetActorHiddenInGame(true);
// Load narrative contentWidget_Narrative.Interface_Load_Narrative(NarrativeDataTable);Widget_Narrative.Interface_Toggle();}
Narrative Progression System
Section titled “Narrative Progression System”Multi-Entry Narrative Support
Section titled “Multi-Entry Narrative Support”Enable sequential dialogue progression:
Data Table Navigation
Section titled “Data Table Navigation”// Narrative Progression LogicOnNextButtonPressed() {narrative_index++;
if (narrative_index < narrative_row_names.Num()) {// More dialogue entries availableDisplayNarrativeEntry(narrative_index);} else {// Narrative complete - return to gameplayCompleteNarrative();}}
CompleteNarrative() {// Return camera to playerInterface_Reset_View_Blend();
// Hide narrative widgetInterface_Toggle();}
Close Button Implementation
Section titled “Close Button Implementation”Allow players to exit narrative early:
- Immediate Exit: Close button immediately returns to gameplay
- Camera Reset: Restore player camera control
- UI Cleanup: Hide narrative interface
Database Integration
Section titled “Database Integration”Narrative Content Organization
Section titled “Narrative Content Organization”Structure narrative data for easy management:
Data Table Setup
Section titled “Data Table Setup”- Database/Narrative/: Dedicated folder for story content
- DT_Narrative_Example: Template narrative structure
- Row Names: Automatic numbering (NewRow, NewRow_0, NewRow_1…)
- Multiple Entries: Each row represents one dialogue segment
Content Creation
Section titled “Content Creation”- Sequential Text: Each data table row contains one dialogue segment
- Flexible Length: Support short exchanges or long monologues
- NPC Assignment: Each NPC can have unique narrative data table
System Integration
Section titled “System Integration”Player Character Integration
Section titled “Player Character Integration”Connect narrative system to player controls:
View Blend Reset
Section titled “View Blend Reset”// Return Camera Control to PlayerInterface_Reset_View_Blend() {player_controller = GetPlayerController();player_controller.SetViewTargetWithBlend(Self, 0.5);
// Show player character againSetActorHiddenInGame(false);
Widget_Narrative.Interface_Toggle(); // Hide narrative UI}
UI Widget Integration
Section titled “UI Widget Integration”- Root Widget: Add narrative widget to main UI
- Positioning: Bottom middle for subtitle-like presentation
- Default Hidden: Only visible during narrative sequences
- HUD Integration: Follow standard widget integration pattern
Narrative Polish
Section titled “Narrative Polish”User Experience Enhancements
Section titled “User Experience Enhancements”- Smooth Transitions: 0.5-second camera blends for cinematic feel
- Clear Controls: Obvious Next and Close buttons
- Readable Text: Appropriate sizing and contrast for text readability
- Player Agency: Allow early exit from narrative sequences
Integration with Other Systems
Section titled “Integration with Other Systems”- Quest Integration: Narrative can trigger quest assignment
- World State: Stories can respond to player progress
- Character Development: NPCs can have different narratives based on game state
The narrative system creates immersive storytelling experiences while maintaining player agency and integrating smoothly with existing game systems for cohesive gameplay flow.