Hello, this is a more high level problem that I simply don’t know how to approach.
Problem
I have a lot of enemy spawners around the world, and I want to make it so that enemies only spawn if any one player has the spawner streamed in, that way if nobody is close, I can despawn the enemies to save some server time.
My ideas
The only ways I can think to do this are:
- loop through each player at each spawner and check on the client, which sounds extremely inefficient.
- on the client, whenever a spawner is streamed in, alert the server to all spawners that are streamed in, and it can update accordingly (this would be complicated).
- every few seconds, ping every player to check the spawners they have streamed in. I think this would be a balance of simplicity and efficiency, but I’m not sure if it’s worth doing something like this or not.
The reason I’m posting about this is that it sounds like the type of thing that already has a really simple solution. I can’t find any methods for this, though. Let me know your thoughts!
Edit: if it is relevent, I am planning on having a VERY large world, but only about 12 players max.