What is the best way to make a lot of skills?

  1. What do I want to achieve?

The title described it, I wanted to make a game with a lot of skills in it (Example: Heroes Online, Critical Strike, Arcane Adventure, etc…)

In short, I just wanna know what is the Best Possible way to make a game like that without ruining the performance.

  1. What is the issue?

Honestly, there is no issue, all I wanted is just an answer to how can I make a game with different skills (blast attack, explosion attack, flight, lava pool, big bang, etc…)

Different types of skill.

  1. What solutions have I tried so far?

I tried to use OOP (Object Oriented Programming) but it doesn’t work well. I mean all it can do is make the stats for the spell, nothing more.

Like you will have to make another script on casting spells, you can’t just put 1 cast style for everysingle spell.

Question 1: Can’t you just use module:CastSpell[TYPENAME]?

Well I tried, but it doesn’t work that great. I mean, different elements have different effects, I can’t just put everything the same.

Question 2: Can’t you just add stats for the spell so that when you use the function, it will cast depends on the spell’s stat?

Yes you can! But instead your code will be a mess with a lot of if statements, making it unclean which is really a problem on making big games.

Question 3: Have you tried ECS (Entity-Component-System)?

Well no, I mean I wanted to use it, but the documentation really confuse me, it doesn’t give me enough information to understand it. So if you can spend your time explaining me about this, then I really appreciate it!

Incase you don’t know about ECS (Entity-Component-System) then here is the documentation

Thanks for reading this long post! Hope you have a nice day. If you have any questions, feel free to comment it down below in the comment section!

Edit 1: Fixed the documentation link.

The idea is to have a different module for either each skillset or each spell. Since you’re using OOP the common fields and functions will be shared (cooldown, damage, cost…). Instead of doing module:CastSpell("spellname") you would then do fireballSpell:Cast(), optionally passing in arguments the spell needs (e.g. target, facing direction). The Cast method will then execute the spell code (create effects, deal with hitboxes and call to the superclass to damage targets…). This way you can very easily add new spells by copying existing spells and you can instantly tweak or remove existing spells.

1 Like

Do you mean that I will have 1 main module (adjusting stats), and each element/class use 1 module, each module will have it own skills? (making skills)

I think that is the answer for now, will make a solution until I really need any further help.

1 Like