{"id":19612555,"url":"https://github.com/chenjd/ttbt-framework","last_synced_at":"2025-07-24T10:09:49.917Z","repository":{"id":74015561,"uuid":"47612152","full_name":"chenjd/TTBT-Framework","owner":"chenjd","description":"可供Unity3D使用的行为树框架。TTBT is a C# framework for easily building and running behavior trees. Here, \"behavior tree\" refers to the technique used to control the behaviour of characters in games. ","archived":false,"fork":false,"pushed_at":"2015-12-09T07:51:57.000Z","size":11,"stargazers_count":19,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-02T10:03:08.021Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chenjd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-08T09:29:25.000Z","updated_at":"2023-04-17T18:06:33.000Z","dependencies_parsed_at":"2023-03-14T16:30:58.398Z","dependency_job_id":null,"html_url":"https://github.com/chenjd/TTBT-Framework","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chenjd/TTBT-Framework","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjd%2FTTBT-Framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjd%2FTTBT-Framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjd%2FTTBT-Framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjd%2FTTBT-Framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chenjd","download_url":"https://codeload.github.com/chenjd/TTBT-Framework/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chenjd%2FTTBT-Framework/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266824108,"owners_count":23990159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T10:47:03.141Z","updated_at":"2025-07-24T10:09:49.895Z","avatar_url":"https://github.com/chenjd.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# TTBT-Framework\n\n\n##What's TingTing Behaviour Trees?\n----------\n\n**TTBT-Framework** is a C# framework for building and running behaviour trees.It provides structures and algorithms that assist you in the task of creating intelligent agents for your game or application. \nThe defination of behavior trees is based on the paper([Towards a Unified Behavior Trees Framework for Robot Control][1]).\n\n\n##The Structure of TTBT-Framework\n\n\n----------\n\n\nTTBT-Framework has the following structure:\n\n    .\n    ├── .gitignore                    \n    ├── README.md\n    ├── Src                        // sources \n    │   ├── Base                   // base    \n    │   |   ├── Blackboard.cs\n    │   |   ├── NodeState.cs\n    │   |   ├── Tick.cs\n    │   |   └── Utilities.cs\n    │   ├── Node                  //node defination\n    │   |   ├── BaseNode.cs       //base class for all nodes\n    │   |   ├── Composite         //composite node\n    |   │   |   ├── _Composite.cs    //base class for composite nodes\n    |   │   |   ├── Priority.cs\n    |   │   |   └── Sequence.cs\n    │   |   ├── Decorator         //decorator node\n    |   │   |   ├── _Decorator.cs   //base class for decorator nodes\n    |   │   |   └── Inverter.cs   //an example of decorator\n    │   |   └── Leaf\n    |   |       ├── _Leaf.cs\n    |   |       ├── Action.cs   //base class for action nodes\n    |   |       └── Condition.cs    //base class for condition nodes\n    |   └── Tree\n    │       └── BehaviorTree.cs\n    └── Test                    //test folder        \n        └── TTBTTest.cs \n\n\n**NOTE:   The test depends on Unity3D.**\n\n##How to use TTBT-Framework\n\n\n----------\n\n\nTTBT-Framework supplys several composite, decorator and leaf nodes. You still can define your own nodes.It's simple.\n\n1. Create action or condition nodes, inheriting from Action or Condition.\n2. Create a behavior tree and set the root node to the tree.\n3. Create a blackboard.\n\nThere is a sample on Unity3D.\n\n\n        //structure of the tree\n        \n                          Priority(root)\n                           /            \\\n                          /              \\\n                         /                \\\n                  Sequence1                Sequenc2\n                  /    |   \\                /     \\\n                 /     |    \\              /       \\\n                /      |     \\            /         \\\n           Condition1 Action1 Action2 Action3      Action4\n      \n      \n\n\n----------\n\n\n      //sample code \n      List\u003cBaseNode\u003e children1 = new List\u003cBaseNode\u003e(){new Condition1(), new Action1(), new Action2()};\n      List\u003cBaseNode\u003e children2 = new List\u003cBaseNode\u003e(){new Action3()};\n      \n      //create sequence node as root\n      Sequence snode1 = new Sequence(children1);\n      Sequence snode2 = new Sequence(children2);\n\n      //create priority node as root\n      Priority pnode = new Priority(new List\u003cBaseNode\u003e() { snode1, snode2});\n\n      //create bt\n      this.bt = new BehaviorTree(pnode);\n\n      //create bb\n      this.bb = new Blackboard();   \n\n\n----------\n\n\n \n       \n![此处输入图片的描述][2]   \n       \n  [1]: http://www.csc.kth.se/~miccol/Michele_Colledanchise/Publications_files/2013_ICRA_mcko.pdf\n  [2]: http://images.cnblogs.com/cnblogs_com/murongxiaopifu/660764/o_TTBTTest.gif","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenjd%2Fttbt-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchenjd%2Fttbt-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchenjd%2Fttbt-framework/lists"}