-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tasks] Schema simplification #2449
Conversation
This is not in a rush to merge. Could use some additional testing. But confidence is high on the changes. @hgtw and myself should at least sign off on this PR when we're ready for it to merge |
Example Task 1 Has several activity types using lists, works beautifully
|
Probably could use some testing by a few others, with some other tasks mixed in |
Added optional stack counts in the reward list
13005 being Iron Ration and 10 charges Task.Reward.Stack.Counts.mp4 |
This will make tooling easier. While denormalizing goallists may not be ideal, it decouples tasks from rewards which share the table and removes a redundant column in favor of a using the delimited string which better matches live packet data.
cd7e1dc
to
9118d13
Compare
* Combine task_activity item and npc fields This will make tooling easier. While denormalizing goallists may not be ideal, it decouples tasks from rewards which share the table and removes a redundant column in favor of a using the delimited string which better matches live packet data. * [Tasks] Deprecate goallists table, migrate reward goal lists, simplify logic * Update 2022_09_25_task_concat_matchlists.sql * Update 2022_09_25_task_concat_matchlists.sql * Tweaks * Fix reward column name in conversion script * Task reward stacking * Update task_client_state.cpp * Implement stack counts * Fix reward item instance memory leak * Validate reward item instance * Fix item reward message * Fix findtask Co-authored-by: Akkadius <[email protected]>
This will make tooling, schema, code easier to reason about.
While denormalizing goallists may not be ideal, it decouples tasks from rewards which share the table and removes a redundant column in favor of a using the delimited string which better matches live packet data.
Akkadius
@hgtw and I have collaborated on this PR taking up different parts
Reason for Change(s)
Task system has been archaic as we've been implementing new systems (Shared Tasks) over time. This PR aims to work towards making more finalized schema simplification changes that should make things easier to reason about.
We have multiple fields doing the same thing and goal lists are also doing the same thing. Let's create one way to do things to keep things simple
Combining Fields
As @hgtw mentioned
npc_id
andnpc_goal_id
combine intonpc_match_list
which can contain a single NPC or a list of NPC's that are pipe delimited|
Example (4007|4009|4013|4024|4036|4043|4078|4080) and can also contain NPC names as partials (orc|gnoll|bear)item_id
anditem_goal_id
combine intoitem_id_list
which can contain a single item or list of items that are pipe delimited|
Example (37025|37029|37032)Goallists Deprecation
This is another move in the vein of simplification. I've never seen content developers really enjoy or understand using goal lists effectively which has warranted another way to manage this sort of functionality.
The
goallists
table along withGoalListManger
are completely deprecated and removed. The SQL takes care of automatically updating things to the new format and backs up the old tables.Because we can flexibly manage lists inline at either the
task
level forreward_id_list
ortask_activities
level fornpc_match_list
anditem_id_list
. We no longer need agoalmethod
orrewardmethod
type that references alist
which was the goal list table.The inline lists are far more flexible and can flexibly match on ID's or names depending on the field
For example
npc_match_list
will match exact ID's or name partials(orc|bear|gnoll|34024)
For example
item_id_list
will only do exact matches on item ID's(1001|1002|1003)
etc.These lists can be as long as they need to be and are limited by
text
(65,535)Schema Consistency
Fields were changed to be consistent with snake casing to be in line with https://docs.eqemu.io/server/database/conventions-guidelines. While we shouldn't just change database fields unless we have a strong reason to, we've already been heavily iterating on this part of the code base recently so we might as well just make things how they should be and simplify what we can considering how core this system is to Dragons of Norrath content and beyond.
tasks
reward
is nowreward_text
(varchar)rewardid
(int) is nowreward_id_list
(text)cashreward
is nowcash_reward
rewardmethod
is nowreward_method
minlevel
is nowmin_level
maxlevel
is nowmax_level
xpreward
is nowexp_reward
task_activities
npc_id
andnpc_goal_id
combine intonpc_match_list
which can contain a single NPC or a list of NPC's that are pipe delimited|
Example (4007|4009|4013|4024|4036|4043|4078|4080) and can also contain NPC names as partials (orc|gnoll|bear)item_id
anditem_goal_id
combine intoitem_id_list
which can contain a single item or list of items that are pipe delimited|
Example (37025|37029|37032)reward_id_list
now contains delimited values ofgoallists
if there was any entries that were linked. In PEQ there were 3 (2 technically)Future Reward Window
When we implement the reward window it will just be its own table, because it has a structure of many other things to select from in terms of options (items, factions, etc.)
Field Usage Matrix
To be updated in official documentation
Forage x (item_list)
(doors table dz_switch_id)
(Touch target)