№ · HANDOFF 杂项 CH.06.27
主页 · 🤝 Handoff 杂项 · storyline-conversion-log

storyline-conversion-log

📅 2026-06-27 · 📦 4.8 KB · 🤝 Handoff 杂项 · 📝 MD 文档 🏷️ 计划🏷️ 时间🏷️ 装备🏷️ 剧情

# Storyline Conversion Log

Pilot

  • Selected pilot: story_m01_n06 from tools/剧情编辑器/src/data/storylineBridge.ts.
  • Target table: src/data/eventTables/storyline-guo-lu-pilot.ts.
  • Reason: this郭芙蓉 node already matches the game-side GameEvent shape closely: day-time affinity, direct guo_lu_romance bond growth, clear economic and reputation effects, and a concrete item drop. It can be bridged as one static event table without changing runtime selection or adding a parallel story model.

Mapping Plan

Editor Quest to game GameEvent mapping for the pilot:

| Editor Quest field | GameEvent field | Rule | | --- | --- | --- | | id | id | Preserve source id with a storyline_ prefix to avoid collision with hand-authored event ids. | | title | title | Copy from the selected Quest. | | eventSeries / tags | eventSeries, resultScope, description | Use the game-side series 同福羁绊; summarize tags into resultScope. | | timeAffinity | timeAffinity | Map directly when values are valid game TimeOfDay values. | | day | dayWindow | Use a tight window around the Quest day so the pilot remains testable and does not flood the random pool. | | yearPhase | yearPhase | year1 maps to opening_year_focus; year2 would map to second_year_rise. | | desc | description | Copy as short event summary. | | scene | sceneDescription | Copy as the popup scene body. | | options[].effects.* | options[].*Effect | Map coins/reputation/cleanliness/safety one-to-one. | | options[].bondEffect | options[].bondEffects[0] | Rename id to bondId, delta to valueDelta; preserve stage and note. | | options[].drops[] | options[].eventDrops[] | Create stable dropId; map name/category/qty/hint to name/category/quantity/usageHint and add flavor text. | | options[].dialogue | options[].dialogue | Copy as-is. |

Completed Steps

  • Read required handoff files and data files.
  • Confirmed docs/pm-agent-lean-efficiency.md is not present at the requested path; the existing file is docs/specs/workflow/pm-agent-lean-efficiency.md.
  • Confirmed game aggregation path: src/data/eventTables/index.ts imports table arrays, wraps them with defineTable, then exports GAME_EVENTS through mergeRandomEventMeta.
  • Chose one郭芙蓉 pilot instead of expanding multiple storyline nodes.
  • Added src/data/eventTables/storyline-guo-lu-pilot.ts as a minimal static bridge table.
  • Registered the pilot table in src/data/eventTables/index.ts.
  • Kept runtime selection unchanged; the new pilot only enters the existing aggregated GAME_EVENTS pool.

Year Compiler

  • Added a minimal year-task compiler around the editor export bridge path.
  • Rule: normalize exported story nodes onto opening -> growth -> pressure -> closing by gameTime.day.
  • Rule: the first chapter carrying endgameChainEffect becomes the terminal cut; if none exists, the line falls back to year-end.
  • Added a derived STORYLINE_YEAR_TASK_PLAN export from the pilot story tables only; no new gameplay rules or save schema changes.

Incomplete / Blocked

  • Full generic converter from editor Quest to game GameEvent is intentionally not implemented in this pass.
  • Source text is partly mojibake in the existing files; this pilot preserves existing text rather than normalizing copy across the project.

Yearline Compiler

  • Added a game-side helper that compiles the storyline slice from src/data/eventTables/storyline-* into gameTime-anchored year tasks.
  • Rule: dayWindow.startDay becomes the chapter anchor day, the first valid timeAffinity becomes the anchor slot, and yearPhase can still be filtered per year line.
  • Terminal rule: any event with endgameChainEffect.failureId truncates the year line at that chapter and records the terminal endgameId.
  • Fallback rule: when no terminal appears, the compiler appends a year-end close task with fallbackToYearEnd = true so the line still seals at year end.
  • This stays a scheduler only. It does not add a new story source, a parallel event pool, or a new gameplay branch.

Next Action

  • If the pilot is approved, repeat the same static bridge pattern for the next single storyline node or table slice.
  • If a generic bridge is needed later, build it as an offline transformation step first, not as a new runtime model.

Validation

  • cmd /c npm run build
  • Build warning only: existing chunk-size warning and unresolved runtime UI asset references, unrelated to this pilot.

Risk / Rollback

  • Rollback scope: remove src/data/eventTables/storyline-guo-lu-pilot.ts and delete the new table import/registration from src/data/eventTables/index.ts.
  • No runtime selection logic, save schema, or unrelated systems were changed.
  • The new table is additive only and isolated to the existing event table aggregation path.