# 143 — Fake Window Actor (`BP_FakeWindow`)

## Purpose
Architectural fake window using planar capture to simulate an outdoor view or adjacent room. Supports parallax depth, sky environment reference, weather overlay, and sublevel visibility.

## Dependencies
- **Requires:** `BP_PlanarCaptureActor` (137), `BPC_PlanarCapture` (136)
- **Engine/Plugin Requirements:** Level Streaming (for sublevel reference)

## Class Info
| Property | Value |
|----------|-------|
| **Parent Class** | `BP_PlanarCaptureActor` (C++ `ABP_PlanarCaptureActor`) |
| **Class Type** | Blueprint Actor |
| **Asset Path** | `Content/Framework/Capture/BP_FakeWindow.uasset` |
| **C++ Status** | 🔵 BP Spec Only |
| **BP Asset** | Create in editor: `BP_FakeWindow` |

## 1. Configuration

| Variable | Value | Description |
|----------|-------|-------------|
| `CaptureComponent.CaptureMode` | `FakeWindow` | Fixed to FakeWindow mode |
| `CaptureComponent.CaptureFOV` | `100.0` | Wider FOV for window view |

### FakeWindow-Specific Properties (Add to BP)
| Variable | Type | Default | Description |
|----------|------|---------|-------------|
| `LinkedRoomSublevel` | TSoftObjectPtr〈UWorld〉 | — | Sublevel containing the room to render |
| `SkyReference` | AActor* | — | Sky/directional light to include in capture |
| `ParallaxDepthScalar` | float | 1.0 | Depth exaggeration for parallax effect |
| `WeatherOverlayType` | EWeatherType | None | Rain/Frost overlay driven by game state |
| `bStreamSublevelOnProximity` | bool | true | Load/unload sublevel based on player distance |
| `StreamInDistance` | float | 3000.0 | Distance to load sublevel |

## 2. Material Setup
| Slot | Material | Description |
|------|----------|-------------|
| SurfaceMesh[0] | `MI_FakeWindow_Interior` | Window with parallax and weather overlay support |

## 3. Event Graph

### Event BeginPlay
```
Event BeginPlay
  ├─ Parent: BeginPlay
  ├─ Set CaptureComponent.CaptureMode = FakeWindow
  ├─ [If bStreamSublevelOnProximity] Start distance check timer
  └─ EnableSurface()
```

### Timer: CheckPlayerDistance
```
CheckPlayerDistance (every 2 seconds)
  ├─ Get Player Pawn location
  ├─ Distance = VectorDist(Player, GetActorLocation())
  ├─ If Distance < StreamInDistance AND sublevel not loaded
  │    └─ Load Stream Level (LinkedRoomSublevel)
  └─ If Distance > StreamInDistance + 1000 AND sublevel loaded
       └─ Unload Stream Level (LinkedRoomSublevel)
```

### Event: SetWeatherOverlay(Weather: EWeatherType)
```
SetWeatherOverlay(Weather)
  ├─ Set WeatherOverlayType = Weather
  ├─ Switch on Weather:
  │    None:   SetSurfaceMPCParameter("RainIntensity", 0.0)
  │             SetSurfaceMPCParameter("FrostIntensity", 0.0)
  │    Rain:   SetSurfaceMPCParameter("RainIntensity", 1.0)
  │    Frost:  SetSurfaceMPCParameter("FrostIntensity", 1.0)
  └─ Trigger material update
```

## 4. Communication Matrix
| Target | Method | What |
|--------|--------|------|
| Level Streaming | `Load Stream Level` / `Unload Stream Level` | Sublevel management |
| `BPC_AtmosphereStateController` (94) | Dispatcher | React to environment state changes |
| `GS_CoreGameState` (6) | Direct (read) | Current chapter/phase for weather state |

## 5. Manual Implementation Guide

### 5.1 Create BP_FakeWindow
1. Create Blueprint Class: Parent = `BP_PlanarCaptureActor`, Name = `BP_FakeWindow`
2. Set `CaptureComponent.CaptureMode = FakeWindow`
3. Set `CaptureComponent.CaptureFOV = 100.0`
4. Assign `MI_FakeWindow_Interior` to SurfaceMesh

### 5.2 Setup the View Room
1. Create a separate sublevel with the room/exterior you want to show through the window
2. Add a `SceneCaptureCamera` actor in the sublevel positioned to capture the desired view
3. In BP_FakeWindow instance: assign `CaptureComponent.FixedCameraActor` → the camera in the sublevel
4. Assign `LinkedRoomSublevel` → the sublevel asset

### 5.3 Performance Considerations
- Fake windows should run at Low or Medium tier by default
- Sublevel streaming avoids rendering room geometry when player is far away
- Consider using a static cubemap fallback at Low quality instead of live capture

## 6. Build Checklist
- [ ] Create BP_FakeWindow Blueprint child
- [ ] Create sublevel with view room
- [ ] Place SceneCaptureCamera in sublevel
- [ ] Configure LinkedRoomSublevel and FixedCameraActor
- [ ] Create stream distance timer
- [ ] Set quality profiles for Low default tier
- [ ] Test sublevel streams in/out based on distance
- [ ] Test weather overlay switching
