Implement 5 discipline root definitions: Combat, Survival, Crafting, Social, Magic #228

Open
opened 2026-03-16 01:40:13 +00:00 by freemo · 0 comments
Owner

Metadata

Key Value
Parent Epic #223 — Skill Tree Data Model & Storage
Legendary #198 — Character Progression & Skills
Branch feature/m4-discipline-root-definitions
Commit Message feat(skills): implement 5 discipline root definitions in YAML config
Points 5
Priority High
MoSCoW Must Have

Background and Context

Every character in Aethyr begins with access to five root disciplines: Combat, Survival, Crafting, Social, and Magic. These root nodes are tier-0 entries in the skill tree — they have no prerequisites and are automatically available at character creation.

The root definitions serve as the anchor points for all sub-trees. They must be stored in a YAML configuration file (conf/skill_trees.yaml) so that game designers can modify the tree structure without changing code. A loader class will parse this YAML and instantiate SkillNode and SkillTree objects.

This issue also establishes the YAML schema convention that all subsequent discipline tree issues will follow.

Expected Behavior

  1. YAML Configuration File at conf/skill_trees.yaml:

    disciplines:
      combat:
        name: Combat
        description: "The art of physical conflict and martial prowess."
        tier: 0
        prerequisites: []
        xp_required: 10000
        max_level: 10
      survival:
        name: Survival
        description: "Skills for enduring and thriving in the wilderness."
        tier: 0
        prerequisites: []
        xp_required: 10000
        max_level: 10
      crafting:
        name: Crafting
        description: "The creation and enhancement of items and equipment."
        tier: 0
        prerequisites: []
        xp_required: 10000
        max_level: 10
      social:
        name: Social
        description: "Influence, persuasion, and interpersonal mastery."
        tier: 0
        prerequisites: []
        xp_required: 10000
        max_level: 10
      magic:
        name: Magic
        description: "The study and channeling of arcane forces."
        tier: 0
        prerequisites: []
        xp_required: 10000
        max_level: 10
    
  2. SkillTreeLoader class at lib/aethyr/core/skills/skill_tree_loader.rb:

    • load(path = "conf/skill_trees.yaml") — reads and parses the YAML, returns a SkillTree instance.
    • Validates YAML structure on load.
    • Raises SkillTreeLoader::InvalidConfigError for malformed YAML.
  3. Character Creation Integration:

    • On character creation, player.info["skills"] is initialized with all 5 root disciplines at level 0, xp 0.
    • Root nodes are always shown as "available" in check_unlockable.

Acceptance Criteria

  • conf/skill_trees.yaml exists with all 5 root discipline definitions.
  • SkillTreeLoader class exists at lib/aethyr/core/skills/skill_tree_loader.rb.
  • SkillTreeLoader.load returns a valid SkillTree with 5 root nodes.
  • Each root node has tier: 0, empty prerequisites, xp_required: 10000, max_level: 10.
  • YAML validation catches missing required fields and raises InvalidConfigError.
  • New characters receive all 5 root disciplines in player.info["skills"].
  • SkillTree#root_nodes returns exactly the 5 discipline roots.

Subtasks

  • Create conf/skill_trees.yaml with the 5 root discipline definitions following the schema above.
  • Create lib/aethyr/core/skills/skill_tree_loader.rb with the SkillTreeLoader class.
  • Implement SkillTreeLoader.load(path) to parse YAML and return a SkillTree.
  • Add YAML schema validation with descriptive error messages.
  • Define SkillTreeLoader::InvalidConfigError exception class.
  • Integrate with character creation to initialize player.info["skills"] with root disciplines.
  • Verify SkillTree#root_nodes returns exactly the 5 roots after loading.
  • Docs: Update YARD comments on affected classes and methods. Update relevant Docusaurus documentation pages if applicable.
  • Tests (Cucumber): Add tests/unit/skill_tree_loader.feature covering YAML loading, schema validation, invalid config handling, root node initialization, character creation integration.
  • Tests (Cucumber Integration): Add integration feature in tests/integration/ for skill tree loading from YAML config and character creation initialization.
  • Tests (Profiling): Run bundle exec rake unit_profile and verify no performance regressions.
  • Quality: Verify coverage >=97% via bundle exec rake unit. If coverage is <97% then review the current unit test coverage report at build/tests/unit/coverage/ and use it to write new Cucumber based unit tests to improve code coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun bundle exec rake unit to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.
  • Quality: Run bundle exec rake (default task: unit tests with coverage) and bundle exec rake integration, fix any errors if needed ensuring both pass across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
## Metadata | Key | Value | |-----|-------| | **Parent Epic** | #223 — Skill Tree Data Model & Storage | | **Legendary** | #198 — Character Progression & Skills | | **Branch** | `feature/m4-discipline-root-definitions` | | **Commit Message** | `feat(skills): implement 5 discipline root definitions in YAML config` | | **Points** | 5 | | **Priority** | High | | **MoSCoW** | Must Have | ## Background and Context Every character in Aethyr begins with access to five root disciplines: Combat, Survival, Crafting, Social, and Magic. These root nodes are tier-0 entries in the skill tree — they have no prerequisites and are automatically available at character creation. The root definitions serve as the anchor points for all sub-trees. They must be stored in a YAML configuration file (`conf/skill_trees.yaml`) so that game designers can modify the tree structure without changing code. A loader class will parse this YAML and instantiate `SkillNode` and `SkillTree` objects. This issue also establishes the YAML schema convention that all subsequent discipline tree issues will follow. ## Expected Behavior 1. **YAML Configuration File** at `conf/skill_trees.yaml`: ```yaml disciplines: combat: name: Combat description: "The art of physical conflict and martial prowess." tier: 0 prerequisites: [] xp_required: 10000 max_level: 10 survival: name: Survival description: "Skills for enduring and thriving in the wilderness." tier: 0 prerequisites: [] xp_required: 10000 max_level: 10 crafting: name: Crafting description: "The creation and enhancement of items and equipment." tier: 0 prerequisites: [] xp_required: 10000 max_level: 10 social: name: Social description: "Influence, persuasion, and interpersonal mastery." tier: 0 prerequisites: [] xp_required: 10000 max_level: 10 magic: name: Magic description: "The study and channeling of arcane forces." tier: 0 prerequisites: [] xp_required: 10000 max_level: 10 ``` 2. **SkillTreeLoader** class at `lib/aethyr/core/skills/skill_tree_loader.rb`: - `load(path = "conf/skill_trees.yaml")` — reads and parses the YAML, returns a `SkillTree` instance. - Validates YAML structure on load. - Raises `SkillTreeLoader::InvalidConfigError` for malformed YAML. 3. **Character Creation Integration:** - On character creation, `player.info["skills"]` is initialized with all 5 root disciplines at level 0, xp 0. - Root nodes are always shown as "available" in `check_unlockable`. ## Acceptance Criteria - [ ] `conf/skill_trees.yaml` exists with all 5 root discipline definitions. - [ ] `SkillTreeLoader` class exists at `lib/aethyr/core/skills/skill_tree_loader.rb`. - [ ] `SkillTreeLoader.load` returns a valid `SkillTree` with 5 root nodes. - [ ] Each root node has `tier: 0`, empty prerequisites, `xp_required: 10000`, `max_level: 10`. - [ ] YAML validation catches missing required fields and raises `InvalidConfigError`. - [ ] New characters receive all 5 root disciplines in `player.info["skills"]`. - [ ] `SkillTree#root_nodes` returns exactly the 5 discipline roots. ## Subtasks - [ ] Create `conf/skill_trees.yaml` with the 5 root discipline definitions following the schema above. - [ ] Create `lib/aethyr/core/skills/skill_tree_loader.rb` with the `SkillTreeLoader` class. - [ ] Implement `SkillTreeLoader.load(path)` to parse YAML and return a `SkillTree`. - [ ] Add YAML schema validation with descriptive error messages. - [ ] Define `SkillTreeLoader::InvalidConfigError` exception class. - [ ] Integrate with character creation to initialize `player.info["skills"]` with root disciplines. - [ ] Verify `SkillTree#root_nodes` returns exactly the 5 roots after loading. - [ ] Docs: Update YARD comments on affected classes and methods. Update relevant Docusaurus documentation pages if applicable. - [ ] Tests (Cucumber): Add `tests/unit/skill_tree_loader.feature` covering YAML loading, schema validation, invalid config handling, root node initialization, character creation integration. - [ ] Tests (Cucumber Integration): Add integration feature in `tests/integration/` for skill tree loading from YAML config and character creation initialization. - [ ] Tests (Profiling): Run `bundle exec rake unit_profile` and verify no performance regressions. - [ ] Quality: Verify coverage >=97% via `bundle exec rake unit`. If coverage is <97% then review the current unit test coverage report at `build/tests/unit/coverage/` and use it to write new Cucumber based unit tests to improve code coverage. Specifically, write Cucumber/Gherkin style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun `bundle exec rake unit` to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%. - [ ] Quality: Run `bundle exec rake` (default task: unit tests with coverage) and `bundle exec rake integration`, fix any errors if needed ensuring both pass across **entire** code base, do not ignore any failure even if it seems unrelated to this commit, fix it. ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done.
freemo added this to the v1.3.0 milestone 2026-03-16 01:40:13 +00:00
freemo self-assigned this 2026-03-16 01:40:13 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference: aethyr/Aethyr#228
No description provided.