Bash.tv → GitHub → itch.io

Experience, levelling and skill trees. XP curves (linear, power, exponential) and how they feel, levelling up with carry-over and several levels at once, max level, XP sources and pacing, stat growth per level, skill trees with prerequisites, ranks, exclusive choices, respec and validation, level-up feedback, and saving progress. Includes tested progression.js. Use for "add XP / levels / skill ...

Download skill (.zip) Files on GitHub

Level progression

Drop-in: assets/progression.js (tests: multi-level gains with carry-over, progress fraction, max-level cap, skill prerequisites by rank, exclusive choices, respec refunds, tree validation catches loops and missing nodes).

import { Level, xpCurve, statAt, SkillTree } from "./core/progression.js";
const lvl = new Level(xpCurve.power(100, 1.5), { maxLevel: 30, onLevelUp: (L) => { points++; celebrate(L); } });
lvl.add(enemy.xp);                  // returns levels gained; lvl.progress → 0..1 for the XP bar
player.maxHp = statAt(100, 12, lvl.level);
const tree = new SkillTree({
  toughness: { cost: 1, maxRank: 3, mods: { maxHp: 10 } },
  dash:      { cost: 2, requires: ["toughness"], requiresRank: { toughness: 2 } },
  fire:      { cost: 1, excludes: ["ice"], mods: { fireDmg: 5 } }, ice: { cost: 1, excludes: ["fire"], mods: { slow: 0.2 } },
});
console.assert(tree.validate().length === 0, tree.validate());
tree.unlock("toughness", wallet /* { points, level } */);  const mods = tree.mods();

Pacing

Curve Feel Use
linear Steady Short games, arcade
power (exp 1.3–1.8) Classic RPG: fast early, slower later Most games
exponential (×1.1–1.3) Very steep late Idle games (with growing income)

Skill trees

Feedback

Level-up: sound, burst, a short banner (“Level 5!”), and a clear “+1 skill point” with a button that opens the tree. Don’t interrupt combat with menus; queue them.

Roguelites

Separate run progression (resets each run) from meta progression (saved). Meta upgrades should widen options more than they raise raw power.