Skip to content

Improve generateChunks option vs missingChunk event #5

Description

@deathcap

If generateChunks is true (and it is by default), then the engine will generate chunks itself, synchronously, through opts.generate

The alternative asynchronous chunk generation technique is to listen for missingChunk events, generate asynchronously, then call showChunk when finished. If this technique is used with generateChunks: true, there is a confusing failure case: the initial chunks generate, but then no new chunks as the player explores. Found in voxel/voxel-example#9

The correct configuration is to set generateChunks: false when using missingChunk/showChunk. This is now documented in voxel-flatland and voxel-land but maybe it could be improved further. Perhaps remove generateChunks and always require listening for missingChunk events? Or have the plugins detect and fail if the option is not set. Or/and get synchronous chunk gen to work again (worked in the three.js-based voxel-engine), so the conflicting chunks won't be empty.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions