Implement HarvestNode data model with 12 fields #239
Labels
No labels
Blocked
Duplicate
MoSCoW/Could Have
MoSCoW/Must Have
MoSCoW/Should Have
Points/1
Points/13
Points/2
Points/21
Points/3
Points/5
Points/8
Priority/Backlog
Priority/Critical
Priority/High
Priority/Low
Priority/Medium
State/Completed
State/In progress
State/In review
State/Paused
State/Unverified
State/Verified
State/Wont Do
Type/Bug
Type/Epic
Type/Feature
Type/Legendary
Type/Task
Type/Testing
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#209 Epic: Harvesting System
aethyr/Aethyr
Reference: aethyr/Aethyr#239
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Metadata
feature/m4-harvest-node-data-modelImplement HarvestNode data model with 12 fields (#239)Background and Context
The harvesting system requires a robust data model to represent harvestable resource nodes scattered throughout the game world. Each
HarvestNoderepresents a single harvestable location (e.g., an ore vein, an herb patch, a timber stand). The data model must capture all the information needed for skill checks, quality calculations, depletion/respawn mechanics, and world placement.This is the foundational data model that all other harvesting features depend on. Without it, neither personal harvesting nor devotee-delegated harvesting can function.
Expected Behavior
A new
HarvestNodeclass (or equivalent data structure) is created with the following 12 fields:String) — The type of resource this node yields (e.g.,"iron_ore","silverleaf","oak_timber").Range) — The base quality range for resources harvested from this node (e.g.,20..80). The actual quality is modified by the harvester's skill.Integer) — The number of seconds until this node respawns after full depletion.String) — The crafting/harvesting skill required to harvest this node (e.g.,"mining","herbalism","woodcutting").Integer) — The number of times this node can be harvested before it is fully depleted.Integer) — The maximum depletion count (used to resetcurrent_depletionon respawn).Integer) — The current number of times this node has been harvested since last respawn. Whencurrent_depletion >= depletion_count, the node is depleted.Floatornil) — The game time at which this node will respawn.nilif the node is not currently depleted.String) — The identifier of the area/room where this node is located.Hashor coordinate object) — The specific position within the area for display and interaction purposes.Array<Hash>) — A list of possible yield items with their drop rates and quantities (e.g.,[{item: "iron_ore", chance: 0.8, qty: 1..3}, {item: "gemstone", chance: 0.05, qty: 1}]).Integer) — A difficulty rating (1-100) that factors into the skill check formula.The model should support:
depleted?method that returnstruewhencurrent_depletion >= depletion_count.respawn!method that resetscurrent_depletionto 0 and clearsrespawn_timer.harvest!method that incrementscurrent_depletionand setsrespawn_timerwhen fully depleted.conf/harvest_nodes.yaml).Acceptance Criteria
HarvestNodeclass exists with all 12 fields properly defined with appropriate types and defaults.depleted?returnstruewhencurrent_depletion >= depletion_count,falseotherwise.respawn!resetscurrent_depletionto 0 and setsrespawn_timertonil.harvest!incrementscurrent_depletionby 1 and setsrespawn_timerwhen the node becomes fully depleted.conf/harvest_nodes.yaml.quality_rangemust be a valid range,depletion_countmust be positive).Subtasks
HarvestNodeclass with all 12 fields, accessors, and initialization logic.depleted?,respawn!, andharvest!methods.conf/harvest_nodes.yaml.conf/harvest_nodes.yamlwith at least 5 example node definitions.tests/unit/harvest_node_model.featurecovering field validation, depleted? logic, respawn! reset, harvest! depletion tracking, YAML loading.tests/integration/for harvest node lifecycle (create, harvest, deplete, respawn).bundle exec rake unit_profileand verify no performance regressions.bundle exec rake unit. If coverage is <97% then review the current unit test coverage report atbuild/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 rerunbundle exec rake unitto 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%.bundle exec rake(default task: unit tests with coverage) andbundle 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:
master, reviewed, and merged before this issue is marked done.