Browse Source

Update example, README

Shellmiao 1 year ago
parent
commit
0c35700634
36 changed files with 800 additions and 305 deletions
  1. 511 4
      README.md
  2. 42 0
      config/example/module_output/Chat_event_output.json
  3. 10 10
      config/example/module_output/Chat_input_output.json
  4. 7 0
      config/example/module_output/Chat_value_output.json
  5. 7 0
      config/example/module_output/Interact_choose_output.json
  6. 25 6
      config/example/modules_config.json
  7. 1 1
      config/example/prompt/event_1.json
  8. 1 1
      config/example/prompt/event_2.json
  9. 1 1
      config/example/prompt/event_3.json
  10. 0 0
      config/example/prompt/input.json
  11. 0 0
      config/example/prompt/json_declare.json
  12. 0 0
      config/example/prompt/value_1.json
  13. 0 0
      config/example/prompt/value_2.json
  14. 1 1
      config/example/user_input.json
  15. 90 0
      config/example_with_outline/module_output/Chat_event_output.json
  16. 7 11
      config/example_with_outline/module_output/Chat_input_output.json
  17. 11 0
      config/example_with_outline/module_output/Chat_outline_output.json
  18. 7 0
      config/example_with_outline/module_output/Chat_value_output.json
  19. 10 0
      config/example_with_outline/module_output/Interact_choose_output.json
  20. 57 7
      config/example_with_outline/modules_config.json
  21. 2 2
      config/example_with_outline/prompt/event_1.json
  22. 2 2
      config/example_with_outline/prompt/event_2.json
  23. 2 2
      config/example_with_outline/prompt/event_3.json
  24. 0 0
      config/example_with_outline/prompt/input.json
  25. 0 0
      config/example_with_outline/prompt/json_declare.json
  26. 5 0
      config/example_with_outline/prompt/outline.json
  27. 0 0
      config/example_with_outline/prompt/value_1.json
  28. 0 0
      config/example_with_outline/prompt/value_2.json
  29. 0 0
      config/example_with_outline/user_input.json
  30. 0 163
      config/three_kingdoms/module_output/Ghat_event_output.json
  31. 0 7
      config/three_kingdoms/module_output/Ghat_value_output.json
  32. 0 21
      config/three_kingdoms/module_output/Interact_choose_output.json
  33. 0 51
      config/xi_you/module_output/Chat_event_output.json
  34. 0 7
      config/xi_you/module_output/Chat_value_output.json
  35. 0 8
      config/xi_you/module_output/Interact_choose_output.json
  36. 1 0
      modules/chat_module.py

+ 511 - 4
README.md

@@ -11,9 +11,24 @@
 
 ## 使用
 
-```powershell
-python .\main_module.py
 ```
+python .\main_module.py -h
+---usage: main_module.py [-h] -n NAME -t TYPE -c CLASSNAME -i ID
+
+---生成文字游戏
+
+---optional arguments:
+---  -h, --help            show this help message and exit
+---  -n NAME, --name NAME  config文件夹中配置的文件夹名称
+---  -t TYPE, --type TYPE  开始的第一个组件的类型
+---  -c CLASSNAME, --classname CLASSNAME
+---                        开始的第一个组件的classname
+---  -i ID, --id ID        开始的第一个组件的id
+
+python .\main_module.py -n example -t Chat -c input -i 1
+```
+
+**重新开始需要删除游戏配置文件中的module_output文件夹中的内容,其中保存了游戏进度; 若不删除,建议根据进度自行修改启动命令中的`-t Chat -c input -i 1`部分,使之在正确的组件上启动**
 
 ## 配置介绍
 
@@ -88,10 +103,12 @@ python .\main_module.py
    }
    ```
 
-   若无下一个组件,则填入None
+   若无下一个组件,则填入
 
    ```json
-   "next_module": None
+   "next_module": {
+   	"type": "End"
+   }
    ```
 
 #### Judgement
@@ -119,7 +136,496 @@ python .\main_module.py
 5. **output**: 与Chat中的output相同
 6. **next_module**: 与Chat中的next_module相同
 
+## Example
+
+```json
+{
+    "Chat": [
+        {
+            "class": "input",
+            "id": 1,
+            "input": {
+                "user_input": "user_input.json",
+                "input_module_prompt":"prompt/input.json",
+                "json_declare":"prompt/json_declare.json"
+            },
+            "prompt_input":{
+                "style":"user_input['style']",
+                "story":"user_input['story']",
+                "declare":"input_module_prompt['declare']",
+                "json_declare":"json_declare['json_declare']"
+            },
+            "prompt": "prompt/input.json",
+            "output": "{class_output_data}",
+            "next_module": {
+                "type": "Chat",
+                "class": "value",
+                "id": 1
+            }
+        },
+        {
+            "class": "value",
+            "id": 1,
+            "input": {
+                "intro": "module_output/Chat_input_output.json",
+                "value_1_module_prompt":"prompt/value_1.json"
+            },
+            "prompt_input":{
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "output_type":"value_1_module_prompt['output_type']"
+            },
+            "prompt": "prompt/value_1.json",
+            "output": "{class_output_data}",
+            "next_module": {
+                "type": "Chat",
+                "class": "event",
+                "id": 1
+            }
+        },
+        {
+            "class": "event",
+            "id": 1,
+            "input": {
+                "user_input": "user_input.json",
+                "event_module_prompt":"prompt/event_1.json",
+                "intro": "module_output/Chat_input_output.json",
+                "value": "module_output/Chat_value_output.json",
+                "json_declare":"prompt/json_declare.json"
+            },
+            "prompt_input":{
+                "style":"user_input['style']",
+                "story":"user_input['story']",
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "output_type":"event_module_prompt['output_type']",
+                "json_declare":"json_declare['json_declare']",
+                "value":"value['value']"
+            },
+            "prompt": "prompt/event_1.json",
+            "output": "{class_output_data_append}",
+            "next_module": {
+                "type": "Chat",
+                "class": "value",
+                "id": 2
+            }
+        },
+        {
+            "class": "value",
+            "id": 2,
+            "input": {
+                "intro": "module_output/Chat_input_output.json",
+                "value_1_module_prompt":"prompt/value_1.json",
+                "value": "module_output/Chat_value_output.json",
+                "event": "module_output/Chat_event_output.json"
+            },
+            "prompt": "prompt/value_2.json",
+            "prompt_input":{
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "event":"event['class_output_data'][-4:]",
+                "value":"value['value']",
+                "output_type":"value_1_module_prompt['output_type']"
+            },
+            "output": "{class_output_data}",
+            "next_module": {
+                "type": "Judgement",
+                "class": "Boolean",
+                "id": 1
+            }
+        },
+        {
+            "class": "event",
+            "id": 2,
+            "input": {
+                "user_input": "user_input.json",
+                "event_module_prompt":"prompt/event_2.json",
+                "intro": "module_output/Chat_input_output.json",
+                "value": "module_output/Chat_value_output.json",
+                "json_declare":"prompt/json_declare.json",
+                "event": "module_output/Chat_event_output.json",
+                "interact":"module_output/Interact_choose_output.json"
+            },
+            "prompt_input":{
+                "style":"user_input['style']",
+                "story":"user_input['story']",
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "output_type":"event_module_prompt['output_type']",
+                "json_declare":"json_declare['json_declare']",
+                "value":"value['value']",
+                "event":"event['class_output_data'][-4:]",
+                "interact":"interact['class_output_data'][-1]"
+            },
+            "prompt": "prompt/event_2.json",
+            "output": "{class_output_data_append}",
+            "next_module": {
+                "type": "Judgement",
+                "class": "Boolean",
+                "id": 2
+            }
+        },
+        {
+            "class": "event",
+            "id": 3,
+            "input": {
+                "user_input": "user_input.json",
+                "event_module_prompt":"prompt/event_3.json",
+                "intro": "module_output/Chat_input_output.json",
+                "value": "module_output/Chat_value_output.json",
+                "json_declare":"prompt/json_declare.json",
+                "event": "module_output/Chat_event_output.json"
+            },
+            "prompt_input":{
+                "style":"user_input['style']",
+                "story":"user_input['story']",
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "output_type":"event_module_prompt['output_type']",
+                "json_declare":"json_declare['json_declare']",
+                "value":"value['value']",
+                "event":"event['class_output_data'][-4:]"
+            },
+            "prompt": "prompt/event_3.json",
+            "output": "{class_output_data_append}",
+            "next_module": {
+                "type": "Judgement",
+                "class": "Boolean",
+                "id": 2
+            }
+        }
+    ],
+    "Judgement": [
+        {
+            "class": "Boolean",
+            "id": 1,
+            "input": {
+                "event": "module_output/Chat_event_output.json"
+            },
+            "judgement_input":{
+                "last_event":"event['class_output_data'][-1]"
+            },
+            "value":"last_event['是否需要玩家选择下一步操作']",
+            "if_true_next": {
+                "type": "Interact",
+                "class": "choose",
+                "id": 1
+            },
+            "if_false_next": {
+                "type": "Chat",
+                "class": "event",
+                "id": 3
+            }
+        },
+        {
+            "class": "Boolean",
+            "id": 2,
+            "input": {
+                "event": "module_output/Chat_event_output.json"
+            },
+            "judgement_input":{
+                "last_event":"event['class_output_data'][-1]"
+            },
+            "value":"last_event['游戏是否结束']",
+            "if_true_next": {"type":"End"},
+            "if_false_next": {
+                "type": "Chat",
+                "class": "value",
+                "id": 2
+            }
+        }
+    ],
+    "Interact": [
+        {
+            "class": "choose",
+            "id": 1,
+            "input": {
+                "event": "module_output/Chat_event_output.json"
+            },
+            "choices": "event['class_output_data'][-1]['玩家可以做出的选择']",
+            "output": "{class_output_data_append}",
+            "next_module": {
+                "type": "Chat",
+                "class": "event",
+                "id": 2
+            }
+        }
+    ]
+}
+```
+
+![example](https://pic.shellmiao.com/2023/05/26/646f94534fd35.png)
+
+## Example_with_outline
+
+```json
+{
+    "Chat": [
+        {
+            "class": "input",
+            "id": 1,
+            "input": {
+                "user_input": "user_input.json",
+                "input_module_prompt":"prompt/input.json",
+                "json_declare":"prompt/json_declare.json"
+            },
+            "prompt_input":{
+                "style":"user_input['style']",
+                "story":"user_input['story']",
+                "declare":"input_module_prompt['declare']",
+                "json_declare":"json_declare['json_declare']"
+            },
+            "prompt": "prompt/input.json",
+            "output": "{class_output_data}",
+            "next_module": {
+                "type": "Chat",
+                "class": "outline",
+                "id": 1
+            }
+        },
+        {
+            "class": "outline",
+            "id": 1,
+            "input": {
+                "user_input": "user_input.json",
+                "intro": "module_output/Chat_input_output.json",
+                "outline_module_prompt":"prompt/outline.json"
+            },
+            "prompt_input":{
+                "style":"user_input['style']",
+                "story":"user_input['story']",
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "output_type":"outline_module_prompt['output_type']"
+            },
+            "prompt": "prompt/outline.json",
+            "output": "{class_output_data}",
+            "next_module": {
+                "type": "Chat",
+                "class": "value",
+                "id": 1
+            }
+        },
+        {
+            "class": "value",
+            "id": 1,
+            "input": {
+                "intro": "module_output/Chat_input_output.json",
+                "value_1_module_prompt":"prompt/value_1.json"
+            },
+            "prompt_input":{
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "output_type":"value_1_module_prompt['output_type']"
+            },
+            "prompt": "prompt/value_1.json",
+            "output": "{class_output_data}",
+            "next_module": {
+                "type": "Chat",
+                "class": "event",
+                "id": 1
+            }
+        },
+        {
+            "class": "event",
+            "id": 1,
+            "input": {
+                "user_input": "user_input.json",
+                "event_module_prompt":"prompt/event_1.json",
+                "intro": "module_output/Chat_input_output.json",
+                "value": "module_output/Chat_value_output.json",
+                "outline":"module_output/Chat_outline_output.json",
+                "json_declare":"prompt/json_declare.json"
+            },
+            "prompt_input":{
+                "style":"user_input['style']",
+                "story":"user_input['story']",
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "outline":"outline['outline']",
+                "output_type":"event_module_prompt['output_type']",
+                "json_declare":"json_declare['json_declare']",
+                "value":"value['value']"
+            },
+            "prompt": "prompt/event_1.json",
+            "output": "{class_output_data_append}",
+            "next_module": {
+                "type": "Chat",
+                "class": "value",
+                "id": 2
+            }
+        },
+        {
+            "class": "value",
+            "id": 2,
+            "input": {
+                "intro": "module_output/Chat_input_output.json",
+                "value_1_module_prompt":"prompt/value_1.json",
+                "value": "module_output/Chat_value_output.json",
+                "event": "module_output/Chat_event_output.json"
+            },
+            "prompt": "prompt/value_2.json",
+            "prompt_input":{
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "event":"event['class_output_data'][-4:]",
+                "value":"value['value']",
+                "output_type":"value_1_module_prompt['output_type']"
+            },
+            "output": "{class_output_data}",
+            "next_module": {
+                "type": "Judgement",
+                "class": "Boolean",
+                "id": 1
+            }
+        },
+        {
+            "class": "event",
+            "id": 2,
+            "input": {
+                "user_input": "user_input.json",
+                "event_module_prompt":"prompt/event_2.json",
+                "intro": "module_output/Chat_input_output.json",
+                "value": "module_output/Chat_value_output.json",
+                "json_declare":"prompt/json_declare.json",
+                "event": "module_output/Chat_event_output.json",
+                "outline":"module_output/Chat_outline_output.json",
+                "interact":"module_output/Interact_choose_output.json"
+            },
+            "prompt_input":{
+                "style":"user_input['style']",
+                "story":"user_input['story']",
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "outline":"outline['outline']",
+                "output_type":"event_module_prompt['output_type']",
+                "json_declare":"json_declare['json_declare']",
+                "value":"value['value']",
+                "event":"event['class_output_data'][-4:]",
+                "interact":"interact['class_output_data'][-1]"
+            },
+            "prompt": "prompt/event_2.json",
+            "output": "{class_output_data_append}",
+            "next_module": {
+                "type": "Judgement",
+                "class": "Boolean",
+                "id": 2
+            }
+        },
+        {
+            "class": "event",
+            "id": 3,
+            "input": {
+                "user_input": "user_input.json",
+                "event_module_prompt":"prompt/event_3.json",
+                "intro": "module_output/Chat_input_output.json",
+                "value": "module_output/Chat_value_output.json",
+                "json_declare":"prompt/json_declare.json",
+                "event": "module_output/Chat_event_output.json",
+                "outline":"module_output/Chat_outline_output.json"
+            },
+            "prompt_input":{
+                "style":"user_input['style']",
+                "story":"user_input['story']",
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "outline":"outline['outline']",
+                "output_type":"event_module_prompt['output_type']",
+                "json_declare":"json_declare['json_declare']",
+                "value":"value['value']",
+                "event":"event['class_output_data'][-4:]"
+            },
+            "prompt": "prompt/event_3.json",
+            "output": "{class_output_data_append}",
+            "next_module": {
+                "type": "Judgement",
+                "class": "Boolean",
+                "id": 2
+            }
+        }
+    ],
+    "Judgement": [
+        {
+            "class": "Boolean",
+            "id": 1,
+            "input": {
+                "event": "module_output/Chat_event_output.json"
+            },
+            "judgement_input":{
+                "last_event":"event['class_output_data'][-1]"
+            },
+            "value":"last_event['是否需要玩家选择下一步操作']",
+            "if_true_next": {
+                "type": "Interact",
+                "class": "choose",
+                "id": 1
+            },
+            "if_false_next": {
+                "type": "Chat",
+                "class": "event",
+                "id": 3
+            }
+        },
+        {
+            "class": "Boolean",
+            "id": 2,
+            "input": {
+                "event": "module_output/Chat_event_output.json"
+            },
+            "judgement_input":{
+                "last_event":"event['class_output_data'][-1]"
+            },
+            "value":"last_event['游戏是否结束']",
+            "if_true_next": {"type":"End"},
+            "if_false_next": {
+                "type": "Chat",
+                "class": "value",
+                "id": 2
+            }
+        }
+    ],
+    "Interact": [
+        {
+            "class": "choose",
+            "id": 1,
+            "input": {
+                "event": "module_output/Chat_event_output.json"
+            },
+            "choices": "event['class_output_data'][-1]['玩家可以做出的选择']",
+            "output": "{class_output_data_append}",
+            "next_module": {
+                "type": "Chat",
+                "class": "event",
+                "id": 2
+            }
+        }
+    ]
+}
+```
 
+![未命名文件 (3)](https://pic.shellmiao.com/2023/05/26/646fa46893c67.png)
 
 ## TODO
 
@@ -127,3 +633,4 @@ python .\main_module.py
 - [ ] 主程序交互优化
 - [ ] 数据处理module
 - [ ] 更多演示case
+- [ ] Debug/Info logger

+ 42 - 0
config/example/module_output/Chat_event_output.json

@@ -0,0 +1,42 @@
+{
+    "class_output_data": [
+        {
+            "事件": "你们来到了一座高山之前,唐僧说这座山叫做火焰山,山上有一只火焰山鸟,我们需要从它身上取得几根羽毛才能过山。你们开始攀登山峰,突然一只机械猴子出现在你们面前,它向你们发起了攻击。",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "使用七十二变躲避攻击",
+                "使用筋斗云躲避攻击",
+                "使用武器反击机械猴子"
+            ],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "你使用筋斗云躲避了机械猴子的攻击,但是你的筋斗云被机械猴子的激光打穿了,你们只能步行前进。走了一段路,你们来到了一片草地,草地上有一只巨大的机械蚂蚁正在翻动土地,看起来它在寻找什么东西。",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "前往机械蚂蚁身边查看",
+                "绕路绕过机械蚂蚁"
+            ],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "你们走到了机械蚂蚁身边,发现它正在寻找一颗神奇的宝石,据说这颗宝石可以让机械蚂蚁变得更加强大。唐僧说这颗宝石可能就是我们要找的真经,我们需要抢在机械蚂蚁之前找到它。突然,机械蚂蚁发现了你们,它向你们发起了攻击。",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "使用七十二变躲避攻击",
+                "使用武器反击机械蚂蚁",
+                "使用魔法攻击机械蚂蚁"
+            ],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "你使用七十二变躲避了机械蚂蚁的攻击,成功逃脱了危险。你们继续前进,来到了一座神秘的城市,城市里到处都是机械生物和魔法生物,它们和平共处,但是你们发现这里的居民都非常奇怪,他们似乎都被某种力量控制着。",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "前往城市中心调查",
+                "离开这座城市继续前进"
+            ],
+            "游戏是否结束": false
+        }
+    ]
+}

+ 10 - 10
config/xi_you/module_output/Chat_input_output.json → config/example/module_output/Chat_input_output.json

@@ -1,21 +1,21 @@
 {
-    "故事简介": "我们将扮演西游记中的孙悟空,师徒四人前往西天取经。然而,与大家所熟知的西游记不同的是,我们所在的世界是赛博朋克的世界。我们一路上会有怎样搞笑又感人的经历呢?",
+    "故事简介": "我们将扮演西游记中的孙悟空,师徒四人前往西天取经。然而,与大家所熟知的西游记不同的是,我们所在的世界是赛博朋克与魔法结合的世界。我们一路上会有怎样搞笑又感人的经历呢?",
     "角色设定": [
         {
-            "角色名": "孙悟空",
-            "特征": "拥有七十二变和筋斗云的猴子"
+            "角色名": "孙悟空",
+            "角色特征": "拥有七十二变和筋斗云的猴子"
         },
         {
-            "角色名": "唐僧",
-            "特征": "慈祥的和尚"
+            "角色名": "唐僧",
+            "角色特征": "慈祥的和尚"
         },
         {
-            "角色名": "八戒",
-            "特征": "贪吃爱睡的猪八戒"
+            "角色名": "八戒",
+            "角色特征": "贪吃的猪八戒"
         },
         {
-            "角色名": "沙僧",
-            "特征": "沉默寡言的沙和尚"
+            "角色名": "沙僧",
+            "角色特征": "沉默寡言的沙和尚"
         }
     ],
     "数值系统": [
@@ -35,5 +35,5 @@
             "数值含义": "角色的魔法值"
         }
     ],
-    "游戏通关所需条件": "成功取得真经并回到人间世界"
+    "游戏通关所需条件": "成功取得真经并回到东土大唐"
 }

+ 7 - 0
config/example/module_output/Chat_value_output.json

@@ -0,0 +1,7 @@
+{
+    "value": {
+        "经验值": "100",
+        "生命值": "50",
+        "魔法值": "0"
+    }
+}

+ 7 - 0
config/example/module_output/Interact_choose_output.json

@@ -0,0 +1,7 @@
+{
+    "class_output_data": [
+        "使用筋斗云躲避攻击",
+        "前往机械蚂蚁身边查看",
+        "使用七十二变躲避攻击"
+    ]
+}

+ 25 - 6
config/three_kingdoms/modules_config.json → config/example/modules_config.json

@@ -127,8 +127,8 @@
             "prompt": "prompt/event_2.json",
             "output": "{class_output_data_append}",
             "next_module": {
-                "type": "Chat",
-                "class": "value",
+                "type": "Judgement",
+                "class": "Boolean",
                 "id": 2
             }
         },
@@ -158,8 +158,8 @@
             "prompt": "prompt/event_3.json",
             "output": "{class_output_data_append}",
             "next_module": {
-                "type": "Chat",
-                "class": "value",
+                "type": "Judgement",
+                "class": "Boolean",
                 "id": 2
             }
         }
@@ -171,8 +171,10 @@
             "input": {
                 "event": "module_output/Chat_event_output.json"
             },
-            "judgement_input":{},
-            "value":"event['class_output_data'][-1]['是否需要玩家选择下一步操作']",
+            "judgement_input":{
+                "last_event":"event['class_output_data'][-1]"
+            },
+            "value":"last_event['是否需要玩家选择下一步操作']",
             "if_true_next": {
                 "type": "Interact",
                 "class": "choose",
@@ -183,6 +185,23 @@
                 "class": "event",
                 "id": 3
             }
+        },
+        {
+            "class": "Boolean",
+            "id": 2,
+            "input": {
+                "event": "module_output/Chat_event_output.json"
+            },
+            "judgement_input":{
+                "last_event":"event['class_output_data'][-1]"
+            },
+            "value":"last_event['游戏是否结束']",
+            "if_true_next": {"type":"End"},
+            "if_false_next": {
+                "type": "Chat",
+                "class": "value",
+                "id": 2
+            }
         }
     ],
     "Interact": [

+ 1 - 1
config/three_kingdoms/prompt/event_1.json → config/example/prompt/event_1.json

@@ -1,5 +1,5 @@
 {
     "output_type": "{\"事件\": \"字符串格式,这是展示给玩家的,讲述了玩家当前遇到的事件,例如“0岁,你出生于颍川一个富贵之家...”。出现新的人物时需要在事件中对新的人物进行描写,并在当前角色设定中添加新的角色\",\"是否需要玩家选择下一步操作\": \"Boolean格式\",\"玩家可以做出的选择\": \"数组格式,玩家可以做出的有限个选择,如果不需要玩家做选择则返回空数组\",\"游戏是否结束\": \"Boolean格式,游戏是否结束\"}",
     "system_template": "我正在生成一个文字冒险游戏,我将输入游戏当前信息与当前游戏的风格、简介,需要你根据游戏当前信息生成玩家接下来遇到的下一个事件,以如下格式输出JSON:{output_type},严格按照格式输出,不要输出除了json字符串之外的其他内容",
-    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value},玩家遇到的下一个事件的json输出为{json_declare}:"
+    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value};游戏目标:{target};玩家遇到的下一个事件的json输出为{json_declare}:"
 }

+ 1 - 1
config/xi_you/prompt/event_2.json → config/example/prompt/event_2.json

@@ -1,6 +1,6 @@
 {
     "output_type": "{\"事件\": \"字符串格式,这是展示给玩家的,讲述了玩家当前遇到的事件,例如“0岁,你出生于颍川一个富贵之家...”。出现新的人物时需要在事件中对新的人物进行描写,并在当前角色设定中添加新的角色\",\"是否需要玩家选择下一步操作\": \"Boolean格式\",\"玩家可以做出的选择\": \"数组格式,玩家可以做出的有限个选择,如果不需要玩家做选择则返回空数组\",\"游戏是否结束\": \"Boolean格式,游戏是否结束\"}",
     "system_template": "我正在生成一个文字冒险游戏,我将输入游戏当前信息与当前游戏的风格、简介,需要你根据游戏当前信息生成玩家接下来遇到的下一个事件,以如下格式输出JSON:{output_type},严格按照格式输出,不要输出除了json字符串之外的其他内容",
-    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value};游戏发生的事件:{event};玩家对最后一次事件做出的选择:{interact};玩家遇到的下一个事件的json输出为{json_declare}:"
+    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value};游戏目标:{target};游戏发生的事件:{event};玩家对最后一次事件做出的选择:{interact};玩家遇到的下一个事件的json输出为{json_declare}:"
     
 }

+ 1 - 1
config/xi_you/prompt/event_3.json → config/example/prompt/event_3.json

@@ -1,5 +1,5 @@
 {
     "output_type": "{\"事件\": \"字符串格式,这是展示给玩家的,讲述了玩家当前遇到的事件,例如“0岁,你出生于颍川一个富贵之家...”。出现新的人物时需要在事件中对新的人物进行描写,并在当前角色设定中添加新的角色\",\"是否需要玩家选择下一步操作\": \"Boolean格式\",\"玩家可以做出的选择\": \"数组格式,玩家可以做出的有限个选择,如果不需要玩家做选择则返回空数组\",\"游戏是否结束\": \"Boolean格式,游戏是否结束\"}",
     "system_template": "我正在生成一个文字冒险游戏,我将输入游戏当前信息与当前游戏的风格、简介,需要你根据游戏当前信息生成玩家接下来遇到的下一个事件,以如下格式输出JSON:{output_type},严格按照格式输出,不要输出除了json字符串之外的其他内容",
-    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value};游戏发生的事件:{event};玩家遇到的下一个事件的json输出为{json_declare}:"
+    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value};游戏目标:{target};游戏发生的事件:{event};玩家遇到的下一个事件的json输出为{json_declare}:"
 }

+ 0 - 0
config/three_kingdoms/prompt/input.json → config/example/prompt/input.json


+ 0 - 0
config/three_kingdoms/prompt/json_declare.json → config/example/prompt/json_declare.json


+ 0 - 0
config/three_kingdoms/prompt/value_1.json → config/example/prompt/value_1.json


+ 0 - 0
config/three_kingdoms/prompt/value_2.json → config/example/prompt/value_2.json


+ 1 - 1
config/xi_you/user_input.json → config/example/user_input.json

@@ -1,4 +1,4 @@
 {
     "style": "西游记,搞笑,孙悟空,赛博朋克",
-    "story": "我将扮演西游记中的孙悟空,我们师徒四人前往西天取经,然而,与大家所熟知的西游记不同的是,我们所在的世界,是赛博朋克的世界。我们一路上会有怎样搞笑又感人的经历呢?"
+    "story": "我将扮演西游记中的孙悟空,我们师徒四人前往西天取经,然而,与大家所熟知的西游记不同的是,我们所在的世界,是赛博朋克与魔法结合的世界。我们一路上会有怎样搞笑又感人的经历呢?"
 }

+ 90 - 0
config/example_with_outline/module_output/Chat_event_output.json

@@ -0,0 +1,90 @@
+{
+    "class_output_data": [
+        {
+            "事件": "你在一次战斗中表现出色,获得了张角的赏识。张角邀请你加入他的内部团队,帮助他制定更好的战略。你发现张角的团队中有一名叫做张宝的人,他是张角的弟弟,但是他的能力和品行都不如张角。你该如何处理这个问题呢?",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "1. 帮助张宝提升能力,让他成为更好的团队成员。",
+                "2. 向张角反映张宝的问题,帮助他解决这个困扰。",
+                "3. 不管这个问题,继续为张角效力。"
+            ],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "张角听取了你的反映,决定给张宝一次机会,让他在下一次战斗中证明自己。你被任命为张宝的教练,需要帮助他提升能力。你发现张宝的问题主要在于缺乏自信和经验,你该如何帮助他呢?",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "1. 给张宝制定一份训练计划,帮助他提升能力。",
+                "2. 在下一次战斗中给张宝提供帮助,让他有机会证明自己。",
+                "3. 向张角反映张宝的进步情况,帮助他更好地管理团队。"
+            ],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "张角听取了你的反映,对张宝的进步感到满意。他决定让你带领一支小队前往敌方阵营进行侦察,为下一步行动做准备。你需要在敌方阵营中搜集情报,但是你发现敌方阵营中有一名你曾经的朋友,他现在是敌方将领。你该如何处理这个问题呢?",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "1. 试图说服朋友投降,加入你的阵营。",
+                "2. 避开朋友,继续搜集情报。",
+                "3. 放弃这次任务,回到张角那里报告情况。"
+            ],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "你试图说服朋友投降,但是他拒绝了你的请求。他告诉你,他已经投身敌方,无法背叛自己的信仰和家族。你感到十分失望,但是你知道你必须完成任务。你需要想办法搜集情报,为下一步行动做准备。",
+            "是否需要玩家选择下一步操作": false,
+            "玩家可以做出的选择": [],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "你成功搜集到了敌方阵营的情报,为张角的下一步行动提供了重要的支持。但是在返回途中,你遭遇了敌方的埋伏,你需要和你的小队一起应对这个突发事件。",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "1. 带领小队奋力抵抗敌人的攻击。",
+                "2. 尝试和敌人谈判,争取和平解决。",
+                "3. 选择撤退,保护自己和小队的安全。"
+            ],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "你和敌人进行了谈判,经过一番交流,你们达成了一项协议。敌人同意放过你和你的小队,你也同意不再对他们进行攻击。你感到这是一次成功的谈判,同时也为你们之间的关系打下了基础。",
+            "是否需要玩家选择下一步操作": false,
+            "玩家可以做出的选择": [],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "你成功搜集到了敌方阵营的情报,为张角的下一步行动提供了重要的支持。但是在返回途中,你遭遇了敌方的埋伏,你需要和你的小队一起应对这个突发事件。",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "1. 带领小队奋力抵抗敌人的攻击。",
+                "2. 尝试和敌人谈判,争取和平解决。",
+                "3. 选择撤退,保护自己和小队的安全。"
+            ],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "你和敌人进行了谈判,经过一番交流,你们达成了一项协议。敌人同意放过你和你的小队,你也同意不再对他们进行攻击。你感到这是一次成功的谈判,同时也为你们之间的关系打下了基础。",
+            "是否需要玩家选择下一步操作": false,
+            "玩家可以做出的选择": [],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "你遇到了一位神秘的道士,他自称是太平道的信徒,希望你能加入他们的行列。他告诉你,太平道的目标是推翻当今的政治体制,建立一个真正公平、和谐的社会。你需要考虑是否加入太平道,并决定自己的立场。",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "1. 加入太平道,成为他们的一员。",
+                "2. 拒绝太平道的邀请,继续自己的道路。"
+            ],
+            "游戏是否结束": false
+        },
+        {
+            "事件": "你听说曹操正在招募人才,希望能够加入他的麾下。你决定前往曹营,看看自己是否有机会成为一名出色的将领。在曹营中,你遇到了一位名叫荀彧的谋士,他对你的才华和能力非常赞赏,并向你提供了一些有用的建议。你需要考虑如何利用这些建议,提升自己的地位和能力。",
+            "是否需要玩家选择下一步操作": true,
+            "玩家可以做出的选择": [
+                "1. 听从荀彧的建议,努力提升自己的能力。",
+                "2. 不听从荀彧的建议,自己寻找机会提升自己。"
+            ],
+            "游戏是否结束": false
+        }
+    ]
+}

+ 7 - 11
config/three_kingdoms/module_output/Ghat_input_output.json → config/example_with_outline/module_output/Chat_input_output.json

@@ -3,37 +3,33 @@
     "角色设定": [
         {
             "名字": "摸鱼",
-            "特征": "墨家子弟,思想独特,擅长机关制造"
+            "特征": "墨家子弟,年龄16岁,思想独特,行为古怪。"
         },
         {
             "名字": "张角",
-            "特征": "黄巾军领袖,号称太平道人,擅长道术"
+            "特征": "黄巾军领袖,号称“太平道人”,信奉道教,擅长巫术。"
         },
         {
             "名字": "曹操",
-            "特征": "魏国开国皇帝,政治手腕高超,擅长用兵"
-        },
-        {
-            "名字": "刘备",
-            "特征": "蜀国开国皇帝,仁义之君,擅长招兵买马"
+            "特征": "魏国开国皇帝,政治家、军事家、文学家,有着复杂的人格和政治野心。"
         }
     ],
     "数值系统": [
         {
             "名称": "武力值",
             "范围": "0-100",
-            "含义": "影响战斗力和攻击力"
+            "含义": "影响战斗力和攻击力"
         },
         {
             "名称": "智力值",
             "范围": "0-100",
-            "含义": "影响策略和谋略的成功率"
+            "含义": "影响策略和谋略的成功率"
         },
         {
             "名称": "魅力值",
             "范围": "0-100",
-            "含义": "影响交际和招募npc的成功率"
+            "含义": "影响人物关系和交际能力。"
         }
     ],
-    "游戏通关所需条件": "成为三国霸主,统一天下!"
+    "游戏通关所需条件": "成为三国时代的一方诸侯,统一天下,实现太平盛世。"
 }

+ 11 - 0
config/example_with_outline/module_output/Chat_outline_output.json

@@ -0,0 +1,11 @@
+{
+    "outline": [
+        "在混乱的三国时代,墨家子弟摸鱼加入了黄巾军,成为一名士兵。",
+        "摸鱼在黄巾军中结识了领袖张角,发现他信奉道教并擅长巫术。",
+        "摸鱼开始思考自己的人生道路,决定发挥自己的智慧和独特思想,努力成为一名出色的将领。",
+        "摸鱼在战斗中表现出色,不断提升自己的武力值和智力值。",
+        "摸鱼结识了曹操,开始接触政治和军事方面的知识。",
+        "摸鱼在政治斗争中表现出色,不断提升自己的魅力值和智力值。",
+        "摸鱼成为一方诸侯,统一天下,实现太平盛世。"
+    ]
+}

+ 7 - 0
config/example_with_outline/module_output/Chat_value_output.json

@@ -0,0 +1,7 @@
+{
+    "value": {
+        "武力值": 70,
+        "智力值": 55,
+        "魅力值": 70
+    }
+}

+ 10 - 0
config/example_with_outline/module_output/Interact_choose_output.json

@@ -0,0 +1,10 @@
+{
+    "class_output_data": [
+        "2. 向张角反映张宝的问题,帮助他解决这个困扰。",
+        "3. 向张角反映张宝的进步情况,帮助他更好地管理团队。",
+        "1. 试图说服朋友投降,加入你的阵营。",
+        "2. 尝试和敌人谈判,争取和平解决。",
+        "2. 尝试和敌人谈判,争取和平解决。",
+        "2. 拒绝太平道的邀请,继续自己的道路。"
+    ]
+}

+ 57 - 7
config/xi_you/modules_config.json → config/example_with_outline/modules_config.json

@@ -16,6 +16,31 @@
             },
             "prompt": "prompt/input.json",
             "output": "{class_output_data}",
+            "next_module": {
+                "type": "Chat",
+                "class": "outline",
+                "id": 1
+            }
+        },
+        {
+            "class": "outline",
+            "id": 1,
+            "input": {
+                "user_input": "user_input.json",
+                "intro": "module_output/Chat_input_output.json",
+                "outline_module_prompt":"prompt/outline.json"
+            },
+            "prompt_input":{
+                "style":"user_input['style']",
+                "story":"user_input['story']",
+                "intro":"intro['故事简介']",
+                "npc":"intro['角色设定']",
+                "value_system":"intro['数值系统']",
+                "target":"intro['游戏通关所需条件']",
+                "output_type":"outline_module_prompt['output_type']"
+            },
+            "prompt": "prompt/outline.json",
+            "output": "{class_output_data}",
             "next_module": {
                 "type": "Chat",
                 "class": "value",
@@ -52,6 +77,7 @@
                 "event_module_prompt":"prompt/event_1.json",
                 "intro": "module_output/Chat_input_output.json",
                 "value": "module_output/Chat_value_output.json",
+                "outline":"module_output/Chat_outline_output.json",
                 "json_declare":"prompt/json_declare.json"
             },
             "prompt_input":{
@@ -61,6 +87,7 @@
                 "npc":"intro['角色设定']",
                 "value_system":"intro['数值系统']",
                 "target":"intro['游戏通关所需条件']",
+                "outline":"outline['outline']",
                 "output_type":"event_module_prompt['output_type']",
                 "json_declare":"json_declare['json_declare']",
                 "value":"value['value']"
@@ -109,6 +136,7 @@
                 "value": "module_output/Chat_value_output.json",
                 "json_declare":"prompt/json_declare.json",
                 "event": "module_output/Chat_event_output.json",
+                "outline":"module_output/Chat_outline_output.json",
                 "interact":"module_output/Interact_choose_output.json"
             },
             "prompt_input":{
@@ -118,6 +146,7 @@
                 "npc":"intro['角色设定']",
                 "value_system":"intro['数值系统']",
                 "target":"intro['游戏通关所需条件']",
+                "outline":"outline['outline']",
                 "output_type":"event_module_prompt['output_type']",
                 "json_declare":"json_declare['json_declare']",
                 "value":"value['value']",
@@ -127,8 +156,8 @@
             "prompt": "prompt/event_2.json",
             "output": "{class_output_data_append}",
             "next_module": {
-                "type": "Chat",
-                "class": "value",
+                "type": "Judgement",
+                "class": "Boolean",
                 "id": 2
             }
         },
@@ -141,7 +170,8 @@
                 "intro": "module_output/Chat_input_output.json",
                 "value": "module_output/Chat_value_output.json",
                 "json_declare":"prompt/json_declare.json",
-                "event": "module_output/Chat_event_output.json"
+                "event": "module_output/Chat_event_output.json",
+                "outline":"module_output/Chat_outline_output.json"
             },
             "prompt_input":{
                 "style":"user_input['style']",
@@ -150,6 +180,7 @@
                 "npc":"intro['角色设定']",
                 "value_system":"intro['数值系统']",
                 "target":"intro['游戏通关所需条件']",
+                "outline":"outline['outline']",
                 "output_type":"event_module_prompt['output_type']",
                 "json_declare":"json_declare['json_declare']",
                 "value":"value['value']",
@@ -158,8 +189,8 @@
             "prompt": "prompt/event_3.json",
             "output": "{class_output_data_append}",
             "next_module": {
-                "type": "Chat",
-                "class": "value",
+                "type": "Judgement",
+                "class": "Boolean",
                 "id": 2
             }
         }
@@ -171,8 +202,10 @@
             "input": {
                 "event": "module_output/Chat_event_output.json"
             },
-            "judgement_input":{},
-            "value":"event['class_output_data'][-1]['是否需要玩家选择下一步操作']",
+            "judgement_input":{
+                "last_event":"event['class_output_data'][-1]"
+            },
+            "value":"last_event['是否需要玩家选择下一步操作']",
             "if_true_next": {
                 "type": "Interact",
                 "class": "choose",
@@ -183,6 +216,23 @@
                 "class": "event",
                 "id": 3
             }
+        },
+        {
+            "class": "Boolean",
+            "id": 2,
+            "input": {
+                "event": "module_output/Chat_event_output.json"
+            },
+            "judgement_input":{
+                "last_event":"event['class_output_data'][-1]"
+            },
+            "value":"last_event['游戏是否结束']",
+            "if_true_next": {"type":"End"},
+            "if_false_next": {
+                "type": "Chat",
+                "class": "value",
+                "id": 2
+            }
         }
     ],
     "Interact": [

+ 2 - 2
config/xi_you/prompt/event_1.json → config/example_with_outline/prompt/event_1.json

@@ -1,5 +1,5 @@
 {
     "output_type": "{\"事件\": \"字符串格式,这是展示给玩家的,讲述了玩家当前遇到的事件,例如“0岁,你出生于颍川一个富贵之家...”。出现新的人物时需要在事件中对新的人物进行描写,并在当前角色设定中添加新的角色\",\"是否需要玩家选择下一步操作\": \"Boolean格式\",\"玩家可以做出的选择\": \"数组格式,玩家可以做出的有限个选择,如果不需要玩家做选择则返回空数组\",\"游戏是否结束\": \"Boolean格式,游戏是否结束\"}",
-    "system_template": "我正在生成一个文字冒险游戏,我将输入游戏当前信息与当前游戏的风格、简介,需要你根据游戏当前信息生成玩家接下来遇到的下一个事件,以如下格式输出JSON:{output_type},严格按照格式输出,不要输出除了json字符串之外的其他内容",
-    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value},玩家遇到的下一个事件的json输出为{json_declare}:"
+    "system_template": "我正在生成一个文字冒险游戏,我将输入游戏当前信息与当前游戏的风格、简介,需要你根据游戏当前信息与故事大纲生成玩家接下来遇到的下一个事件,以如下格式输出JSON:{output_type},严格按照格式输出,不要输出除了json字符串之外的其他内容",
+    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value};游戏目标:{target};故事大纲:{outline};玩家遇到的下一个事件的json输出为{json_declare}:"
 }

+ 2 - 2
config/three_kingdoms/prompt/event_2.json → config/example_with_outline/prompt/event_2.json

@@ -1,6 +1,6 @@
 {
     "output_type": "{\"事件\": \"字符串格式,这是展示给玩家的,讲述了玩家当前遇到的事件,例如“0岁,你出生于颍川一个富贵之家...”。出现新的人物时需要在事件中对新的人物进行描写,并在当前角色设定中添加新的角色\",\"是否需要玩家选择下一步操作\": \"Boolean格式\",\"玩家可以做出的选择\": \"数组格式,玩家可以做出的有限个选择,如果不需要玩家做选择则返回空数组\",\"游戏是否结束\": \"Boolean格式,游戏是否结束\"}",
-    "system_template": "我正在生成一个文字冒险游戏,我将输入游戏当前信息与当前游戏的风格、简介,需要你根据游戏当前信息生成玩家接下来遇到的下一个事件,以如下格式输出JSON:{output_type},严格按照格式输出,不要输出除了json字符串之外的其他内容",
-    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value};游戏发生的事件:{event};玩家对最后一次事件做出的选择:{interact};玩家遇到的下一个事件的json输出为{json_declare}:"
+    "system_template": "我正在生成一个文字冒险游戏,我将输入游戏当前信息与当前游戏的风格、简介,需要你根据游戏当前信息与故事大纲生成玩家接下来遇到的下一个事件,以如下格式输出JSON:{output_type},严格按照格式输出,不要输出除了json字符串之外的其他内容",
+    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value};游戏目标:{target};故事大纲:{outline};游戏发生的事件:{event};玩家对最后一次事件做出的选择:{interact};玩家遇到的下一个事件的json输出为{json_declare}:"
     
 }

+ 2 - 2
config/three_kingdoms/prompt/event_3.json → config/example_with_outline/prompt/event_3.json

@@ -1,5 +1,5 @@
 {
     "output_type": "{\"事件\": \"字符串格式,这是展示给玩家的,讲述了玩家当前遇到的事件,例如“0岁,你出生于颍川一个富贵之家...”。出现新的人物时需要在事件中对新的人物进行描写,并在当前角色设定中添加新的角色\",\"是否需要玩家选择下一步操作\": \"Boolean格式\",\"玩家可以做出的选择\": \"数组格式,玩家可以做出的有限个选择,如果不需要玩家做选择则返回空数组\",\"游戏是否结束\": \"Boolean格式,游戏是否结束\"}",
-    "system_template": "我正在生成一个文字冒险游戏,我将输入游戏当前信息与当前游戏的风格、简介,需要你根据游戏当前信息生成玩家接下来遇到的下一个事件,以如下格式输出JSON:{output_type},严格按照格式输出,不要输出除了json字符串之外的其他内容",
-    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value};游戏发生的事件:{event};玩家遇到的下一个事件的json输出为{json_declare}:"
+    "system_template": "我正在生成一个文字冒险游戏,我将输入游戏当前信息与当前游戏的风格、简介,需要你根据游戏当前信息与故事大纲生成玩家接下来遇到的下一个事件,以如下格式输出JSON:{output_type},严格按照格式输出,不要输出除了json字符串之外的其他内容",
+    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};当前数值:{value};游戏目标:{target};故事大纲:{outline};游戏发生的事件:{event};玩家遇到的下一个事件的json输出为{json_declare}:"
 }

+ 0 - 0
config/xi_you/prompt/input.json → config/example_with_outline/prompt/input.json


+ 0 - 0
config/xi_you/prompt/json_declare.json → config/example_with_outline/prompt/json_declare.json


+ 5 - 0
config/example_with_outline/prompt/outline.json

@@ -0,0 +1,5 @@
+{
+    "output_type": "示例:{\"outline\":[\"字符串格式,描述发生了事件1\",\"字符串格式,描述发生了事件2\"]}",
+    "system_template": "我正在生成一个文字冒险游戏,我将输入游戏当前信息与当前游戏的风格、简介,需要你根据游戏当前信息生成故事大纲,要从开始到结局都包含,并避免出现历史或逻辑错误。以如下格式输出JSON:{output_type},严格按照格式输出,不要输出除了json字符串之外的其他内容",
+    "human_template": "游戏风格:{style};游戏参考:{story};故事简介:{intro};角色设定:{npc};数值系统:{value_system};游戏目标:{target};故事大纲的json输出为{output_type}:"
+}

+ 0 - 0
config/xi_you/prompt/value_1.json → config/example_with_outline/prompt/value_1.json


+ 0 - 0
config/xi_you/prompt/value_2.json → config/example_with_outline/prompt/value_2.json


+ 0 - 0
config/three_kingdoms/user_input.json → config/example_with_outline/user_input.json


+ 0 - 163
config/three_kingdoms/module_output/Ghat_event_output.json

@@ -1,163 +0,0 @@
-{
-    "class_output_data": [
-        {
-            "事件": "你跟随黄巾军攻打一座城池,城内守军顽强抵抗,你被派去破坏城墙,你发现城墙上有一个机关,你可以选择使用自己的机关制造技能修复它,或者直接攻击城墙",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "修复机关",
-                "攻击城墙"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你成功修复了城墙上的机关,城墙被破坏,你们顺利攻入城内。在城内,你遇到了一位墨家弟子,他向你表示愿意加入黄巾军,你可以选择接受他的加入或者拒绝他",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "接受加入",
-                "拒绝加入"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你接受了墨家弟子的加入,他向你展示了他的机关制造技能,你们开始合作制造更加先进的武器和防具。在一次战斗中,你们成功地使用了一种新型弩车,大大提高了黄巾军的战斗力。曹操听闻了你们的战绩,派人前来招揽你们,你可以选择加入曹操的麾下,或者继续留在黄巾军",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "加入曹操",
-                "留在黄巾军"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你加入了曹操的麾下,成为他的部下。曹操对你的机关制造技能非常赞赏,让你负责制造更加先进的武器和防具。在一次战斗中,你们成功地使用了一种新型投石车,大大提高了魏军的战斗力。刘备听闻了你们的战绩,派人前来招揽你们,你可以选择加入刘备的麾下,或者继续留在曹操的军队",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "加入刘备",
-                "留在曹操军队"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你加入了刘备的麾下,成为他的部下。刘备对你的机关制造技能非常赞赏,让你负责制造更加先进的武器和防具。在一次战斗中,你们成功地使用了一种新型火药,大大提高了蜀军的战斗力。曹操听闻了你们的战绩,派人前来招揽你们,你可以选择加入曹操的麾下,或者继续留在刘备的军队",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "加入曹操",
-                "留在刘备军队"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你加入了曹操的麾下,成为他的部下。曹操对你的机关制造技能非常赞赏,让你负责制造更加先进的武器和防具。在一次战斗中,你们成功地使用了一种新型投石车,大大提高了魏军的战斗力。这时,曹操派你前往一座山寨,消灭山寨中的叛军。你可以选择带上你的机关制造师兄弟,或者独自前往",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "带上机关制造师兄弟",
-                "独自前往"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你独自前往山寨,途中遇到了一位神秘的道士。道士自称是张角的弟子,他告诉你张角正在寻找一位能够制造出更加先进机关的人才,他邀请你加入黄巾军,成为张角的部下。你可以选择加入黄巾军,或者继续前往山寨消灭叛军",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "加入黄巾军",
-                "继续前往山寨"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你到达了山寨,发现反军已经被暹汽的部队消测了。但是你发现山寨中有一批机具装置,看起来非常先进。你可以选择将这些机具装带回暹汽的军队,或者将它们留给黄川军",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "带回暹汽的军队",
-                "留给黄川军"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你成功将机具装置带回了暹汽的军队,曹操对你的贡献非常满意,晋升你为机关制造部门的负责人。你开始着手研发更加先进的机关装备,帮助魏国在战争中取得更多的胜利。在一次试验中,你发现了一种新型机关装置,可以大幅提高魏军的攻击力和防御力。曹操决定将这种机关装置用于下一次攻城战,你需要带领机关制造团队将这种机关装置制造出来。你可以选择加班加点完成制造,或者招募更多的工匠来帮助你",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "加班加点完成制造",
-                "招募更多的工匠"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你和机关制造团队加班加点,终于在最后一刻完成了新型机关装置的制造。曹操非常满意,决定在下一次攻城战中使用这种机关装置。但是,你发现这种机关装置的制造需要大量的资源和人力,你需要想办法解决这个问题。你可以选择向曹操请求更多的资源和人力,或者想办法自己解决",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "向曹操请求更多的资源和人力",
-                "想办法自己解决"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你决定自己解决机关装置制造所需要资源和人力问题。你想到了一个功力,可以通过制造和贩卡机关置来赞取足够的资金和资源。你开始着手制造机关置,并在市场上贩卡。但是,你很快发现市场上已经有很多人在贩卡。你需要想力功能改进机关置的性能,或者降低价格来吸引更多的买家",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "改进机关置的性能",
-                "降低价格来吸引更多的买家"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你成功改进了机关置的性能,使其更加高效和稳定。你的机关置开始受到更多人的关注和购买,你的财富和资源也随之增加。曹操对你的贡献非常满意,晋升你为机关制造部门的总负责人。你开始着手研发更加先进的机关装备,帮助魏国在战争中取得更多的胜利。在一次试验中,你发现了一种新型机关装置,可以大幅提高魏军的攻击力和防御力。曹操决定将这种机关装置用于下一次攻城战,你需要带领机关制造团队将这种机关装置制造出来。你可以选择加班加点完成制造,或者招募更多的工匠来帮助你",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "加班加点完成制造",
-                "招募更多的工匠"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你和机关制造团队开始加班加点,全力制造新型机关装置。在经过几天的努力后,你们终于在最后一刻完成了制造。曹操非常满意,决定在下一次攻城战中使用这种机关装置。但是,你们的身体状况已经非常糟糕,需要休息和调养。你可以选择休息一段时间,或者继续工作",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "休息一段时间",
-                "继续工作"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你和机关制造图队体继续工作,但是身体犹私情越来越糕情,有些人已经开始生病。曹操非常着惊,他需要这种机关装置来赞得下一场战争。他给你施工了很大的压力,让你必须在规定时间内完成制造。你需要决定是否继续加班加点,或者停止工作让大家休息",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "继续加班加点",
-                "停止工作让大家休息"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你和机关制造团队继续加班加点,身体状况越来越糟糕,有些人已经无法坚持下去。在最后一天,你们终于完成了机关装置的制造。曹操非常满意,决定在下一场攻城战中使用这种机关装置。但是,你们的身体已经到了极限,需要休息和调养。你可以选择休息一段时间,或者继续工作。",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "休息一段时间",
-                "继续工作"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你和机关制造团队休息了一段时间,身体状况得到了一定的恢复。但是,曹操需要你们继续制造更多的机关装置,以备不时之需。你需要决定是否继续工作,或者拒绝曹操的要求",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "继续工作",
-                "拒绝曹操的要求"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你和机关制造团队继续加班加点,身体状况越来越糟糕,有些人已经无法坚持下去。在制造过程中,你发现了一个机关装置的设计缺陷,如果不及时修复,可能会导致机关装置在战斗中失灵。你需要决定是否继续加班加点,或者停下来修复设计缺陷。",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "继续加班加点",
-                "停下来修复设计缺陷"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你决定停下来修复机关装置的设计缺陷。经过一番修复,机关装置终于得以完美地制造出来。曹操非常满意,决定在下一场攻城战中使用这种机关装。你的机关制造团队也因为这次成功的制造者而被曹操的赛车评估。",
-            "是否需要玩家选择下一步操作": false,
-            "玩家可以做出的选择": [],
-            "游戏是否结束": false
-        }
-    ]
-}

+ 0 - 7
config/three_kingdoms/module_output/Ghat_value_output.json

@@ -1,7 +0,0 @@
-{
-    "value": {
-        "武力值": 90,
-        "智力值": 70,
-        "魅力值": 80
-    }
-}

+ 0 - 21
config/three_kingdoms/module_output/Interact_choose_output.json

@@ -1,21 +0,0 @@
-{
-    "class_output_data": [
-        "修复机关",
-        "接受加入",
-        "加入曹操",
-        "加入刘备",
-        "加入曹操",
-        "独自前往",
-        "继续前往山寨",
-        "带回暹汽的军队",
-        "加班加点完成制造",
-        "想办法自己解决",
-        "改进机关置的性能",
-        "加班加点完成制造",
-        "继续工作",
-        "继续加班加点",
-        "休息一段时间",
-        "继续工作",
-        "停下来修复设计缺陷"
-    ]
-}

+ 0 - 51
config/xi_you/module_output/Chat_event_output.json

@@ -1,51 +0,0 @@
-{
-    "class_output_data": [
-        {
-            "事件": "你们来到了一座高科技城市,城市中心有一座高塔,传说里面有一位神秘的机械大师,可以为你们打造更强大的武器和装备。你们是否要前往高塔寻找机械大师?",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "前往高塔",
-                "不前往高塔"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你们来到了高塔,发现高塔的门口有一位机器人守卫,机器人守卫询问你们的来意,你们该如何回答?",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "说出自己的来意",
-                "攻击机器人守卫",
-                "逃跑"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你们说出了自己的来意,机器人守卫听完后,让你们进入了高塔。高塔内部光线昏暗,四周布满了各种机械设备,你们该如何前进?",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "寻找机械大师的实验室",
-                "随意探索高塔"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你们随意探索高塔,空间听到了一阵机械声响,你们跟着声音走去,发现一台机器人正在进行自我修复,机器人发现了你们,突然向你们发起攻击!",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "攻击机器",
-                "退跑"
-            ],
-            "游戏是否结束": false
-        },
-        {
-            "事件": "你们成功击败了机器人,但是机器人的爆炸导致了高塔的结构出现了问题,你们需要尽快逃离高塔!你们该如何逃离高塔?",
-            "是否需要玩家选择下一步操作": true,
-            "玩家可以做出的选择": [
-                "寻找电梯",
-                "寻找紧急出口",
-                "继续往上爬"
-            ],
-            "游戏是否结束": false
-        }
-    ]
-}

+ 0 - 7
config/xi_you/module_output/Chat_value_output.json

@@ -1,7 +0,0 @@
-{
-    "value": {
-        "经验值": "100",
-        "生命值": "30",
-        "魔法值": "20"
-    }
-}

+ 0 - 8
config/xi_you/module_output/Interact_choose_output.json

@@ -1,8 +0,0 @@
-{
-    "class_output_data": [
-        "前往高塔",
-        "说出自己的来意",
-        "随意探索高塔",
-        "攻击机器"
-    ]
-}

+ 1 - 0
modules/chat_module.py

@@ -28,6 +28,7 @@ def chat_module(classname,id,input,prompt,output):
     input_prompt=chat_prompt.format_prompt(**{key: value for key, value in input.items()}).to_messages()
     print("输入prompt为:"+str(input_prompt))
     rsp = chat(input_prompt)
+    print('--------------------------Output--------------------------')
     try:
         game_event = json.loads(rsp.content, object_hook=convert_choice)
         print(game_event)