2.1 KiB
2.1 KiB
RPG 运行时直读世界草稿 Profile 检查 2026-04-25
结论
RPG 运行时进入游戏时不应再通过 resultPreview.preview 或 legacy runtime profile 做中间转换,主数据源统一为 Agent session 的 draftProfile。
本次检查确认:
- Rust 侧
custom_world_foundation_draft已直接产出draftProfile。 - 前端原先
buildCustomWorldProfileFromAgentSession()仍只读取session.resultPreview.preview,这会绕过草稿 profile 中已经存在的角色形象、关系、压力等字段。 - 角色选择页与游戏内角色本身可以消费
CustomWorldProfile.playableNpcs[].imageSrc,断点在“session -> profile”的入口,而不是角色选择页。 - “进入世界”按钮原先还会先执行
sync_result_profile,把当前结果页旧快照再同步回 session;如果结果页 profile 没有最新角色图,会在进入角色选择页前覆盖掉draftProfile中的正确形象。
已修正
buildCustomWorldProfileFromAgentSession()改为直接归一化session.draftProfile。resultPreview只保留为发布质量、blocker、预览外壳信息,不再作为进入游戏 profile 的数据源。- Agent 草稿结果进入游戏时直接使用最新
agentSessionProfile,不再把当前结果页 profile 回写成新的运行时 profile。 - 前端
normalizeCustomWorldProfileRecord()补齐 rs 草稿角色字段兼容:publicMask/publicIdentity->description/visualDescription/personalityfallbackcurrentPressure/hiddenHook->backstory/actionDescription/sceneVisualDescriptionfallbackrelationToPlayer->motivation/relationshipHooksfallbackimageSrc/generatedVisualAssetId/generatedAnimationSetId/animationMap保持直通
后续约束
- 新 RPG 运行时链路只允许读取
draftProfile。 - 不再为进入游戏构造额外 legacy profile,也不再把
resultPreview.preview当作运行时真相源。 - 如果草稿中新增角色、场景、物品字段,应优先扩展
draftProfile的归一化读取,而不是增加中间转换结构。