Przejdź do treści
Biblioteka skilli
Programowanie · Nauka i wyjaśnianie

bevy-core-concepts

/bevy-core-concepts

Wyjaśnia podstawy Bevy 0.19: składanie App i Plugin, wybór między Update a FixedUpdate, kolejność Startup, PreUpdate i PostUpdate, systemy wyłączne oraz graf harmonogramu.

Repozytorium
bevy-skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
25.08.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 25.08.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wyjaśnia podstawy Bevy 0.19: składanie App i Plugin, wybór między Update a FixedUpdate, kolejność Startup, PreUpdate i PostUpdate, systemy wyłączne oraz graf harmonogramu.

Oryginalny opis (EN)

Use when wiring up an `App`, writing a `Plugin`, choosing between `Update` and `FixedUpdate`, ordering `Startup`/`PreUpdate`/`PostUpdate`, or writing an exclusive system (`fn(&mut World)`) in Bevy 0.19. Covers the schedule graph, run order, and the `SimpleExecutor` removal.

Jak działa

  1. When to use this skill
  2. Canonical pattern
  3. Schedule cheat sheet
  4. Bevy 0.19 gotchas
  5. See also
Sekcje z nagłówków SKILL.md, w oryginale · 101 linii, 535 słów
Podgląd SKILL.md
---
name: bevy-core-concepts
description: Use when wiring up an `App`, writing a `Plugin`, choosing between `Update` and `FixedUpdate`, ordering `Startup`/`PreUpdate`/`PostUpdate`, or writing an exclusive system (`fn(&mut World)`) in Bevy 0.19. Covers the schedule graph, run order, and the `SimpleExecutor` removal.
license: MIT
compatibility: opencode,claude-code,cursor
metadata:
  tier: "1"
  area: ecs
  bevy_version: "0.19"
---

# Bevy 0.19 — Core concepts (App, Plugin, Schedule, World)

## When to use this skill

- Setting up a new Bevy app or library plugin.
- Deciding which schedule (`Startup`, `Update`, `FixedUpdate`, `PostUpdate`, ...) a system belongs in.
- Writing an exclusive system that needs `&mut World`.
- Hitting schedule cycles, elevated ambiguity diagnostics, or deferred-command order bugs.
- Asking "where should X run?"

## Canonical pattern

```rust
use bevy::prelude::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugins(GamePlugin)
        .run();
}

pub struct GamePlugin;

impl Plugin for GamePlugin {
    fn build(&self, app: &mut App) {
        app.insert_resource(Score(0))
            .add_systems(Startup, spawn_world)
            .add_systems(Update, (read_input, apply_gravity).chain())
            .add_systems(FixedUpdate, simulate_physics)
            .add_systems(PostUpdate, sync_transforms);
    }
}

#[derive(Resource)]
struct Score(u32);

fn spawn_world(mut commands: Commands) {
    commands.spawn((Camera3d::default(), Transform::from_xyz(0.0, 4.0, 8.0)));
}

fn read_input(_keys: Res<ButtonInput<KeyCode>>) {}
fn apply_gravity(_t: Res<Time>) {}
fn simulate_physics(_t: Res<Time<Fixed>>) {}
fn sync_transforms(_q: Query<&mut Transform>) {}

// Exclusive system — full mutable World access, runs alone.
fn rebuild_index(world: &mut World) {
    let count = world.entities().len();
    world.insert_resource(EntityCount(count));
}

#[derive(Resource)]
struct EntityCount(u32);
```

## Schedule cheat sheet

| Schedule | Use for |
|---|---|
| `Startup` | One-shot setup. Runs once before `Update`. |
| `PreUpdate` | Reading input, networking ingress, frame-start bookkeeping. |
| `Update` | Per-frame game logic. Runs at render rate. **Default for game systems.** |
| `PostUpdate` | Reactive bookkeeping after `Update` (transform propagation lives here). |
| `Last` | Anything that must run after `PostUpdate` (rare). |
| `FixedFirst` / `FixedPreUpdate` / `FixedUpdate` / `FixedPostUpdate` / `FixedLast` | Deterministic, tick-rate work: physics, networking simulation, gameplay state. Runs zero or more times per render frame to catch up to `Time<Fixed>`. |

**Rule of thumb:** if a system must produce the same result for the same inputs regardless of frame rate, put it in `FixedUpdate`. Otherwise `Update`.

## Bevy 0.19 gotchas

- **`SimpleExecutor` was removed.** It used to apply deferred commands after every
  system. The remaining executors use dependency information to place
  `ApplyDeferred`; add `.before`, `.after`, or `.chain()` when downstream systems must
  see commands in the same schedule. Shared mutable access is serialized, but does
  not by itself define which system goes first.
- **`ScheduleBuildError` variants were renamed.** If you `match` on them, update: `HierarchyLoop` → `HierarchySort(DiGraphToposortError::Loop(...))`, `DependencyCycle` → `DependencySort(DiGraphToposortError::Cycle(...))`.
- **Executor configuration takes an executor value in 0.19.** Replace
  `set_executor_kind(ExecutorKind::SingleThreaded)` with
  `set_executor(SingleThreadedExecutor::new())` (or
  `MultiThreadedExecutor::new()` / `default_executor()`).
- **Resources implement `Component` in 0.19.** Generic bounds that used `Resource` only to exclude components no longer do so; audit broad component queries and generic APIs.
- **`State::set()` now always triggers a transition** — even if the requested state equals the current one. Use `next_state.set_if_neq(...)` for the old "no-op when equal" behavior.
- Don't put render-world passes in `Update`. Main-world components may prepare
  render data there, but GPU passes belong in render schedules. See `bevy-rendering`.
- Exclusive systems block everything in their schedule — use them only when you really need `&mut World` (scene loading, batch reflection, schema migrations).

## See also

- [`bevy-ecs-systems`](../bevy-ecs-systems/SKILL.md) — params, sets, conditions,
  ordering, and ambiguity diagnostics.
- [`bevy-ecs-components`](../bevy-ecs-components/SKILL.md) — entity data.
- [`bevy-rendering`](../bevy-rendering/SKILL.md) — render schedules and systems.
- [`bevy-physics`](../bevy-physics/SKILL.md) — Rapier schedule placement and
  `PhysicsSet` ordering.
- [`bevy-input-actions`](../bevy-input-actions/SKILL.md) — frame input transfer into fixed ticks.
- [`bevy-testing`](../bevy-testing/SKILL.md) — controlled `App` stepping and manual time.
- [`bevy-migration-0-18-to-0-19`](../bevy-migration-0-18-to-0-19/SKILL.md) — executor
  instances and resources-as-components.

Wersje

RepozytoriumWynikLicencja
Ta strona · chrisgliddon/bevy-skills100MIT
ianpurton/disposable-heroes100MIT

Migawka bazy z 13.11.2026 · wersja paczki a955909db656 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 1 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100bevy
    Kieruje zadania Bevy 0.20 do właściwego podskilla, pilnuje wyboru Update lub FixedUpdate i flag funkcji Cargo.
  • 100bevy
    Kieruje do właściwej umiejętności Bevy 0.19 i przypina wersję silnika, przy wyborze między Update a FixedUpdate oraz flag Cargo, ECS, zasobów, renderowania lub migracji.
  • 100bevy-testing-patterns
    Testuje logikę harmonogramu Bevy przez cargo test, MinimalPlugins i app.update(), w testach jednostkowych systemów, zasobów i kolejności .chain().
  • 100bevy-game-loop-time-trial
    Buduje w Bevy 0.20 wyścig na czas jako dane ECS: jeden zasób z zegarem, bramki międzyczasów i meta połączone przez chain, podczas gdy ruch idzie w FixedUpdate.
  • 100bevy-testing
    Testuje Bevy 0.19 przez App::update, TimeUpdateStrategy, FixedUpdate, MessageCursor i On<E>: deterministyczne kroki, opróżnianie zadań async bez sleepów, światy headless i regresję wizualną z przechwytywaniem obrazu.
  • 100bevy-testing
    Testuje Bevy 0.20 deterministycznie: krokowanie aplikacji, zadania asynchroniczne, światy bez ekranu i testy wizualne.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.