Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
zhandouxiaojiji committed Apr 17, 2024
1 parent b81d944 commit ae3933b
Showing 4 changed files with 17 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -13,6 +13,8 @@ dist-ssr
dist-electron
release
*.local
build
settings.json

# Editor directories and files
.vscode/.debug.env
39 changes: 15 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,43 @@
# 行为树编辑器(桌面版)
这是一个直观、可视化的行为树编辑器,行为树的保存格式为json,可以让策划自行去实现AI,技能,buff等复杂的游戏逻辑,从而减少不必要的沟通成本和提升开发效率。
![](readme/preview.png)
# 行为树编辑器
这是一个直观、可视化、通用的行为树编辑器,行为树的保存格式为json,可以让策划自行去实现AI,技能,buff等复杂的游戏逻辑,从而减少不必要的沟通成本和提升开发效率。

![](readme/preview.gif)

## 使用方法
+ 打开编辑器
+ 工作区->节点定义->选择文件(json)
+ 工作区->选择目录(指定行为树所在的目录)
+ 工作区->另存为(将工作区保存起来,以便下次打开)
+ 行为树->新建

## 示例项目
+ 工作区: sample/workspace.json
+ 节点定义: sample/node-config.json
+ 工作区: sample/workspace.b3-workspace
+ 节点定义: sample/node-config.b3-setting
+ 行为树目录: sample/workdir
+ 批处理脚本: sample/scripts

Tips: workspace.json也可以手动编辑,加上isRelative可以让配置中的路径变成相对路径,这样就不需要团队中每个人在使用前都必须先创建工作区

## 节点定义
```typescript
interface ArgsDefType {
interface NodeArg {
name: string, // 字段名
type: string, // 字段类型
desc: string, // 字段中文描述
default?: string; // 默认值
options?: NodeArgOption[]; // 枚举类型
}
interface BehaviorNodeTypeModel {
interface NodeDef {
name: string; //节点名称
type?: string; //节点分类(Composite,Decorator,Condition,Action)
desc?: string; //节点说明
args?: ArgsDefType[]; //参数列表
input?: string[]; //输入变量名
output?: string[]; //输出变量名
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
npm install # 安装依赖
npm start # 运行测试
npm run dist # 编译exe可执行文件
npm run build # 编译可执行文件
```

## 技术栈
@@ -53,12 +50,6 @@ npm run dist # 编译exe可执行文件
+ lua版本 [behavior3lua](https://github.com/zhandouxiaojiji/behavior3lua)
+ js/ts版本 计划中。

## TODO
+ 右键菜单
+ 面板拖拽新建节点
+ 变量自动补全
+ 设置面板
+ 禁止动画选项

## About
目前编辑器还处于非常简陋的阶段,有问题可以联系作者(QQ1013299930),本项目将长期维护,望前端大佬们多提点~
本项目将长期维护,欢迎各位大佬加群交流(Q群:644761605)
Binary file added readme/preview.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed readme/preview.png
Binary file not shown.

0 comments on commit ae3933b

Please sign in to comment.