Skill Trees ~ Summary of md doc file for skilltrees - uchicago-cs/chiventure GitHub Wiki

md doc file linked below: https://github.com/uchicago-cs/chiventure/blob/dev/docs/skilltrees.md

This doc contains a high-level design philosophy of the skill trees feature, taking a “dual-object” approach to define two separate interfaces and implementations:

  • Object 1: Global Skill Tree (GST)
  • Object 2: Individual Skill Trees (IST)

Below is a summary of the two main objects and their respective interfaces and implementation:

Implementation:

GST structs and enums:
sid_t: enum type defining skills as variables
skill_type_t: enum type defining active/passive variables (whether the skill is active or not in a player)
skill_node_t: a struct which holds critical info about the skill and each skill has one skill_node_t struct corresponding to it
skill_tree_t: a struct that stores multiple skill_node_t structs
tid_t: enum type corresponding to a distinct skill tree that the player has access to, each skill_tree_t has a distinct tid

IST structs:
skill_t: Each skill has a corresponding skill_t struct using info from the global skill tree implementation (it uses the sid_t and skill_type_t enums described in the global implementation)
skill_inventory_t: holds all of the skills that a player has (thus, holds multiple skill_t structs). Each player has exactly one skill_inventory_t struct

Interface:

GST:
To interact w/ structs mentioned under implementation and learn more about the functions: include/skilltree.h

IST:
Details about functions used to interact with skills structs: include/skill.h
Details about functions used to interact with inventory structs: include/inventory.h

Interactions between GST and IST:

Details about functions used to interact at the intersection of global skill tree and individual skill trees: include/skilltree.h