Godot OOP multiplayer design question

Godot Version



Hi There.
I’m working on a multiplayer project that I want to build with modding support in mind from day one. For all of my classes, there are methods that must replicate to the Server, and then the server must replicate to all Clients.
For example:

namespace Game;

using Godot;
using System.Collections.Generic;

public abstract partial class Buildable : Node3D

    public abstract List<Vector3I> GetGridCells(Vector3I position);

    /// <summary>
    /// Moves the buildable to a new location
    /// </summary>
    /// <param name="position">The new grid position of the buildable.</param>
    /// <param name="rotation">The new rotation of the buildable.</param>
    public virtual void Move(Vector2I position, int rotation)
        Position = new Vector3(position.X, 0, position.Y);
        Rotation = new Vector3(0, Mathf.DegToRad(rotation % 4 * 90), 0);

The problem is, I want the system to be easily extended so the behaviour of the Move method can be overridden. However, if there is any networking in the method to handle replication when the buildable is moved, then overriding the method will remove this networking. I dont want the overriding class to have to also reimplement networking, such as a mod.
Is there something wrong with my design? How can i decouple networking from this?


There are concerns that if you allow a modder to write code and have that code replicate across to peers, is a huge security risk!

It would be better to have a modder adjust a list of stats that are utilized By the code.

Even so, you would want to leverage the position and whatever else you need with a replication config via a MultiplayerSynchronizer. Then there is no concern about what code they provide.