Exception During Quest Save Loading Problem

Announcements, support questions, and discussion for Quest Machine.
Post Reply
publicminsu
Posts: 5
Joined: Wed Jun 19, 2024 9:26 pm

Exception During Quest Save Loading Problem

Post by publicminsu »

Hello,

I encountered an issue while loading quest saves and am writing to seek assistance.

74905462-599a-4fe2-9862-2dc8a083787e.png
74905462-599a-4fe2-9862-2dc8a083787e.png (156.29 KiB) Viewed 1541 times
When an exception occurs during the quest save loading process, a Clone is returned. This results in the QuestState defaulting to Unknown instead of Active, leaving the quest in an unreceived state.

1fcdce98-42d3-4c25-a5c9-62c00f4cc263.png
1fcdce98-42d3-4c25-a5c9-62c00f4cc263.png (211.66 KiB) Viewed 1541 times
It seems this problem arises when the saved data during deserialization does not match the asset data.

Could you please advise on a possible solution?
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Exception During Quest Save Loading Problem

Post by Tony Li »

Hi,

What version of Quest Machine are you using?

If you saved the game in a different version, do you remember what version of Quest Machine it was?
publicminsu
Posts: 5
Joined: Wed Jun 19, 2024 9:26 pm

Re: Exception During Quest Save Loading Problem

Post by publicminsu »

Thank you for your response.

My Quest Machine version is 1.2.34.
Please note that the issue I'm experiencing is not due to importing data from a different Quest Machine version (because I have maintained the same version throughout).

The current issue arises when saving quest data from a previously created quest and then modifying the quest before reloading it.

In my opinion, the problem occurs due to the following steps:

1. Create Quest A.
2. Save progress of Quest A as Quest Data B.
3. Modify Quest A, resulting in Quest A-1.
4. Load progress data B. Since B was created for Quest A, it cannot load values for A-1, resulting in an exception.
5. Fetch a copy of A-1 (using quest.Clone()).

This results in discarding all progress made in A (losing quest state).
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Exception During Quest Save Loading Problem

Post by Tony Li »

Hi,

In version 1.2.34, the positions of two bytes in quest save data were in the incorrect order, which could cause issues like this. It was fixed in version 1.2.35.

Would it be possible for you to back up your project, update to the current Quest Machine version, and start a new save file?
publicminsu
Posts: 5
Joined: Wed Jun 19, 2024 9:26 pm

Re: Exception During Quest Save Loading Problem

Post by publicminsu »

Thank you for responding, but that's not the answer I was looking for.

It seems I didn't explain my situation properly. I'm sorry.
Let me explain again:

1. (Editor) Create a quest.
2. (Game) Progress through the quest Data.
3. (Game) Save the quest Data.
4. (Editor) Delete a node from the quest.
5. (Game) Load the quest Data.
6. (Game) The quest Data resets (triggering an exception that calls quest.Clone())

It seems to be a situation like this.
The issue is that quest.Clone() causes the quest to completely reset from the beginning, even if there is progress already made.
스크린샷 2024-06-24 165753.png
스크린샷 2024-06-24 165753.png (62.74 KiB) Viewed 1508 times
It seems that QuestListContainer.cs(ApplyData / quest.Clone()) and QuestStateSerializer.cs are relevant to the issue at hand.

Is there no way to load quest data while preserving progress as much as possible?
publicminsu
Posts: 5
Joined: Wed Jun 19, 2024 9:26 pm

Re: Exception During Quest Save Loading Problem

Post by publicminsu »

https://www.pixelcrushers.com/phpbb/vie ... ess#p28871

It seems there was a previous topic about a similar problem.
Is the solution in that topic the only method?
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Exception During Quest Save Loading Problem

Post by Tony Li »

It depends on how drastically the quest has changed. If removing that node changes the context of the quest, then it would be better to make a new quest. If it's just a minor adjustment, then the issue is probably the bug I mentioned above where the save system in this older version of Quest Machine will not be able to reload the quest from a saved game if the number of nodes has changed.
publicminsu
Posts: 5
Joined: Wed Jun 19, 2024 9:26 pm

Re: Exception During Quest Save Loading Problem

Post by publicminsu »

Thank you for your response. It was helpful!
User avatar
Tony Li
Posts: 22108
Joined: Thu Jul 18, 2013 1:27 pm

Re: Exception During Quest Save Loading Problem

Post by Tony Li »

Glad to help!
Post Reply