storyline-conversion-log
# Storyline Conversion Log
Pilot
- Selected pilot:
story_m01_n06fromtools/剧情编辑器/src/data/storylineBridge.ts. - Target table:
src/data/eventTables/storyline-guo-lu-pilot.ts. - Reason: this郭芙蓉 node already matches the game-side
GameEventshape closely: day-time affinity, directguo_lu_romancebond 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.mdis not present at the requested path; the existing file isdocs/specs/workflow/pm-agent-lean-efficiency.md. - Confirmed game aggregation path:
src/data/eventTables/index.tsimports table arrays, wraps them withdefineTable, then exportsGAME_EVENTSthroughmergeRandomEventMeta. - Chose one郭芙蓉 pilot instead of expanding multiple storyline nodes.
- Added
src/data/eventTables/storyline-guo-lu-pilot.tsas 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_EVENTSpool.
Year Compiler
- Added a minimal year-task compiler around the editor export bridge path.
- Rule: normalize exported story nodes onto
opening -> growth -> pressure -> closingbygameTime.day. - Rule: the first chapter carrying
endgameChainEffectbecomes the terminal cut; if none exists, the line falls back to year-end. - Added a derived
STORYLINE_YEAR_TASK_PLANexport from the pilot story tables only; no new gameplay rules or save schema changes.
Incomplete / Blocked
- Full generic converter from editor
Questto gameGameEventis 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-*intogameTime-anchored year tasks. - Rule:
dayWindow.startDaybecomes the chapter anchor day, the first validtimeAffinitybecomes the anchor slot, andyearPhasecan still be filtered per year line. - Terminal rule: any event with
endgameChainEffect.failureIdtruncates the year line at that chapter and records the terminalendgameId. - Fallback rule: when no terminal appears, the compiler appends a year-end close task with
fallbackToYearEnd = trueso 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.tsand delete the new table import/registration fromsrc/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.