Skip to content

Fix region boundary snapping (Fixes #7) and add worker pool for parallel voxelization - #9

Closed
deloskiytbackup wants to merge 1 commit into
Teddy563:mainfrom
deloskiytbackup:fix/issue-7-regions-and-workers
Closed

deloskiytbackup wants to merge 1 commit into
Teddy563:mainfrom
deloskiytbackup:fix/issue-7-regions-and-workers

Conversation

@deloskiytbackup

Copy link
Copy Markdown
Contributor

Summary of Changes

  1. Fix region boundary clipping (Fixes Random teleportation glitch #7):
  • Sets MAX_REGION_RADIUS = 22_000 blocks (~22 km) in EarthRegions.
  • Players and cameras flying beyond 22 km now cleanly enter the natural buffer zone between places (EarthRegions.at() returns null instead of snapping abruptly to a neighboring country grid cell at 25 km).
  • Bounded radial check applied across mod/, mod-26.2/, and mod-26.3/.
  1. Parallel Voxelization via Worker Threads:
  • Added VoxelWorker and VoxelPool (service/src/voxel-pool.mjs and service/src/voxel-worker.mjs) using node:worker_threads.
  • Moves CPU-intensive mesh voxelization (voxelizeArea) off the main HTTP event loop, scaling across CPU cores and zero-copy transferring vox.buffer.
  • Supports configurable worker count (cfg.voxelWorkers), automatic thread scaling based on available CPUs, task queuing, auto-respawn, and graceful fallback to synchronous execution if worker threads are unavailable.
  • Added unit tests in service/test/voxel-pool.test.mjs. All 41 service tests pass.

Teddy563 added a commit that referenced this pull request Oct 27, 2026
Add Fabric 1.20.1 support, region travel safeguards, worker recovery and safe native settings. Integrates contributions from #9 and #10 with follow-up fixes.
@Teddy563

Copy link
Copy Markdown
Owner

Thanks! Integrated into #13 and released in 1.0.4, with follow-up fixes for worker recovery and geographic region handoff. Keeping #7 open for live-travel confirmation.

@Teddy563 Teddy563 closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Random teleportation glitch

2 participants