Id like to preface this by stating this is an advanced scripting question, please dont answer if you dont have any valuable input. Thanks!
Ive recently been prototyping an object oriented game, and now want to tackle replication.
Lets use a turret as an example, what i would do is have two modules, one for the client, and one for the server. The client handles things like turning, input, etc, the server handles authentication (Ie, player interacts with object, server module recieves request, then gives info back to initial client making request to create their own client object). The server module isnt really the topic of this post, but i thought throw it in here.
Now what i want to do, is have the turret object persistently created accross all clients (that is, to have the same id), store the persistent objects on the server for players joining, and then when i want to update say, the angle the turret is facing at, i can have the host client (in this case the pilot of the turret) send a request to the server to update their turret, with info like objectId, function name, params, etc. When the request meets the other clients, theyd see if an object in their store matches the objectId, and then if so execute the function with the given params. Thus turning the turret, and replicating it. Heres a diagram.
What im trying to ask is if this form of replication is viable, and not overcomplicating things, and if there are any other viable alternatives for an object derived game design model.
I want to reuse as little code as possible, which is what i would be doing were this conventional programming.