给 CWS 做了一套剧本系统与 Mod 平台(v1.0 Showcase) #204
walthack
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
背景
CWS 的核心魅力在「无预设剧本、涌现式叙事」,规则系统 + AI 决策跑出来的故事不可预测,这点本身就足够好。所以 fork 的出发点不是替换沙盒。
而是想试一种互补的玩法——在沙盒之外加一层「预定义初始世界」的入口。比如想让玩家「进入南北朝乱世」「三国早期」「或者自己写的某段架空朝代」,AI 仍然涌现剧情,但起手的政治版图 / 宗门分布 / 关键人物已有约束。这种玩法对历史背景党、剧本创作者、想做特定主题模组的人都比较友好。
为什么做这个系统
纯沙盒下,每局都是「白纸 + 同一套规则」——非常适合反复探索规则,但不太适合:
所以做了两件耦合的事:
引擎层从一开始就按「通用」设计——
sanguo三国仙纪 存在的唯一目的就是证明引擎不是为liuchao特化的。架构概览
Scenario Engine:
scenario.json(含 initial_state / avatars / relations / events).zip,带安全校验(zip-bomb / path-traversal / symlink / bundled-collision)Mod 平台:
asset/llm-prompt/locale/predicate/effect后端结构:
Simulator.step()并发写 world)/api/v1/query|command/*命名空间ADR-005→ADR-023,在docs/adr/功能展示
(取自 fork
main分支,完整 10 张截图在docs/release-artifacts/v1.0/screenshots/)新建游戏 — Scenario 选择

Scenario 仓库 — Installed / Downloaded / Updates + Create + Import

Mod 管理 — Python hooks 默认关闭

Python hooks 信任 modal

验证情况(v1.0.0-final,2026-06-05)
--scenario=liuchao/--scenario=sanguo)完整报告:
docs/release-verification-report.md想请教的问题
这个 fork 一开始就是按「保持与上游方向兼容」的原则推进的,但要不要 / 怎么 upstream 一直是个问号。具体想请教维护者几个问题:
/api/v1命名空间、ADR 体系等,是否与你们正在推进的方向冲突?不论结论是「合入」「不合入」还是「先放着观察」,反馈对 fork 的下一步规划都有价值。如果合适也可以约个更细的同步(异步留言 / Discord / B 站均可)。
English summary
I built a generic Scenario Engine and Mod Platform on top of CWS (fork:
walthack/cultivation-world-simulator@v1.0.0-final). The motivation is to complement — not replace — CWS's pure-sandbox emergent storytelling, by letting players import pre-defined worlds (e.g. 六朝 Six Dynasties, 三国 Three Kingdoms) as the starting frame, while AI agents still drive the rest emergently. Two bundled scenarios (liuchao,sanguo) ship specifically to prove the engine isn't specialized for one period.The Mod Platform exposes five overlay types —
asset,llm-prompt,locale,predicate,effect— and includes a Python hooks safety gate that is disabled by default and requires both an Advanced Settings toggle and a trust-modal confirmation before any custom Python is allowed to execute. Backend uses a runtime / service / API layering with a single serialized mutation entry-point under/api/v1/query|command/*. 19 ADRs (ADR-005→ADR-023) record the key design decisions.Engineering state at v1.0.0-final: backend 1694 pytest passing, frontend 571 vitest passing, Playwright Layer 3 (Python gate) 6/6, Layer 4A (scenario engine end-to-end) 7/7, all green. Full verification report at
docs/release-verification-report.md; ADRs atdocs/adr/; 10-shot release pack atdocs/release-artifacts/v1.0/screenshots/.The question I'd like to put to the maintainers: does this "import a pre-defined world" direction fit CWS's long-term roadmap, or does it conflict with the pure-emergence philosophy and belong permanently in a third-party fork / mod layer? If it does fit, what's the most appropriate upstreaming path — per-PR series, an RFC-style discussion first, a small validation slice, or something else? Are there architectural preferences I should adapt to first?
Feedback either way — yes / no / let it sit — would be genuinely useful for planning the next step on the fork. Happy to follow up async or via Discord / Bilibili as you prefer.
All reactions