How would I use Knit to a create a melee combat system with selectable movesets?

Hi all, 2nd time writing here about Knit, beginning to understand more but whilst working on my game, I came into a dilemma about how to handle different characters / movesets, switching through them and such whilst using the Knit framework.

Basically, how would (or should) I handle having 8 moves (4 in base form, 4 in ultimate form), and other basic attacks and moves (like punches and dashes) in a moveset that a player can switch to?

(Videos of The Strongest Battlegrounds to demonstrate the system I had in mind)
Punches (activated when pressing M1):

Moves (activated by pressing the corresponding number keys):

The 4 moves should be able to be used by pressing their corresponding number keys and the other moves (punches, etc) would have their own dedicated keys.

(I should note I’m not asking for people to write an entire system for me, just need a nudge in the right direction because I am fairly new to developing with this framework, so any reply helps! :slight_smile:)

I would say never go head first into a framework as it is very complex speaking as someone who switched from the old AerogameFramework to Knit to using my own framework.

From this experience I would say a framework scales with your technical knowledge. For example a framework like Nevermore has too many utility modules that you probably won’t use yet… Probably the reason why #resources:community-resources has a lot of frameworks.

Instead I recommend starting with the base principles as Knit follows OOP principles with it’s singleton classes (Services, Controllers) so rather than following a framework you should follow a programming model instead.

To do this just head straight into it and get your hands dirty.

Start with a very dirty single script:

Then componentalize it. Put the inputs into a single function, realize you can separate the multiple Update functions a lot more.

Here is another example with someone elses ability script simply just separating one long script into components and functions that can easily be moved around, copy pasted, and reorganized.

In Knit the local script handling input would be called “InputController”. Then there will another for the server known as “AbilityService”.

Edit: I am looking into this example years later you only realize that animations will also be loaded a lot in that character added function, that’s another module or controller named “AnimationController” right there.

To be honest the main draw of Knit is to knit and provide networking between the client and server but you can just use this module to just handle it just as easily.

2 Likes

Thank you for the reply, though I’m not quite sure I still understand.
What would be the purpose of any of those Controllers and Services? (I.e the AnimationController and AbilityService you talked about) Could you please elaborate?

Will also consider looking into the other networking module you linked.

Learn about Services and Controllers here: Knit | Knit (sleitnick.github.io)

I understand what services and controllers do, I was asking what those two specific ones I listed (AnimationController and AbilityService) do in practice.