-
Notifications
You must be signed in to change notification settings - Fork 13
NPC ~ Action Documentation
Action is an aspect of the NPC module which allows the player to interact with the NPCs by talking to and trading with them. The current actions can be split into three larger groups, called KIND 5, KIND 6, and KIND 7 ACTIONS. The name of these groups is inspired by, but not directly related to, actions KIND 1, 2, 3, 4 in the action management code. With KIND 5 ACTIONS, the player can either TALK_TO or IGNORE to the NPCs. In KIND 6, the player can GIVE or STEAL an item from the NPCs. In KIND 7, the player can TRADE or BUY with the NPCs. In the actual implementation, the functions are called do_npc_action, do_npc_item_action, and do_npc_exchange_action respectively.
In order to implement these npc specific action functions, a new struct called agent_t was introduced to Chiventure. The agent_t can hold an item or npc, meaning that a new layer above items and npcs is added.Many helper functions that will be used in the future implementation of npc/actions overlap with the item functions, and thus agent_t was created. agent_t is in npc.h, however, there were many files that were affected due to this new struct including files in actionmanagement and game_state.
/* Agent: a struct of things that you can perform actions upon
* - item: an item
* - npc: an NPC
*/
typedef struct agent
{
item_t *item;
npc_t *npc;
} agent_t;
Furthermore, the enum actions_t and action_kind (both in action_structs.h) were modified so that they contain the respective KIND actions related to npcs.
Lastly, an important structure is the linked list called list_action_t in action_structs.h. It is simply a linked list of actions_t. This was added as a new variable in the npc_t struct to represent all of the possible actions the player can initiate with the npc.
/* A linked list struct that contains the following:
* - action: the action at the head of the list
* - next: the next item in the linked list
*/
typedef struct list_action {
enum actions *npc_action;
struct list_action *next;
} list_action_t;
The three functions of this module consist of do_npc_action
, do_npc_item_action
, and do_npc_item_item_action
. In order to assist with the implementation of these, a helper function called contains_action was also introduced. It checks if the action is listed on the list_npc_action_t of an npc (which is a represent all of the possible actions the player can initiate with the npc).
With this helper function, in mind, they all share the same basic parameters of context struct encapsulating the shared state in chiventure, an NPC action type struct, an npc struct, and a string describing the result of the function. The latter two contains an item parameter which is the item to exchange hands for KIND 6 and which is the item in the npc's inventory for KIND 7. The first few include structures from other modules and can be found in the respective modules. The last parameter of the string is especially useful for integrating the npc actions aspect with the npc dialogue aspect, which is explained more in depth in the action in the NPC Dialogue and Action Implementation documentation. If all conditions are met, the player is able to successfully interact with the npc and a 0 is returned, while errors will be returned if successful
KIND 5 and KIND 6 are fully complete. However, with KIND 7, the BUY part cannot be implemented yet since there needs to be a currency-like feature first. Additionally, for TRADE for KIND 7 the player can’t choose which item to give away and it just takes the first item on the list which has a higher price than the wanted item. KIND 5 and KIND 6 are fully complete. However, with KIND 7, the BUY part cannot be implemented yet since there needs to be a currency-like feature first. Additionally, for TRADE for KIND 7 the player can’t choose which item to give away and it just takes the first item on the list which has a higher price than the wanted item. These two issues will are also outlined in the backlog.
Currency: https://github.com/uchicago-cs/chiventure/projects/1#card-82635563
Choosing item: https://github.com/uchicago-cs/chiventure/projects/1#card-82635632
-
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