• Stars
    star
    2,818
  • Rank 15,459 (Top 0.4 %)
  • Language
    C#
  • License
    MIT License
  • Created over 3 years ago
  • Updated 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

luban是一个强大、易用、优雅、稳定的游戏配置解决方案。luban is a powerful, easy-to-use, elegant and stable game configuration solution.

Luban

icon

license star

luban is a powerful, easy-to-use, elegant, and stable game configuration solution. It is designed to meet the needs of simple to complex game configuration workflows from small to very large game projects.

luban can handle a variety of file types, supports mainstream languages, can generate multiple export formats, supports rich data inspection functions, has good cross-platform capabilities, and generates extremely fast. Luban has a clear and elegant generation pipeline design, supports good modularization and plug-in, and is convenient for developers to carry out secondary development. Developers can easily adapt luban to their own configuration format, and customize powerful configuration tools that meet project requirements.

Luban standardizes the game configuration development workflow, which can greatly improve the efficiency of planning and programming.

Core features

  • Rich source data format. Support excel family (csv, xls, xlsx, xlsm), json, xml, yaml, lua, etc.
  • Rich export formats. Support generating binary, json, bson, xml, lua, yaml and other format data
  • Enhanced excel format. Simple configurations such as simple lists, substructures, structured lists, and arbitrarily complex deep nested structures can be concisely configured
  • Complete type system. Not only can it express common specification line lists, but it can flexibly and elegantly express complex GamePlay data such as behavior trees, skills, plots, and dungeons because supports OOP type inheritance
  • Support multiple languages. Supports generating language codes such as c#, java, go, cpp, lua, python, typescript, etc.
  • Support mainstream message schemes. protobuf(schema + binary + json), flatbuffers(schema + json), msgpack(binary)
  • Powerful data verification capability. ref reference check, path resource path, range range check, etc.
  • Perfect localization support
  • Supports all major game engines and platforms. Support Unity, Unreal, Cocos2x, Godot, WeChat games, etc.
  • Good cross-platform capability. It can run well on Win, Linux, and Mac platforms.
  • Support all mainstream hot update solutions. hybridclr, ilruntime, {x,t,s}lua, puerts, etc.
  • Clear and elegant generation pipeline, it is easy to carry out secondary development on the basis of luban, and customize a configuration tool suitable for your own project style.

Documentation

Excel format overview

basic data format

primitive_type

enum data format

enum

bean data format

bean

Polymorphic bean data format

bean

container

collection

nullable type

nullable

no primary key table

table_list_not_key

Multi-primary key table (joint index)

table_list_union_key

Multi-primary key table (independent index)

table_list_indep_key

singleton table

Some configurations have only one copy globally, such as the opening level of the guild module, the initial size of the backpack, and the upper limit of the backpack. At this time, it is more appropriate to use a singleton table to configure these data.

singleton

vertical table

Most tables are horizontal tables, that is, one record per row. Some tables, such as singleton tables, are more comfortable to fill in vertically, with one field per line. A1 is ##column means using vertical table mode. The singleton table above is filled in as follows in vertical table mode.

singleton

Use sep to read beans and nested beans.

sep_bean

Use sep to read normal containers.

sep_bean

Use sep to read structure containers.

sep_bean

multi-level header

colloumlimit

Qualify column format

titlelimit

Enumerated column-qualified format

title_enum

polymorphic bean column qualification format

title_dynamic_bean

column-qualified format for map

title_map

multiline field

map

Data label filtering

tag

Overview of other formats

Take behavior tree as an example to show how to configure behavior tree configuration in json format. For xml, lua, yaml and other formats, please refer to Detailed Documentation.

{
   "id": 10002,
   "name": "random move",
   "desc": "demo behavior 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": []
       }
     ]
   }
}

code usage preview

Here we only briefly show the usage of c#, typescript, go, and c++ languages in development. For more languages and more detailed usage examples and codes, see Example Project.

  • C# usage example
// One line of code can load all configurations. cfg.Tables contains an instance field for all tables.
var tables = new cfg.Tables(file => return new ByteBuf(File.ReadAllBytes($"{gameConfDir}/{file}.bytes")));
// access a singleton table
Console.WriteLine(tables.TbGlobal.Name);
// access normal key-value table
Console.WriteLine(tables.TbItem.Get(12).Name);
// support operator [] usage
Console.WriteLine(tables.TbMail[1001].Desc);
  • example of typescript usage
// One line of code can load all configurations. cfg.Tables contains an instance field for all tables.
let tables = new cfg. Tables(f => JsHelpers. LoadFromFile(gameConfDir, f))
// access a singleton table
console.log(tables.TbGlobal.name)
// access normal key-value table
console.log(tables.TbItem.get(12).Name)
  • go usage example
// One line of code can load all configurations. cfg.Tables contains an instance field for all tables.
if tables , err := cfg.NewTables(loader) ; err != nil {
  println(err. Error())
  return
}
// access a singleton table
println(tables. TbGlobal. Name)
// access normal key-value table
println(tables. TbItem. Get(12). Name)
  • c++ usage example
     cfg::Tables tables;
     if (!tables.load([](ByteBuf& buf, const std::string& s) { 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;

license

Luban is licensed under the MIT license

More Repositories

1

hybridclr

HybridCLR是一个特性完整、零成本、高性能、低内存的Unity全平台原生c#热更方案。 HybridCLR is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotupdate.
C++
5,483
star
2

hybridclr_trial

HybridCLR 示例项目
C#
703
star
3

hybridclr_unity

Unity package for HybridCLR
C#
572
star
4

luban_examples

luban example projects
C#
284
star
5

il2cpp_plus

改造过的支持HybridCLR的il2cpp版本
243
star
6

Excel2TextDiff

将xlsx之类的文件转成text然后再调用diff工具对比变化,非常适合替换TortoiseGit,TortoiseSvn之类的默认diff命令。 convert excel file(xls,xlsx,xlm etc) to text then launch diff tool(TortoiseDiff) to show differences.
C#
124
star
7

inspect_hybridclr

深入剖析il2cpp及HybridCLR实现的技术专栏
114
star
8

huatuo

HybridCLR 是一个特性完整、零成本、高性能、低内存的近乎完美的Unity全平台原生c#热更方案。 HybridCLR is a fully featured, zero-cost, high-performance, low-memory solution for Unity's all-platform native c# hotfix
111
star
9

gidb

GiDB是一个极高性能的分布式内嵌对象数据库,相比redis性能提升一个以上数量级,同时提供完整的事务支持。游戏系统无状态化的高性能解决方案。
77
star
10

dhe_demo

Differential Hybrid Execution demo project
C#
26
star
11

hybridclr_test

HybridCLR test project
C#
14
star
12

luban_unity

unity package for luban
C#
11
star
13

behavior_tree

behavior tree implements like which in UE4
C#
10
star
14

VariableFrameHeader

以类似pb varint格式的length作帧头的无需提前知道body大小的O(1)额外移动开销的帧格式算法
C#
6
star
15

focus-creative-games.github.io

homepage
HTML
4
star
16

huatuo_upm

unity package for huatuo.
C#
2
star
17

lubandoc

luban document web site
HTML
2
star
18

focus-creative-games

HTML
1
star
19

hybridclr_benchmark

benchmark project for hybridclr
C#
1
star
20

hybridclr-doc

document for hybridclr
JavaScript
1
star
21

luban-doc

static document website for luban
JavaScript
1
star