Quest Error Log & Other Changes

For all talk about quests. Creating, testing, bugs, and development progress.
Post Reply
User avatar
Interkarma
Posts: 3178
Joined: Sun Mar 22, 2015 1:51 am

Quest Error Log & Other Changes

Post by Interkarma » Fri Jun 01, 2018 10:05 pm

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: 3178
Joined: Sun Mar 22, 2015 1:51 am

Re: Quest Error Log & Other Changes

Post by Interkarma » Sat Jun 02, 2018 1:58 am

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: 1432
Joined: Tue Aug 25, 2015 1:54 am

Re: Quest Error Log & Other Changes

Post by Jay_H » Sat Jun 02, 2018 3:07 am

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.
Check out the Daggerfall Unity mod page on ModDB.

I rarely read instructions well the first time. Tell me to re-read them. I'll do it.

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

Re: Quest Error Log & Other Changes

Post by Hazelnut » Sun Jun 03, 2018 8:03 pm

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.

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

Re: Quest Error Log & Other Changes

Post by Jay_H » Mon Jun 04, 2018 12:44 pm

Thank you :) I hope to keep it in that condition as we go along.
Check out the Daggerfall Unity mod page on ModDB.

I rarely read instructions well the first time. Tell me to re-read them. I'll do it.

Post Reply