[0.10.20] - EndQuest rearming in some conditions, leading to quest performance issues [RESOLVED 0.10.21]

kingink
Posts: 4
Joined: Mon Mar 02, 2020 4:23 pm

Re: [0.10.20] - HaveItem not clearing leads to quest performance issues

Post by kingink »

Yeah, I did. I began my first real playthough of this game with the 10.20 version. I've played most of the fighters guild quests with no problems, and was working my way through temple quests. This is the first one I had bug out on me so far.

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

Re: [0.10.20] - HaveItem not clearing leads to quest performance issues

Post by Hazelnut »

I think I have traced this to a bug in the EndQuest action. Looking at fixes now.
Attachments
lagCause.JPG
lagCause.JPG (82.86 KiB) Viewed 1367 times
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: [0.10.20] - HaveItem not clearing leads to quest performance issues

Post by Hazelnut »

Looks to me like the issue is that the EndQuest action isn't setting itself as non-rearmable, will need Interkarma to look closer and confirm as I don't have the understanding of the quest machine to be 100% sure this is the correct fix. However with this one line change I can load the save with normal performance and everything seems fine.

Code: Select all

        public EndQuest(Quest parentQuest)
            : base(parentQuest)
        {
            allowRearm = false;	// This is the only line I added to fix the problem.
        }
When I found that the end quest action of the victory task was taking almost a second (see profiler pic above) I looked at the quest data saved and it's marked as complete, however the code is running to update and evaluate it every quest machine tick which is not right. Looking in the debugger, isComplete was false. Looked at a few other actions code and came to the conclusion that this task must have been rearmed.

I still think that the quest script has redundancy here because the preceding give pc action ends the quest anyway since it has no notify message, so this doesn't need removing but it would also fix the problem I suppose. There seem to be a few other quests that do this, so not sure exactly why it's only just been picked up.

I couldn't see anything to do with have item or either change previously discussed.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: [0.10.20] - HaveItem not clearing leads to quest performance issues

Post by Interkarma »

I don't see any issues with making "end quest" non-rearmable. In theory, the quest should terminate at that moment in time. Probably what's happening is some other action is rearming parent action before the quest ending can be triggered, causing it to loop in that state indefinitely.

Nice troubleshooting Hazelnut. :)

Edit: Updated topic subject in first post to reflect this.

User avatar
pango
Posts: 3359
Joined: Wed Jul 18, 2018 6:14 pm
Location: France
Contact:

Re: [0.10.20] - EndQuest rearming in some conditions, leading to quest performance issues

Post by pango »

I wonder if it fixes rep dropping, or if it's just a similar issue...
Mastodon: @pango@fosstodon.org
When a measure becomes a target, it ceases to be a good measure.
-- Charles Goodhart

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

Re: [0.10.20] - EndQuest rearming in some conditions, leading to quest performance issues

Post by Hazelnut »

You know this very well might, that quest also has the same combo in the success path. No idea how it would happen though looking at the quest script but it will be interesting to see.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

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

Re: [0.10.20] - EndQuest rearming in some conditions, leading to quest performance issues

Post by Interkarma »

pango wrote: Tue Mar 03, 2020 12:54 am I wonder if it fixes rep dropping, or if it's just a similar issue...
Would make sense. I resolved another cause of this a while back, but some reports continued which indicates something else was at work. Would be nice if this resolved both case with one line of code changed. Best kind of outcome. :)

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

Re: [0.10.20] - EndQuest rearming in some conditions, leading to quest performance issues

Post by Interkarma »

I've merged Hazelnut's change and will close this one out now.

Locked