How to make a skill tree?

H

Homunculus

Guest
I guess a picture is worth a thousand words...?

There are many ways to implement something like a skill tree, but you generally want to involve data structures like ds_lists, ds_maps and arrays.

I'd start by creating a structure for every skill defining the name, icon, description, acquired state, etc... A skill therefore could be a ds_map with keys pointing to its properties, or an array where every position references a specific property (using an enum instead of hardcoding the array index).

Once you have the above, it's just a matter of determining how to construct your tree. You could add a "children" and "parent" property to the above structure for example, where parent points to the required skill required to unlock the current one, and children can be a ds_list or array of sub-skills. This allows you to traverse the skill tree both ways starting from anywhere.

All of the above is of course unrelated to how the players see and interacts with the skill tree, you will have to build a user interface on top of that.


If it sounds a bit too generic, well, it is. You didn't spend much time explaining the specifics nor what you did so far, so...
 
O

omid

Guest

Yes thanks for your comment. A simple tree diagram that can be used to insert and store a family tree, for example.
 
H

Homunculus

Guest
The basics are as described above, you have to define the "nodes" of the tree (skills for example) and the "edges" (how nodes are connected).
The specifics depend on the kind of tree you trying to build. A family tree is different from the tree in the image you just posted for example.
 
O

omid

Guest
The basics are as described above, you have to define the "nodes" of the tree (skills for example) and the "edges" (how nodes are connected).
The specifics depend on the kind of tree you trying to build. A family tree is different from the tree in the image you just posted for example.
thanks for your comment
 
Top