Skip to content
Viewing as a member
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 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.

XP curves

XpCurve is configurable per skill — quadratic by default, polynomial for professiondb-authored curves.

Practice and standing

Practice says what a level comes to at one action — whether it still teaches, fades, or is outgrown, and how much faster and less wasteful a practised hand is.

Professions feature

(professions feature) register_professions seeds the registry from bevy_items' professiondb, and level_in reads a level by the profession's own curve.

Message pipeline

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

Optional Bevy plugin

BevySkillsPlugin registers resources, messages, and systems, ordered by the exported SkillSystems sets. 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 — XpCurve, SkillRegistry, SkillProfile, and Practice — with 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 an XpCurve — quadratic by default (99-level cap), or polynomial for curves authored in professiondb. 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.

Discuss on the forum

Questions, fixes and notes on this page live in the KBVE forum.