I am working on a multiplayer game and I am trying to implement real time editing of terrain using the asset TerraVol. I successfully made the terrain generate the same for all players on the network with the help of Network.Instantiate. The first issue I have run into is that I cannot locally edit terrain that was instantiated using Network.Instantiate. I can, however, edit terrain locally if I click and drag the map object into the scene from the file viewer. I assume this happens because the terrain was instantiated on the network rather than just a normal local instantiate. When I try to edit the terrain that was instantiated using Network.Instantiate i get this error... NullReferenceException: Object reference not set to an instance of an object TerraVol.ActionData..ctor (Vector3i position, Vector3 size, TerraVol.Block blockType, ActionDataType type, BrushType brush, Single isovalueToAdd, Boolean createVegetation, Boolean force) (at Assets/TerraVolPack/TerraVol/Scripts/Data/ActionData.cs:148) Builder.DoAction (Nullable`1 point) (at Assets/TerraVolPack/TerraVol/Scripts_to_customize/Builder.cs:251) Builder.Update () (at Assets/TerraVolPack/TerraVol/Scripts_to_customize/Builder.cs:91) I dont get that error when the terrain is instantiated locally. I am very confused.. hopefully someone who knows something about TerraVol can help me out. Thanks
I don't use TerraVol, but think, that you can use Network.RPC call to your server, and modify terrain on it. And server will sent data to other connected players.
I made the server generate the terrain and then save the .terra file to the network by turning it into a byte array and using RPC calls to send and deserialize it. For the saving and sending of the .terra file I edited the Builder.cs class. On the clients, in the TerraMap class, I tested to see if the instance was client or server. If it was client, I set the loadPath to the path where the file would end up once deserialized. I did that test because I used Network.Instantiate on the Map gameobject. Hopefully that helps a little bit.