{"repo":"tbillington/bevy_best_practices","free":true,"listed":false,"github":"https://github.com/tbillington/bevy_best_practices","clone":"git clone https://github.com/tbillington/bevy_best_practices.git","description":"An opionated set of Best Practices for the Bevy game engine","language":"Rust","stars":439,"topics":["best-practices","bevy","ecs","game-development","guide","rust"],"license":"Apache-2.0","category":"game-templates","readme_excerpt":"Bevy Best Practices An opionated set of conventions for Bevy projects. Table of Contents - Entities - Name and Cleanup - Strong IDs - System Scheduling - Update systems should be bounded - Co-locate system registration for the same State - Events - Prefer Events for structuring logic and systems - Explicit ordering - Explicit event handling system run criteria - Helpers - Cleanup - Getter Macros - Project Structuring - Prelude - Plugins - Performance - Builds - Development - Release - Distribution - License - Your contributions Entities Name and Cleanup All top-level entities must be spawned with a Name and cleanup component at the front of the bundle. It's expected that child entities don't need a cleanup component as it will be handled by the parent. Names assist with debugging. Cleanup components indicate to which state the entity belongs, and to remove it upon exit of that state. By always having these two \"meta\" components at the front it makes it easy to spot entities where they are missing. As of bevy 0.14 you can now use StateScoped components which fulfill a similar role. You can read more about the cleanup pattern I'm using in the bevy cheatbook. Strong IDs For things in your game that should persist between saving/loading, and networking, use your own ID type over Entity . Entity is more akin to a pointer, it is not to be relied upon for referencing something across sessions or over the network. Here is an example of making a strong ID type for quests. Keeping the ","default_branch":null,"files":null,"tree":[],"storefront":"/r/tbillington","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/tbillington/bevy_best_practices/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}