{"id":15630292,"url":"https://github.com/mrgvsv/bevy_proto","last_synced_at":"2025-04-04T06:06:51.365Z","repository":{"id":41989981,"uuid":"423297083","full_name":"MrGVSV/bevy_proto","owner":"MrGVSV","description":"Create config files for entities in Bevy","archived":false,"fork":false,"pushed_at":"2023-10-04T04:42:42.000Z","size":680,"stargazers_count":241,"open_issues_count":10,"forks_count":25,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-04T05:49:10.851Z","etag":null,"topics":["bevy-engine","bevy-plugin","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MrGVSV.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-11-01T00:59:44.000Z","updated_at":"2025-03-30T02:19:21.000Z","dependencies_parsed_at":"2024-01-07T06:22:38.554Z","dependency_job_id":"d567b524-4823-488f-8c61-7335e7b4814a","html_url":"https://github.com/MrGVSV/bevy_proto","commit_stats":{"total_commits":103,"total_committers":7,"mean_commits":"14.714285714285714","dds":0.4271844660194175,"last_synced_commit":"5701889b805422ffec63a1907ee90a567dc59958"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGVSV%2Fbevy_proto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGVSV%2Fbevy_proto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGVSV%2Fbevy_proto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrGVSV%2Fbevy_proto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrGVSV","download_url":"https://codeload.github.com/MrGVSV/bevy_proto/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128750,"owners_count":20888235,"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":["bevy-engine","bevy-plugin","rust"],"created_at":"2024-10-03T10:31:20.089Z","updated_at":"2025-04-04T06:06:51.341Z","avatar_url":"https://github.com/MrGVSV.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bevy_proto\n\n[![Crates.io](https://img.shields.io/crates/v/bevy_proto)](https://crates.io/crates/bevy_proto)\n[![Docs](https://img.shields.io/docsrs/bevy_proto)](https://docs.rs/bevy_proto/latest/bevy_proto/)\n[![License](https://img.shields.io/crates/l/bevy_proto)](https://github.com/MrGVSV/bevy_proto/blob/main/License.md)\n\nSpawn entities in Bevy with a simple configuration file, similar to Unity's prefabs.\n\nThis crate can be used for:\n\n* Quick prototyping\n* Modding support\n* Data-defined behaviors\n\n## 📋 Features\n\n- **Define** entities easily with config files:\n\n  \u003e ```rust\n  \u003e (\n  \u003e   name: \"player\",\n  \u003e    schematics: {\n  \u003e     \"game::creature::Health\": (\n  \u003e       value: 100,\n  \u003e     ),\n  \u003e   },\n  \u003e )\n  \u003e ```\n\n- **Inherit** functionality from other prototypes:\n\n  \u003e ```rust\n  \u003e (\n  \u003e   name: \"Skeleton\",\n  \u003e   templates: [\"Enemy\", \"Creature\"],\n  \u003e   // ...\n  \u003e )\n  \u003e ```\n\n- **Setup** entire entity hierarchies:\n\n  \u003e ```rust\n  \u003e (\n  \u003e   name: \"Blaster\",\n  \u003e   schematics: {\n  \u003e     \"game::weapon::AmmoEntity\": (\n  \u003e       // Even reference other entities in the tree:\n  \u003e       entity: EntityPath(\"./@1\"),\n  \u003e     ),\n  \u003e   },\n  \u003e   children: [\"Scope\", \"AmmoPack\"]\n  \u003e )\n  \u003e ```\n\n- **Load** assets automatically:\n\n  \u003e ```rust\n  \u003e (\n  \u003e   name: \"Puppy\",\n  \u003e   schematics: {\n  \u003e     \"game::level::Level\": (\n  \u003e       // Load by path:\n  \u003e       background: AssetPath(\"textures/bg.png\"),\n  \u003e       // Or define assets inline:\n  \u003e       map: Asset((\n  \u003e         name: \"Level 1\",\n  \u003e         size: (20, 20),\n  \u003e         // ...\n  \u003e       ))\n  \u003e     ),\n  \u003e   },\n  \u003e )\n  \u003e ```\n\n- **Spawn!**\n\n  \u003e ```rust\n  \u003e fn spawn_player(mut commands: ProtoCommands) {\n  \u003e   commands.spawn(\"player\");\n  \u003e }\n  \u003e ```\n\n## 📲 Installation\n\nAdd the following to your `[dependencies]` section in `Cargo.toml`:\n\n```rust\nbevy_proto = \"0.11\"\n```\n\nOr use `cargo add`:\n\n```\ncargo add bevy_proto\n```\n\n## 📓 Examples\n\nCheck out the [examples](https://github.com/MrGVSV/bevy_proto/tree/main/examples) folder for examples and tutorials for\nusing the crate.\n\n## 🕊 Bevy Compatibility\n\n| bevy   | bevy_proto |\n|--------|------------|\n| 0.11.0 | 0.11.0     |\n| 0.10.1 | 0.10.0     |\n\nFor previous versions of this crate, see the [Previous Versions](#-previous-versions) section below.\n\n## 🥅 Goals\n\nThis crate is mostly feature-complete.\n\nThere are a few more things I think would be really nice to add. Below is a list of my current goals and what's been\naccomplished thus far:\n\n| Goal                                             | Status |\n|--------------------------------------------------|--------|\n| Reflection support                               | ✅      |\n| Nested prototypes                                | ✅      |\n| Package-specifier                                | 🚧     |\n| Configurable schematics filtering and processing | ✅      |\n| Prototype arguments                              | 🚧     |\n| Entity-less prototypes                           | ✅      |\n| Value access                                     | 🚧     |\n| Custom file format support                       | ✅     |\n| Improved documentation                           | 🚧     |\n| Benchmarks                                       | 🚧     |\n\n## 🕰 Previous Versions\n\nBefore version 0.8 of `bevy_proto`, this crate relied on the [`typetag`](https://github.com/dtolnay/typetag) crate. This\nallowed us to accomplish similar goals by using `serde`'\ns  [`Deserialize`](https://docs.rs/serde/latest/serde/trait.Deserialize.html) instead of `bevy`'s `FromReflect`. This\nwas nice in that it meant we could avoid having to register every type, but it had a few drawbacks.\n\nFor one, it had issues working on WASM, which made its usage platform-specific. Additionally, its life-before-main\nbehavior is not guaranteed to exist or work as intended by the Rust compiler, meaning it could suddenly stop working at\nsome future point in time.\n\nLastly, and most importantly, is that it's not the direction Bevy itself is currently taking. Bevy is building upon its\nreflection library, and much of the community is following the same. As this becomes more and more standard (especially\nwith an editor), it will just be better to lean into reflection.\n\nHowever, in the interest of allowing users to decide if they also want to make the switch, I have preserved the\noriginal `typetag`-based code under a new crate:\n\n[**`bevy_proto_typetag`**](https://github.com/MrGVSV/bevy_proto_typetag)\n\nI imagine the crate won't see many updates outside those to bump the Bevy version. I may come back to it to create a\nsimilar flow as this crate, but I'm not going to make any promises on that as I want this crate to be the main focus.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrgvsv%2Fbevy_proto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmrgvsv%2Fbevy_proto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmrgvsv%2Fbevy_proto/lists"}