Hello guys !
I’m starting to work on some top down mmorpg.
And of course there is combat, pve and pvp.
To give you an idea of the skills available in the combat system, let’s just speak about a grab skill (prototype don’t judge):
I think it’s one of the most complex from a network point of view, but maybe I’m wrong (I just added a dash and a basic combo for now anyway)
So for now I do the following :
-
Client/Get input
-
Client/Process the input and fire the server for a specific skill activation
-
Client/Attack animation
-
Server/Get the event for the specific attack
-
Server/Set player walk speed to 0
-
Server/Create hitbox and do damage on touch (should be a simple box raycast though)
-
Server/Move the ennemy (npc or player)
-
Server/Connect beam for vfx
-
Server/ If the attack is asked when someone is grabbed, then launch it
And some other little stuff
So basically I always give the ownership to the server on the player asking to trigger an attack, and give it back after the execution. And when the grab start I give the ownership to the player who caught the ennemy, and reset it when released.
Even with this there is things I’m wondering :
- Animation on the server would be a good way to trigger the hitbox on a specific part of the animation. I saw on the forum that animation on the server should be okay.
- Some vfx need a target, which can be only know from the server if it’s not a player
But then I tried to simulate lag (only inside Roblox Studio, I couldn’t manage to setup a software to control my ping), and realized that if there is some delay, even in pve, the game would be unplayable.
I think the right way to manage the combat system is to be able to compute everything on the client and the server, and comparing the results and correct if needed.
So I searched in this direction, but… even for a simple attack, if I want the player to simulate the hit and everything. It needs ownership for at last the collision check, and maybe other things like humanoid health. And I would still need the server to trigger other clients, would this not be a problem? I’m also wondering about AI.
So the question, after all this ^^, how do you setup the architecture for this ?
Sorry for the big question, band thanks !