Creating abilities for an asym game

I am creating an asym game and I was wondering how I would go about creating abilities/moves for the characters?

What I’m mostly confused about is coding the actual abilities themselves. I’m not sure whether to calculate them on client or server. Would I calculate hitboxes on client but the visuals of the moves and damage on server?

5 Likes

Although it can be done on the server, it is generally good practice to play animations on the client. I’d recommend doing hitboxes on the server to make them fairer but hey I’m not the one making the game.

We can’t help much with the abilities themselves since:

A: everybody makes games differently, code structurewise, namewise, etc.
B: We don’t know the end goal you want
C: i don’t know why this is here i just wanted to put c

2 Likes

In terms of an end goal: I’m gonna guess what you mean is what do I want an ability to look like.

I guess I would want the player to push an ability key, it plays an animation locally, then I guess sends it to the server? Then the server places the moves visuals and stuff. The main thing I want to know is if there are better practices and if there is a way to make this work for multiple abiltiies (ie one remote event controls every possible ability).

I hope clarifying helped. I should have mentioned this in my inital post :sob:

1 Like

if u want I can send my version, though if I do I would highly advise that you don’t use it, as it is tailored to my game + you won’t learn much by just taking somebody’s code

1 Like

I’ve figured out a way myself! But I would love to look at your code for some potential improvements if thats okay?

Hello! I’d like to ask how did you do this in the end? as I would need to use abilities like u mentioned and make the server do something without Mass using remote events. Did you use attributes or?

to op, sorry I haven’t replied my studio hasn’t been working lately, to the guy I’m replying to though the best way is to just make a couple remote events and replicate them to each character. I use M1Ability, QAbility, E ability, and RAbility. Then I have a local script in starterplayerscripts and it just checks if each remote event exists, then binds it to the according keybind

1 Like

The way I did it still needs some work but I can try explain it! Every character has a module and has ability modules as children. The character module requires these on server start and the character module is then required too. Then I have a CharacterService that holds all of these things and has some functions like GetAbility and GetAbilityFromCharacter.

Upon setting the players character, it gets all the abilities from that character and puts them in the clients loaded abilities. When the player pushes a key, it checks through the loaded abilities table and sees if the keycode matches with any of the abilities keycode variable. If it is, then it sends the ability to the server and then the server uses the abilites .Activate function.

It could use some improvement such as having the ability activate on the client and having animation events control certain aspects, but having it server sided is fine too!

(So sorry for the late reply, it slipped my mind :sob:)

1 Like

If you want me to elaborate on anything, let me know!

1 Like

ya that’s a pretty solid method I never thought of doing that lol nice job

1 Like