Devlog 4: NPCs Dynamically And Dialogue System

Characters/NPCs GamePlay




NPCs dynamically react to the player's actions:

Characters can see what the player is attempting to do in certain circumstances, like the player calling a character, if a character with low trust sees what is occurring, they can block what the player is attempting to do, and if successful will result in that character who the player called, to lose trust. 

There is a potential of characters getting kicked out, if the players manage to persuade important characters. If an important character spots another character helping or is protecting the player, they can get that character helping the player get kicked out of the restaurant.

Gathering of characters, if the player is being very mischievous, they will attract the attention of every character they have encountered. An example, during player exploration, if a player collides with a sculpture and it drops. Will cause the characters to go towards the player’s locations to see what the problem is. If they see the player, it will result in a failure condition. 

Sibling interplay, certain characters can ask the player to do certain things, like tricking or pranking other characters mainly siblings, which the player can use to their advantage. Pick up system: Paired with the NPC dynamics mechanic, players can pick up objects. Like glasses, cups, plates, including Tanzanian small artifacts, sculptures, and art. Depending on the significance of these objects, players can pass or give them to characters in the restaurant. As part of the sibling interplay, where if a character spots, another character with an important object. They will attempt to grab it off the character that is in possession of that object.

 

Dialogue System

Players will find the dialogue system familiar, as it operates within the turn-based and selection-based mechanics commonly found in RPGs. The system is initiated when players interact with characters or NPCs, presenting them with dialogue and path options. Depending on the conversation type, the main character, David or Matais, will initiate the dialogue. In most cases, the characters/NPCs will start speaking first, their words appearing in the dialogue box. Once the NPCs have finished speaking, the player can respond by selecting a path, thereby exercising their agency in the conversation.

 

During preproduction, I initially designed the dialogue system with three rigid options for the player to select from, which I referred to as agreeable, rude, and neutral. However, after extensive playtesting, I realized that the system was not as engaging as I had hoped. Players were not reacting as I had anticipated, and the system was not eliciting the desired excitement and engagement. As a result, I made significant changes to the system, which I will detail in the following sections.

To complete the prior dialogue system

  • If a character is essential to the plot or gameplay, players have three options.
  • If a character is less important to the plot, players have two options.
  • Additionally, depending on the result of a conversation or if there is no more dialogue, there will be one or two options to select from.

These choices can lead to various outcomes. For instance, if the player has a negative encounter with a character and reencounters them, the character may immediately call for security or warn other characters to stay away from the player. The player then has the option to apologize or stand their ground. If they choose to stand their ground, the character will call for security, and the player will be chased. If caught, this could lead to a failure condition. I have retained some of these outcomes to maintain the stakes and consequences of the player's choices.

 

Instead of only three options for players to select from in the updated dialogue system, I tested and added more options that vary in emotion regarding agreeability, rudeness, and indifference. This makes the dialogue experience feel much more natural and impactful. Additionally, it elicits the feelings I wanted from the players, who were reactive and engaged during the playtesting.

Depending on the character’s importance to the primary mission and progression, the player’s influence is reflected in the increased dialogue options and the extended length of the conversation from 6 to 10 layers of dialogue. This empowers the player to shape the game world according to their choices.


Player response affects the trust gauge, and each character’s trust gain and loss points dynamics are unique and based on their personality. This adds a layer of complexity to the game’s social system, making it more engaging for the players. As the dialogue progresses, a character’s trust points increase both in gaining and losing, reflecting the intricacies of trust dynamics.

For example, when the player initiates an interaction with a less important character, they will receive four responses: two from David and two from Matias.

The player’s response trust effect on the first layer can lead to significant gains or losses, ranging from 8 to 10 trust points. As the player progresses to layer 4, the stakes are raised with the trust points number increasing to a range of 20 to 40 points, making the player’s decision feel weighty and impactful.

Continually, to make the interaction generate more emotion from players, I implemented a player timer response that functions when the character/NPC completes their dialogue. The player has a set timer of about 20 - 40 seconds to respond (response time ranges depending on the number of response options). If the player responds within the given timer, the character will complement the boys, increasing their character/NPC’s trust. If the player does not respond in time, the character will insult the boys, and some trust will be decreased.

For example, all Characters have a trust gauge bar of 100 points, which is the full amount,

Depending on what you have done during exploration, the characters might be different when you interact with them for the first time. Some might be 50 or another 70

When the NPCs complete the dialogue, you reply within the timer limit and gain five trust points, and when you don’t reply within the timer limit, you lose 8 trust points.

Let’s say you replied with an agreeable path response with 20 trust points but did not reply in time, which would cost you about eight trust points. In total, you would gain 12 trust points. Your time response either adds or subtracts trust points from your response option.

 

Here are the key components for the dialogue system

Player Input

  • Use the keyboard (E to initiate, space to skip/type) and UI buttons (choices)
  • Input. GetKeyDown() check allow the player to:
  • ·      Start dialogue if NPC is nearby
  • ·       Skip typing
  • ·       Advance through dialogue


Dialogue layer 1 to 8 or 10

Each layer is a structured exchange:

  1. NPC speaks, (NPC dialogue)
  2. The player picks a response (4 – 8 options, depending on the character)
  3. The system evaluates the player response, adjust trust, and shows character’s reaction.
  4. The system progresses to the next layer or ends.

 

System Breakdown

  • Initialization (Start)
  • The canvas is hidden
  • The timer is configured

 

2. the dialogue start (StartDialogue)

  • Triggered by the player pressing e in range
  • Unlock the cursor
  • Sets up the first dialogue layer (SetDialogueLayer())

 

3. Dialogue layer Execution (SetDialogueLayer)

  • NPC speak via typeSentence()
  • After typing completes, player choices are shown
  • Timer begins for the player to respond

 

4. typing effect (Type Sentence)

  • Simulates letter by letter typing
  • Plays typing effect/ sounds
  • Can be skipped with space.

 

5 player response (SetPlayerTurn and ChoosePath)

  • Shows number of buttons with the player dialogue choices
  • Clicking a button
  • Plays a sound
  • Stops the timer
  • Adjust NPCs/character’s (trust score) if answered before timeout.
  • Starts the player response coroutine
  • Proceeds to a custom coroutine like HandleLayer() based on the layer

 

6 response evaluation (AdjustCharacterBasedOnPath)

  • Each choice is mapped to a specific character score change (positive or negative)
  • Trust can swing significantly depending on the tone/content of the player’s response

 

7 NPC/Character Reaction (Character Response)

  • After the player speaks, character reacts with a short follow up
  • Randomly picks from positive or negative responses depending on the character change from the last answer.

 

8 Timer Mechanism

  • A 20 second countdown starts when player choices appear
  • If it reaches 0, OnTimerExpired() triggers
  • Character (Adila Mizik) drops by 10
  • Character insults or scolds the player
  • Conversation proceeds regardless.

 

9 Dialogue End (EndDialogue)

  • Happens after the final layer or if the player exits the interaction zone/radius
  • Hides UI
  • Resets cursor lock and visibility
  • Calls CheckcharacterlevelAtEnd() to handle final trust logic

 

Summary:

  • The dialogue tree system is a layered, reactive dialogue system that does the following:
  • Controls dialogue follow using layers and coroutines
  • Creates immersive pacing with the typewriter and audio feedback.
  • Challenges the player with time-sensitive choices
  • Tracks trust dynamically through a trust system
  • Branches conversational paths based on trust and timing, leading to varied narrative outcomes.

 

 



Character UI:

Each character has a unique UI design and colour scheme to ensure each interaction is exceptional and distancing. Character Us is designed to be simple, straightforward and easy to use. Beginning from the left side of the conversation, the UI is the character's picture portrait with their name on top. In the middle is the dialogue box where the character's dialogue sentences and player response appear. Slightly on the right are the path buttons or player response buttons. A sidebar or scroll bar allows the player to scroll up and down to ensure that the player views all of their reply or response paths.



 

Comments