Is there a better approach for my fighting system?

Hey developers,

I’m currently working on a PVE game based off Metal Gear Rising, and I want the combat mechanics to be as responsive and quick as possible, like you press a button and you immediatly see the effects and the player getting hit, and I currently have a system that goes kind of like that.

image

So, to put it short, I have the client that fetches the animation and data of the attack from a Module Script, creates a local hitbox and fire a remote to do server sanity checks while in parallel, I have another remote that is gonna send all clients the position and the Instance of the VFX/SFX.

You probably get the idea, but the problem is that I have two remotes and one of them that goes a whole Client → Server → all Clients course and there could possibly a delay which I don’t want.

I know this is not really efficient but I don’t know what good alternative I could aim for, could anyone please help me and indicate me a better solution? I know that I shouldn’t prioritize this for a singleplayer game but I’d help me for other situations.

Thanks in advance!


i do that exact thing, and mine looks like this.

only day 2 in the making tho.

my “sanity checks” are using os.clock to compare delays between hits and stuff and magnitude + dot checks, might remove the dot checks tho since they’re quite uneccesary unless it’s for blocking

So you also use two different remotes with one that does a full Client → Server → Clients course?

That looks pretty smooth to me, maybe I’m just getting too worried about delay.

when the player hits, it sends a remote to update, and makes sure you don’t update too fast.
when the player actually hits a another character, it checks if the update was in sync with the hit, if it was it’ll allow you to hit.

I see.

So doing my original idea would be the best outcome? I don’t know if you have any faster alternative or more practical alternatives but if you do, please suggest them.

eh na just use os.clock and remotes

I see, I’ll try that then.

Another question, what’s your method to fetch the data about your attack? Do you have the values & Instances saved on a folder or in a Module Script?

yea i have it all in a module script

Alright, thanks for the help! Appreciate it.