> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/emotion-profile.md).

# 情绪配置文件

`ConvaiEmotionProfile` 是 Emotion 系统的核心配置资源。它控制表情进入和退出的速度、是否在每次新情绪出现时插入微表情爆发、在长时间对话中如何通过中性轮替防止脸部僵住，以及哪些输出绑定会将分数传递到角色的网格或 Animator。每个参数的默认值都适合对话型 NPC 表情——请先使用随附的示例，再从那里开始调整。

### 创建配置文件资源

在 Project 窗口中，右键单击你的 `Assets/` 文件夹并选择：

**Create → Convai → Embodiment → Emotion Profile**

一个名为 `ConvaiEmotionProfile` 的资源会出现。将其重命名为具有描述性的名称（例如， `NPC_Guard_EmotionProfile`）并将其分配给角色的 **Profile** 字段，位于角色的 `ConvaiEmotionController` 组件。

{% hint style="info" %}
如果想在不创建资源的情况下开始，只需分配随附的 `ConvaiSamplesShared_EmotionProfile` 来自 `Packages / Convai SDK for Unity / SamplesShared / Resources / Embodiment / Modules / Emotion`。如果你想修改任何值，请先复制它——包内的资源是只读的。
{% endhint %}

### 分类参考

| 字段    | 默认值                | 说明                                                                                |
| ----- | ------------------ | --------------------------------------------------------------------------------- |
| `分类法` | *（无——内置 Plutchik）* | 可选 `EmotionTaxonomyAsset` 用于定义可识别哪些情绪标签，以及服务器标签如何解析为规范名称。留空即可使用内置的九情绪 Plutchik 集。 |

该分类法还提供按情绪划分的口型影响提示，供 LipSync 混合层使用。请参见 [情绪分类法](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/emotion-taxonomy.md) 以获取内置集合的完整详情以及如何创建自定义集合。

### 平滑参数

来自服务器的情绪分数不会立即应用。累加器会在每一帧应用指数平滑，使表情自然过渡，而不是在数值之间突变。

| 字段                | 范围           | 默认值   | 说明                                                   |
| ----------------- | ------------ | ----- | ---------------------------------------------------- |
| `lerpSpeed`       | 0.1 – 20     | **5** | 分数向目标值上升的速度。数值越高，感觉越利落；数值越低，则越缓慢。                    |
| `decaySpeed`      | 0.1 – 20     | **2** | 一旦目标被移除，分数回落到零的速度。默认情况下，衰减刻意比上升更慢，让情绪自然停留更久。         |
| `intensityOffset` | -0.25 – 0.25 | **0** | 在进入累加器之前，添加到每个归一化强度值上的固定偏置。正值会让所有情绪看起来更强烈；负值会让它们更克制。 |

**指数平滑的工作方式：** 每一帧，当前分数都会朝目标值前进剩余距离的一部分。在 `lerpSpeed = 5`时，分数大约会在一秒内覆盖该距离的 99%。将速度加倍会把达到完整表情所需的时间减半。当目标降为零时，衰减也使用相同机制。

### 微表情爆发

当新的情绪到来时，累加器可以先应用一次短暂的过冲——在稳定水平之上短促跃升——然后再稳定下来。这样能让表情以更有冲击力、也更自然的方式进入画面，比简单的线性上升更适合屏幕呈现。

| 字段                    | 范围           | 默认值        | 说明                                                     |
| --------------------- | ------------ | ---------- | ------------------------------------------------------ |
| `microBurstEnabled`   | —            | **true**   | 完全启用或禁用爆发效果。                                           |
| `microBurstDuration`  | 0.05 – 1.5 s | **0.25 s** | 在分数衰减到持续值之前，过冲包络持续多长时间。                                |
| `microBurstOvershoot` | 1.0 – 3.0×   | **1.4×**   | 在爆发顶点应用于分数的峰值倍率。1.4 表示表情会短暂达到其持续水平之上的 40%。             |
| `microBurstThreshold` | 0 – 1        | **0.15**   | 触发爆发所需的最小分数变化量。低于此阈值的小幅波动会被平滑处理而不触发爆发，从而防止细微情绪变化时出现抖动。 |

{% hint style="info" %}
对于平静、专业的模拟，请将 `microBurstOvershoot` 其降低到 1.1–1.2，或完全禁用爆发效果。对于高能量或戏剧化角色，最高可用到 1.8。
{% endhint %}

### 中性轮替

持续接收情绪信号的角色——例如在长篇讲解中始终保持“好奇”——最终可能会出现僵住的表情，从而破坏沉浸感。中性轮替通过定期将当前表情淡出至中性，然后再恢复，来解决这个问题；即使底层情绪保持不变，也能产生细微、逼真的变化。

| 字段                          | 范围         | 默认值       | 说明                                              |
| --------------------------- | ---------- | --------- | ----------------------------------------------- |
| `neutralAlternationEnabled` | —          | **true**  | 启用或禁用轮替系统。                                      |
| `alternationMinInterval`    | 0.5 – 30 s | **3 s**   | 在开始一次中性回落之前，当前表情至少保持的时间。                        |
| `alternationMaxInterval`    | 0.5 – 30 s | **7 s**   | 最大保持时间。每个周期的实际间隔会在最小值和最大值之间随机选取。                |
| `alternationBlendDuration`  | 0.05 – 5 s | **1 s**   | 过渡到中性（以及返回）所需的时间。较短的数值会形成清晰、明确的重置；较长的数值则几乎察觉不到。 |
| `alternateOnlyWhileTalking` | —          | **false** | 启用后，轮替只会在角色主动说话时发生。如果你希望轮到之间的停顿能更稳定地保持表情，这会很有用。 |

{% hint style="warning" %}
设置 `alternationMinInterval` 是位于 `alternationMaxInterval` 为相同的低值（例如都设为 1 秒）会让脸部看起来像在闪烁，而不是自然轮替。请让这两个值至少相差 2–3 秒，并且对大多数角色来说，将最小值保持在 2 秒以上。
{% endhint %}

### 输出绑定

该配置文件的 **Blendshape 绑定** 是位于 **Animator 绑定** 部分定义哪些网格 blendshape 和 Animator 浮点参数会在每一帧接收平滑后的情绪分数。这些会被配置为以下列表： `EmotionSlotBinding` 条目——每个输出通道中每种情绪各占一个槽位。

完整字段定义、针对不同骨骼/绑定的指导，以及预构建的 `RealisticEmotionSlots` 工厂均已涵盖于 [情绪输出绑定](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/output-bindings.md).

### 下一步

{% content-ref url="/pages/931fe5969b6c7b83aac82771a8aedc0f94f896d1" %}
[情绪输出绑定](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/output-bindings.md)
{% endcontent-ref %}

{% content-ref url="/pages/830c8a41ce176512408273566b88a4c868c56a59" %}
[情绪分类法](/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/emotion-taxonomy.md)
{% endcontent-ref %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.convai.com/api-docs/zh/cha-jian-yu-ji-cheng/convai-unity-sdk/features/emotion/emotion-profile.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
