Quest Debugging

For all talk about quests. Creating, testing, bugs, and development progress.
User avatar
JorisVanEijden
Posts: 64
Joined: Mon Aug 12, 2019 5:02 pm

Quest Debugging

Post by JorisVanEijden » Tue Aug 27, 2019 7:33 am

I'm working on a tool to aid in quest debugging.
https://stellargames.github.io/Quester/

The dftemplate quest format that DFU uses comes from QBN & QRC files decompiled by Donald Tipton's template engine.
This decompiler left out all the data of which the purpose was not known at the time, and got the purpose of some of the data wrong. This causes some confusion and makes fixing quests in DFU involve some guesswork.

My tool uses the information from https://en.uesp.net/wiki/Daggerfall:Que ... _QBN_Files to dig out every last byte from the daggerfall QBN files.

This still leaves some data unknown though. I'd like to try to figure out some more. For this I need to be able to load quests in Daggerfall Classic at will and preferably dig into some npc info with a console or debugger.

What kind of tools are available for this purpose? How do I use them?
How for example do I start quest R0C10Y00 to verify some npc factions without having to play through the game?

*edit: fixed hacking-guide link to jump to the relevant portion
Last edited by JorisVanEijden on Tue Aug 27, 2019 7:56 am, edited 1 time in total.

User avatar
Nystul
Posts: 1383
Joined: Mon Mar 23, 2015 8:31 am

Re: Quest Debugging

Post by Nystul » Tue Aug 27, 2019 7:49 am

Kender wrote:
Tue Aug 27, 2019 7:33 am
My tool uses the information from https://en.uesp.net/wiki/Daggerfall:Quest_hacking_guide to dig out every last byte from the daggerfall QBN files.
One note: while developing DFU I think we identified some of the info there as partly incorrect or wrong, e.g.:
%hnt macro is not as claimed there "Direction of location." instead it is just a hint (a references to a text record with a specific id) depending on the context of use of %hnt

User avatar
JorisVanEijden
Posts: 64
Joined: Mon Aug 12, 2019 5:02 pm

Re: Quest Debugging

Post by JorisVanEijden » Tue Aug 27, 2019 8:05 am

I'm only using the info that DFU does not use, that is the QBN files.
I try to stay as close to DFU as possible with item, faction, etc lists.

The quests have been translated from QBN to TEMPLATE to DFU and each translation step has misunderstandings and mistakes.
A better understanding of the original QBN format and easy access to the data that TEMPLATE left out can help identify and resolve these.

User avatar
Interkarma
Posts: 4878
Joined: Sun Mar 22, 2015 1:51 am

Re: Quest Debugging

Post by Interkarma » Tue Aug 27, 2019 10:25 pm

Welcome to the forums. It's always good to have another data adventurer in our midst. :)

A quick primer for quest debugging is below. I recommend you also grab TheLacus' Visual Studio Code template to help write custom quests for isolated testing. You can start and stop quests while the game is running.

LeftShift+Tab - Cycles quest deugger display state.

[ and ] - Cycle through active quests.

` (backquote/tilde) - Opens console.

enddebugquest - Tombstones the quest currently selected in debugger.

endquest [UID] - Tombstones quest of specific ID.

startquest [filename] - Starts quest of filename in StreamingAssets/Quests. If the quest requires a questor, click on an NPC before starting quest and they will be used as the active questor.

purgeallquests - Dumps everything running on the quest machine.

Something to keep in mind is that Daggerfall Unity is a superset of classic Daggerfall. I see the classic quest system and its quests as a legacy baseline only. I am just as happy for quest issues to be solved by re-scripting as I am incremental fixes to the action behaviour.

Classic quests are also famously buggy in and of themselves. I don't in any way see them as a pristine baseline worthy of being tied down to. We have fixed hundreds of issues present in classic quests that are no longer present in DFU, and expanded the quest system capabilities far beyond what classic was remotely capable of. I place far more value in what happens in DFU in the future than trying to perfectly emulate decades-old bytecode. To put it another way - classic quests have to come forwards into a new framework, not the another way around.

I only mention this so it's clear what my goals are, and you don't spend time on changes that will be at odds with those goals. But I do welcome any help and clarity to improve action emulation that isn't heading towards a refactor of the quest system. A good example is this recent PR (are you JorisVanEijden on git?). Information like that is perfect and helps improve understanding. If that's the kind of thing you're about here, then bring it on. :)

User avatar
JorisVanEijden
Posts: 64
Joined: Mon Aug 12, 2019 5:02 pm

Re: Quest Debugging

Post by JorisVanEijden » Wed Aug 28, 2019 5:28 pm

Yes, I'm Joris. I'll synchronise my github, discord and forum accounts to avoid confusion.

I completely understand your position and agree with it. I never intended to change the way DFU quest engine works. That would not be a productive time expenditure.

When I started debugging quests I could not understand or follow the TEMPLATE syntax and what it was supposed to do (still find it hard to read, even after going through the entire documentation).
So since I could not understand what the quest was supposed to do I could not figure out if there was a bug in DFU or in a quest or "as intended".
I then went to the classic bytecode, found it easier to follow and got hooked on decompiling it.
Now I find it very useful in assisting me in figuring out bug reports for quests. Not for making DFU replicating classic 100%.

For debugging I was asking about daggerfall classic. I was looking at this bug report for S0000501.
and think I've figured out the issue and a solution, but I'd like to verify if the quest does indeed reward you with a random item with shocking enchantment ("%it of shocking" according to my tool's decompilation of S0000501)
But I have no way to easily get this quest and play through it in classic :(

User avatar
Jay_H
Posts: 2837
Joined: Tue Aug 25, 2015 1:54 am

Re: Quest Debugging

Post by Jay_H » Wed Aug 28, 2019 5:49 pm

Your help is extremely welcome :) I was quick to misinterpret "new debugger" as "start from scratch" so I'm glad we're all on the same page now, in spite of my error.

I'll see if I can trigger the Lord K'avar quest. It's not hard to get in classic, it's just... mind-draining. One of my first requests for DFU was to disable it permanently :lol: Then we'll see if the item is Shocking.
ON HIATUS. Will be difficult to find.
Come join the Unofficial Daggerfall Unity Discord.
See the Daggerfall Unity Wiki on the UESP.

User avatar
Jay_H
Posts: 2837
Joined: Tue Aug 25, 2015 1:54 am

Re: Quest Debugging

Post by Jay_H » Wed Aug 28, 2019 7:07 pm

No go. I just got an Unrestrainable Common Symbol, for Free Action.
ON HIATUS. Will be difficult to find.
Come join the Unofficial Daggerfall Unity Discord.
See the Daggerfall Unity Wiki on the UESP.

User avatar
JorisVanEijden
Posts: 64
Joined: Mon Aug 12, 2019 5:02 pm

Re: Quest Debugging

Post by JorisVanEijden » Fri Aug 30, 2019 5:50 pm

Thanks for checking Jay.
That gave me a different idea, which would have involved you checking if S0000502 rewarded you with a something "of Force Bolts".
Fortunately for you I managed to edit the _TUTOR__ quest to give me the item in question ;)

Which allowed me to verify that these are the subclasses of the magic items (class 4):

Code: Select all

 0 "Silent %it",
 1 "%it of the Wise",
 2 "%it of Wildfire",
 3 "%it of Force Bolts",
 4 "Shining %it",
 5 "%it of the Sealed Door",
 6 "%it of Undeniable Access",
 7 "%it of Venom Antidote",
 8 "%it of Life Stealing",
 9 "%it of Wizard's Fire",
10 "Leaping %it",
11 "%it of Water-walking",
12 "%it of Magicka",
13 "Never Tiring %it",
14 "%it of Featherweight",
15 "%it, the Protector",
16 "%it of Shocking",
17 "Cursing %it",
18 "%it of Far Silence",
19 "%it of Venom Spitting",
20 "Blazing %it of Fireballs",
21 "Frosty %it of Ice Storms",
22 "%it of Lightning",
23 "Deadman's %it",
24 "Healing %it",
25 "%it of the Orc Lord",
26 "Unrestrainable %it",
27 "%it of Iron Will",
28 "%it of Nimbleness",
29 "Torgo's %it",
30 "%it of Fortitude",
31 "%it of Friendship",
32 "%it of Good Luck",
33 "%it of Oblivion",
34 "%it of Toxic Clouds",
35 "%it of Paralysis",
Still need to figure out the "%it" part. It looks like a random item, but from which list?

User avatar
Jay_H
Posts: 2837
Joined: Tue Aug 25, 2015 1:54 am

Re: Quest Debugging

Post by Jay_H » Fri Aug 30, 2019 6:04 pm

Lines up perfectly. Looking great :)
ON HIATUS. Will be difficult to find.
Come join the Unofficial Daggerfall Unity Discord.
See the Daggerfall Unity Wiki on the UESP.

User avatar
JorisVanEijden
Posts: 64
Joined: Mon Aug 12, 2019 5:02 pm

Re: Quest Debugging

Post by JorisVanEijden » Sat Aug 31, 2019 7:16 am


Post Reply