Bevy TLDR – Game development with Bevy summarized
a day ago
- #rust
- #game-development
- #ecs
- Bevy is a modular, high-performance Entity-Component-System (ECS) game engine built in Rust.
- Entities in Bevy are identifiers for rows in an in-memory database, while components are columns.
- Components can have life-cycle hooks (on_add, on_insert, on_replace, on_remove, on_despawn) for side effects.
- Resources are special components without an entity, providing convenient access in systems.
- Systems in Bevy are Rust functions that can only have parameters implementing SystemParam.
- Commands are used to change the state of the World efficiently, enqueuing changes for the next schedule.
- Apps coordinate systems through schedules (Startup, Update, FixedUpdate) and can manage different states.
- Plugins group related functionality and can be added to an App to extend its capabilities.
- Queries allow systems to access components of entities, with filters for specific conditions.
- Assets are loaded asynchronously via the AssetServer, with support for events and state tracking.
- Messages and Events facilitate communication between systems, with Messages being buffered and Events immediate.
- Relationships in Bevy are managed through components like ChildOf and Children for parent-child hierarchies.
- Input handling in Bevy supports keyboard, mouse, gamepad, and touch inputs through resources like ButtonInput.
- Cameras in Bevy manage render targets, projections, and view positions, with 2D and 3D variants.
- UI in Bevy is built using nodes with flexbox or CSS grid layouts, and supports interactivity through Interaction components.
- Timers in Bevy can be one-shot or repeating, and are used to trigger actions after a duration.
- Audio in Bevy is handled through AudioSource and AudioSink, with support for playback controls and spatial audio.
- Scenes in Bevy allow for serialization and deserialization of entities and components into files.
- Physics in Bevy is not built-in but can be added via plugins like Avian, supporting rigid bodies and collisions.