Quest Design Principles

A current goal of the coding team is to review all quests to make sure that not only are they working, but that they follow standardized principles for how they are implemented, that they are coded efficiently, and that they avoid any pitfalls introduced by the Skyrim engine. This means reviewing in the CK as much as in-game.

This document lays out the rules that quests in Skywind are to follow. Coders should work to make sure these principles are met, and should only deviate from them when necessary. (Some examples of when deviation is okay or even needed are given later.)

Quest Design Fundamentals

Rule 0 is that quests should follow Morrowind as closely as possible, save for explicitly decided upon changes. That is to say, things should not be changed from Morrowind for the sake of easier implementation. However, some times our hands will be tied—Rule 0, and every rule given here can be broken if the situation requires it.

  1. The quest must be fully completable without quest markers. This means descriptive objectives and detailed journal entries.

    • Skyrim’s journal does not retain old log entries. Skywind’s journal entries will have to be adapted from Morrowind to include old information (unless UI people can work something out.)

  2. Quest givers should not mark locations on the player's map, unless their dialogue indicates that they will do so. This means that the only time the player will have a map marker is when that location had a map marker in Morrowind.

    • If a quest/info fragment already has a map marker reveal set up (and that map marker wasn't revealed in the original Morrowind), put the AddToMap command inside an if statement like so: if SkywindUtils.DoRevealMapMarkers() // myMarker.AddToMap() // endif

    • This will allow the map marker reveal to be conditioned on a menu option. We may end up not using it, but it will be better to do this than to throw out existing work.

    • Note: Revealed map markers should never have fast travel automatically enabled.

  3. Exploration is a part of a quest; quest markers should aid in exploration rather than supplant it.

    • Consider the quest Beneran's Bounty: You are assigned an NPC to kill, and are told what cave to find the NPC in. However, Percius does not have directions to the cave, and instead points you to Maar Gan to search for better information. The quest marker for this case should point you to Maar Gan first, and only point you towards the actual NPC once you've gotten that information in Maar Gan.

    • Similarly, the first quest of the Main Quest points you to the South Wall for directions to reach Caius; there should not be a marker pointing directly to Caius until the player has gotten directions to him from Bacola Closcius at the South Wall.

    • Quests where the player plays the role of detective should not have markers pointing to specific clues.

    • (Remember that markers are a subset of objectives, not the objective itself! We should still have objectives for Beneran, Caius, etc... at the outset of the quest.)

  4. Player actions have consequences. The player should be able to fail quests by killing the wrong people, losing items, etc…

    • Remember to include new failure stages to the quest to account for this.

  5. All quest NPCs should be in place prior to the beginning of the quest (unless they were dynamically enabled/placed in Morrowind). It should be possible to kill these NPCs before the quest begins.

  6. Quest items can be found prior to the start of the quest (unless they were dynamically enabled/placed in Morrowind).

    • In other words, avoid using an alias to create a quest item, unless you have a good reason.

    • You may have to use a script to record if a player picked up an object early. This way the journal can be properly updated when the quest starts.

  7. The world does not wait on the player: Faction quests are staged to start regardless of if the player has “officially” been assigned the quest.

    • E.g., the player can kill Drarayne Thelas's rats, save Teres Arothan from nix-hounds, etc... all before joining the Fighter's Guild.

  8. Quest items are droppable. That is, don't use the "quest object" flag on the item's alias.

  9. Enabling/disabling objects such as chests should be avoided.

  10. All doors and chests should be pickable. If a door/chest must be non-pickable, it should be barred, magically sealed, etc... not simply "Requires Key".

  11. When the player is asked to collect debt or donations from NPCs, they should be able to pay off the debt or give the donation themselves, bypassing the quest.

    • However, make sure that dialogue prompts indicate this, such as "(Lie) I collected the debt from Desele," so that the player doesn't accidentally skip the quest.

Quest Implementation Standards

These standards are less about fundamental design and more about keeping things consistent between quests.

  1. All scripts should use the fbmw prefix. Be sure to set this prefix in your CK preferences for script fragments.

  2. Scripting should be kept in quest stage fragments or in functions on scripts attached to the quest as much as possible. Scripting in TopicInfo fragments should be kept to a minimum. Ideally, TopicInfo fragments will be nothing but setting quest stages and modifying disposition.

    • If reviewing a quest, move things out of TIFs and into quest fragments whenever possible.

    • This will also make the dialogue revisions for quests much, much easier.

  3. All original Morrowind stages should be present in the Skywind quest.

    • An exception is that some stages can be combined to handle, e.g. how Morrowind had different stages to handle different player genders. In Skywind, we can use one stage with conditioned logs. However, leave a comment about this in the stage fragment, and be sure to change any dialogue conditions calling on that stage.

  4. Stage 1 is used to initialize/start up a quest, generally before the quest is added to the journal.

    • Quests must be started in order for dialogue regarding the quest to run.

    • Quests will not be added to the journal until a quest objective has been displayed.

  5. Stage 255 is reserved for failing faction quests when the quest-giver dies. (Scripting for this is handled on the fbmwXXAdvancement quest.)

  6. Stage 500 is reserved for failing faction quests when the player is permanently expelled from the faction. (Scripting for this is handled on the fbmwXXAdvancement quest.)

  7. Quest Objectives should be numbered to match the stage they are completed on.

  8. When the player uses persuasion checks in regular dialogue, use the following formats for prompts:

    • (Persuade) at the end of the prompt for persuasion attempts (no indication for difficulty)

    • (Intimidate) at the end of the prompt for intimidation attempts (no indication for difficulty)

    • (Bribe ###g) at the end of the prompt for bribery attempts

    • (Lie) at the start of the prompt if you want or need to indicate that the player is lying.

    • (Attack) at the end of the prompt if the player will start combat with this line.

  9. Disposition increases should happen at the start of dialogue.

  10. Code to give an item to the NPC should happen at the start of dialogue.

  11. "Buffer" dialogue should be eliminated. See Quest Dialogue Rewrites, guideline #5 for more details.

    • This is most common for giving items to NPCs but also occurs for things like the "Travel Together" topic. Just make choice top-level.

    • Unused infos should be moved to a new, non-top level topic, named <previous topic name>Unused. Deletion of these responses can happen post-QA.

  12. If responses for a quest-important topic has a disposition requirement with no low-disposition catchall, create new catchalls using the "Info Refusal" sharedinfos.

Coding Review Guidelines

When reviewing a quest, these are some things you should look for, on top of the general "does it work?":

  1. Are there lots of duplicate topicinfos in dialogue?

    • For instance, most faction quests givers have an reaction to the player being expelled that is repeated in several quests. This should be turned into a SharedInfo topic so that the VA only needs to give one take, and so we only need the voice file in the build once.

    • Or, if a multi-segment line has male/female alternatives, use Invisible Continues to minimize the amount of duplicated dialogue.

  2. Is dialogue organized intuitively? For instance, if a topicinfo prompts a yes/no response from the player, the responses should be in the same branch as the topicinfo, and the topic should have a descriptive name. Player responses tend to be set up in their own branches with prefixes like 1, 2, 3, etc... instead of something descriptive. This should be changed.

  3. Are there excessive repeated topicinfos to handle different player responses? For example, one version that has responses A and B, then a second with responses A, B, and C. Morrowind required prompts to be set up like this, but Skyrim does not. Instead, if the responses are properly conditioned, they won't show up in the dialogue menu if the conditions aren't valid.

  4. If there is an NPC follower, do they follow the player wherever the player goes? We want to implement a system that limits them to only follow the player in the direction of their destination.

    • For some NPCs, this can be done entirely by conditioning packages on their current cell (e.g. Satyana should never leave Arenim Ancestral Tomb).

    • Others will need a new system, possibly using a custom region to control where they can go in the exterior. Those cases might need to be handled later as we do not have a "system" for it yet.

  5. Do NPCs have outside-of-dialogue lines at the appropriate time? This applies generally to followers and NPCs that get healed by the player as part of quests. In Morrowind, they would be scripted to say something like "Wait for me!" if you got too far away from a follower or "Thank you!" if you healed a diseased NPC during a quest. This was not added to Skywind originally. The lines for this have been added in-game but the coding for it is incomplete.

  6. Is quest coding optimized? Look for any Actor/ObjectReference properties---these should be minimized or ideally eliminated.

  7. Do quest journal entries retain old information? In Morrowind, you could always go back to look at old entries but this is not possible in the Skyrim engine. So, entries may need to be modified, or the quest stages in general reworked, to make sure that old information can still be reviewed, or to make sure that information can be collected out-of-order from the quest stages.

    • Ideally we would edit the UI so that the player could toggle back to old entries, but currently we do not know if this is feasible. One possibility for quests with lots of info would be to have NPCs give notes to the player with some key information.

  8. Do disposition changes have the right values? Some of coding was never altered from the old days when we used Relationship Rank instead of an actual disposition value.

  9. Have non-voiced parts of Morrowind dialogue been removed from Skywind dialogue? For instance "[Falura Llervu looks down at the ground waiting for you to speak.]" or "As you wish. [Chaplain Ogrul teaches you his version of the Restore Luck spell.] There." The former example should probably get some changes from writing. The latter should be split into two topics with an invisible continue between them, and code to fade out/fade in. For other cases, use your best judgment/ask for advice.

    • Note: The script fbmw_DefaultTeachScript has some functions for teaching skills, spells, and attributes in this manner, so you don't need a custom script each time. Attach it to the quest, then call its functions in dialogue or in quest stage fragments.

  10. Do dialogue topics unlock at the appropriate time? A lot of Morrowind's system was not ported well, so we have, e.g. directions to a quest destination appearing before a quest was assigned, or all parts of a conversation are available instantly rather than having to progress through it. Condition these based on stage, or use quest variables to unlock topics throughout conversation.

    • Note: Be sure to check lines that are in one of the MorroDefaultQuests!

      • When Skywind devs first sorted dialogue into quests vs. the catchall MorroDefaultQuest, sometimes quest-important topics were accidentally left in MorroDefaultQuest when they should have been moved.

      • In Feb. 2021 (build 0.9.9.21), the single MorroDefaultQuest was split into numerous quests with the name MorroDefaultQuest<descriptor>, and organized by topic.

      • The were organized as such in order to preserve the filenames for voice acted lines, and therefore not cause conflicts with the VA pipeline.

      • So, remember to check these quests for relevant dialogue, e.g. MorroDefaultQuestQuestfbmwHRRedoran has misc dialogue related to Redoran quests.

  11. Does the quest properly handle dead NPCs? If a dead NPC would block progression of the quest, then the quest should fail. If a dead NPC would stop a quest from starting, we need to make sure this is handled correctly. For instance, faction quests would need to skip over this quest if there is no dialogue to handle the death. Or, new dialogue could be written if the questgiver is currently not assigned to a VA.

  12. Are pre- and post-quest dialogue properly accessibly before and after the quest? Dialogue will not be available until the quest has started, and will stop being available when the quest has been stopped.

    • Consider moving some pre/post-quest dialogue to it's own (start-game enabled) quest so that the main quest can be stopped while keeping dialogue still available. (There are some optimization benefits to this as well.)

  13. Is cell ownership handled properly, so that the player can reach NPCs in their home when needed? If the player registers as trespassing, it may cause the NPC to break out of dialogue.

  14. If an NPC is scripted to attack the player, is combat handled properly?

    • If the NPC is in a shared faction with the player, you should remove that faction's Combat Relation faction (prefix `0CrFac`) from the NPC, so that the NPC does not register the player as an ally.

    • The SkywindUtils script has three convenience functions for handling combat: StartPersistentCombat (starts combat and sets AVs/factions/relationships so that the NPC remains aggressive), StartCombatAsDuel (starts persistent combat, and also disables all nearby NPCs from assisting), and EndPersistentCombat (undoes the StartPersistentCombat).

Helpful Tips and Hints

  1. All aliases must fill properly for a quest to start. If a quest doesn't start when it should, this is the first thing to check.

    1. You can check which aliases are a problem by setting all of them to "Optional" (hotkey Ctrl+Shift+O), starting the quest, and using sqv <quest ID> in the console to see which do not fill correctly.

    2. Actors must have a Persist Location set on their placed reference in order to fill properly using the Unique Actor fill type.

    3. Unique actors can have only one instance of themselves placed in the world. If there are more, then aliases using that actor will fail to fill. (Landscapers have a bad habit of placing multiple instances of unique NPCs.)

    4. If an alias is created in such a way that it matches another alias, that other alias must be filled first (that is, higher in the list of aliases---they are filled top-to-bottom).

  2. Start Game Enabled quests require an "SEQ" file for their plugin. If you make a new SGE quest to hold pre/post-quest dialogue, make sure to make an SEQ file for your plugin, and leave a note on the Merger spreadsheet to make a new SEQ file for the Skywind.esm file.

  3. When starting work on a quest, click the Recompile All Papyrus Scripts button in the Quest Data. Make a list of all the scripts that fail and check anywhere those scripts are used.

  4. Keep script fragments simple, and put anything even moderately complex in a script attached to the quest. Then, call functions from the attached script. This is easily done with the kMyQuest property on quest fragments, and can easily be done with code like <your script's name> myScript = GetOwningQuest() as <your script's name> // myScript.MyFunction(...).

  5. Make sure that the Target for each condition is correct. That is, make sure it is checking the condition on the correct actor, whether that be the NPC you are talking to ("Subject") or the Player Character ("Target").

  6. Make sure the comparisons/values in each condition are logically sound

    1. AND/OR compares with the next condition down

    2. All OR conditions are evaluated first, for example:

      1. A and B or C and D = A and (B or C) and D.

      2. A or B and C or D = (A or B) and (C or D).

  7. Make sure ALL of the properties you create for scripts are filled!

  8. If you are trying to initiate dialogue with an NPC and it seems like they just won't initiate it and stare blankly at you, check the specific line in the Creation Kit. Chances are, the line they are supposed to say is flagged as a Goodbye line. In order to get around this, make sure you have BOTH the Dialogue Subtitles AND the General Subtitles settings in-game set (Found under Settings - > Display). This should solve the issue for the time being, and the subtitles will pass very quickly because chances are, there are no voice acted lines or blank noise recorded for it yet, which is why it wasn't showing up in the first place.

Note on Moving Dialogue/Topics

Whenever you move dialogue around, we need to be sure that this will not affect the processes of the filecutting and voice acting departments. Here are some guidelines to ensure this is not a problem:

  1. Check the voice acting Trello (or ask @km816) if a character has been assigned to VA yet. If they haven't been assigned, their dialogue can be moved around freely. Otherwise:

  2. Dialogue filenames come from the first 10 characters of the quest ID and first 15 characters of the topic ID.

  3. Only move topics between quests when both quests have the same first 10 characters. Otherwise, it will mess up filenames.

  4. Only move topicinfos between topics when both topics have the same first 15 characters. Otherwise, it will mess up filenames.

  5. SharedInfo topics are a great way to preserve filenames while letting you move dialogue around freely.

    1. Create a new SharedInfo topic on the "Misc" tab. Name it something like <Original topic name>SharedInfo

      • E.g. if I'm moving lines from fbmwFGVasVasTopic, I'd make the SharedInfo topic fbmwFGVasVasTopicSharedInfo.

      • Note that a shorter name can be used if the original quest & topic name are short enough.

    2. Move the topicinfo in question to the SharedInfo topic. Give it a descriptive ID, typically something like <quest><speaker><context>.

    3. Replicate the info to wherever needed (right click --> replicate to topic). Note that you will have to redo the scripting and prompt.