Friday, February 21, 2014

The Daunting Dialogue System, Part 1: Overview & Priority

So, I've finally finished the design document for Lifelike's dialogue system. Funny how a single bullet point ("Integrated, un-intrusive dialogue") can turn into about nine pages of specifications. The design for this definitely turned out to be more complicated than expected. The complexity is mainly caused by the fact that, while our core gameplay is turn-based, the dialogue is real-time.

Because of this, it's possible for dialogue to be triggered while other dialogue is already going on. Find the solution to this problem (and more!) in the first half of the Dialogue System Design Document, after the break.



Overview

Dialogue is our main system of delivering narrative to the player, so it’s important that we get it right.


Dialogue will be delivered through text bubbles that appear above and point to the character talking. They will last for varied amounts of time, and there are a lot of specific things we need to do to make sure it is presented correctly, without awkwardness, and without getting in the way of gameplay.


I’ll begin with general dialogue rules, followed by rules about dialogue priority, and finally detailing different types of dialogue and how each type should function.

General Rules

  1. Dialogue should appear in a white bubble above the speaking character
  2. The dialogue bubble should point to the speaking character
  3. Dialogue can overlap other dialogue in time, but not in space. (i.e., it should be possible for characters to speak at the same time, but dialogue bubbles should never overlap each other on the screen)
  4. (reach? need feedback on the feasibility of this) If dialogue that is either part of a conversation or from a player character is triggered from a character that is off-screen, the text bubble should appear on the side of the screen closest to that character, with a small portrait of that character appearing to the left of the text bubble.
  5. (if we use fog of war) Dialogue cannot be triggered from characters that are inside the fog of war.
  6. Information every line of dialogue needs to have:
    1. The parameters for triggering the dialogue
    2. The text of the dialogue
    3. The character saying the line
    4. The length of time that the line should remain on-screen (in seconds)
    5. The urgency level of the dialogue (details below)
    6. If the dialogue is part of a conversation:
      1. What conversation it is a part of
      2. Its place in the conversation order
      3. Its trigger time (in seconds) after the conversation has began
    7. If it is not part of a conversation:
      1. Has this line of dialogue been triggered already in this play-session?
      2. Can this line of dialogue be triggered more than once in a play-session?
    8. (reach) Size (font + bubble size)
    9. (reach) Bubble type (soft, thought bubble, shout, etc.)


Priorities & Interruption Rules

Different types of dialogue have different priorities. Here is the basic priority list (from highest to lowest):
  1. Death Reaction
  2. Event Conversation
  3. Idle Conversation
  4. Event Comment
  5. Idle Comment

Interruption

A dialogue line or sequence is interrupted when it is forcibly stopped early.

Urgency

All dialogue sequences (whether conversations or stand-alone lines) have an urgency level from 0-2.
  • 0: This dialogue is not urgent at all, and its trigger will be ignored if there is other higher priority conflicting dialogue taking place.
  • 1: Urgency 1 dialogue will take place after whatever conflicting dialogue is happening right now, but will not interrupt it.
    • NOTE: in order to avoid awkwardness, a small delay should be forced between active dialogue and triggered urgency 1 dialogue (i.e., urgency 1 dialogue shouldn’t happen immediately after conflicting dialogue, but after a couple of seconds).
  • 2: Urgency 2 dialogue will take place immediately upon triggering, interrupting any conflicting dialogue.
    • NOTE: a dialogue having Urgency 2 does not necessarily mean that it is important; it’s more related to how time-sensitive the dialogue is. So, unimportant combat reaction comments are still Urgency 2 because it wouldn’t make sense for them to happen several seconds after the event that triggered them.

Conflicting Dialogue

There are two things that make dialogue conflict:
  1. If they involve any of the same characters.
  2. All conversations conflict with each other, even if they don’t have any character conflicts, because it would be too hard to follow multiple conversations.

Active  vs. Triggered Dialogue

Active dialogue is dialogue that is in the middle of happening.
Triggered dialogue is dialogue that is trying to start happening.

Priority Rules


  1. In conflicts, priority of active dialogue beats urgency of triggered dialogue.
    1. For example, reactionary combat-triggered dialogue will have an urgency of 2, as it doesn’t make sense for someone to say “ow!” a couple seconds after getting hit. However, it is still in the priority of Event Comments (Priority 4). So, if a conflicting urgency 1 Event Conversation (Priority 2) or Idle Conversation (Priority 3) is active when the “ow!” would be triggered, the “ow!” will not interrupt the conversation, even though it has a higher urgency.
    2. However, this does NOT mean that a higher priority triggered dialogue will always interrupt a lower priority active dialogue. Example: an urgency 1 Event Conversation will still wait for all active dialogue of any priority to be finished before it begins.
  2. Urgency 1 dialogue essentially ignores priority. Since urgency 1 essentially translates to “not time sensitive”, a low priority urgency 1 triggered dialogue can still be queued up to follow a higher priority active dialogue. However...
  3. Only one urgency 1 dialogue can be queued to play at any time.
  4. If there are no conflicts, it is possible for some dialogue to trigger even when there is already active dialogue taking place.
    1. Example: if a conversation is happening between the player characters, Idle Comment dialogue can still trigger if it isn’t conflicting with the active conversation. So, an enemy could still grunt or cough when dialogue between player characters is happening.

To be continued!

No comments:

Post a Comment