TL;DR: Bevy is the most popular open-source game engine written in Rust. It uses an Entity Component System (ECS) architecture where game logic is expressed as systems (functions) that query and transform components (data) attached to entities (IDs). Bevy is data-oriented, highly parallel by default, and refreshingly free of inheritance hierarchies. It runs on Windows, macOS, Linux, and WASM (in-browser). As of 2025, Bevy is pre-1.0 but production-used for many indie games.
What Is Bevy?
Bevy is a Rust game engine built around the ECS pattern; instead of class hierarchies, you attach components (data) to entities, and systems (functions) process matching entities.
The three core primitives:
| Primitive | What it is | Example |
|---|---|---|
| Entity | A unique ID (like a database row) | Player #42 |
| Component | Data attached to an entity | Position, Health, Sprite |
| System | A function that queries entities | move_players, apply_gravity |
# Cargo.toml
[dependencies]
bevy = "0.15"How Does a Basic Bevy App Look?
use bevy::prelude::*;
// Components are plain Rust structs
#[derive(Component)]
struct Player;
#[derive(Component)]
struct Velocity(Vec2);
#[derive(Component)]
struct Health(f32);
fn main() {
App::new()
.add_plugins(DefaultPlugins) // window, renderer, input, etc.
.add_systems(Startup, spawn_player) // runs once at start
.add_systems(Update, ( // runs every frame
move_player,
check_health,
))
.run();
}
// System: spawns the player entity with components
fn spawn_player(mut commands: Commands) {
commands.spawn((
Player,
Velocity(Vec2::new(100.0, 0.0)),
Health(100.0),
Transform::default(),
));
}
// System: queries all entities with Player + Velocity + Transform
fn move_player(
time: Res<Time>,
mut query: Query<(&Velocity, &mut Transform), With<Player>>,
) {
for (velocity, mut transform) in &mut query {
transform.translation.x += velocity.0.x * time.delta_secs();
transform.translation.y += velocity.0.y * time.delta_secs();
}
}
fn check_health(query: Query<&Health, With<Player>>) {
for health in &query {
if health.0 <= 0.0 {
println!("Player is dead!");
}
}
}What Makes Bevy's ECS Fast?
Bevy's ECS stores components in contiguous memory (archetype-based storage) and runs systems in parallel automatically; systems that access different components run concurrently.
// These two systems run in parallel; no shared mutable access
fn move_enemies(mut query: Query<&mut Transform, With<Enemy>>) { /* ... */ }
fn update_ui(mut query: Query<&mut Text, With<ScoreDisplay>>) { /* ... */ }
// This system waits for move_enemies; shares Transform
fn detect_player_collision(
players: Query<&Transform, With<Player>>,
enemies: Query<&Transform, With<Enemy>>,
) { /* ... */ }Bevy's scheduler detects data dependencies and parallelizes automatically; no manual threading needed.
What Does the Bevy Ecosystem Include?
- Rendering: 2D sprites, 3D PBR renderer, camera, lighting
- Input: keyboard, mouse, gamepad, touch
- Audio: spatial audio, volume control
- Assets: hot-reload images, sounds, scenes, GLTF models
- UI: Bevy UI (flex-based), text rendering
- Animation: skeletal, sprite sheet
- Physics: via
bevy_rapieroravian(third-party) - WASM: run Bevy games in the browser via WebAssembly
Frequently Asked Questions
Bevy is pre-1.0 (as of 2025) and has breaking changes between releases. Many indie games have shipped with Bevy, but API stability is not guaranteed yet. Small-to-medium games are a great fit; large productions should evaluate the churn risk.
Bevy has no editor (yet). Unity/Godot have mature editors, asset stores, and larger ecosystems. Bevy offers more control, Rust's safety guarantees, and better performance in ECS-heavy scenarios. Godot has Rust bindings (godot-rust) if you want an editor with Rust scripting.
Yes; Bevy has no scripting language. Game logic is written entirely in Rust. It is a good way to learn Rust through game development, but you'll need to get comfortable with the language.
Plugins are bundles of systems, resources, and components registered on App. They're the primary way to organize Bevy code and the mechanism by which third-party crates (physics, networking, etc.) integrate with Bevy.
Sources
Related Glossary Terms
- WASM: Bevy games can run in the browser via WASM
- Rayon: Bevy uses similar data-parallel patterns
- Struct: Components are plain Rust structs
Keep Reading
- Rust Bevy Game Engine 2026: comprehensive guide to building games with Bevy
- Rust for Game Development: comparing Bevy to other game engines
- Rust vs C++: why Rust is displacing C++ in game engine development
.avif)
