Page 13 of 26

Re: ORK integration

Posted: Fri Jul 24, 2020 6:50 am
by dlevel
Still trying to figure out why saves don't work as intended, but will debug it some more.

another issue is that when I get some auto generated quests the icons are not showing up in the Active Quests (the icons appear normally before you get the quests in the quest dialogue - available quests)

https://ibb.co/7VrXV78

and one more:

When I exit to the main menu the quest HUD is still visible, I tried doing a custom onSceneChange and disable the Quest HUD gameobject but then when enabled again the quests are not showing even though they are there. Any way to tackle this?

Re: ORK integration

Posted: Fri Jul 24, 2020 10:31 am
by Tony Li
Hi,
dlevel wrote: Fri Jul 24, 2020 6:50 amStill trying to figure out why saves don't work as intended, but will debug it some more.
I understand it might be hard to send a reproduction project since it does server saves, but feel free to send me any info that you'd like me to take a look at.
dlevel wrote: Fri Jul 24, 2020 6:50 amanother issue is that when I get some auto generated quests the icons are not showing up in the Active Quests (the icons appear normally before you get the quests in the quest dialogue - available quests)
Add the icons to your quest database's EntityType Images list. This gives Quest Machine access to the images when you load a saved game.
dlevel wrote: Fri Jul 24, 2020 6:50 amWhen I exit to the main menu the quest HUD is still visible, I tried doing a custom onSceneChange and disable the Quest HUD gameobject but then when enabled again the quests are not showing even though they are there. Any way to tackle this?
The simplest way is to just disable Quest Machine's Canvas(es) in the main menu scene:

Code: Select all

foreach (var canvas in QuestMachineConfiguration.instance.GetComponentsInChildren<Canvas>())
{
    canvas.enabled = false;
}
And then enable them in your gameplay scenes (canvas.enabled = true).

Re: ORK integration

Posted: Fri Jul 24, 2020 11:51 am
by dlevel
I understand it might be hard to send a reproduction project since it does server saves, but feel free to send me any info that you'd like me to take a look at.
Could you tell me what Save Across Scene does and if I need to have it checked? Also I have multiple quest givers, maybe having a save key would work since all these quest givers have different name, does having the saves in one key helps?


https://ibb.co/HY4spsR

and same for the Quest Journal for ORK, should the save across scene change be enabled (the actual game is in 1 scene, the other scenes are main menu/game over etc)? and Save Key should match the quest giver save key or be different? Need to understand these things so I can debug the save issues :D


Add the icons to your quest database's EntityType Images list. This gives Quest Machine access to the images when you load a saved game.
I did that but the issue persists, how auto-generated quests use a specific DB since they are created on runtime?

Re: ORK integration

Posted: Fri Jul 24, 2020 2:27 pm
by Tony Li
dlevel wrote: Fri Jul 24, 2020 11:51 amCould you tell me what Save Across Scene does and if I need to have it checked? Also I have multiple quest givers, maybe having a save key would work since all these quest givers have different name, does having the saves in one key helps?
In general, Save Across Scene Changes should always be ticked. If it's not ticked on a saver component, then as soon as the game enters a different scene, it will remove that saver component's data from the save system's memory. This is fine for unimportant things like the positions of bullets, or a bird circling in the air. Once you leave the scene, it's no longer important to remember exactly where that bird is. The player won't notice if the bird starts circling from its original design-time position. This helps reduce the size of saved game files while allowing you to save very detailed information in the player's current area.

But most other things, such as the quest lists on quest givers and the player, should definitely be saved across scene changes.
dlevel wrote: Fri Jul 24, 2020 11:51 amSave Key should match the quest giver save key or be different?
The Key should be unique for different things. For example, if you have 2 quest giver NPCs -- a wizard and a knight -- their Quest Giver save keys should be different from each other, and they should also not be the same as any other savers in the game.

However, if you have the same player, or a recurring NPC, in multiple scenes, you'll want to use the same key. For example, say the wizard can be in the Wizard's Tower scene or the City Hall scene, but it's the same wizard. Use the same Key for each instance of the wizard (the one in the Wizard's Tower and the other one in City Hall). This way they'll save and load the same data record.
dlevel wrote: Fri Jul 24, 2020 11:51 am
Add the icons to your quest database's EntityType Images list. This gives Quest Machine access to the images when you load a saved game.
I did that but the issue persists, how auto-generated quests use a specific DB since they are created on runtime?
Is the quest database with those image assignments assigned to the Quest Machine GameObject's Quest Databases list?

The Quest Machine GameObject (actually the Quest Machine Configuration component on the GameObject) registers all images assigned to its quest databases. When you restore a procedurally-generated quest from a saved game, the quest reconnects its images by retrieving them by name from the list of registered images.

Re: ORK integration

Posted: Sat Aug 29, 2020 9:04 am
by dlevel
So I have a weird issue, I have a daily quest generator that generates quests in regard of the players level etc. but if one day the player is level 5 and gets his daily finishes it but never returns it to the daily quest NPC and saves, and then goes to level 6 and next day new daily quests generate, then the previous ones cannot be returned (have requires return to completed checked) nor abandoned (no abandon button since they are completed). Is there a way to handle this? any code I can run to auto complete/abandon these past auto-generated quests?

Re: ORK integration

Posted: Sat Aug 29, 2020 9:36 am
by Tony Li
Hi,

Why can't the player turn in the level 5 generated quest? Presumably the "return to completed" node has the regular generated condition to listen for "Discussed Quest" + the quest ID. That shouldn't chance even if the NPC generates a new level 6 quest. The NPC should show a dialogue with an option to turn in the level 5 quest or pick up the level 6 quest. And the level 5 quest shouldn't be completed until the player turns it in.

Are extra things happening that I'm not picking up on?

Re: ORK integration

Posted: Sat Aug 29, 2020 9:42 am
by dlevel
Wel thats the issue, it doesn't have an option to return the old quests, the just stay on player's quest journal completed and the quest generator has only the new active quests in there not getting the old ones as completed so they can be returned.

Re: ORK integration

Posted: Sat Aug 29, 2020 10:02 am
by Tony Li
At what point do they show completed? When the player does the task, or when the player talks to the NPC again?

(I have to step out of the office for a bit, but I'll reply back as soon as I can.)

Re: ORK integration

Posted: Sat Aug 29, 2020 10:15 am
by dlevel
When the player does the task they are completed to their journal (and hud), and if he goes back to the npc he can return it, but if the player doesn't return and his level surpases the NPCs previous generation quests, the NPC generate new ones and doesn't have the Completed ones so the player can complete them (after saving/loading the quests the next day since the dailies are refreshing every morning)

So the way I do this is having dummy spawn gameobjects in regard of player's level, so at level 5 the dummy objects have spider entities so the generator generates spider quests, at player level 6+ the dummy objects that spawn are skulls so the generator has skull quests. I generate the quests by running generator.GenerateQuest();

Re: ORK integration

Posted: Sat Aug 29, 2020 11:34 am
by Tony Li
When the player accepts the level 5 quest, the NPC's instance of the level 5 quest will be gone. The player will have a new instance of the level 5 quest, complete with information about who to return to when done. So it's OK that the NPC no longer has the level 5 quest in its list.

After the player kills the level 5 spiders, but before the player returns to the NPC, open the Quest Editor window and inspect the player. Is the level 5 quest still in the Active state? The quest nodes should be in these states:
  • Start: True
  • Kill x spiders: True
  • Return to NPC: Active
  • Success: Inactive
Is that the way it looks in your project?