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.
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.
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
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.
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.