Hello guys, I have been working on a Co-op rpg for quite a while now
I've setup a server and client which synchronizes position and rotation very well, using a quad tree to optimize performance.
And now I have tackled a design dilema which I'm not sure which solution would be “better” to solve the problem:
The design issue I have is how to synchronize skill-result across the network.
In my scenario each skillEffect can have a unique implementation of what the effect can do, no generic constraints whatsoever, and those skillEffects are stored in a dictionary which is accessible for both the server and the client.
When a player/character casts a skill, I send a skill-cast-accept packet to nearby players, and they visually cast the skill (though they do not mutate their state), once the skill's effect has taken place it generates a skill result which would be sent to nearby clients on the next tick.
And now I wonder what schema a skillResult should look like.
I have 2 options that are possible to implement,
the 1st is having the skillResult contain the casterId, effectId, and nearby characters and let the client perform the same skilleffect as well in order to mutate the state - This method is better in terms of bye economy though it lets the client the ability to mutate their state, with possibly non-synced data, which could later cause de-sync with the server.
Option 2 that I thought of - is having each skillEffect return a specific skillResult which is unique to that skill, the skillResult will contain all of the mutations performed through the skill effect – This method could be far more pricey in terms of bye economy though it will be safer to use since there is 1 and only 1 variation of the skill result, and the client will not count on a falsey state.
I'd love to hear your opinion about this, and also if you are familiar with other networking forums please share them ?