Are networked object pools possible?
I'm trying to make a multiplayer FPS game and I need to spawn various different objects such as projectiles, bullet impacts, and bullet holes, but instantiating three objects for every single round fired seems quite expensive, not to mention the data that would be required to send that over a network... (Since we can't know how Server.Spawn() works behind the scenes, I would assume it's not desirable for the same reasons)
.
That's where object pools come in hand, and they function very well on a local client but when trying to network this, I keep running into various errors, mostly issues with authority...
.
What I'd like to do is have a pool script on which I can call Pooler.Spawn(Object, Location), and then have the Pooler class handle all of the networking. I figured it would look something like this:
.
1) A client would decide something needs to happen and calls Pooler.SpawnObject() and passes in the object and a location
2) Inside the Pooler.SpawnObject(), a request is sent to the server
3) The server tells every client's Pooler script to spawn an object of the requested type at the location
.
What needs to be done to accomplish this? I seem to misunderstand what is allowed to call what, and how... Assume I know absolutely nothing about Unity's networking. .
Thanks in advance for any responses given