Awesome Open Source
Awesome Open Source

Luban

license Build Status
Docker Auto Docker Build

icon


links


luban****

lubanexceljsonxmlc#bytesjson

luban

  • {excel(csv,xls,xlsx)jsonbsonxmlyamlluaunity ScriptableObject} => {binaryjsonbsonxmlluayamlerlang custom format}
  • excel
  • OOPexceljsonluaxml****GamePlay
  • c#javagoc++luapythonjavascripttypescripterlangrustgdscript
  • protobuf(schema + binary + json)flatbuffers(schema + json)msgpack(binary)
  • refpathrange
  • main-patch

  • ****UnityUnrealCocos2xGodotWin,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 1 2 xx|yy xxx zzz
2 2;4 3 4 5 aaaa|bbbb|cccc aaa bbb ccc
3 2;4;6 3 4 5 6 aaaa|bbbb|cccc aaa bbb ccc

Reward "int item_id; int count; string desc; "

##var id reward reward2 reward3
##type int Reward Reward Reward#sep=,
##var item_id count desc
1 1001 10 item 1 1002 11 item 2 1002,1,item 3
2 2001 10 item 2 2002 20 item 4 2003,2,item 5

1

##var id rewards1 rewards2
##type int list,Reward list,Reward#sep=,
## id reward list desc1 reward list desc2
1 1001 1 desc1 1002 2 desc2 1001,1,desc1 1002,2,desc2 1003,3,desc3
2 1001 1 desc1 1001,1,desc1 1002,2,desc2

2

##var id name rewards
##type int string list,Reward
##var 0 1 2
1 task1 1001 10 desc1 1002 12 desc2 1003 13 desc3
2 task1 1003 30 desc3 1004 40 desc4
3 task1 1005 50 desc5

3

##var id name rewards
##type int string list,Reward
##var 0 1 2
##var item_id num desc item_id num desc item_id num desc
1 task1 1001 10 desc1 1002 12 desc2 1003 13 desc3
2 task1 1003 30 desc3 1004 40 desc4
3 task1 1005 50 desc5

##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 1 stage1 stage desc1 1,2,3 1001 1
2 stage2 stage desc2 1,2,3 1001 1
3 stage3 stage desc3 1,2,3 1002 1
2 task2 1 stage1 stage desc1 1,2,3 1001 1
2 stage2 stage desc2 1,2,3 1002 1

##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 1 stage1 stage desc1 1,2,3 1001 1 1 hello 5001 1
2,2,2 1002 2
2 stage2 stage desc2 1,2,3 1001 1 1 hello 5001 1
2 hello 5001 1
3 hello 5001 1
3 stage3 stage desc3 1,2,3 1002 1 1 hello 5001 1
2,2,2 1002 2 1 hello 5001 1
2,2,2 1002 2
2 task2 1 stage1 stage desc1 1,2,3 1001 1
2,2,2 1002 2
2,2,2 1002 2
2 stage2 stage desc2 1,2,3 1002 1 1 hello 5001 1
2,2,2 1002 2

map

##var id lans
##type int map,string,string
##var ch-zn en jp fr
1 apple aaa aaa
2 banana bbb bbb

buff

##var id shape shape2
##type int Shape Shape
##var $type radius width height
1 Circle 10 Circle 100
2 Rectangle 10 20 10 20
3 10 Triangle 15 15 15
4 Circle 10 Rectangle 30 20

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_level int desc1 10
bag_init_capacity int desc2 100
bag_max_capacity int desc3 500
newbie_tasks list,int desc4 10001,10002

jsonluaxmlyaml

jsonxmlluayaml

{
  "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#typescriptgoc++

  • 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.

Alternatives To Luban
Select To Compare


Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages
Top Projects

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,094,551
C Sharp (170,124
Video Game (82,980
Json (39,611
Lua (35,819
Unity (18,841
Xml (18,396
Csv (15,131
Yaml (10,303
Excel (7,291
Protocol Buffers (4,261
Godot Engine (2,870
Unreal Engine (2,321
Datatable (2,144
Xlsx (1,535
Xls (889
Ue4 (793
Flatbuffers (223
Cocos2d X (136
Scriptableobject (57
Ilruntime (40
Excel2json (7
Xlsx2json (3