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.
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.