How to make a skill system

So “Vampire Survivors” seemed to be a good game, to try and learn game development, and practice UE5 in BP only. And it also is. I have learned a ton so far, and understand much more now, then i did when i started. I have half, a game now. Chasing enemies, homing projectiles, HP and XP bar etc., and i made it all on my own - with help from YT ofc.

But one thing i just cant seem to get right, is the skill system. I have been searching YT, forums etc. and even contacted several skilled people on discord as well, to try and get a point in the right direction, or a “baby” guide on how its done/could be done. But not much to come for.

So, is there anyone here, who can help me in the right direction, of creating such a skill system?

For those who dont know the system:
When the Player levels up, a popup is shown with 3 random spells the user can pick. When one is picked, user get the spell and popup disappears.
If one of the 3 random spells, is a spell that the user already have picked earlier, the spell levels up. Spells can contain different specs. for example:
Fireball spell:
lvl 1 - just fires a single fireball.
lvl 2 - + 1 fireball
lvl 3 - + 10 dmg
lvl 4 - + 10% Crit
etc.

The info on what’s on the next level should be shown to the player, so he can choose which spell/upgrade he want.

This seems so simple in my mind, but i just cant wrap my head around, how to make it work. I would appreciere any guidance, screenshot or BP - ill take what i can :slight_smile:

Thanks in advance.

Look into Actor Components.

  • a base component each skill inherits from
  • the functionality of the skill is defined in each component
  • those components are spawned and given to the player, dynamically
  • before doing so, check if a component already exists, if so → call lvl up on that existing component instead
  • the player can communicate with the components through an interface
  • the comps can talk back to the owner directly, through a dispatcher or an interface (you could implement a two-way interface)
1 Like

Thanks for the reply.

I will look into Actor Components, and learn how they work.
Do you have a suggestion on how i should store all the spells, and all the levels on each spell? Or should i just store them in the Actor Component? Or maybe make an Actor Component for each spell?

  • each spell is a separate actor component, inheriting from a base class with some shared functionality (how to play a sound, how to show some damage numbers, self destruct, count how many times it was used)

  • only the children components have actual spell logic, damage dealing, player effects. There’s no need for a fireball to know how to heal a player.

  • hold the upgrade logic inside the component. An integer variable indicating spell level may be enough; each spells knows what their own higher tiers do and can self upgrade accordingly. You may need a Data Table if it gets complex (it always does, even if it starts a simple thing :expressionless: )

  • to save a component - you will need a component class and its level only (wishful thinking). When saving, the player can look up their components and read the class + lvl int. When reloading, read class and spawn a component pushing in lvl int as value and the component will reconfigure itself as if you were upgrading it.


Disclaimer:

Never played Vampire Survivors :exploding_head:, no clue what it is but I did hear the name before.

Ah okay, some of that actually made sense to me haha

To what usage should i be using data tables for? how complex should it be, before i start using that?

and fair enough with Vampire Survivors, Here is a video, of the game, so you can see how the level up works, and what its about :slight_smile:

That’s up to you. If the spell has like 3 lvls, it’s probably fine to keep data in the component. If you have 30 lvls to each spell, I’d chuck it all into a DT.

If you have like 100 spells in total, no matter how complex they are, a DT might be a better idea to start with. Easier to edit / balance things in a single location than regularly re-visit 50 components and tweak arrays.

Vampire Survivors

Makes sense, cool short loop concept, with a super high player skill level. There’s like a whole new roguelike subgenre around those.

Ah fair enough, its only gonna be like 5-10 levels pr spell, so dont think i need a DT, or at least i hope not haha.

Yeah its a ■■■■ fun subgenre, and it seemed easy to recreate :rofl:

Once you’ve made 2, it gets criminal and you know you need 98 more, you can always refactor.

haha could imagine :rofl: but the setting are mostly gonna be size of the spell, damange, crit, speed, numbers of objects. So think i can manage that to start with - or hope so

1 Like