Quest Error Log & Other Changes

For all talk about quest development - creation, testing, and quest system.
Post Reply
User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Quest Error Log & Other Changes

Post by Interkarma »

I'm working through a few items in the QuestMachine code this weekend. The first change I'm making is to redirect all quest exceptions, information, and errors to their own log: "quest_log.txt".

You will find the quest_log file in the persistent data path (same place as save games and settings.ini). Incidentally this is the same place the "output_log" file will be placed after the upgrade to Unity 2018.1.2f1 in a couple of weeks, so both logs will be in the same place.

Just like the output log, the quest log file will be cleared every time you start the game. Any errors caught during compilation or execution will be redirected to the quest log file instead. I'll also update any Debug.Log() quest-related output to use this location and add some more detail where possible.

The second change is wrapping both quest compilation and execution in try/catch blocks. Any exceptions encountered during quest execution will be redirected to the quest log from the usual output log target.

The main benefit of improving exception handling is to help prevent bad quests causing problems in other systems (e.g. talk system is very sensitive to dud quest data). If a quest crashes, it will be terminated instantly so that downstream systems don't end up with bad data from failed quests. There are loads of reasons a quest can go bad, including just basic stuff like syntax errors and logic problems when writing them. My goal is to minimise problems from as many of these as possible.

Basically, I'm working towards creating a kind of "execution sandbox" for the quest system, something should have done from the start.

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

Re: Quest Error Log & Other Changes

Post by Interkarma »

This is almost completed now and will in next set of builds. Here's a small example of the quest_output.txt log.

Code: Select all

Starting new quest log 6/2/2018 11:51 AM
Daggerfall Unity version 0.5.282

Parsing quest A0C0XY04.txt
Could not find local site for _meetingplace_ with P2=0 in Ephesus/The Feather and Skull Pub.
Note in the this case, the _meetingplace_ is an "apothecary". This building type doesn't exist in this small town, but it would exist in a larger town. The quest itself does not contain the error, it's just not suitable for this town.

One of the common reasons the quest system is crashing the talk system, for example, is because these cases aren't being captured properly and a null quest is being handed off to other systems. A big part of what I'm doing in this review is capturing these problems so they don't crash other systems.

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

Re: Quest Error Log & Other Changes

Post by Jay_H »

Very good! Even without the improved diagnostics this is a welcome change. I've had to open the player log when it's over 300kb in size (sometimes over a meg) and that's kind of a draw on the system :lol: I look forward to this.

User avatar
Hazelnut
Posts: 3015
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Quest Error Log & Other Changes

Post by Hazelnut »

Good stuff. I suspect quest niggles will have a long tail, so this is definitely the way forward.

Jay, didn't want to pollute your classic quest bugs thread, but can I just say here how great it is! Nice work mate.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: Quest Error Log & Other Changes

Post by Jay_H »

Thank you :) I hope to keep it in that condition as we go along.

Post Reply