《Guardian Tales》Affinity System Design Document (English Version)**
---
#### **1. Design Overview**
Under 2D constraints (static interface, no character movement, low AI reliance), the system achieves deep emotional interaction through three core modules:
1. **Storyboard Emotion Theater**: Transform 2D interface into dynamic narrative stages
2. **Choice Weight System**: Player decisions globally impact relationship networks
3. **Dynamic Interface Rebuild**: Enhance immersion through visual layering & behavioral feedback
---
#### **2. Core Module Design**
##### **2.1 Storyboard Emotion Theater**
```mermaid
graph TD
A[Main Interface] --> B[Intimacy Zone]
A --> C[Neutral Zone]
A --> D[Conflict Zone]
B -->|Hug| E[Char A+B]
C -->|Chat| F[Char C+D]
D -->|Confront| G[Char E vs F]
```
**Implementation**:
- **Zone Rules**:
- Left zone: Affinity ≥70 pairs only
- Center zone: Daily chat events
- Right zone: Auto-generated rival confrontations
- **Cinematic Logic**:
- Key events in comic panels (max 4 splitscreens)
- 15° dialog tilt for spatial depth
- Convert battle VFX to emotion particles
##### **2.2 Choice Weight System**
**Decision Logic Example**:
```python
# Pseudo-code: Emotion Impact
def emotion_impact(choice_type):
weight_table = {
'rational': {'trust':+10, 'romance':-5},
'emotional': {'intimacy':+15, 'logic':-8},
'rebellious': {'conflict':+20, 'surprise':+30}
}
return weight_table.get(choice_type, {})
# Implementation
player_choice = detect_gesture(swipe_dir)
update_relationship(emotion_impact(player_choice))
```
**Feedback Design**:
| Choice Type | Visual FX | Sound Design | Haptic Feedback |
|-------------|-------------------|------------------|-----------------|
| Rational | Gear data flow | Machinery hum | Short vibration |
| Emotional | Heart particles | Piano chord | Long x2 |
| Rebellious | Interface cracks | Glass shatter | Strong x3 |
##### **2.3 Dynamic Interface Rebuild**
**Layer Implementation**:
| Layer | Elements | Dynamic Rules |
|-------|---------------------|----------------------------|
| BG | Background | Time filter (dawn/dusk/night)|
| Mid | Character sprites | Breathing (0.5-2px amplitude)|
| Top | UI controls | Opacity gradient (30-100%) |
**Low-Cost Animation**:
- Frame reuse technology:
- Convert battle idle animations to micro-gestures
- 12-frame base expressions library (100+ variants via layering)
---
#### **3. Technical Implementation**
##### **3.1 State Machine Logic**
```mermaid
stateDiagram-v2
[*] --> Idle
Idle --> MorningEvent: 06:00-08:00
Idle --> NightEvent: 20:00-22:00
MorningEvent --> Training: 70% chance
MorningEvent --> Breakfast: 30% chance
NightEvent --> SecretTalk: Affinity≥50
NightEvent --> Solitude: Affinity<50
```
##### **3.2 Player Data Tracking**
**Memory Corridor System**:
- Replayable event timeline
- Spend "Memory Crystals" to revisit scenes
- Unlock hidden stories via achievements
**Legacy Mechanism**:
- Retired characters transfer partial affinity to new ones
- Historical choices affect new characters' initial dialogs
---
#### **4. Player Experience Optimization**
##### **4.1 Multi-Modal Feedback**
- **Visual**:
- Border color temperature shifts
- Environment object state sync
- **Auditory**:
- Custom breathing SFX per character
- Dynamic ambient sound mixing
- **Haptic**:
- Encoded vibration patterns
##### **4.2 Low-Cost Content Expansion**