Skip to content

Complete AI Asset Generation Pipeline Integration & Documentation #1393

Description

@pethers

🎯 Objective

Create comprehensive documentation and integration pipeline for all AI asset generation tools, ensuring consistent workflow, quality standards, and efficient batch processing across the 7 generator scripts.

📋 Background

Black Trigram has 7 AI generation scripts but lacks unified documentation, batch processing tools, and quality validation. A complete pipeline will ensure assets are generated consistently, validated for quality, and integrated seamlessly.

📊 Current State

  • Generator Scripts: 7 tools (SFX, music, images, videos, sprites)
  • Documentation: Individual script comments only
  • Batch Processing: Manual, no orchestration
  • Quality Validation: None - manual review required
  • Integration Guide: Missing - developers must reverse-engineer usage

Pipeline Components Needed:

  1. Master Documentation (docs/AI_ASSET_GENERATION.md)

    • Complete guide for all 7 generators
    • Korean cultural context guidelines
    • Prompt engineering best practices
    • Quality standards and validation
  2. Batch Orchestrator (scripts/orchestrate_asset_generation.ts)

    • Run all generation tasks from single command
    • Parallel execution with progress tracking
    • Error handling and retry logic
    • Cost estimation before running
  3. Quality Validator (scripts/validate_generated_assets.ts)

    • Check file formats and sizes
    • Validate Korean cultural accuracy (automated checks)
    • Performance impact assessment
    • Generate validation reports
  4. Asset Registry (scripts/register_generated_assets.ts)

    • Auto-register new assets in codebase
    • Update TypeScript types and constants
    • Generate asset manifests
    • Create integration templates

✅ Acceptance Criteria

  • Complete AI generation documentation (docs/AI_ASSET_GENERATION.md)
  • Batch orchestration tool with parallel execution
  • Automated quality validation for all asset types
  • Asset registration automation
  • CI/CD integration guide for automated generation
  • Cost estimation tool (OpenAI/Bedrock/ElevenLabs API costs)
  • Korean cultural accuracy guidelines documented
  • Example workflows for common scenarios
  • Troubleshooting guide for common issues
  • All tools tested with real asset generation

🛠️ Implementation Guidance

Phase 1: Master Documentation

File to Create: docs/AI_ASSET_GENERATION.md

Content Structure:

# AI Asset Generation Pipeline

## Overview
Complete guide to generating game assets using AI tools.

## Available Generators
1. **SFX Generation** - `scripts/generate_sfx.ts`
2. **Music Generation** - `scripts/generate_music_suno.ts`
3. **Image Generation (OpenAI)** - `scripts/generate_image_openai.ts`
4. **Image Generation (Bedrock)** - `scripts/generate_image_bedrock.ts`
5. **Sprite Generation** - `scripts/generate_archetype_sprites.ts`
6. **Video Generation (OpenAI)** - `scripts/generate_video_openai.ts`
7. **Video Generation (Bedrock)** - `scripts/generate_video_bedrock.ts`

## Korean Cultural Context Guidelines
- Traditional Korean elements (팔괘, 오방색, 단청)
- Cyberpunk Korean fusion aesthetic
- Respectful martial arts representation
- Korean language integration (한글)

## Batch Workflows
### Generate All Trigram Visual Effects
\`\`\`bash
npm run generate:trigrams
\`\`\`

### Generate All Archetype Music
\`\`\`bash
npm run generate:archetype-music
\`\`\`

## Quality Standards
- Visual assets: PNG with alpha, optimized size
- Audio assets: WebM/MP3, -14 LUFS normalized
- Video assets: WebM/MP4, <10MB per clip
- Korean accuracy: Validated by cultural consultant

Phase 2: Batch Orchestrator

File to Create: scripts/orchestrate_asset_generation.ts

// Orchestrate all asset generation tasks
import { spawn } from 'child_process';

interface GenerationTask {
  script: string;
  args: string[];
  parallel: boolean;
  estimatedCost: number;
  estimatedTime: number; // minutes
}

const GENERATION_WORKFLOWS = {
  'full-asset-refresh': [
    { script: 'generate_trigram_effects.ts', parallel: true, cost: 2.40, time: 15 },
    { script: 'generate_vital_point_sfx.ts', parallel: true, cost: 8.50, time: 30 },
    { script: 'generate_archetype_battle_music.ts', parallel: true, cost: 15.00, time: 45 },
    // ... all generation tasks
  ]
};

// Run workflow with progress tracking
async function runWorkflow(name: string) {
  const tasks = GENERATION_WORKFLOWS[name];
  console.log(`\n🚀 Starting workflow: ${name}`);
  console.log(`📊 Estimated cost: $${tasks.reduce((sum, t) => sum + t.cost, 0).toFixed(2)}`);
  console.log(`⏱️ Estimated time: ${tasks.reduce((sum, t) => sum + t.time, 0)} minutes`);
  
  const confirm = await promptUser('Continue? (y/n): ');
  if (confirm !== 'y') return;
  
  // Execute tasks with parallel execution support
  for (const task of tasks) {
    if (task.parallel) {
      // Launch parallel workers
    } else {
      // Run sequentially
    }
  }
}

Phase 3: Quality Validator

File to Create: scripts/validate_generated_assets.ts

// Validate all generated assets for quality and standards
interface ValidationResult {
  valid: boolean;
  errors: string[];
  warnings: string[];
  metrics: {
    fileSize: number;
    dimensions?: { width: number; height: number };
    duration?: number;
    format: string;
  };
}

async function validateAssets(directory: string): Promise<ValidationResult[]> {
  // Check file formats, sizes, Korean accuracy, performance impact
}

Phase 4: Asset Registry

File to Create: scripts/register_generated_assets.ts

// Auto-register generated assets in codebase
async function registerAssets(assetType: string, files: string[]) {
  // 1. Update TypeScript constants
  // 2. Generate asset manifest
  // 3. Update AudioAssetRegistry/texture loaders
  // 4. Create integration templates
}

Phase 5: npm Scripts Integration

Add to package.json:

{
  "scripts": {
    "generate:all": "tsx scripts/orchestrate_asset_generation.ts full-asset-refresh",
    "generate:trigrams": "tsx scripts/orchestrate_asset_generation.ts trigram-effects",
    "generate:music": "tsx scripts/orchestrate_asset_generation.ts archetype-music",
    "generate:environments": "tsx scripts/orchestrate_asset_generation.ts environment-backgrounds",
    "validate:assets": "tsx scripts/validate_generated_assets.ts",
    "register:assets": "tsx scripts/register_generated_assets.ts"
  }
}

🎮 Testing Scenarios

  1. Full Pipeline: Run complete asset generation, validation, and registration
  2. Parallel Execution: Verify 5+ tasks run simultaneously without conflicts
  3. Cost Estimation: Validate API cost calculations match actual usage
  4. Quality Validation: Catch format errors, size issues, cultural inaccuracies
  5. CI Integration: Test automated generation in GitHub Actions

🔗 Related Resources

  • Existing Generators: scripts/generate_*.ts (7 scripts)
  • Audio System: src/audio/ (integration points)
  • Asset Loading: src/utils/archetypeAssets.ts
  • Korean Constants: src/types/constants/index.ts

📊 Metadata

Priority: High | Effort: M (6-8h) | Domain: tooling, documentation, ci-cd

Labels: type:documentation, type:tooling, domain:ci-cd, priority:high, size:medium, ai-generation, pipeline

🔗 Dependencies

Should be completed after: Issues #1386-#1392 (uses insights from individual asset generation)
Blocks: None (improves workflow for future asset generation)


흑괘의 길을 걸어라 - Walk the Path of the Black Trigram

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions