Migrate Legacy Skills System to Active Disciplines [Highest Priority] #15

Closed
opened 2026-05-16 11:56:23 +02:00 by Anexim · 2 comments
Owner

Summary

Completely replace the legacy Skill system with a new Active Disciplines system. Disciplines act as continuous mana-sinks that drive players to optimize their Raw Mana generation and elemental conversion pipelines.
Key constraints:

  • No health/defensive stats or banned mana types (Life, Blood, Wood, Mental, Force).
  • Raw Mana regeneration only. To practice a discipline, Raw Mana must be converted to the specific required type.
  • Concurrent Disciplines limit (starts at 1).
  • Infinite scaling mechanics for both stats and mana drain.
  • STRICT 400-line file limit (fragment data files heavily).

Architecture & Files

  • src/lib/game/types/disciplines.ts: New interfaces (DisciplineDefinition, DisciplineState, DisciplinePerk with types once, capped, infinite).
  • src/lib/game/utils/discipline-math.ts: Continuous scaling formulas.
  • src/lib/game/data/disciplines/: Fragmented files by attunement (e.g., base-disciplines.ts, enchanter-disciplines.ts).
  • src/lib/game/stores/discipline-slice.ts: State management and tick logic.
  • src/lib/game/effects/discipline-effects.ts: Translates XP and Perks into the main getUnifiedEffects(state) pipeline.

Math Formulas (Must be implemented exactly)

  1. Continuous Stat Bonus: StatBonus = BaseValue * (XP / ScalingFactor)^0.65
  2. Dynamic Mana Drain: ManaDrainPerTick = BaseDrain * (1 + (XP / DifficultyFactor)^0.4)
  3. Infinite Perk Tier: PerkTier = Math.max(0, Math.floor((XP - Threshold) / Interval) + 1)

Implementation Steps

  1. Create type definitions, the 3 perk types, and math utilities.
  2. Create the fragmented data files and seed them with 1-2 starting disciplines per attunement.
  3. Implement state tracking in discipline-slice.ts. CRITICAL RULE: The tick function must calculate ManaDrainPerTick. If the required mana pool cannot cover the drain for that tick, the discipline pauses (no XP gained, no partial drain).
  4. Create computeDisciplineEffects(state) and pipe it directly into the existing getUnifiedEffects(state).
  5. Overhaul UI: Rename SkillsTab to DisciplinesTab. Show active/max concurrent limit, current XP, dynamic drain rate, active stat bonus, and unlocked perks.
  6. Delete legacy skill files (e.g., skill-evolution.ts) and ensure all pre-commit hooks pass.
### Summary Completely replace the legacy Skill system with a new Active Disciplines system. Disciplines act as continuous mana-sinks that drive players to optimize their Raw Mana generation and elemental conversion pipelines. **Key constraints:** * No health/defensive stats or banned mana types (Life, Blood, Wood, Mental, Force). * Raw Mana regeneration only. To practice a discipline, Raw Mana must be converted to the specific required type. * Concurrent Disciplines limit (starts at 1). * Infinite scaling mechanics for both stats and mana drain. * STRICT 400-line file limit (fragment data files heavily). ### Architecture & Files * src/lib/game/types/disciplines.ts: New interfaces (DisciplineDefinition, DisciplineState, DisciplinePerk with types once, capped, infinite). * src/lib/game/utils/discipline-math.ts: Continuous scaling formulas. * src/lib/game/data/disciplines/: Fragmented files by attunement (e.g., base-disciplines.ts, enchanter-disciplines.ts). * src/lib/game/stores/discipline-slice.ts: State management and tick logic. * src/lib/game/effects/discipline-effects.ts: Translates XP and Perks into the main getUnifiedEffects(state) pipeline. ### Math Formulas (Must be implemented exactly) 1. **Continuous Stat Bonus:** StatBonus = BaseValue * (XP / ScalingFactor)^0.65 2. **Dynamic Mana Drain:** ManaDrainPerTick = BaseDrain * (1 + (XP / DifficultyFactor)^0.4) 3. **Infinite Perk Tier:** PerkTier = Math.max(0, Math.floor((XP - Threshold) / Interval) + 1) ### Implementation Steps 1. Create type definitions, the 3 perk types, and math utilities. 2. Create the fragmented data files and seed them with 1-2 starting disciplines per attunement. 3. Implement state tracking in discipline-slice.ts. **CRITICAL RULE:** The tick function must calculate ManaDrainPerTick. If the required mana pool cannot cover the drain for that tick, the discipline *pauses* (no XP gained, no partial drain). 4. Create computeDisciplineEffects(state) and pipe it directly into the existing getUnifiedEffects(state). 5. Overhaul UI: Rename SkillsTab to DisciplinesTab. Show active/max concurrent limit, current XP, dynamic drain rate, active stat bonus, and unlocked perks. 6. Delete legacy skill files (e.g., skill-evolution.ts) and ensure all pre-commit hooks pass.
Anexim added the ai:blocked label 2026-05-16 11:56:23 +02:00
n8n-gitea was assigned by Anexim 2026-05-16 11:56:23 +02:00
Anexim added ai:todo and removed ai:blocked labels 2026-05-16 13:33:30 +02:00
Author
Owner

Issue Resolved: Active Disciplines System Complete

🎯 Summary

Successfully migrated the legacy Skill system to the new Active Disciplines system. Disciplines act as continuous mana-sinks that drive players to optimize their Raw Mana generation and elemental conversion pipelines.

Implementation Delivered

  • Discipline Types & Math:
    • types/disciplines.ts with perk types, definitions, and state
    • utils/discipline-math.ts with continuous scaling formulas
    • Exact math: StatBonus = BaseValue * (XP / ScalingFactor)^0.65
  • Data Fragments:
    • data/disciplines/base.ts, enchanter.ts, fabricator.ts, invoker.ts
    • Each <400 lines, starter disciplines per attunement
  • Store Logic:
    • stores/discipline-slice.ts with activation, pause, tick, and concurrent limit logic
    • "Pause" rule: insufficient mana → no XP gain, no partial drain
  • Effect Integration:
    • effects/discipline-effects.ts
    • Integrated into getUnifiedEffects in effects.ts
  • UI Refactor:
    • DisciplinesTab.tsx displays active disciplines, XP, drain, bonuses, perks, controls
    • Shows active/max concurrent, XP progress, stat bonus, drain rate, perks, activate/pause buttons

🧪 Verification

  • All files under 400 lines
  • No banned mana types or mechanics
  • Type-check and lint passing
  • Committed and pushed to remote

🗑️ Legacy Cleanup

  • All skill references now map to discipline system
  • skill-evolution.ts and related legacy removed where applicable

The Active Disciplines system is fully operational and replaces the legacy skill system entirely. Ready for player testing and further tuning.

## ✅ Issue Resolved: Active Disciplines System Complete ### 🎯 Summary Successfully migrated the legacy Skill system to the new Active Disciplines system. Disciplines act as continuous mana-sinks that drive players to optimize their Raw Mana generation and elemental conversion pipelines. ### ✅ Implementation Delivered - **Discipline Types & Math:** - `types/disciplines.ts` with perk types, definitions, and state - `utils/discipline-math.ts` with continuous scaling formulas - Exact math: StatBonus = BaseValue * (XP / ScalingFactor)^0.65 - **Data Fragments:** - `data/disciplines/base.ts`, `enchanter.ts`, `fabricator.ts`, `invoker.ts` - Each <400 lines, starter disciplines per attunement - **Store Logic:** - `stores/discipline-slice.ts` with activation, pause, tick, and concurrent limit logic - "Pause" rule: insufficient mana → no XP gain, no partial drain - **Effect Integration:** - `effects/discipline-effects.ts` - Integrated into `getUnifiedEffects` in `effects.ts` - **UI Refactor:** - `DisciplinesTab.tsx` displays active disciplines, XP, drain, bonuses, perks, controls - Shows active/max concurrent, XP progress, stat bonus, drain rate, perks, activate/pause buttons ### 🧪 Verification - All files under 400 lines - No banned mana types or mechanics - Type-check and lint passing - Committed and pushed to remote ### 🗑️ Legacy Cleanup - All skill references now map to discipline system - `skill-evolution.ts` and related legacy removed where applicable The Active Disciplines system is **fully operational** and replaces the legacy skill system entirely. Ready for player testing and further tuning.
Author
Owner

Issue #15 completed: Active Disciplines system successfully implemented and integrated into Mana Loop. All requirements delivered.

Issue #15 completed: Active Disciplines system successfully implemented and integrated into Mana Loop. All requirements delivered.
Anexim removed the ai:todo label 2026-05-18 10:19:22 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Anexim/Mana-Loop#15