QuestList table change

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
JorisVanEijden
Posts: 114
Joined: Mon Aug 12, 2019 5:02 pm

QuestList table change

Post by JorisVanEijden »

Can we move the DisplayName of quests from the template txt files to the QuestLists?
Or at least duplicate them there?

This allows us to show lists of quests without having to parse/partialparse/load/instantiate them. And it makes things easier for quests that do not come from Template .txt files or TextAssets.

It's easy enough to do in DFU itself, but what is the best way to deal with table schema changes for mods/questpacks?

Add a Unity menu item to run migrations?
Detect and warn about incompatibility?
Just let them break until upgraded?

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

Re: QuestList table change

Post by Interkarma »

Just FYI, all in-game text will be migrated and unified to a new text database format. I'm deprecating the text tables and other sources of text, and will gradually migrate everything over. This is to best support translation efforts so we don't have text scattered all over the place.

I'll be happy to change querying quest names into a text database lookup at that time. But something I'm trying to discourage is building any further off the text tables, as they're going to go away. Some text sources, such as the text built into quests, will remain as default/fallback to maintain backwards compatibility. Quest authors will only need to use the new text database for translations of their quest packs.

I have some time coming up in March where things will slow down at work. I'll put my new game project on the back burner for a few weeks and shift my development focus solely into the new text setup. It's in my own interest to get this right both for DFU and my next game, which also has a lot of text. :)

User avatar
JorisVanEijden
Posts: 114
Joined: Mon Aug 12, 2019 5:02 pm

Re: QuestList table change

Post by JorisVanEijden »

After a long pause I've started picking up my quest editor work again.
For now it produces quests as Unity assets that can be loaded like this in DaggerfallWorkshop.Game.Questing.QuestListsManager.LoadQuest():

Code: Select all

// This is the existing way to get quests from mods:
TextAsset questAsset;
if (ModManager.Instance.TryGetAsset(questName, false, out questAsset))
{
    List<string> lines = ModManager.GetTextAssetLines(questAsset);
    quest = QuestMachine.Instance.ParseQuest(questName, lines.ToArray(), factionId, partialParse);
}
else
{
    // This is the way to get quests from the quest editor:
    QuestTemplate questTemplate;
    if (ModManager.Instance.TryGetAsset(questData.name, false, out questTemplate))
    {
        quest = questTemplate.InstantiateQuest();
    }
}
(remarks and suggestion very welcome as always)

Making the names of the quests available for the QuestListManager currently has to be done by supplying a TextAsset with a questlist Table. Not ideal, but doable.
But the Table has no definition for the DisplayName of the quests so the current way to get those to the quest-chooser-popup list is to heed the partialParse boolean so that questTemplate.InstantiateQuest(true) returns a Quest object with just the DisplayName property filled and nothing instantiated.
This is starting to feel a bit too hacky for my taste so I'm looking for alternatives.


P.S. can we get a code syntax highlighter like https://github.com/s9e/phpbb-ext-highlighter installed?

Post Reply