I’ve been hard at work the last couple of weeks, finally making serious inroads into the real meat of the quest system. Here’s a quick diary of my progress since last post. If you follow me on Twitter, you’ve already seen most of this, although there’s a new video at the end you might enjoy.
In the last post, I talked about using buildings as quest sites. This has allowed me to start work on placing NPCs, items, and enemies as part of quests, and to support branching quest execution based on where player is in world.
When a named NPC is reserved by quest system, Daggerfall Unity handles all the book-keeping to move that NPC to the quest site. I tested this out using King Gothryd at first. Once the new quest site is determined and Gothryd is reserved, scene builders will no longer deploy him at the usual home location – unless the quest specifies the atHome flag at time of NPC reservation. In screenshot below, Gothryd has already left for the quest site.
The quest system then generates a SiteLink between target Place and Person resources. When the player visits the target location, scene builders need to place Gothryd at that location. Here’s Gothryd at the end of his journey.
I wanted to take a short break from NPCs and moved onto items briefly. There’s a few different ways Daggerfall uses Item resources in quests. They might added directly to your inventory, placed in a dungeon, or used as a permanent reward. Different quest conditions will also trigger based on whether player is carrying a certain item or not. I still have a lot to do here, but have made a start on the first case – adding an item directly to player inventory. The parchment with a green background below is the first real quest item in Daggerfall Unity. Specifically, it’s the letter from Brisienna.
At this point the quest engine is getting advanced enough that I need more detail on what’s happening under the hood at any time. I put together a quest debugger that shows the various Task and Timer states for a running quest. I plan to make this capable of step-through execution in the short term. The debugger shows which tasks are active/inactive and which timers are pending/running/complete. After setting this up, I could finally resolve many bugs in execution flow. I also added proper support for persist-until tasks, global variable links, and rearming tasks designed to switch on and off.
I’m pleased to say the quest system is all coming together rather quickly now. There’s still a huge amount of work to do, but most of the hard problems have been solved now and I’m just building out action support and fixing bugs. Here’s a little video of the current state of the quest system. Some of the early quests are working nicely now.
As a bonus, this video also shows the new skill tracking and player levelling by Allofich. Yep, it’s possible to level-up in Daggerfall Unity now thanks to his efforts. Great work Allofich!