0

I want my game to have stones, laying around on the terrain. The player can then pick up these stones. My terrain is pretty huge (around 5000x5000 in unity terms) though. I don't think it will be optimal to place hundreds (maby even thousands) of stones as game objects. As my game is multiplayer, I cannot just instantiate the stones as players walk because two players approaching each other would see stones spawning. I also cannot add the stones to the trees of my terrain and mass place them because it would conflict with my tree-chopping and cutting down script.

The solution to my mind would be to somehow procedurally place stones without players noticing. Is this the best way to do it? And if so, how?

I don't need any code but if someone could just outline how they would approach this please? I can't think of the best way to do this... Any ideas would be great!

4

1 回答 1

1

I stepped over this problem myself a short time ago. I would recommend to read about "Linear congruential generators" 1.

They are used to generate pseudo-random numbers. But the random numbers depend on the given seed. So if every player has the same seed, it should be possible to generate the stones while the players walk. Because of the same seed all the players would get the same random number at the position x,y and with this they would all generate the same stone at the same places.

于 2015-04-07T10:46:02.863 回答