What would be the better way of doing this?

Just looking for some general advice from those that are more experienced with the Unity engine than I am.

I’m building a space based game, some of you may have seen my thread about it.

I’m trying to make my game virtually limitless. Each time the player leaves a “sector” either a new one is generated, or if the player had been there before, loaded from save file.

What I originally planned was this:
Have an overall game controller, thats always running keeping track of where the player is, which sector.
Have two identical scenes. Each scene represents a dynamic sector.
When the player leaves the sector/scene and enters the other one, the scene checks with the game controller to determine which sector to load, or if it needs to generate a new one.

But, I’m thinking ahead, and potentially want to add multiplayer functionality in the future.
I’ve watched some tutorials from Unity on multiplayer functionality so I have a general idea of how it works.
Unless I’m missing something, the way I had it planned with mess up if there is more than one player in the scene and the game controller thinks they are in different sectors.
I dont know what would happen. I doubt it would crash the game. But it might load the objects from both sectors (or more if there are more players) or refuse to load anything.

So, do I create an actual scene for each sector? This would be potentially thousands of scenes if the game gets big enough. And would take a lot of time that could be better spent working on other aspects of the game.

Or do I just expand the size of the playing field, and just put trigger colliders around each sector as its generated to detect when a player leaves a sector and enters another, so all sectors are in the same scene, and if you zoom out enough it looks like a chess board?

Or is there a better way I am not thinking of?

Thanks for any advice or thoughts on the matter you may have.

Privacy & Terms