Multiple scenes for an open-world game?

I have an “open world” game, Blankstorm, that uses a multi-scene system, and wanted to know if it’s better from a performance perspective to only use one scene. Here is how the system works:

A given Save has levels. Each Level is a scene with some extra properties that is generated upon instantiation. A Level’s location is a Vector2 that says where exactly that level is positioned in the world. Levels can be generated like Minecraft’s chunks - infinitely. Currently, only the player’s current level is rendered, since levels are 20,000 x 20,000.

For both performance and for some easier coding, I was wondering if a single-scene system would work better, where world generation and such occur similar to how Minecraft generates structures and such.

Here is a very simpe psuedocode example:
Old:

class Save
  Map levels
  Map ships
  Map playerData
  ...
class Level
  Array celestialBodies
  Vector2 location
  ...

New:

class Level
  Map levels
  Map ships
  Map playerData
  Array celestialBodies
  Vector2 location
  Function generateRegion() //generates structures, celestial bodies, etc. for a certain area.
  ...

I think both would work but a mono scene might be simpler to handle transitions and such ?

1 Like

I was thinking that could work to, though I’m not sure how that would affect performance in a very large world (maybe only render objects within a certain radius of the player?)

Maybe you could benefit from AssetContainer to prevent having unecessary objects in your scene ?

1 Like

Currently I use AssetContainer for most of the entities, though planets and stars are procedurally generated and can’t use AssetContainer.

so it should be all good and disabling far away meshes might be a good idea indeed :slight_smile: they would be by culling but if you are sure they are, you can save a bit of extra process.