{"id":28393552,"url":"https://github.com/pistondevelopers/ai_behavior","last_synced_at":"2025-06-26T11:32:24.803Z","repository":{"id":22531082,"uuid":"25871703","full_name":"PistonDevelopers/ai_behavior","owner":"PistonDevelopers","description":"AI behavior tree","archived":false,"fork":false,"pushed_at":"2023-03-04T19:28:47.000Z","size":168,"stargazers_count":71,"open_issues_count":2,"forks_count":12,"subscribers_count":40,"default_branch":"master","last_synced_at":"2025-06-24T21:51:36.972Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PistonDevelopers.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"bvssvni"}},"created_at":"2014-10-28T13:55:01.000Z","updated_at":"2025-05-09T22:07:53.000Z","dependencies_parsed_at":"2024-06-21T05:43:47.553Z","dependency_job_id":"a1795f52-4551-4a18-bfbf-57417ea99073","html_url":"https://github.com/PistonDevelopers/ai_behavior","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/PistonDevelopers/ai_behavior","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fai_behavior","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fai_behavior/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fai_behavior/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fai_behavior/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PistonDevelopers","download_url":"https://codeload.github.com/PistonDevelopers/ai_behavior/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PistonDevelopers%2Fai_behavior/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262056198,"owners_count":23251620,"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","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":"2025-05-31T16:38:42.120Z","updated_at":"2025-06-26T11:32:24.769Z","avatar_url":"https://github.com/PistonDevelopers.png","language":"Rust","funding_links":["https://github.com/sponsors/bvssvni"],"categories":[],"sub_categories":[],"readme":"ai_behavior [![Build Status](https://travis-ci.org/PistonDevelopers/ai_behavior.svg?branch=master)](https://travis-ci.org/PistonDevelopers/ai_behavior) [![Docs](https://docs.rs/piston-ai_behavior/badge.svg)](https://docs.rs/piston-ai_behavior)\n===========\n\nAI behavior tree\n\nYou can serialize the\nbehavior tree using [Serde](https://crates.io/crates/serde) and\ne.g. [Ron](https://crates.io/crates/ron).\n\n### What is an AI behavior tree?\n\nAn AI behavior tree is a kind of state machine logic for processes.\n\nMany things that a game logic does, e.g. controlling AI characters,\nfits the pattern of AI behavior trees.\n\nAn AI behavior tree is a very generic way of organizing interactive logic.\nIt has built-in semantics for processes that signals `Running`, `Success` or\n`Failure`.\n\nFor example, if you have a state `A` and a state `B`:\n\n- Move from state `A` to state `B` if `A` succeeds: `Sequence([A, B])`\n- Try `A` first and then try `B` if `A` fails: `Select([A, B])`\n- Do `B` repeatedly while `A` runs: `While(A, [B])`\n- Do `A`, `B` forever: `While(WaitForever, [A, B])`\n- Wait for both `A` and `B` to complete: `WhenAll([A, B])`\n- Wait for either `A` or `B` to complete: `WhenAny([A, B])`\n\nSee the `Behavior` enum for more information.\n\n### Parallel semantics\n\nThis library has parallel semantics for AI behavior trees.\nIt means that multiple processes can happen at the same time\nand the logic can be constructed around how these processes runs or terminate.\n\nFor example, `While(A, [B])` runs both `A` and `B` at the same time.\nIf either `A` or `B` fails, then the whole while-behavior fails.\n\nA property of AI behavior trees with parallel semantics is that you can\ncontrol termination conditions externally, as opposed to most\nprogramming languages where termination condition is controlled internally:\n\n```text\nwhile A() {\n    // This inner loop will never terminate unless `B` fails.\n    while true {\n      B();  // Runs `B` forever.\n    }\n}\n```\n\n```text\n// This will terminate if `A` stops running, which also stops `B`.\nWhenAny([A,\n  While(WaitForever, [\n    B\n  ])\n])\n```\n\n[How to contribute](https://github.com/PistonDevelopers/piston/blob/master/CONTRIBUTING.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpistondevelopers%2Fai_behavior","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpistondevelopers%2Fai_behavior","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpistondevelopers%2Fai_behavior/lists"}