generate sub scenes programmatically

We are working on a sample where we do procedural dungeon generation.

Our approach is:

  • A dungeon tile is an entity scene
  • A procedural generator high level streaming rig (User code) has a list of SceneAsset references that define the possible tiles stored in a scriptable object.

At load time the scriptable objects defines all possible scenes, we load the meta data of each scene. (Eg. what connectivity of tiles do we have) Based on that it determines the placement of every possible tile in the world. Each represented by an entity representing the scene.

Then it uses normal streaming functionality to load the data. Eg. some scene sections are always loaded, other scene sections are loaded on demand based on distance.

To Unity.Entities we are adding the following things to support this:

  • We are adding the ability to load & offset entity scenes (By letting users modify the loading staging world, before it is moved to the simulation world)
  • We are adding the ability to load the same entity scene multiple times (Each one offset differently)
  • We are adding the ability to generate meta data from the scene that can be used during placement

I expect those will land in a release in a couple of weeks in dots.

20 Likes