Synchronous or Asynchronous Generation

Home --> Programming Projects --> Fractal Block Engine --> Procedural World Generation --> Synchronous or Asynchronous Generation

When to Generate Chunks Synchronously?

When the system needs to procedurally generate a chunk, this can be done either synchronously or asynchronously. In general, we want to generate more chunks asynchronously (because this is done my multiple threads). However sometimes we want to generate chunks synchronously because this may be blocking other tasks.

Here are some guidelines for when we want chunk generation to be synchronous:

Proto Chunks

See here for the definition of a proto chunk.

When a chunk is first added to the active chunk tree, it is an empty shell: a proto chunk. We either populate it synchronously right then, or we make a request to populate it asynchronously. Once the system that procedurally generates chunks finishes, we "populate" the chunk and the chunk is no longer a proto chunk.

Note that populating a chunk actually requires more than just procedural world generation. We also must load all changes that have been made to the chunk previously from a save file.