Skip to content
crates · rust · bevy

Skill progression forbevy_skills

A skill-progression crate for Bevy — per-entity XP, levels, and skill checks in a pure-Rust core, with an optional Bevy ECS plugin and event pipeline layered on top.

Pure-Rust core, optional Bevy

The core is plain Rust with a quadratic XpCurve, SkillRegistry, and SkillProfile, so it also serves FFI cdylibs and headless consumers with zero Bevy dependency.

  • Core — XP, levels, and skill checks in plain Rust.
  • bevy feature — optional ECS plugin, on by default.
RustBevy crate
2024Edition
game-devCategories
MITLicense

What it gives you

Features

Skill catalogue

SkillRegistry, SkillDef, and SkillId register named skills with a category and optional icon.

Per-entity state

SkillProfile and SkillEntry track XP and level per entity.

Quadratic XP curve

XpCurve is configurable per skill.

Message pipeline

(bevy feature) GrantXpMsg, LevelUpMsg, SkillCheckMsg, and SkillCheckResultMsg drive a publish/subscribe flow.

Optional Bevy plugin

BevySkillsPlugin registers resources, messages, and systems. The bevy feature is on by default and can be disabled so the crate compiles with zero Bevy dependency for FFI and headless use.

Get started

Usage

main.rs
use bevy::prelude::*;
use bevy_skills::{BevySkillsPlugin, SkillRegistry, SkillDef, GrantXpMsg, LevelUpMsg};

App::new()
    .add_plugins(BevySkillsPlugin)
    .add_systems(Startup, |mut registry: ResMut<SkillRegistry>| {
        registry.register(SkillDef {
            r#ref: "mining".into(),
            name: "Mining".into(),
            xp_curve: None,
            category: "gathering".into(),
            icon: None,
        });
    });

Questions

Frequently asked

What does the bevy_skills crate do?

bevy_skills is a skill-progression system for games. It tracks per-entity skill XP and levels, fires events on level-up, and provides skill checks for gating interactions such as mining, woodcutting, cooking, smithing, alchemy, and combat.

Can bevy_skills be used without Bevy?

Yes. The core is plain Rust with a quadratic XpCurve, SkillRegistry, and SkillProfile and has zero Bevy dependency. The optional bevy feature (on by default) adds the BevySkillsPlugin, Component and Message derives, and the ECS systems, and can be disabled for FFI cdylibs and headless consumers.

How does XP progression work in bevy_skills?

Each skill uses a configurable quadratic XpCurve. Sending a GrantXpMsg for an entity and skill adds XP; when a threshold is crossed the crate emits a LevelUpMsg, and SkillCheckMsg / SkillCheckResultMsg gate interactions by level.