Implement 6 quality outcome tiers with stat scaling #246

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

Metadata

Field Value
Parent Epic Epic: Crafting Quality & Skills (#213)
Legendary Crafting & Resource Economy (#200)
Type Feature
Priority Medium
MoSCoW Must Have
Points 5
Branch feature/m4-quality-outcome-tiers
Commit Message Implement 6 quality outcome tiers with stat scaling (#246)

Background and Context

Every crafted item in Aethyr is assigned a quality tier based on the player's performance in the crafting minigame. The quality tier system provides a clear, recognizable hierarchy that rewards skilled crafters with mechanically superior items. This system is central to the crafting economy — it creates a market for high-quality goods and gives players a reason to invest in their crafting skills.

The six quality tiers, their score ranges, and stat multipliers are:

Tier Score Range Stat Multiplier
Crude 1-20 0.5x
Poor 21-40 0.7x
Standard 41-60 1.0x
Fine 61-80 1.2x
Masterwork 81-95 1.5x
Legendary 96-100 2.0x

The stat multiplier is applied to the base stats defined in the recipe's output item template. For example, an iron sword with base_damage=10 crafted at Masterwork quality would have damage=15.

Expected Behavior

  1. After a crafting minigame completes, the quality score (1-100) is mapped to one of the six tiers.
  2. The tier determines a stat multiplier that is applied to all numeric base stats in the item template.
  3. The item's name is prefixed with the quality tier (e.g., "Masterwork Iron Sword").
  4. The item's description includes the quality tier and a flavor text appropriate to the tier.
  5. The quality tier is stored as a property on the item for future reference (e.g., for trade, reputation, display).
  6. Edge cases:
    • A score of exactly 20 is Crude, exactly 21 is Poor, etc.
    • A score of exactly 95 is Masterwork, exactly 96 is Legendary.
    • Multipliers are applied to all numeric stats (damage, durability, armor, healing, etc.).
    • Non-numeric stats (name, type, description) are not multiplied.

Acceptance Criteria

  • A QualityTier module/class maps quality scores (1-100) to the correct tier name and multiplier.
  • All six tiers have the correct score ranges: Crude(1-20), Poor(21-40), Standard(41-60), Fine(61-80), Masterwork(81-95), Legendary(96-100).
  • The stat multiplier (Crude=0.5x, Poor=0.7x, Standard=1.0x, Fine=1.2x, Masterwork=1.5x, Legendary=2.0x) is correctly applied to all numeric base stats.
  • Crafted items have their name prefixed with the quality tier name.
  • Crafted items store the quality tier as a persistent property.
  • Edge case score boundaries are handled correctly (e.g., 20=Crude, 21=Poor, 95=Masterwork, 96=Legendary).

Subtasks

  • Create the QualityTier module/class with tier definitions, score ranges, and multipliers.
  • Implement QualityTier.for_score(score) that returns the tier name and multiplier for a given score.
  • Implement stat scaling logic that applies the multiplier to all numeric base stats in an item template.
  • Implement item name prefixing with quality tier name.
  • Implement quality tier as a persistent property on crafted items.
  • Add tier-appropriate flavor text for item descriptions.
  • Integrate with the crafting minigame output flow.
  • Docs: Update YARD comments on affected classes and methods. Update relevant Docusaurus documentation pages if applicable.
  • Tests (Cucumber): Add tests/unit/quality_outcome_tiers.feature covering score-to-tier mapping for all 6 tiers, boundary scores, stat multiplier application, name prefixing, persistence.
  • Tests (Cucumber Integration): Add integration feature in tests/integration/ for crafting items at different quality tiers and verifying stats.
  • 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 | Field | Value | |---|---| | **Parent Epic** | Epic: Crafting Quality & Skills (#213) | | **Legendary** | Crafting & Resource Economy (#200) | | **Type** | Feature | | **Priority** | Medium | | **MoSCoW** | Must Have | | **Points** | 5 | | **Branch** | `feature/m4-quality-outcome-tiers` | | **Commit Message** | `Implement 6 quality outcome tiers with stat scaling (#246)` | ## Background and Context Every crafted item in Aethyr is assigned a quality tier based on the player's performance in the crafting minigame. The quality tier system provides a clear, recognizable hierarchy that rewards skilled crafters with mechanically superior items. This system is central to the crafting economy — it creates a market for high-quality goods and gives players a reason to invest in their crafting skills. The six quality tiers, their score ranges, and stat multipliers are: | Tier | Score Range | Stat Multiplier | |---|---|---| | Crude | 1-20 | 0.5x | | Poor | 21-40 | 0.7x | | Standard | 41-60 | 1.0x | | Fine | 61-80 | 1.2x | | Masterwork | 81-95 | 1.5x | | Legendary | 96-100 | 2.0x | The stat multiplier is applied to the base stats defined in the recipe's output item template. For example, an iron sword with base_damage=10 crafted at Masterwork quality would have damage=15. ## Expected Behavior 1. After a crafting minigame completes, the quality score (1-100) is mapped to one of the six tiers. 2. The tier determines a stat multiplier that is applied to all numeric base stats in the item template. 3. The item's name is prefixed with the quality tier (e.g., "Masterwork Iron Sword"). 4. The item's description includes the quality tier and a flavor text appropriate to the tier. 5. The quality tier is stored as a property on the item for future reference (e.g., for trade, reputation, display). 6. Edge cases: - A score of exactly 20 is Crude, exactly 21 is Poor, etc. - A score of exactly 95 is Masterwork, exactly 96 is Legendary. - Multipliers are applied to all numeric stats (damage, durability, armor, healing, etc.). - Non-numeric stats (name, type, description) are not multiplied. ## Acceptance Criteria - [ ] A `QualityTier` module/class maps quality scores (1-100) to the correct tier name and multiplier. - [ ] All six tiers have the correct score ranges: Crude(1-20), Poor(21-40), Standard(41-60), Fine(61-80), Masterwork(81-95), Legendary(96-100). - [ ] The stat multiplier (Crude=0.5x, Poor=0.7x, Standard=1.0x, Fine=1.2x, Masterwork=1.5x, Legendary=2.0x) is correctly applied to all numeric base stats. - [ ] Crafted items have their name prefixed with the quality tier name. - [ ] Crafted items store the quality tier as a persistent property. - [ ] Edge case score boundaries are handled correctly (e.g., 20=Crude, 21=Poor, 95=Masterwork, 96=Legendary). ## Subtasks - [ ] Create the `QualityTier` module/class with tier definitions, score ranges, and multipliers. - [ ] Implement `QualityTier.for_score(score)` that returns the tier name and multiplier for a given score. - [ ] Implement stat scaling logic that applies the multiplier to all numeric base stats in an item template. - [ ] Implement item name prefixing with quality tier name. - [ ] Implement quality tier as a persistent property on crafted items. - [ ] Add tier-appropriate flavor text for item descriptions. - [ ] Integrate with the crafting minigame output flow. - [ ] Docs: Update YARD comments on affected classes and methods. Update relevant Docusaurus documentation pages if applicable. - [ ] Tests (Cucumber): Add `tests/unit/quality_outcome_tiers.feature` covering score-to-tier mapping for all 6 tiers, boundary scores, stat multiplier application, name prefixing, persistence. - [ ] Tests (Cucumber Integration): Add integration feature in `tests/integration/` for crafting items at different quality tiers and verifying stats. - [ ] 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:41:46 +00:00
freemo self-assigned this 2026-03-16 01:41:46 +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#246
No description provided.