Skill Trees ~ Skilltree "effect" implementation and roadmap - uchicago-cs/chiventure GitHub Wiki

The effect.c and effect.h files are responsible for describing the actual results of the skills that are part of skilltrees. The current design tries to depict a way for game developers to easily be able to add tangible results to their created skills. This has been done by splitting effects into three different "atomic" types: statistic modifying effects, damage-causing effects, and attribute modifying effects. These are all combined using a union into the effect struct. Future developments of effect will hopefully result in us being able to combine multiple effects in different ways. Further information on the ways effects will be combined is given on this wiki page: Integrating complex skills into skilltrees .

2022 Update: The current version has effect_type struct setup into 4 “atomic” types since the statistic modifying effects type was divided into player statistic modifying effects and item statistic modifying effects. Some complex skill implementations are could be added as described on this wiki page: Integrating complex skill (combined, random, sequential, etc.) implementation . There are some functions and tests left to complete as well as effect integration to complete.

Version History

The current version of effect.c and effect.h is v1, which only describes a design and has very barebones implementation, with most methods being skeleton methods.

2022 Update: The current version is v2.1 There are still some function implementations left to complete, some testing to fix, and other specifications to add such as complex skill implementation.

Statistic Modifying Effects

Statistic modifying effects are effects that describe the modification of player stats such as maximum health, attack power, defense power, etc. These effects maybe be permanent or temporary (if permanent, the duration is set to 0). These work by modifying the player effects hash table or the player statistics hash table. v1 of effect.h and effect.c described the design of this type of effect and listed some crucial methods that would be related to this effect type. We hope to have at least a barebones implementation for these methods in v2, which is slated for completion by end of sprint 3 2021.

2022 Update: Crucial methods and functions were added to the effect.h/effect.c files which apply statistic modifying effects. Overall, statistic modifying effects were separated into two categories; 1) player statistic modifying effects and 2) item statistic modifying effects. This means that statistic modifying effects are effects that either modify player stats such as maximum health, or modify item statistics such as durability. A lot of the functions dealing with item_stats still need to be completed, for instance the item_stat_effect struct is yet to be completed where the player statistic effect functions are generally better fleshed out.

Damage Causing Effects

Damage causing effects are effects that cause damage to an opponent in battle. An example of a skill that would do this would be something like a skill named fireball, which causes 10 damage to an enemy. This effect type will hopefully also be implemented in v2 of effect.c and effect.h. Implementation of this effect relies on working with rpg-battles. In the future, it may be possible to change the implementation of this effect to cause damage of different types, such as poison, fire, etc.

2022 Update: Damage causing effects generally rely on the battle team's documentation/implementations. For instance a move_unlock enum is used to "unlock" a move which can then be used to cause damage. Further collaboration with the rpg-battles team is needed and certain implementations are unfinished, for instance on the move_effect struct and the execute_move_effect function.

Attribute Modifying Effects

Attribute modifying effects are effects that modify the attributes of objects in the game world. This effect type would allow a game developer to add skills such as lockpicking, which would enable a player equipped with this skill to open doors that would otherwise require a key. This effect type will also hopefully be implemented to an extent in v2 of effect.c and effect.h; however, a fully fledged implementation of this effect type may take longer than other effect types as it is probably more complex than the previous two skill types.

2022 Update: Item attribute modification has been added and there are basic functions such as a function defining an attribute modifying effect. While there is a struct which defines an effect that changes the attribute of an item, it is limited to changing the attribute only if it is a boolean, character, integer, or string so this could be expanded to take other types. Furthermore, creating a new attribute is not yet supported.

Future Roadmap

In the future, we hope to develop a way to link multiple atomic skill types together. v1 relied on a linked list so that a skill could have multiple effects; however, we will delete this for v2 and add a few more effect types in the future so that we can describe complex skills in a better manner in the future. We also hope to rewrite the current tests to support our new implementation of tests before the end of this class. Any of these activities not completed would hopefully be taken over by the rpg-skilltrees team in 2022.

2022 Update: It seems that skills still use a linked list to contain all the effects a skill can have as seen in the skilltrees_common.h file, while there isn’t a way to link multiple atomic skill types together in a complex skill type. Furthermore, while the statistic modifying effects were separated into either player or item statistic modifying, it might be possible to add more effect types to make skills more complex. Tests seem to be fairly thoroughly implemented but some sections must be fixed which were commented out due to test failure (for instance in inventory_test).