import type { SystemInfoConfig } from './types' export const gameConfig: SystemInfoConfig = { title: 'Game System-Info', description: 'Unity WebGL Spiel-Integration fuer Gamification.', version: '1.0', architecture: { layers: [ { title: 'Game UI', components: ['Game Canvas', 'Loading Screen', 'Score Display'], color: '#3b82f6' }, { title: 'Unity Runtime', components: ['WebGL Player', 'Asset Bundles', 'Physics'], color: '#000000' }, { title: 'Backend Bridge', components: ['Score API', 'Progress Sync', 'Leaderboard'], color: '#10b981' }, { title: 'Storage', components: ['Player Data', 'Achievements', 'Analytics'], color: '#f59e0b' }, ], }, features: [ { name: 'WebGL Rendering', status: 'active', description: 'Browser-basiertes Spiel' }, { name: 'Progress Tracking', status: 'active', description: 'Fortschrittsspeicherung' }, { name: 'Leaderboard', status: 'planned', description: 'Bestenlisten' }, { name: 'Achievements', status: 'planned', description: 'Erfolge und Badges' }, ], roadmap: [ { phase: 'Phase 1: Core (Q1)', priority: 'high', items: ['WebGL Optimization', 'Mobile Support', 'Save System', 'Auth Integration'] }, { phase: 'Phase 2: Social (Q2)', priority: 'medium', items: ['Multiplayer', 'Chat', 'Friend System', 'Challenges'] }, { phase: 'Phase 3: Gamification (Q3)', priority: 'low', items: ['Achievement System', 'Rewards', 'Seasons', 'Events'] }, ], technicalDetails: [ { component: 'Engine', technology: 'Unity', version: '2022 LTS', description: 'Game Engine' }, { component: 'Platform', technology: 'WebGL 2.0', description: 'Browser Runtime' }, { component: 'Compression', technology: 'Brotli', description: 'Asset Compression' }, { component: 'API', technology: 'REST/WebSocket', description: 'Backend Communication' }, ], auditInfo: [ { category: 'Game Status', items: [ { label: 'Build Version', value: 'Tracking', status: 'ok' }, { label: 'WebGL Kompatibilitaet', value: 'Getestet', status: 'ok' }, { label: 'Mobile Support', value: 'In Arbeit', status: 'warning' }, { label: 'Performance', value: 'Optimiert', status: 'ok' }, ], }, { category: 'Integration', items: [ { label: 'Auth Integration', value: 'Aktiv', status: 'ok' }, { label: 'Progress Sync', value: 'Aktiv', status: 'ok' }, { label: 'Leaderboard', value: 'Geplant', status: 'warning' }, { label: 'Achievements', value: 'Geplant', status: 'warning' }, ], }, { category: 'Assets', items: [ { label: 'Bundle Size', value: 'Optimiert', status: 'ok' }, { label: 'Kompression', value: 'Brotli', status: 'ok' }, { label: 'Lazy Loading', value: 'Aktiviert', status: 'ok' }, { label: 'CDN', value: 'CloudFlare', status: 'ok' }, ], }, ], fullDocumentation: `

Unity WebGL Game Integration

1. Uebersicht

Das Game-Modul integriert Unity-basierte Lernspiele als WebGL-Anwendungen in die Web-Plattform. Es ermoeglicht Gamification von Lerninhalten.

2. Architektur

┌─────────────────────────────────────────────────────────────────┐
│                      Web Application                             │
│  ┌────────────────────────────────────────────────────────────┐ │
│  │                    Game Container                           │ │
│  │  ┌───────────────────────────────────────────────────────┐ │ │
│  │  │              Unity WebGL Canvas                        │ │ │
│  │  │                                                        │ │ │
│  │  │    ┌─────────────┐    ┌─────────────┐                 │ │ │
│  │  │    │   Scene     │    │   UI        │                 │ │ │
│  │  │    │   Objects   │    │   Layer     │                 │ │ │
│  │  │    └─────────────┘    └─────────────┘                 │ │ │
│  │  │                                                        │ │ │
│  │  └───────────────────────────────────────────────────────┘ │ │
│  └────────────────────────────────────────────────────────────┘ │
│                              │                                   │
│                              v                                   │
│  ┌────────────────────────────────────────────────────────────┐ │
│  │                    Unity Bridge (jslib)                     │ │
│  └────────────────────────────────────────────────────────────┘ │
└────────────────────────────┬────────────────────────────────────┘
                             │
                             v
┌─────────────────────────────────────────────────────────────────┐
│                      Backend API                                 │
│  ├── /api/game/auth        (JWT Validation)                    │
│  ├── /api/game/progress    (Save/Load)                         │
│  ├── /api/game/leaderboard (Rankings)                          │
│  └── /api/game/events      (Analytics)                         │
└─────────────────────────────────────────────────────────────────┘

3. Unity Build Settings

EinstellungWertGrund
CompressionBrotliBeste Kompression
Code StrippingMediumBundle-Groesse
WebGL Memory256 MBStabil
Exception HandlingExplicitly ThrownPerformance
Graphics APIWebGL 2.0Features

4. API Endpoints

EndpointMethodeBeschreibung
/api/game/sessionPOSTSession starten
/api/game/progressGETSpielstand laden
/api/game/progressPOSTSpielstand speichern
/api/game/leaderboardGETBestenliste
/api/game/eventsPOSTAnalytics-Events

5. Bridge Communication

JavaScript → Unity:
├── SendMessage(objectName, methodName, value)
├── JSON Serialization fuer komplexe Daten
└── Event Queue fuer Batch-Operationen

Unity → JavaScript:
├── jslib Plugin: [DllImport("__Internal")]
├── Callback Pattern
└── JSON Response

6. Save System

{
  "player_id": "user-uuid",
  "game_id": "math-adventure",
  "progress": {
    "level": 5,
    "score": 1250,
    "stars": [3, 3, 2, 2, 1],
    "unlocked": ["item-1", "item-2"],
    "last_checkpoint": "level5-mid"
  },
  "settings": {
    "sound": true,
    "music_volume": 0.7,
    "difficulty": "normal"
  },
  "updated_at": "2025-01-14T12:00:00Z"
}

7. Performance-Optimierung

8. Loading Flow

Seite geladen
     │
     v
┌───────────────────────────────────────┐
│  1. Container initialisieren          │
│     - Canvas vorbereiten              │
│     - Loading UI anzeigen             │
└─────────────────┬─────────────────────┘
                  │
                  v
┌───────────────────────────────────────┐
│  2. Unity Loader                      │
│     - .data (Assets)                  │
│     - .wasm (Code)                    │
│     - .js (Framework)                 │
└─────────────────┬─────────────────────┘
                  │
                  v
┌───────────────────────────────────────┐
│  3. Initialisierung                   │
│     - User Auth pruefen               │
│     - Progress laden                  │
│     - Scene starten                   │
└─────────────────┬─────────────────────┘
                  │
                  v
┌───────────────────────────────────────┐
│  4. Game Ready                        │
│     - Loading UI ausblenden           │
│     - Input aktivieren                │
└───────────────────────────────────────┘

9. Analytics Events

EventDatenVerwendung
game_startsession_idSession Tracking
level_completelevel, score, timeProgression
achievementachievement_idEngagement
errorerror_type, detailsDebugging
game_endsession_durationRetention

10. Browser-Kompatibilitaet

BrowserDesktopMobile
Chrome
Firefox
Safari⚠ (iOS Limits)
Edge
`, }