Skip to content

Run chunk loading translation in web worker #8

@deathcap

Description

@deathcap

Handle the chunkColumnLoad-event-triggered chunk loading, translating the MC/mineflayer chunks to voxel.js chunk data (ndarray), in a web worker to avoid blocking the UI during loading (currently takes ≈500 ms/chunk)


optimization idea: have the worker accumulate cubic voxeljs chunks (32x32x32) from mc's chunks (16x256x16), and send the raw chunk data as an ArrayBuffer (as a transferrable to avoid copying) back to the main thread, where it does game.showChunk on the completed chunk - similar to voxel-land (worker, listener)

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