Add quest definitions, JSON loading and the CharacterQuests table - #109
Add quest definitions, JSON loading and the CharacterQuests table#109Sulphural wants to merge 3 commits into
Conversation
Data model and resource loading for quests, plus the persistence schema they will use. Nothing consumes them yet - the manager, packets and handlers follow in separate PRs. Quests are authored in Resources/Quests.json: text ids, giver/turn-in NPCs, rewards, and an ordered list of goals (talk to an NPC, reach a location, or collect pickups). Quests written before goals existed still work through EffectiveGoals, which synthesizes the single talk-to-target goal. QuestDefinitionCollection indexes quests by giver and by every goal target, and assigns world guids to each Collect goal's pickups so an interaction can be traced back to the goal it credits.
|
This is a perfect first step. Thank you!! I'll put in a review soon. |
yungcomputerchair
left a comment
There was a problem hiding this comment.
I haven't looked into the logic too deeply just yet but I spotted a few issues that need to be addressed.
| public byte CollectCursorId { get; set; } = 17; | ||
| public int CollectInteractRange { get; set; } = 12; |
There was a problem hiding this comment.
Why are these both here and also in the quest definition? They should ideally only be in one place
There was a problem hiding this comment.
The dedupe here went the wrong way. These stats are per-goal, not per-quest. So move them back to the QuestGoal and use them from there.
I'm actually not sure it makes sense for these interactable values to be in the quest domain at all; we should probably have an IInteractable interface that unifies this and the collection NPCs (@amuralle FYI)
There was a problem hiding this comment.
(to be clear, you don't have to worry about an interface right now. Just move these to QuestGoal for now)
|
|
||
| // One collectible pickup to spawn for a Collect goal. Guids are assigned at load time and map back to | ||
| // (quest, goal) via Collectibles. | ||
| public sealed class CollectibleSpawn |
There was a problem hiding this comment.
@amuralle some of this looks like repeated work that the collections system already put in. can you take a look?
There was a problem hiding this comment.
Removed collections stuff from PR.. but the current system is global with a respawn timer. Definitely need to discuss more on this.
There was a problem hiding this comment.
Yeah I've been thinking about this- there's collectables that are user-specific used in quests for sure, I remember tons of them that only the quester could see. Will start looking through my own stuff and see if we can fit this in somehow.
There was a problem hiding this comment.
I think we need to all have a talk about how this should be architected
abf0160 to
bb9bb00
Compare
abf0160 to
c48101e
Compare
These stats are per-goal, not per-quest: one quest can mix a distant landmark step with a close-up pickup, so a single quest-level pair cannot describe both. Move them off QuestDefinition onto QuestGoal and read them from there.
Data model and resource loading for quests, plus the persistence schema they will use.
Quests are authored in Resources/Quests.json: text ids, giver/turn-in NPCs, rewards, and an ordered list of goals (talk to an NPC, reach a location, or collect pickups).
QuestDefinitionCollection indexes quests by giver and by every goal target, and assigns world guids to each Collect goal's pickups so an interaction can be traced back to the goal it credits.