freshcrate
Skin:/
Home > Frameworks > cultivation-world-simulator

cultivation-world-simulator

基于 AI Agent 工作流的修仙世界模拟器,旨在还原智能、开放的仙侠世界。| An open-source Cultivation World Simulator using Agentic Workflow to create a dynamic, emerging Xianxia world.

Why this rank:Strong adoptionRecent releaseHealthy release cadence

Description

基于 AI Agent 工作流的修仙世界模拟器,旨在还原智能、开放的仙侠世界。| An open-source Cultivation World Simulator using Agentic Workflow to create a dynamic, emerging Xianxia world.

README

— ✦ —

修仙世界模拟器 (Cultivation World Simulator)

GitHub starsBilibili QQ Group Discord License

PythonFastAPIVueTypeScriptVitePixiJS 游戏演示

你将作为“天道”,观察一个由规则系统与 AI 共同驱动的修仙世界模拟器自行演化。 全员 LLM 驱动、群像涌现叙事、支持 Docker 一键部署,也适合源码开发与二次创作。

Featured|HelloGitHub 4thfever%2Fcultivation-world-simulator | Trendshift

📖 简介

这是一个 AI 驱动的修仙世界模拟器。 模拟器中,每一个修士都是独立的Agent,可以自由观测环境并做出决策。同时,为了避免AI的幻觉与过度发散,编入了复杂灵活的修仙世界观与运行规则。在规则与 AI 共同编织的世界中,修士Agent们与宗门意志相互博弈又合作,新的精彩剧情不断涌现。你可以静观沧海桑田,见证门派兴衰与天骄崛起,也可以降下天劫或魔改心灵,微妙地干预世界进程。

✨ 核心亮点

  • 👁️ 扮演“天道”:你不是修士,而是掌控世界规则的天道。观察众生百态,体味苦辣酸甜。
  • 🤖 全员 AI 驱动:每个 NPC 都独立基于LLM驱动,都有独立的性格、记忆、人际关系和行为逻辑。他们会根据即时局势做出决策,会有爱恨情仇,会结党营私,甚至会逆天改命。
  • 🌏 规则作为基石:世界基于灵根、境界、功法、性格、宗门、丹药、兵器、武道会、拍卖会、寿元等元素共同组成的严谨体系运行。AI 的想象力被限制在合理又足够丰富的修仙逻辑框架内,确保世界真实可信。
  • 🦋 涌现式剧情:开发者也不知道下一秒会发生什么。没有预设剧本,只有无数因果交织出的世界演变。宗门大战、正魔之争、天骄陨落,皆由世界逻辑自主推演。

宗门体系



城市区域



事件经历

角色面板



性格与装备



自主思考



江湖绰号

洞府探秘



角色信息



丹药/法宝/武器

🚀 快速开始

推荐方式

  • 想改代码或调试:使用源码部署,并准备 Python 3.10+、Node.js 18+ 和可用的模型服务。
  • 想直接体验:优先使用 Docker 一键部署。

首次启动说明

  • 无论使用源码还是 Docker,首次进入后都需要先在设置页配置可用的模型预设(如 DeepSeek / MiniMax / Ollama),再开始新游戏。
  • 开发模式下,前端页面通常会自动打开;如果没有自动打开,请访问启动日志中显示的前端地址。

方式一:源码部署(开发模式,推荐)

适合需要修改代码或调试的开发者。

  1. 安装依赖并启动

    # 1. 安装后端依赖
    pip install -r requirements.txt
    
    # 2. 安装前端依赖 (需 Node.js)
    cd web && npm install && cd ..
    
    # 3. 启动服务 (自动拉起前后端)
    python src/server/main.py --dev
  2. 配置模型 在前端设置页选择模型预设(如 DeepSeek / MiniMax / Ollama)后,即可开始新游戏。配置会自动保存到用户数据目录。

  3. 访问前端 开发模式会自动拉起前端开发服务器,请访问启动日志中显示的前端地址,通常为 http://localhost:5173

方式二:Docker 一键部署(未测试)

无需配置环境,直接运行即可:

git clone https://github.com/4thfever/cultivation-world-simulator.git
cd cultivation-world-simulator
docker-compose up -d --build

访问前端:http://localhost:8123

后端容器通过 CWS_DATA_DIR=/data 统一持久化用户数据,包含设置、密钥、存档和日志。默认已映射到宿主机 ./docker-data,即使执行 docker compose down 后重新 up,这些数据也会保留。

局域网/手机访问配置 (点击展开)

⚠️ 移动端 UI 暂未完全适配,仅供尝鲜。

  1. 后端配置:推荐通过环境变量启动后端,例如 PowerShell 中执行 $env:SERVER_HOST='0.0.0.0'; python src/server/main.py --dev。如需改默认值,可编辑只读配置 static/config.yml 中的 system.host
  2. 前端配置:修改 web/vite.config.ts,在 server 块中添加 host: '0.0.0.0'
  3. 访问方式:确保手机与电脑在同一 WiFi 下,访问 http://<电脑局域网IP>:5173
外接 API / Agent/Claw 接入 (点击展开)

这部分适合做外部 agent / Claw 接入、自动化脚本,或者实现“观察 -> 决策 -> 干预 -> 再观察”的闭环游玩。

推荐直接围绕稳定命名空间开发:

  • 只读查询:/api/v1/query/*
  • 受控写入:/api/v1/command/*

常见起点接口:

  • GET /api/v1/query/runtime/status
  • GET /api/v1/query/world/state
  • GET /api/v1/query/events
  • GET /api/v1/query/detail?type=avatar|region|sect&id=<target_id>
  • POST /api/v1/command/game/start
  • POST /api/v1/command/avatar/*
  • POST /api/v1/command/world/*

最小接入流程通常是:

  1. 先调用 GET /api/v1/query/runtime/status 判断当前运行状态。
  2. 如未开局,调用 POST /api/v1/command/game/start 初始化。
  3. world/stateeventsdetail 拉取世界快照与目标信息。
  4. 根据策略调用一个 command 执行干预。
  5. 干预后重新 query,不要依赖本地缓存推断结果。

接口成功时通常返回:

{
  "ok": true,
  "data": {}
}

失败时会返回结构化错误,可读取 detail.codedetail.message 做程序判断。

补充说明:

  • 应用设置仍通过 /api/settings*/api/settings/llm* 管理,它们属于设置真源,不属于外接控制兼容层。
  • 更完整的接口清单、分层设计与扩展约定请参考 docs/specs/external-control-api.md

💭 为什么要做这个?

修仙网文中的世界很精彩,但读者永远只能观察到一隅。

修仙品类游戏要么是完全的预设剧本,要么依靠人工设计的简单规则状态机,有许许多多牵强和降智的表现。

在大语言模型出现后,让“每一个角色都是鲜活的”的目标变得似乎可以触达了。

希望能够创造出纯粹的、快乐的、直接的、活着的修仙世界的沉浸感。不是像一些游戏公司的纯粹宣传工具,也不是像斯坦福小镇那样的纯粹研究,而是能给玩家提供真实代入感和沉浸感的实际世界。

📞 联系方式

如果您对项目有任何问题或建议,欢迎提交 Issue。


⭐ Star History

如果你觉得这个项目有趣,请给我们一个 Star ⭐!这将激励我们持续改进和添加新功能。

插件

感谢贡献者为本 repo 贡献插件。

👥 贡献者

更多贡献细节请查看 CONTRIBUTORS.md

📋 功能开发进度

🏗️ 基础系统

  • ✅ 基础世界地图、时间、事件系统
  • ✅ 多样化地形类型(平原、山脉、森林、沙漠、水域等)
  • ✅ 基于Web前端显示界面
  • ✅ 基础模拟器框架
  • ✅ 配置文件
  • ✅ release 一键即玩的exe
  • ✅ 菜单栏 & 存档 & 读档
  • ✅ 灵活自定义LLM接口
  • ✅ 支持mac os
  • ✅ 多语言本地化
  • ✅ 开始游戏页
  • ✅ BGM & 音效
  • ✅ 玩家可编辑
  • ✅ 扮演模式

🗺️ 世界系统

  • ✅ 基础tile地块系统
  • ✅ 基础区域、修行区域、城市区域、宗门区域
  • ✅ 同地块NPC交互
  • ✅ 灵气分布与产出设计
  • ✅ 世界事件
  • ✅ 天地人榜
  • 更大更美观地图 & 随机地图

👤 角色系统

  • ✅ 角色基础属性系统
  • ✅ 修炼境界体系
  • ✅ 灵根系统
  • ✅ 基础移动动作
  • ✅ 角色特质与性格
  • ✅ 境界突破机制
  • ✅ 角色间的相互关系
  • ✅ 角色交互范围
  • ✅ 角色Effects系统:增益/减益效果
  • ✅ 功法
  • ✅ 兵器 & 辅助装备
  • ✅ 外挂系统
  • ✅ 丹药
  • ✅ 角色长短期记忆
  • ✅ 角色的长短期目标,支持玩家主动设定
  • ✅ 角色绰号
  • ✅ 生活技能
    • ✅ 采集、狩猎、采矿、种植
    • ✅ 铸造
    • ✅ 炼丹
  • ✅ 凡人
  • 化神境界

🏛️ 组织

  • ✅ 宗门
    • ✅ 设定、功法、疗伤、驻地、行事风格、任务
    • ✅ 宗门特殊动作:合欢宗(双修),百兽宗(御兽)等
    • ✅ 宗门等阶
    • ✅ 道统
  • 世家
  • ✅ 朝廷
  • ✅ 组织意志AI
  • ✅ 组织任务、资源、机能
  • ✅ 组织间关系网络

⚡ 动作系统

  • ✅ 基础移动动作
  • ✅ 动作执行框架
  • ✅ 有明确规则的定义动作
  • ✅ 长动作执行和结算系统
    • ✅ 支持多月份持续的动作(如修炼、突破、游戏等)
    • ✅ 动作完成时的自动结算机制
  • ✅ 多人动作:动作发起与动作响应
  • ✅ 影响人际关系的LLM动作
  • ✅ 系统性的动作注册与运行逻辑

🎭 事件系统

  • ✅ 天地灵气变动
  • ✅ 多人大事件:
    • ✅ 拍卖会
    • ✅ 秘境探索
    • ✅ 天下武道会
    • ✅ 宗门传道大会
  • 突发事件
    • 宝物/洞府出世
    • 天灾

⚔️ 战斗系统

  • ✅ 优劣互克关系
  • ✅ 胜率计算系统

🎒 物品系统

  • ✅ 基础物品、灵石框架
  • ✅ 物品交易机制

🌿 生态系统

  • ✅ 动植物
  • ✅ 狩猎、采集、材料系统
  • 魔兽

🤖 AI增强系统

  • ✅ LLM接口集成
  • ✅ 角色AI系统(规则AI + LLM AI)
  • ✅ 协程化决策机制,异步运行,多线程加速ai决策
  • ✅ 长期规划和目标导向行为
  • ✅ 突发动作响应系统(对外界刺激的即时反应)
  • ✅ LLM驱动的NPC对话、思考、互动
  • ✅ LLM生成小片段剧情
  • ✅ 根据任务需求分别接入max/flash模型
  • ✅ 小剧场
    • ✅ 战斗小剧场
    • ✅ 对话小剧场
    • ✅ 小剧场不同文字风格
  • ✅ 一次性选择(如是否要切换功法)

🏛️ 世界背景系统

  • ✅ 注入基础世界知识
  • ✅ 用户输入历史,动态生成功法、装备、宗门、区域信息

✨ 特殊

  • ✅ 奇遇
  • ✅ 天劫 & 心魔
  • 机缘 & 因果
  • 占卜 & 谶纬
  • 角色隐秘 & 阴谋
  • 飞升上界
  • 阵法
  • 世界秘密 & 世界法则
  • 灭世危机
  • 开宗立派/自立世家/成为皇帝

🔭 远期展望

  • 历史/事件的小说化&图片化&视频化
  • Skill agent化,修士自行规划、分析、调用工具、决策
  • 将自己的Claw配入修仙世界

Release History

VersionChangesUrgencyDate
v3.5.0## What's Changed * feat: upgrade MiniMax default model to M3 by @octo-patch in https://github.com/4thfever/cultivation-world-simulator/pull/202 **Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v3.3.0...v3.5.0High6/2/2026
v3.3.0## What's Changed * fix(ai): stop NPCs from planning breakthrough before bottleneck by @cooleryu in https://github.com/4thfever/cultivation-world-simulator/pull/197 * 加入不同种族(妖族) by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/199 * Ground LLM action params in live world options by @cooleryu in https://github.com/4thfever/cultivation-world-simulator/pull/198 ## New Contributors * @cooleryu made their first contribution in https://github.com/4thfever/cultivation-worldHigh5/5/2026
v3.1.0## What's Changed * i18n: refine Vietnamese LLM prompt templates by @Meanliss in https://github.com/4thfever/cultivation-world-simulator/pull/193 ## New Contributors * @Meanliss made their first contribution in https://github.com/4thfever/cultivation-world-simulator/pull/193 **Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v3.0.1...v3.1.0High5/1/2026
v3.0.1**Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v3.0.0...v3.0.1High4/18/2026
v3.0.0## What's Changed * Feat/play mode by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/191 **Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v2.5.0...v3.0.0High4/18/2026
v2.5.0## What's Changed * feat: enhance external control API and update documentation by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/185 * feat: 已故角色独立存档与管理 by @cw1990 in https://github.com/4thfever/cultivation-world-simulator/pull/189 ## New Contributors * @cw1990 made their first contribution in https://github.com/4thfever/cultivation-world-simulator/pull/189 **Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v2.4.0...v2.5.0High4/11/2026
v2.4.0## What's Changed * Feat/jp by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/180 * 优化 EventStorage 查询,批量加载事件关联数据 by @RealityError in https://github.com/4thfever/cultivation-world-simulator/pull/182 * Feat/goldfinger by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/183 ## New Contributors * @RealityError made their first contribution in https://github.com/4thfever/cultivation-world-simulator/pull/182 **Full Changelog**: https://github.com/High4/5/2026
v2.3.0**Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v2.2.0...v2.3.0Medium3/30/2026
v2.2.0## What's Changed * feat: add MiniMax as LLM provider preset by @octo-patch in https://github.com/4thfever/cultivation-world-simulator/pull/178 * feat: add Anthropic native API format support by @Seafoodsz in https://github.com/4thfever/cultivation-world-simulator/pull/179 ## New Contributors * @octo-patch made their first contribution in https://github.com/4thfever/cultivation-world-simulator/pull/178 * @Seafoodsz made their first contribution in https://github.com/4thfever/cultivation-world-sMedium3/29/2026
v2.1.0## What's Changed * fix: 修复 Docker 构建时缺少 tools 目录的问题 by @LuckVd in https://github.com/4thfever/cultivation-world-simulator/pull/177 ## New Contributors * @LuckVd made their first contribution in https://github.com/4thfever/cultivation-world-simulator/pull/177 **Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v2.0.1...v2.1.0Low3/21/2026
v2.0.0## What's Changed * refactor sect by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/173 **Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v1.8.2...v2.0.0Low3/14/2026
v1.8.2**Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v1.8.1...v1.8.2Low3/7/2026
v1.8.1**Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v1.8.0...v1.8.1Low3/3/2026
v1.8.0## What's Changed * Refactor/relation by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/168 * Feat/martial arts by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/169 **Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v1.7.4...v1.8.0Low3/1/2026
v1.7.4**Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v1.7.2...v1.7.4Low2/27/2026
v1.7.2## What's Changed * feat: add three levels ranking by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/165 **Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v1.7.1...v1.7.2Low2/27/2026
v1.7.1**Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v1.7.0...v1.7.1Low2/26/2026
v1.7.0## What's Changed * Feat/pyweb by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/159 * fix/impart-allowlist-upstream-friend-sibling by @Robinwhliu in https://github.com/4thfever/cultivation-world-simulator/pull/161 ## New Contributors * @Robinwhliu made their first contribution in https://github.com/4thfever/cultivation-world-simulator/pull/161 **Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v1.6.0...v1.7.0Low2/23/2026
v1.6.0## What's Changed * Fix/license by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/152 * Feat/orthodoxy by @4thfever in https://github.com/4thfever/cultivation-world-simulator/pull/155 **Full Changelog**: https://github.com/4thfever/cultivation-world-simulator/compare/v1.5.4...v1.6.0Low2/17/2026
v1.5.4Release v1.5.4Low2/14/2026
v1.5.3fix a ton of bugsLow2/12/2026
v1.5.2Release v1.5.2Low2/11/2026
v1.5.1Release v1.5.1Low2/7/2026
v1.5.0Release v1.5.0Low2/7/2026
v1.4.1Release v1.4.1Low2/2/2026
v1.4.0Release v1.4.0Low2/1/2026
v1.3.0Release v1.3.0Low1/24/2026
v1.2.2Release v1.2.2Low1/19/2026
v1.2.1Release v1.2.1Low1/18/2026
v1.2.0Release v1.2.0Low1/14/2026
v1.1.0版本更新日志 ✨ 新增系统 情绪系统:实装情绪机制,角色决策将受近期经历影响;新增「情绪化」特质及前端情绪状态展示。 丹药体系:引入多境界丹药(涵盖突破、延寿、回血等功效);采用“获取即服用”机制,支持效果叠加与自动过期逻辑。 生活技能: 挖矿:新增矿脉分布(四种境界矿石)及挖矿动作,新增「矿工」特质。 制造:实装铸造(炼器)与炼丹功能,消耗同阶材料产出对应境界物品,成功率受境界、特质及法宝加成影响。 💰 经济与贸易 商店机制:实装城市差异化商店(StoreMixin),不同城市出售特定的丹药或兵器;UI 新增商品详情面板。 物价重构:引入买卖差价体系(默认系统售价为收购价的 1.5 倍);建立出世宝物流通管理机制。 交互优化:整合购买逻辑,移除独立的“换兵器”动作,统一通过购买获取新装备。 🌍 世界与玩法 疗伤机制:全地图可用疗伤,宗门总部提供额外加成;新增「苟」特质(自称“稳健”)。 宗门总部:重构总部逻辑,角色初始知晓自家方位,且限制进入他宗总部。 世界观增强:丰富 AI 对境界差距、寿元、天地灵机等基础设定的认知;角色能更清晰地感知自身状态(EfLow1/9/2026
v1.0.9Release v1.0.9Low1/1/2026
v1.0.3Release v1.0.3Low11/15/2025
v1.0.2Release v1.0.2Low11/8/2025
v1.0.1Release v1.0.1Low11/1/2025

Dependencies & License Audit

Loading dependencies...

Similar Packages

deer-flowAn open-source long-horizon SuperAgent harness that researches, codes, and creates. With the help of sandboxes, memories, tools, skill, subagents and message gateway, it handles different levels of tamain@2026-06-06
MeowKitProduction ready. AI Agent Workflow System for Claude Codev2.10.2
graphbitGraphBit is the world’s first enterprise-grade Agentic AI framework, built on a Rust core with a Python wrapper for unmatched speed, security, and scalability. It enables reliable multi-agent workflowGraphbit_Python_v0.6.7
agent-resources🛠️ Install, manage, and share Claude Code skills effortlessly with one command, streamlining your workflow and enhancing team collaboration.main@2026-06-07
ai-lead-qualifier🧠 Qualify leads with an AI-driven system that understands intent, asks key questions, and structures quality leads without hardcoding processes.main@2026-06-07

More in Frameworks

spec_driven_developSpec-Driven Develop is a platform-agnostic AI agent skill that automates the pre-development workflow for large-scale complex tasks. It is not a framework, not a runtime, not a package manager — it is
deer-flowAn open-source long-horizon SuperAgent harness that researches, codes, and creates. With the help of sandboxes, memories, tools, skill, subagents and message gateway, it handles different levels of ta
tqdmFast, Extensible Progress Meter
simBuild, deploy, and orchestrate AI agents. Sim is the central intelligence layer for your AI workforce.