-
Notifications
You must be signed in to change notification settings - Fork 13
NPC ~ Design Document for NPC Dialogue and Action Implementation
Dialogue in Chiventure currently lacks any custom actions players can take in conversation. As of now, users can respond with standard dialogue options; only an internal implementation of adding options to give or take items has been added to the dialogue code.
Adding a range of custom actions could enhance the variety of potential conversations. Designs for a couple of new actions, including STEAL
, TRADE
, and BUY
within the npc/action design could easily be integrated into the node_actions
struct in the dialogue module to represent actions. We will then create a design document explaining a future implementation of these actions into conversation.
Conversations are currently implemented as directed graphs where the nodes are the NPCs' reactions and the edges are the options the player can choose in response. These options include dialogue responses as well as two actions, defined as node_action_type
– GIVE_ITEM
and TAKE_ITEM
. START_QUEST
and START_BATTLE
also exist but are not fully implemented as the battle and quest features of Chiventure have not been fleshed out enough yet.
On the other hand, documentation for the NPC action module defines a npc_type
enum containing 6 potential actions– TALK_TO
, IGNORE
, GIVE
, STEAL
, TRADE
, and BUY
. It also defines an npc_action
struct where custom NPC actions can be created. Consult the NPC Action Documentation for more details.
First we must consolidate the npc_actions
and node_action
structs. Some of the available action types already overlap in design– for example, GIVE
and STEAL
in npc_action with GIVE_ITEM
and TAKE_ITEM
in npc_dialogue. GIVE_ITEM
and TAKE_ITEM
provide a more flexible list of uses when compared to the situational STEAL
option, so they will substitute for GIVE
and STEAL
respectively. TALK_TO
would not need to be included within NPC dialogue as the initiation of the conversation implies the player talking to the character. The other 3 new actions in npc_actions will be integrated into the new enum type. Each unique node_action will be classified as either KIND 4
, KIND 5
, or KIND 6
. A new module will need to be created to classify different types of NPCs and the KINDS
of actions they have access to (design is provided in the next section).
To fully implement npc_actions into the existing conversation design, custom functions for adding each of these actions as nodes into conversations would be necessary (modeled after add_give_item
, add_take_item
, add_start_quest
, and add_start_battle
). Their definitions would have the following format:
int add_action_name(convo_t *c, char *node_id);
TRADE
would also require some type of char* item_id
for each item part of the swap. A basic implementation of a 1-to-1 trade could be formatted as such:
int add_trade_item(convo_t *c, char *node_id, char* given_item_id, char* received_item_id);
Future implementations of a trade action where players can give and receive multiple items could include linked lists of strings. The item_wrapped_for_llist
struct defined in game-state/item could be implemented as such:
int add_trade_item(convo_t *c, char *node_id, item_list_t* given_item_id_lst, item_list_t* received_item_id_lst);
Then, the cases in do_npc_action
would need to be made for each unique action. The actions taken within the code would vary based on the content of the action– for example, GIVE
/TAKE_ITEM
uses functions from the game-state/items
module to manipulate the player’s inventory. However, each of these cases should have error-raising conditionals to return FAILURE
if the action cannot be completed under current conditions. To do this, functions from the action module from used, particularly do_npc_action
, do_npc_item_action
, and do_npc_item_item_action
. These functions execute KIND 4
, KIND 5
, and KIND 6
actions respectively, returning a string indicating the success of the action. Once a new type and struct are created to consolidate npc_actions
and node_actions
, these functions can simply take a pointer to these actions and execute them on a case-by-case basis.
- A currency system to trade with NPCs
Currently there is no currency system implemented within Chiventure. This is to be expected since there was no need. However, one of the crucial aspects of npc-actions is to have the player be able to trade with the NPCs. This could be accomplished through simply trading items given that the implementation of actions and dialogue needs only an item to trade or steal. But having a currency system and module would be an interesting idea to explore. Other considerations would including needing to figure out where the currency comes from and integrating it with different modules including but not limited to NPCs, action, quests, battles, sound, etc.
- A NPC mood and personality module
This module could implement personality and mood features specific to NPCs that influence the way they interact with the player. For example, a mood meter could fluctuate depending on whether the player makes negative or positive actions towards the NPC. A lowered or heightened mood could restrict or expand an NPC’s available conversation choices or change rates of in-conversation events occurring (certain information or items being given). NPCs could also be assigned different personality types, requiring players to employ different strategies in conversation to unlock certain information, actions, or unique features of the characters.
- More types of NPC actions
Many other actions could be implemented to further diversify the range of NPC interactions. Some potential actions include:
HUG
,LAUGH
,COMPLIMENT
,INSULT
, orRECRUIT TO PARTY
(potential implementation of parties of NPCs accompanying the PC, providing services like giving items, healing, conversing, providing information, and battling). In terms of the action functionality, changes in game_state via the functions defined in mode could be implemented for actions that trigger changes outside of conversations. For example, anINSULT
action could connect to the NPC state module and change an NPC’s mood value.
-
Action Management
-
Battles
- Design Document
- Text Based Combat in Other Games
- User Stories
- Wishlist
- Battle Planning 2022
- Battle User Stories Review 2022
- Structs in Other Modules Related to Battles 2022
- Stat Changes Design Document
- Run Function Design Document
- CLI Integration Design Document
- Move Changes Design Document
- Unstubbing Stubs Design Document
- Battle Items and Equipment Design Document
- Battle Item Stats
- Battles Demo Design Document
- Battles Testing Moves, Items, and Equipment Design Document
- Sound integration with battle (design document)
-
Custom Actions
-
Custom Scripts
-
DSL
-
CLI
-
Enhanced CLI
-
Game-State
-
Graphics
- Design Plan
- Design document for integrating split screen graphics with chiventure
- GDL (Graphical Description Language)
- Graphics Sandbox
- Design Document for NPC Graphics and Dialogue
- Feature Wishlist (Spring 2021)
- Installing and Building raylib on a VM
- LibSDL Research
- Module Interactions
- Working with Raylib and SSH
- raylib
- GDL
-
Linking the Libzip and Json C to chiventure on CSIL machines
-
Lua
-
NPC
- Dependencies: Player class, Open world, Battle
- Action Documentation
- Design Document for NPC Generation in Openworld
- Design and Planning
- Establishing Dependencies
- Implementation of Custom Scripts
- Independent Feature: NPC Movement Design Document
- Player Interaction Design and Planning
- Dialogue
- Design Document for NPC Dialogue and Action Implementation
- Loading NPCs from WDL Files
- NPC Battle Integration Design Document
- NPC Battle Integration Changes Design Document
-
Open World
- Autogeneration and Game State
- Deciding an integration approach
- Designing approach for static integration into chiventure
- Feature Wishlist
- Generation Module Design layout
- Potential connections to the rest of chiventure
- Single Room Generation Module Design
- Source Document
- User Stories
- World Generation Algorithm Plan
- Loading OpenWorld Attribute from WDL
-
Player Class
-
Player
-
Quests
-
Rooms
-
Skill Trees
- Avoiding soft locks in skill tree integration
- Components of Exemplary Skill Trees
- Design Document and Interface Guide
- Environment interactions based on skill characteristics
- Integrating complex skill (combined, random, sequential, etc.) implementation
- Integration of a Leveling System
- Potential Integration with existing WDL
- Research on game balancing in regards to skill trees
- Research on skill tree support in modern day game engines
- SkillTree Wiki Summary
- Skilltree "effect" implementation and roadmap
- Summary of md doc file for skilltrees
- Design ideas in connection to other features
- Summary of Skill Tree Integration 2022
- The Difficulty of the Reading the World
- Complex Skills Summary
-
Sound
-
Stats
-
WDL