Hello,
I’m still in early stage of UE4 learning, but a skill tree could be really straight forward in BP only.
To implement a skill tree, you will need at least 3 things : the logical tree, some mechanic to apply an effect on the player when a given skill (or combination) is activ, and, some interface to let the player see or interact with the skill tree. I think a good guideline is to design the whole system to be extensible at the minimal dev cost (ie skill adding is as low cost as possible).
The logical part
A skill tree is just a cascade of conditionnal branches (so you will probably chain som Branch node in BP). One approach would be to define a flag for each skill, and let the tree “BP” (BP=Blueprint) Code set flags to 1 or 0, depending on the condition. Search for “Branch Node” in blueprint-related tutorials (youtube, UE4 wiki). I recommend the UE4 tutorial channel on youtube for this matter, if you are entirely new to UE4. This BP can be on playercharacter. This is almost as simple as drawing your tree on a paper.
The effect on the player
here, you take your skill flags or flags array, and code the effect of what you need for a given skill flag or any relevant combination you need for your project. This can be also on playercharacter BP. As you see, the communication between the logical tree and skills are some flags. This way, you separate the logic of the tree, from the implementation of the effects on the player (which you’ll implement at the most appropriate moment for you in the project).
The interface
by using UMG, you provide an interface that will display the state of your tree, and let the play select an unlocked skill. This should be a separate logic from the Playercharacter (I’m not yet on UMG learning, so beware : educated guess ahead). Basically, the UMG code will only have some icons, and will display an “activ” or inactiv icon for a skill, based on the status of the flags. Ideally, you would avoid to implement any logic related to the skill tree on the UMG part (keep it in the tree). the GUI would just read skill flags, and trigger some event to request the assignation of a skill, and read the result (use event here, I think). If you start to dispatch some part of the logical tree here and there, your brain will explode at some point or another when debugging the skill system…
I think no C++ is required at all, and I would even not recommend the use of it for the logical tree itself (it’s more quickly tweakable from BP). Usage of C++ of the effects can be interesting, but not required, unless you have some very specific effect to accomplish (time warp? black hole spawning in the middle of a town… :P)
You’ll probably need some C++ if you intend to produce an auto-layout system for the display of the tree on GUI, by this approach is very unlikely to be suitable for a game. An auto-layout is relevant if you have a dynamic array of skills, which I never saw in a game.
Regards,