Network Instantiate vs Local Instantiate

Hey all, please bare with me as I am very new to the whole “networking” thing, but I think this is a very valid question.

In my game that I am creating, an infinite runner, there are premade “chunks” of terrain already created and I want them to generate as the player runs (which I have done on a local scale). Now my question.

Is it better to use Network.Instantiate for the next plot of terrain (I would assume this would use up more resources)

OR

Is it better to send a RPC with an ID(byte format) for the specific “chunk”, then generate it locally on all clients? (I could see this being the better alternative, less usage etc)

I mean obviously they will both give the same results, apart from possibly bandwidth usage. Am I correct in saying the second method is a much better one?

Thanks guys
Myhijim

The second method would be MUCH lighter on the bandwidth as you would be sending a 16-bit short(or a byte if your ok with a 255 chunk max), instead of a complete object’s data.

You would just have to make sure both clients generate the same chunk from that integer type.

Nope… and let’s see why. Assuming you’re using Unity’s inbuilt networking:

Source

Or in other words - it’s working in a very similar way to the way you intend to implement your own version.

As such the choice is really down to convenience and control - not massive differences in algorithm.

I prefer the RPC+ID solution, has more control. You can for example send a few initialization parameters with the ID.