Skip to content

Run generation steps in workers #24

Description

@barrulus

Generation is data in, data out over pack and grid typed arrays, which transfer between threads zero copy. Seeded Alea is deterministic in a worker. Start with the self-contained heavy steps: Voronoi and reGraph, rivers, routes, trade network, military.

Prerequisite: route the remaining DOM-read generation knobs through the options object. Some generators read inputs via optional-chained DOM lookups and silently fall back to defaults off the main thread. That cleanup stands on its own.

Renderers stay on the main thread; workers return data. Keep a synchronous fallback path so tests and old code paths do not fork. Verify by diffing the resulting pack against a main-thread run for the same seed - typed arrays byte identical.

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions