focus-creative-games / luban

Licence: MIT license
你的最佳游戏配置解决方案 {excel, csv, xls, xlsx, json, bson, xml, yaml, lua, unity scriptableobject} => {json, bson, xml, lua, yaml, protobuf(pb), msgpack, flatbuffers, erlang, custom template} data + {c++, java, c#, go(golang), lua, javascript(js), typescript(ts), erlang, rust, gdscript, protobuf schema, flatbuffers schema, custom template} code。

Programming Languages

C#
18002 projects
Smarty
1635 projects

Projects that are alternatives of or similar to luban

Vscode Data Preview
Data Preview 🈸 extension for importing 📤 viewing 🔎 slicing 🔪 dicing 🎲 charting 📊 & exporting 📥 large JSON array/config, YAML, Apache Arrow, Avro, Parquet & Excel data files
Stars: ✭ 245 (-85.24%)
Mutual labels:  config, yaml, excel
Xresloader
跨平台Excel导表工具(Excel=>protobuf/msgpack/lua/javascript/json/xml)
Stars: ✭ 161 (-90.3%)
Mutual labels:  protobuf, excel, msgpack
Hiyapyco
HiYaPyCo - A Hierarchical Yaml Python Config
Stars: ✭ 58 (-96.51%)
Mutual labels:  config, yaml
Config Lite
A super simple & flexible & useful config module.
Stars: ✭ 78 (-95.3%)
Mutual labels:  config, yaml
Cfgdiff
diff(1) all your configs
Stars: ✭ 138 (-91.69%)
Mutual labels:  config, yaml
Strictyaml
Type-safe YAML parser and validator.
Stars: ✭ 836 (-49.64%)
Mutual labels:  config, yaml
Home Assistant Config
Home Assistant config files, rewritten to use the latest features, 100+ documented automations, automatically generated ToC 🏠 🤖
Stars: ✭ 926 (-44.22%)
Mutual labels:  config, yaml
Gray Matter
Contributing Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
Stars: ✭ 2,105 (+26.81%)
Mutual labels:  config, yaml
Hoplite
A boilerplate-free library for loading configuration files as data classes in Kotlin
Stars: ✭ 322 (-80.6%)
Mutual labels:  config, yaml
Config
📝 Go config manage(load,get,set). support JSON, YAML, TOML, INI, HCL, ENV and Flags. Multi file load, data override merge, parse ENV var. Go应用配置加载管理,支持多种格式,多文件加载,远程文件加载,支持数据合并,解析环境变量名
Stars: ✭ 225 (-86.45%)
Mutual labels:  config, yaml
Konf
A type-safe cascading configuration library for Kotlin/Java/Android, supporting most configuration formats
Stars: ✭ 225 (-86.45%)
Mutual labels:  config, yaml
Dasel
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Stars: ✭ 759 (-54.28%)
Mutual labels:  config, yaml
Koanf
Light weight, extensible configuration management library for Go. Built in support for JSON, TOML, YAML, env, command line, file, S3 etc. Alternative to viper.
Stars: ✭ 450 (-72.89%)
Mutual labels:  config, yaml
Mconfig
MCONFIG is a lightweight Golang library for integrating configs files like (json, yml, toml) and environment variables into one config struct.
Stars: ✭ 28 (-98.31%)
Mutual labels:  config, yaml
Airframe
Essential Building Blocks for Scala
Stars: ✭ 442 (-73.37%)
Mutual labels:  config, msgpack
Dynaconf
Configuration Management for Python ⚙
Stars: ✭ 2,082 (+25.42%)
Mutual labels:  config, yaml
libcluon
libcluon is a small and efficient, single-file and header-only library written in modern C++ to power microservices.
Stars: ✭ 81 (-95.12%)
Mutual labels:  protobuf, msgpack
yaml
A Laravel YAML parser and config loader
Stars: ✭ 100 (-93.98%)
Mutual labels:  config, yaml
Quicklib
Quick development library (AutoMapper, LinQ, IOC Dependency Injection, MemoryCache, Scheduled tasks, Config, Serializers, etc) with crossplatform support for Delphi/Firemonkey (Windows,Linux,OSX/IOS/Android) and freepascal (Windows/Linux).
Stars: ✭ 274 (-83.49%)
Mutual labels:  config, yaml
Simple Settings
A simple way to manage your project settings.
Stars: ✭ 165 (-90.06%)
Mutual labels:  config, yaml

Luban

license Build Status
Docker Auto Docker Build

icon


links


介绍

luban是你的最佳游戏配置解决方案

luban高效地处理游戏开发中常见的excel、json、xml之类的数据,检查数据错误,生成c#等各种语言的代码,导出成bytes或json等多种格式。

luban统一了游戏配置开发工作流,极大提升了策划和程序的工作效率。

核心特性

  • 强大的数据解析和转换能力 {excel(csv,xls,xlsx)、json、bson、xml、yaml、lua、unity ScriptableObject} => {binary、json、bson、xml、lua、yaml、erlang、 custom format}
  • 增强的excel格式,可以简洁地配置出像简单列表、子结构、结构列表,以及任意复杂的深层次的嵌套结构。
  • 完备的类型系统,支持OOP类型继承,搭配excel、json、lua、xml等格式数据灵活优雅表达行为树、技能、剧情、副本之类复杂GamePlay数据
  • 支持生成c#、java、go、c++、lua、python、javascript、typescript、erlang、rust、gdscript 代码
  • 支持生成 protobuf(schema + binary + json)、flatbuffers(schema + json)、msgpack(binary)
  • 强大的数据校验能力。ref引用检查、path资源路径、range范围检查等等
  • 完善的本地化支持。静态文本值本地化、动态文本值本地化、时间本地化、main-patch多地区版本
  • 强大灵活的自定义能力,支持自定义代码模板和数据模板
  • 通用型生成和缓存工具。也可以用于生成协议、数据库之类的代码,甚至可以用作对象缓存服务
  • 良好支持主流引擎、全平台、主流热更新方案、主流前后端框架。支持Unity、Unreal、Cocos2x、Godot、微信小游戏等主流引擎。工具自身跨平台,能在Win,Linux,Mac平台良好工作。

完整特性请参见 feature

文档

excel格式速览

完整示例请详见 excel格式介绍

普通表

##var id x1 x5 x6 s1 s2 v3 t1
##type int bool long float string text#sep=| vector3 datetime
## id desc1 desc2 desc3 desc4 desc7 desc1 time
1 false 1000 1.2 hello key1|world1 1,2,3 1999-10-10 11:12:13
2 true 1000 2.4 world key2|world2 2,4,5 1999-10-12 11:12:13

原生数据列表

##var id arr1 arr2 arr3 arr4
##type int (array#sep=;),int list,int (list#sep=|),string list,string
## id desc1 desc2 desc3 desc4
1 1;2;3 12 xx|yy xxxzzz
2 2;4 345 aaaa|bbbb|cccc aaabbbccc
3 2;4;6 3456 aaaa|bbbb|cccc aaabbbccc

子结构

Reward为包含 "int item_id; int count; string desc; " 这三个字段的子结构。

##varidrewardreward2reward3
##typeintRewardRewardReward#sep=,
##varitem_idcountdesc
1100110item 1100211item 21002,1,item 3
2200110item 2200220item 42003,2,item 5

结构列表 1

##var id rewards1 rewards2
##type int list,Reward list,Reward#sep=,
## id reward list desc1 reward list desc2
1 10011desc110022desc2 1001,1,desc11002,2,desc21003,3,desc3
2 10011desc1 1001,1,desc11002,2,desc2

结构列表 2

##var id name rewards
##type int string list,Reward
##var 0 1 2
1task1100110desc1100212desc2100313desc3
2task1100330desc3100440desc4
3task1100550desc5

结构列表 3

##var id name rewards
##type int string list,Reward
##var 0 1 2
##var item_idnumdesc item_idnumdesc item_idnumdesc
1task1100110desc1100212desc2100313desc3
2task1100330desc3100440desc4
3task1100550desc5

多行表

##var id name *stages
##type int string list,Stage
##var id name desc location item_id num
## id desc1 desc1 desc2 desc3 desc4 desc5 desc6
1 task1 1stage1stage desc11,2,310011
2stage2stage desc21,2,310011
3stage3stage desc31,2,310021
2 task2 1stage1stage desc11,2,310011
2stage2stage desc21,2,310021

多级多行表

多行表的列表字段,每个列表元素还可以是多行。支持任意多级的多行嵌套。另外也允许有多个多行字段,每个字段的行数还可以不同。

##var id name *stages
##type int string list,Stage
##var id name desc *tips *rules
##var location item_id num id name item_id num
## id desc1 desc1 desc2 desc3 desc4 desc5 desc6 id desc item id count
1 task1 1stage1stage desc11,2,3100111hello50011
2,2,210022
2stage2stage desc21,2,3100111hello50011
2hello50011
3hello50011
3stage3stage desc31,2,3100211hello50011
2,2,2100221hello50011
2,2,210022
2 task2 1stage1stage desc11,2,310011
2,2,210022
2,2,210022
2stage2stage desc21,2,3100211hello50011
2,2,210022

map 类型的多级子标题

##varidlans
##typeintmap,string,string
##varch-znenjpfr
1苹果appleaaaaaa
2香蕉bananabbbbbb

类型继承(适合技能、buff相关配置)

##varidshapeshape2
##typeintShapeShape
##var$typeradiuswidthheight
1Circle10Circle100
2Rectangle1020矩形1020
310Triangle151515
4Circle10Rectangle3020

多主键表(联合索引)

多个key构成联合唯一主键。

##var key1 key2 key3 num
##type int long string int
1 1 aaa 123
1 1 bbb 124
1 2 aaa 134
2 1 aaa 124
5 6 xxx 898

多主键表(独立索引)

多个key独立索引。

##var key1 key2 key3 num
##type int long string int
1 2 aaa 123
2 4 bbb 124
3 6 ccc 134
4 8 ddd 124
5 10 eee 898

单例表

有一些配置全局只有一份,比如 公会模块的开启等级,背包初始大小,背包上限。此时使用单例表来配置这些数据比较合适。

##var guild_open_level bag_init_capacity bag_max_capacity newbie_tasks
##type int int int list,int
## desc1 desc 2 desc 3 desc 4
10 100 500 10001,10002

纵表

##var#column ##type ##
guild_open_levelintdesc110
bag_init_capacityintdesc2100
bag_max_capacityintdesc3500
newbie_taskslist,intdesc410001,10002

json、lua、xml、yaml 格式速览

以行为树为例,展示json格式下如何配置行为树配置。xml、lua、yaml等等格式请参见 详细文档

{
  "id": 10002,
  "name": "random move",
  "desc": "demo behaviour tree",
  "executor": "SERVER",
  "blackboard_id": "demo",
  "root": {
    "$type": "Sequence",
    "id": 1,
    "node_name": "test",
    "desc": "root",
    "services": [],
    "decorators": [
      {
        "$type": "UeLoop",
        "id": 3,
        "node_name": "",
        "flow_abort_mode": "SELF",
        "num_loops": 0,
        "infinite_loop": true,
        "infinite_loop_timeout_time": -1
      }
    ],
    "children": [
      {
        "$type": "UeWait",
        "id": 30,
        "node_name": "",
        "ignore_restart_self": false,
        "wait_time": 1,
        "random_deviation": 0.5,
        "services": [],
        "decorators": []
      },
      {
        "$type": "MoveToRandomLocation",
        "id": 75,
        "node_name": "",
        "ignore_restart_self": false,
        "origin_position_key": "x5",
        "radius": 30,
        "services": [],
        "decorators": []
      }
    ]
  }
}

代码使用预览

这儿只简略展示c#、typescript、go、c++ 语言在开发中的用法,更多语言以及更详细的使用范例和代码见示例项目

  • C# 使用示例
// 一行代码可以加载所有配置。 cfg.Tables 包含所有表的一个实例字段。
var tables = new cfg.Tables(file => return new ByteBuf(File.ReadAllBytes($"{gameConfDir}/{file}.bytes")));
// 访问一个单例表
Console.WriteLine(tables.TbGlobal.Name);
// 访问普通的 key-value 表
Console.WriteLine(tables.TbItem.Get(12).Name);
// 支持 operator []用法
Console.WriteLine(tables.TbMail[1001].Desc);
  • typescript 使用示例
// 一行代码可以加载所有配置。 cfg.Tables 包含所有表的一个实例字段。
let tables = new cfg.Tables(f => JsHelpers.LoadFromFile(gameConfDir, f))
// 访问一个单例表
console.log(tables.TbGlobal.name)
// 访问普通的 key-value 表
console.log(tables.TbItem.get(12).Name)
  • go 使用示例
// 一行代码可以加载所有配置。 cfg.Tables 包含所有表的一个实例字段。
if tables , err := cfg.NewTables(loader) ; err != nil {
 println(err.Error())
 return
}
// 访问一个单例表
println(tables.TbGlobal.Name)
// 访问普通的 key-value 表
println(tables.TbItem.Get(12).Name)
  • c++ 使用示例
    cfg::Tables tables;
    if (!tables.load([](ByteBuf& buf, const std::string& s) { buf.clear(); return buf.loadFromFile("../GenerateDatas/bytes/" + s + ".bytes"); }))
    {
        std::cout << "== load fail == " << std::endl;
        return;
    }
    std::cout << tables.TbGlobal->name << std::endl;
    std::cout << tables.TbItem.get(12)->name << std::endl;

路线图

  • 新增 unity 内置编辑器
  • 新增 unreal 内置编辑器
  • 补充单元测试

友情链接

License

Luban is licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].