Thursday, August 11, 2016

Sunday, July 24, 2016

Saturday, July 23, 2016

Friday, July 22, 2016

Thursday, July 21, 2016

[Engineering] Skill Tree Breakdown

One of the many features in Project Einherjar is the ability to enhance the Valkyrie's abilities. In-game, this is done through the skill tree system. A staple in many RPGs skill trees are complex systems usually involving multiple branches in which the player can customize their character.

Being an RPG enthusiast myself, it was pretty fun programming this system. Here I will be discussing a bit of a breakdown on how our skill tree works.

One of the main things that are always found in skill trees are "leaves". Leaves are the individual skills themselves, which more often than not have a prerequisite to be unlocked. This is the first part of the skill tree system we made. The SkillLeaf class we made contained data like its name, the required points to purchase said skill and a list of prerequisites needed in order to be even able to purchase it in the first place. It also contained functions such as Unlock, which is implemented differently based on classes derived from this class. Each leaf also has references to its "parent" leaf and "child" leaves. Parent referring to prerequisite leaves, child referring to leaves that require it to be used.




The next part of a skill tree is the branch. Branches are what split the leaves inside the tree. One branch could all relate to a specific aspect of the character. Branches, at the start, actually only contain one leaf called the root. Root leaves are leaves that have no parent thus starting immediately available to the player for purchase. The branch is responsible for generating the rest of the leaves using only the root leaf. Each time the branch generates a new leaf, it checks if the newly loaded one has a child leaf and continues until a leaf loaded has none. We did this way so that we could easily rearrange the order of leaves on a branch without messing with a blueprint too much. Designers could simply change what child leaf a skill has to rearrange the branch. This system also supports mutli prerequisites but was unused in-game.



The last part is the actual tree itself. The tree is composed of branches and contains data such as current skill points. Perhaps the last complex part of the actual tree as it mostly served as a way to simply have a container for multiple branches.




To those curious, this was mostly done in C++. The skill leaf class was made in C++ but each skill leaf in game was implemented using blueprints.