Update README.md

This commit is contained in:
zhandouxiaojiji committed 2024-04-17 15:24:27 +08:00
1 parent b81d9449c9
commit ae3933b925
4 files changed
+17 -24

No files matched your search

+2
View File
@@ -13,6 +13,8 @@ dist-ssr
dist-electron dist-electron
release release
*.local *.local
build
settings.json
# Editor directories and files # Editor directories and files
.vscode/.debug.env .vscode/.debug.env
+15 -24
View File
@@ -1,30 +1,25 @@
# 行为树编辑器(桌面版) # 行为树编辑器
这是一个直观、可视化的行为树编辑器,行为树的保存格式为json,可以让策划自行去实现AI,技能,buff等复杂的游戏逻辑,从而减少不必要的沟通成本和提升开发效率。 这是一个直观、可视化、通用的行为树编辑器,行为树的保存格式为json,可以让策划自行去实现AI,技能,buff等复杂的游戏逻辑,从而减少不必要的沟通成本和提升开发效率。
![](readme/preview.png)
![](readme/preview.gif)
## 使用方法
+ 打开编辑器
+ 工作区->节点定义->选择文件(json)
+ 工作区->选择目录(指定行为树所在的目录)
+ 工作区->另存为(将工作区保存起来,以便下次打开)
+ 行为树->新建
## 示例项目 ## 示例项目
+ 工作区: sample/workspace.json + 工作区: sample/workspace.b3-workspace
+ 节点定义: sample/node-config.json + 节点定义: sample/node-config.b3-setting
+ 行为树目录: sample/workdir + 行为树目录: sample/workdir
+ 批处理脚本: sample/scripts + 批处理脚本: sample/scripts
Tips: workspace.json也可以手动编辑,加上isRelative可以让配置中的路径变成相对路径,这样就不需要团队中每个人在使用前都必须先创建工作区
## 节点定义 ## 节点定义
```typescript ```typescript
interface ArgsDefType { interface NodeArg {
name: string, // 字段名 name: string, // 字段名
type: string, // 字段类型 type: string, // 字段类型
desc: string, // 字段中文描述 desc: string, // 字段中文描述
default?: string; // 默认值
options?: NodeArgOption[]; // 枚举类型
} }
interface BehaviorNodeTypeModel { interface NodeDef {
name: string; //节点名称 name: string; //节点名称
type?: string; //节点分类(Composite,Decorator,Condition,Action) type?: string; //节点分类(Composite,Decorator,Condition,Action)
desc?: string; //节点说明 desc?: string; //节点说明
@@ -32,15 +27,17 @@ interface BehaviorNodeTypeModel {
input?: string[]; //输入变量名 input?: string[]; //输入变量名
output?: string[]; //输出变量名 output?: string[]; //输出变量名
doc?: string; //文档说明(markdown格式) doc?: string; //文档说明(markdown格式)
color?: string; //节点颜色
icon?: string; //节点图标
} }
``` ```
节点定义也是json格式,参照[sample/node-config.json](sample/node-config.json),编辑器不提供节点定义的编辑,强烈建议节点定义文件由代码生成 (参照示例项目[behavior3lua](https://github.com/zhandouxiaojiji/behavior3lua))。 节点定义配置在项目创建的时候会自动生成一个配置,参照[sample/node-config.b3-setting](sample/node-config.b3-setting),这是个json的配置文件。编辑器不提供节点定义的编辑,强烈建议节点定义文件由代码生成 (参照示例项目[behavior3lua](https://github.com/zhandouxiaojiji/behavior3lua))。
## 编译与构建 ## 编译与构建
```shell ```shell
npm install # 安装依赖 npm install # 安装依赖
npm start # 运行测试 npm start # 运行测试
npm run dist # 编译exe可执行文件 npm run build # 编译可执行文件
``` ```
## 技术栈 ## 技术栈
@@ -53,12 +50,6 @@ npm run dist # 编译exe可执行文件
+ lua版本 [behavior3lua](https://github.com/zhandouxiaojiji/behavior3lua) + lua版本 [behavior3lua](https://github.com/zhandouxiaojiji/behavior3lua)
+ js/ts版本 计划中。 + js/ts版本 计划中。
## TODO
+ 右键菜单
+ 面板拖拽新建节点
+ 变量自动补全
+ 设置面板
+ 禁止动画选项
## About ## About
目前编辑器还处于非常简陋的阶段,有问题可以联系作者(QQ1013299930),本项目将长期维护,望前端大佬们多提点~ 本项目将长期维护,欢迎各位大佬加群交流(Q群:644761605)
Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB