# Level Structure Template ## Overview This document defines the standard structure and components for creating Training Academy campaign levels. Follow this template to ensure consistency across all levels. --- ## Level Data Structure ### Basic Level Properties ```javascript { id: 'academy-level-X', // Unique identifier (academy-level-1, academy-level-2, etc.) name: 'Level Title', // Display name (e.g., "Edge Training 101") arc: 'Arc Name', // Story arc (Foundation, Immersion, Advanced Training, etc.) level: X, // Level number (1, 2, 3, etc.) duration: 300, // Estimated duration in seconds interactiveType: 'scenario-adventure', // Always use this for campaign levels interactiveData: { // Scenario data here... } } ``` --- ## Scenario Structure ### Interactive Data Template ```javascript interactiveData: { title: 'Level X: Level Title', // Match the level name steps: { // Steps defined here... } } ``` --- ## Step Types ### 1. Story Step (Narrative/Dialogue) **Purpose**: Display story text without user interaction beyond continuing ```javascript start: { type: 'story', mood: 'welcoming', // Options: welcoming, instructional, praising, anticipatory, intense, etc. story: 'Your story text here. This displays to the player.', nextStep: 'next_step_id' } ``` **Common Moods**: - `welcoming` - Friendly introduction - `instructional` - Teaching/guidance - `praising` - Positive reinforcement - `anticipatory` - Building excitement - `intense` - High energy/challenge - `satisfied` - Completion/success --- ### 2. Action Step (Interactive Task) **Purpose**: Execute an interactive task (edge, rhythm, library management, etc.) ```javascript step_id: { type: 'action', mood: 'instructional', story: 'Explanation of what the player will do.', interactiveType: 'edge', // Type of interactive task params: { // Task-specific parameters count: 5, instruction: 'Edge 5 times - slowly and deliberately', showTimer: true, // ALWAYS include for countdown timer display preserveContent: false // Set to true if you want to append to existing content }, nextStep: 'next_step_id' } ``` --- ### 3. Completion Step **Purpose**: Mark level as complete and show completion message ```javascript completion: { type: 'completion', mood: 'satisfied', story: '✅ Level X Complete - Summary of achievements.', outcome: 'levelX_complete' } ``` --- ## Standard Interactive Task Types ### Edge Task **Purpose**: Edge training - stroke to the brink without release ```javascript { type: 'action', mood: 'instructional', story: 'Edge training instructions.', interactiveType: 'edge', params: { count: 5, // Number of edges (optional) duration: 300, // Duration in seconds (optional) instruction: 'Edge 5 times - slowly and deliberately', showTimer: true, // Show countdown timer in sidebar preserveContent: false, // Whether to preserve existing content keepVideoPlaying: false // Keep video player active }, nextStep: 'next_step_id' } ``` **Components Created**: - Edge instruction display - Start button - Dev skip button (auto-shown in dev mode) - Session duration display - Sidebar countdown timer (if showTimer: true) - Status messages --- ### Rhythm Task **Purpose**: Follow specific stroking rhythm patterns ```javascript { type: 'action', mood: 'focused', story: 'Follow the rhythm pattern.', interactiveType: 'rhythm', params: { pattern: 'slow-fast-slow', // Pattern name (see patterns below) duration: 180, // Duration in seconds enableVideo: true, // Enable video playback enableMetronomeSound: true, // Play metronome tick sounds showTimer: true, // Show countdown timer in sidebar multiPattern: [ // Optional: Multiple patterns in sequence { pattern: 'fast-slow-fast', duration: 300 }, { pattern: 'varied-medium', duration: 360 } ] }, nextStep: 'next_step_id' } ``` **Available Patterns**: - `slow-fast-slow` - [60, 80, 100, 120, 140, 120, 100, 80, 60] BPM - `fast-slow-fast` - [140, 120, 100, 80, 60, 80, 100, 120, 140] BPM - `steady` - [90, 90, 90, 90, 90, 90] BPM - `escalating` - [60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, 170, 180] BPM - `varied-slow` - [70, 80, 90, 100, 0, 80, 90, 110, 100, 0, 70, 85, 95, 80, 100] BPM - `varied-medium` - [100, 120, 140, 160, 150, 0, 130, 150, 170, 140, 180, 0, 120, 160, 140, 180, 200] BPM - `varied-intense` - [140, 160, 180, 200, 0, 160, 180, 200, 220, 0, 180, 200, 220, 240, 0, 200, 220, 180, 240] BPM **Components Created**: - Pattern title display - BPM display - Phase indicator - Metronome visual (pulsing indicator) - Video player (if enableVideo: true) - Video controls (skip, volume) - Metronome volume control - Dev skip button - Sidebar countdown timer --- ### Rhythm Training Task (Advanced) **Purpose**: Advanced rhythm training with custom tempo sequences ```javascript { type: 'action', mood: 'intense', story: 'Advanced rhythm training with varying tempo.', interactiveType: 'rhythm-training', params: { duration: 180, enableVideo: false, showTimer: true, tempoSequence: [ { tempo: 60, duration: 25.71 }, // Slow warmup { tempo: 120, duration: 25.71 }, // Medium { tempo: 150, duration: 25.71 }, // Fast { tempo: 60, duration: 25.71 }, // Back to slow { tempo: 150, duration: 25.71 }, // Fast again { tempo: 200, duration: 25.71 }, // Intense { tempo: 240, duration: 25.71 } // Extreme finish ] }, nextStep: 'next_step_id' } ``` **Components Created**: - Beat timeline visualization (scrolling beats) - Current BPM display - Tempo label - Video player (optional) - Volume controls - Dev skip button - Sidebar countdown timer --- ### Add Library Directory Task **Purpose**: Add media directory to library ```javascript { type: 'action', mood: 'practical', story: 'Add content to your library.', interactiveType: 'add-library-directory', params: { suggestedTags: ['amateur', 'solo'], showTimer: true }, nextStep: 'next_step_id' } ``` **Components Created**: - Select directory button - Suggested tags display - Result status area - Automatic completion on success --- ### Tag Files Task **Purpose**: Tag files in the library ```javascript { type: 'action', mood: 'practical', story: 'Tag files in your library.', interactiveType: 'tag-files', params: { minFiles: 10, suggestedTags: ['pov', 'blowjob', 'riding', 'amateur'], showTimer: true, preserveContent: true // Keep existing content visible }, nextStep: 'next_step_id' } ``` **Components Created**: - Open library button - Tag progress tracker - Suggested tags display - Auto-completion when target reached --- ### Video Start Task **Purpose**: Start video playback ```javascript { type: 'action', mood: 'intense', story: 'Watch the video.', interactiveType: 'video-start', params: { player: 'focus', // Video player mode tags: ['amateur'], // Filter tags duration: 120, // Duration in seconds showTimer: true // Show countdown timer in sidebar }, nextStep: 'next_step_id' } ``` **Components Created**: - Video player container - Start video button - Dev skip button - Sidebar countdown timer - Auto-completion when duration complete --- ## Standard UI Components ### 1. Sidebar Countdown Timer **Always Preserve Game Stats Panel** ```javascript // ✅ CORRECT - Use specific timer elements const countdownEl = document.getElementById('sidebar-countdown-display'); const countdownWrapper = document.getElementById('sidebar-countdown-timer'); // Show timer if (countdownWrapper) { countdownWrapper.style.display = 'block'; } // Update timer if (countdownEl) { const minutes = Math.floor(timeRemaining / 60); const seconds = timeRemaining % 60; countdownEl.textContent = `${minutes}:${seconds.toString().padStart(2, '0')}`; } // Hide timer if (countdownWrapper) { countdownWrapper.style.display = 'none'; } // ❌ WRONG - Never use sidebar.innerHTML // This destroys the game stats panel! sidebar.innerHTML = '