Growing a Skill Tree - Dustin Myers


A lot of games lock progression behind a skill tree. And honestly, its a great thing to have! By letting the player choose what to invest points into while they play, it allows them to specialize in the mechanics they enjoy, and give them incentive to explore or kill more monster or whatever other mechanic is in place that lets them get that next upgrade. But implementing a skill tree can be a bit of a hassle.  

When coding a skill tree, there are quite a few variables you have to keep in mind:
Is the skill already unlocked?
Is there a previous skill that needs unlocked first?
Is that previous skill unlocked?
Do you have enough skill points?

There can be many more of course, based on the player's class, level, whether or not certain quests where completed, and so on, but for the purposes of our game we will just stick with those four. Now, we have about twenty-six skill upgrades we want implemented, and each one has its own list of gets and sets, and thus implementing the logic for a skill tree is a lot of work. So how do we circumvent that work? I choose to break it down into those four variables, and just optimize a single skill. 

By trying to make a template for every skill upgrade using only one skill, I was able to quickly find bugs, and soon I had my base. I tested it a few times more to make sure it worked, and added some extra logic to communicate to the player, and myself, what was happening, and soon it was ready to go!

In the end, this approach meant I spent about an hour working on a single skill. But once it was done, I was able to complete the other twenty-five in three hours total. And what's more, its already debugged! Not that I didn't test it all anyway, with programming, you can never be sure. 

Get Element Clash

Leave a comment

Log in with itch.io to leave a comment.