Skip to content

Feat: Quest Schedule ID Rework + Board Quest Rotation#822

Merged
RyanYappert merged 4 commits into
sebastian-heinz:developfrom
RyanYappert:feat/board_quest_rework
Jun 7, 2025
Merged

Feat: Quest Schedule ID Rework + Board Quest Rotation#822
RyanYappert merged 4 commits into
sebastian-heinz:developfrom
RyanYappert:feat/board_quest_rework

Conversation

@RyanYappert

@RyanYappert RyanYappert commented May 14, 2025

Copy link
Copy Markdown
Collaborator

Contains two major features, of which the second necessitates the former.

  • QuestId (which uniquely define a quest's client-side assets, including flags, texts, spawned NPCs, etc) and QuestScheduleId (which is used by the client/server/DB for tracking individual implementations of quests) have been decoupled.
  • In general, this doesn't require reworking of most systems, with some exceptions:
    • If you were attempting to reference a specific quest by scheduleId and previously just casting (uint)QuestId.Foo, you should instead use Server.AssetRepository.QuestScheduleIdAsset[QuestId.Foo] to get the same result.
    • If you were doing this without access to the server object (perhaps in a script initialization), you can grab it by static shenanigans, via QuestManager.AssetRepository... Yes, this is cursed.
    • If you were previously providing explicit questScheduleIds as part of a quest definition (either json or scripted), you should instead provide a uint variant_index/VariantIndex. For most quests, this is capped at 127 because of janky compression of the existing 32 bit QuestId space into 25 bits.
      • Existing quests q20055001 A Strange Bird Dances in the Forest and q20055004 The Abductors' True Nature have been migrated as an example.
    • If you were previously inventing questIds (for world manage purposes), you should provide a scheduleId pattern in the QuestScheduleId.csv asset. These are capped at (15,127,127,127) for the same compression issues. The final column can be used to note the computed scheduleId for later reference, if you think you might want to dig it out of a DB.
  • As part of this, the DB is migrated to Version 42. Because I am lazy about migration, non-MSQ progress is dropped, as are the quest priority, EXM rank record, and quest reward log tables. Please warn your players that they should collect any outstanding rewards before they get deleted.
  • Board quests (hunt and delivery) now rotate on a daily basis. Like most things, this occurs at 5 AM JST.
    • Boards automatically parse the standard enemy spawn, enemy drop tables, and gathering item assets to attempt to generate quests that are 1) achievable in their region and 2) appropriate level.
    • Boards are driven by "generating groups" defined in LightQuests.json.
    • Each board attempts to generate 2-5 hunt quests, 2-5 delivery quests, a hunt area order, and a delivery area order, per day. Area Orders request additional kills/items (6-10 vs 2-4) and have correspondingly higher rewards.
    • Rewards are controlled by scripts; see light_delivery_quest_reward.csx and light_hunt_quest_reward.csx for examples.
    • When boards overlap their sampling region (e.g. Tel and WDT), the "difficulty" is most easily controlled by their bias parameter. When bias_rerolls > 0, that many additional quests are rolled for each slot, and the lowest/highest level quest of that set is taken (direction controlled by bias_lower). Usually Area Orders are biased one step easier to prevent them from being "kill 10 Golems" or something obnoxious.
    • If a player holds a board quest past its delivery ending (the next 5 AM rotation), it'll be automatically discarded when they next reset an instance.

Warning

As part of this, the DB is migrated to Version 42. Because I am lazy about migration, non-MSQ progress is dropped, as are the quest priority, EXM rank record, and quest reward log tables. Please warn your players that they should collect any outstanding rewards before they get deleted.

TODO:

  • Copious amounts of testing.
  • Adjust some debug commands to not be awful to use with the scheduleId changes.
  • Figure out the "proper" way to notify a player that quests have been cancelled due to delivery ending.
  • Fine tuning the quest generation algorithm.
  • Maybe figure out how the quests-per-day stuff works.
  • Maybe figure out how the "use GG to finish all the quests on a board" works.
  • Maybe do Clan Quest rotation and add quests to the second board of clan quests.

Checklist:

  • The project compiles
  • The PR targets develop branch

Comment thread Arrowgene.Ddon.GameServer/Characters/QuestManager.cs Outdated
Comment thread Arrowgene.Ddon.GameServer/Handler/QuestGetSetQuestListHandler.cs
Comment thread Arrowgene.Ddon.GameServer/Quests/LightQuests/LightQuestManager.cs Outdated
Comment thread Arrowgene.Ddon.GameServer/Quests/LightQuests/LightQuestManager.cs Outdated
Comment thread Arrowgene.Ddon.Shared/Model/EnemyId.cs
Comment thread Arrowgene.Ddon.GameServer/DdonGameServer.cs Outdated
Comment thread Arrowgene.Ddon.GameServer/Handler/RankingBoardListHandler.cs Outdated
Comment thread Arrowgene.Ddon.Database/Files/Database/Script/migration_light_quest_refactor.sql Outdated
Comment thread Arrowgene.Ddon.GameServer/Characters/QuestManager.cs Outdated
Comment thread Arrowgene.Ddon.GameServer/Handler/StageAreaChangeHandler.cs Outdated
Comment thread Arrowgene.Ddon.GameServer/Quests/LightQuests/LightQuestManager.cs Outdated
Comment thread Arrowgene.Ddon.Shared/Model/ClientItemInfo.cs Outdated
Comment thread Arrowgene.Ddon.Shared/Model/Quest/QuestBlockType.cs
@pacampbell

Copy link
Copy Markdown
Collaborator

I wish you had all the deleted files in 1 commit and the changes in another. It is hard to review the thing because my browser is acting poorly with the volume of files changed :(

Comment thread Arrowgene.Ddon.GameServer/Handler/StageAreaChangeHandler.cs Outdated
Comment thread Arrowgene.Ddon.Cli/Command/ServerCommand.cs

private static readonly TimeSpan BOARD_QUEST_DURATION = TimeSpan.FromDays(1);
// TODO: This should be configurable, but needs to be synced with the reset task or the boards act funny.
private static readonly TimeSpan BOARD_QUEST_DURATION = TimeSpan.FromMinutes(2); //TimeSpan.FromDays(1);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 minutes? development value? 🤔

Comment thread Arrowgene.Ddon.Scripts/scripts/chat_commands/godmode.csx
Comment thread Arrowgene.Ddon.Server/DdonServer.cs Outdated
Comment thread Arrowgene.Ddon.Shared/Csv/ClientItemInfoCsv.cs
@alborrajo alborrajo mentioned this pull request May 23, 2025
2 tasks
@RyanYappert RyanYappert force-pushed the feat/board_quest_rework branch 2 times, most recently from 9051cf7 to 74e6752 Compare May 26, 2025 01:27
Comment thread Arrowgene.Ddon.Scripts/scripts/chat_commands/ql.csx Outdated
var questEnemy = new InstancedEnemy()
{
EnemyId = Convert.ToUInt32(jEnemy.GetProperty("enemy_id").GetString(), 16),
EnemyId = (EnemyId)Convert.ToUInt32(jEnemy.GetProperty("enemy_id").GetString(), 16),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wonder if we should make something similar for this like I did for AssetCommonDeserializer.ParseItemId.

Comment thread Arrowgene.Ddon.Shared/AssetReader/QuestAssetDeserializer.cs Outdated
@pacampbell

Copy link
Copy Markdown
Collaborator

I think you might need to update some of the comments in your PR.

@RyanYappert RyanYappert force-pushed the feat/board_quest_rework branch from 74e6752 to 0442f60 Compare May 26, 2025 07:16
@pacampbell pacampbell requested a review from alborrajo May 26, 2025 19:25
@RyanYappert RyanYappert force-pushed the feat/board_quest_rework branch from 0442f60 to cc0dc17 Compare May 26, 2025 19:38
@RyanYappert RyanYappert mentioned this pull request May 27, 2025
2 tasks
private const string DefaultSchemaFile = "Script/schema_sqlite.sql";

public const uint Version = 43;
public const uint Version = 44;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as #856 we have to be careful with the merges

@RyanYappert RyanYappert force-pushed the feat/board_quest_rework branch from cc0dc17 to ab404a4 Compare June 1, 2025 06:19
Comment thread Arrowgene.Ddon.GameServer/Handler/QuestGetPartyQuestProgressInfoHandler.cs Outdated
Comment thread Arrowgene.Ddon.GameServer/Quests/GenericQuest.cs Outdated
private uint CURRENT_VARIANT_ID = 0;

// TODO: This should be configurable, but needs to be synced with the reset task or the boards act funny.
private static readonly TimeSpan BOARD_QUEST_DURATION = TimeSpan.FromDays(1);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this property be read from the task entry in DB? 🤔

Decayed quest cancellation notice on area reset.
Clean up EnemyId/EnemyUIId/ClientItemInfos implementation; use ItemId, EnemyId, and EnemyUIId when possible instead of uints
Light quest DB stuff, adjustments to handle variant ids, removing decayed quests when returning to town, rotation task and RPC for child servers.
Fix some tasks announcing to the non-head servers on the wrong route.
Migration 43 -> 44; add support for new quest_id + variant_index scheme for decoupling quest and schedule id.
Cleanup inconsistent packet id naming; add some new quest cancellation packets.
Light quest generation, mixin for light quest rewards, and asset.
Add DeliveryItemsLight and KillTargetEnemies block support to QuestBlockExtension. Add explicit support for DistributionStart/End in the quest asset and quest system.
Remove existing board quests.
…hing non-board quests. Adjust migration versioning. Default generators now use all available questIds daily.
… from being considered for generation. Improve rewards for boss hunt quests while reducing their count.
@RyanYappert RyanYappert force-pushed the feat/board_quest_rework branch from ab404a4 to d2b9f7f Compare June 7, 2025 03:57
@RyanYappert RyanYappert merged commit 73b85a3 into sebastian-heinz:develop Jun 7, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants