C# boolean based skill tree

Hi all,
I’ m currently working on a top down Rpg for android and would like some input in regards to the Skill system that i plan to make.

The game uses 4 vitals - hp, fatigue, BioEnergy(think space magic) and Shields, which have values that all scale on their own with levelings (i want to avoid attributes) but may also be added to by cetain skills (e.g. +30 hp to basevalue from Skill_X)

For the skill system i have multiple groups (e.g. Melee, Pistol, Armor, Science) and under each group or tree there are a collection of perks in a tree. I was thinking of using booleans to say if a skill is learned or not so when the player spends 1 skill point (gained on leveling up) they unlock a skill in the tree and provide access to the next one.

So, (sorry for the long post) I was wondering if anyone could give some advice on how to list the skills and create the code for a skill tree in this fashion (i can do a gui later) which will check to see the prior skill has been attained before unlocking more.

Thanks,
Jose

Bumpity bump…

Anyone?

i guess noone answered until now as your question is quite unspecific. so the answers also will be very unspecific.

personally i think there is no ideal, best or perfect way to achieve this. all have drawbacks and advantages. what system may suit you best depends on how flexible, extendible and code independent you need it. if you are the only developer and prefer to work in code rather than editor this may work as you described it. if you need more features (several skill/perklevels, multiple prerequisites, high automation when adding/changing the tree) i would suggest to invest some more work. it also mainly depends on how you only have passive skills which enable a certain weapon or bouns or if your skills contain active “abilities” which need to be activated and run for a certain time.
all those questions remain unanswered in your post and that may be one reason people have difficulties to formulate an answer. also this system heaviliy depends on other systems we have no knowledge about (fe health, poison etc) so we cannot suggest you how to do it. on the other hand if you post your code of all other relevant systems hardly anyone will go through it as it simply means doing the work for you. thats what i meant with unspecific question. the smaller the bits the better a reader can chew (understand) them and try to help.

i would put the skills in a class with an enum for each skill. the skill contains a list of required skills, name, icon, the cost of purchase, the trained level (if more than one). then the skill(tree) is simply a list of this class fed with proper values. and the skillmanager contains this list and provides some convenience methods to get all trained skills, all skills currently available for training, check if a certain skill is trained (and active). note that none of the classes needs to inherit from monobehavior if you don’t need the functionality of it.

there may be some rpg-packages in the asset store. maybe purchase one and see how they do it or use it right away. also the burgzergarcade hack + slash tutorial contains a basic rpg system with vitals, buffs und skills.

1 Like