{"id":"shmeatley/atlas","name":"atlas","scope":"shmeatley","platform":"roblox","description":"A procedural generation toolkit for Roblox.","version":"0.2.1","latest":"0.2.1","versions":["0.1.0","0.1.1","0.1.2","0.1.3","0.2.0","0.2.1"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"3f3310ba14807b56d2e528768af59facca1d09565d66675f6d0e54232d9d5ec6","likes":0,"downloads":0,"install":"forest install shmeatley/atlas","url":"https://forest.dev/p/roblox/shmeatley/atlas","files":"https://api.forest.dev/ai/package/roblox/shmeatley/atlas/files","readme":"# Atlas\r\n\r\n[![CI](https://github.com/shmeatley/atlas/actions/workflows/ci.yml/badge.svg)](https://github.com/shmeatley/atlas/actions/workflows/ci.yml)\r\n[![Wally](https://img.shields.io/badge/wally-shmeatley%2Fatlas-blue)](https://wally.run/package/shmeatley/atlas)\r\n[![Docs](https://img.shields.io/badge/docs-moonwave-blue)](https://shmeatley.github.io/atlas)\r\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)\r\n\r\nAtlas is a procedural generation toolkit for Roblox, written in fully-typed\r\nLuau.\r\n\r\n- **Noise** — seeded Perlin, simplex, and Voronoi (Worley) samplers in 2D and\r\n  3D, with derivatives (analytical for Perlin and Simplex), binary island\r\n  masks, plus fBm helpers for layering octaves.\r\n- **Sampling** — uniform random and Poisson disc (blue noise) point\r\n  scattering, deterministic per seed.\r\n- **Curves** — monotone cubic response curves built from control points, for\r\n  remapping noise (or any value) without overshoot.\r\n- **Visualization** — draggable on-screen `EditableImage` windows rendered\r\n  through pixel buffers, with built-in presets for noise, curves, and point\r\n  sets.\r\n\r\n## Installation\r\n\r\n```toml\r\n[dependencies]\r\nAtlas = \"shmeatley/atlas@0.2.1\"\r\n```\r\n\r\nThen run:\r\n\r\n```sh\r\nwally install\r\n```\r\n\r\n## Quick start\r\n\r\n```lua\r\nlocal Atlas = require(path.to.Atlas)\r\n\r\n-- Seeded noise: same seed, same world.\r\nlocal simplex = Atlas.Noise.Simplex.new(42)\r\n\r\n-- Shape the raw noise with a response curve.\r\nlocal falloff = Atlas.Curve.new({\r\n\tVector2.new(0, 0),\r\n\tVector2.new(0.4, 0.1),\r\n\tVector2.new(0.7, 0.8),\r\n\tVector2.new(1, 1),\r\n})\r\n\r\nlocal function terrainHeight(x: number, z: number): number\r\n\tlocal noise = Atlas.Noise.fbm2D(simplex, x * 0.01, z * 0.01, 4)\r\n\treturn falloff:evaluate(noise * 0.5 + 0.5) * 100\r\nend\r\n\r\n-- Binary island mask: 1 for land, 0 for water.\r\nlocal island = Atlas.Noise.Island.new({ seed = 42, breakage = 0.5, detail = 0.75 })\r\nlocal function isIslandLand(x: number, z: number): boolean\r\n\treturn island:sample2D(x * 0.002, z * 0.002) == 1\r\nend\r\n\r\n-- Slope-aware placement using analytical derivatives (no extra samples).\r\nlocal _, dx, dz = simplex:sample2DWithDerivative(10, 20)\r\nlocal steepness = math.sqrt(dx * dx + dz * dz)\r\n\r\n-- Blue-noise scatter for trees, rocks, spawn points…\r\nlocal trees = Atlas.Sampling.poissonDisc(512, 512, 8, 42)\r\n\r\n-- See what you're generating (client-side).\r\nlocal window = Atlas.Visualizer.new({ title = \"Terrain preview\" })\r\nwindow:render(Atlas.Visualizer.Presets.noise(simplex, { scale = 0.02, curve = falloff }))\r\n```\r\n\r\nFull API reference: [shmeatley.github.io/atlas](https://shmeatley.github.io/atlas)\r\n\r\n## Performance\r\n\r\n### Studio native (0.2.1)\r\n\r\nMeasured in a separate Roblox Studio **server play session**, with `--!native`\r\non the benchmark Script and Perlin/Simplex ModuleScripts. Studio's profiler\r\nrecorded native execution of the sampled kernels. Medians of 31 trials,\r\nrotating the order of released Atlas 0.2.0, the optimized code, and\r\n`math.noise`. CPU: AMD Ryzen 5 7600X; Studio 0.743.0.7431133.\r\n\r\n| Workload | Optimized Atlas | math.noise | Atlas / built-in time |\r\n|---|---:|---:|---:|\r\n| Perlin scalar 2D | 0.0306 us | 0.0407 us | 0.75x |\r\n| Perlin scalar 3D | 0.0416 us | 0.0405 us | 1.03x |\r\n| Simplex scalar 2D | 0.0412 us | 0.0405 us | 1.02x |\r\n| Simplex scalar 3D | 0.0558 us | 0.0405 us | 1.38x |\r\n| Perlin grid 128x128 | 0.230 ms | 0.617 ms | 0.37x |\r\n| Perlin grid 32x32x32 | 0.819 ms | 1.240 ms | 0.66x |\r\n| Simplex grid 128x128 | 0.386 ms | 0.622 ms | 0.62x |\r\n| Simplex grid 32x32x32 | 1.375 ms | 1.237 ms | 1.11x |\r\n\r\nLower ratios are better. Bulk references use specialized 2D/3D loops filling\r\nthe same-sized arrays. Atlas preserves its own seeded outputs; these are\r\ndifferent noise fields from `math.noise`. Relative to 0.2.0 in the same run,\r\nscalar Perlin improved 5�12%, scalar Simplex 20�22%, and Simplex grids\r\n29�31%. Perlin grid implementations are unchanged. Interpreter controls\r\nshowed Simplex taking about 2�9% longer than 0.2.0, so these changes target\r\nnative execution rather than a universal runtime improvement.\r\n\r\n[Full Studio native report, exact validation and raw trials](benchmarks/2026-10-17/studio-native/README.md).\r\nReproduce with `python tools/studio_native.py`, open the generated place,\r\nand press Play. Add `--validate` for the exact-output suite.\r\nThese changes are included in 0.2.1; the historical tables below describe 0.2.0.\r\n\r\n### Released 0.2.0: CLI and Studio interpreter\r\n\r\nMeasured October 17, 2026 on an AMD Ryzen 5 7600X. Tables show medians of\r\n11 trials, including closure-call overhead. **Native CLI** uses Luau O2 with\r\nnative code generation; **Studio interpreter** is a fresh measurement inside\r\nRoblox Studio Edit mode. The Studio native measurements above are separate\r\nfrom these historical release measurements.\r\nCompare ratios within one runtime: **lower is better; 1.00x equals that\r\nruntime's `math.noise` cost**. These algorithms produce different fields;\r\nderivative, cell and fBm rows also return more information or do more work.\r\n\r\n### Scalar noise\r\n\r\nMicroseconds per call, 100,000 calls per trial. Atlas samplers use seed 42.\r\nEach ratio uses the matching-dimensional `math.noise` reference.\r\n\r\n| Workload | Native CLI us/call | vs math.noise | Studio interpreter us/call | vs math.noise |\r\n|---|---:|---:|---:|---:|\r\n| math.noise 2D | 0.043 | 1.00x | 0.040 | 1.00x |\r\n| Perlin 2D | 0.033 | 0.77x | 0.120 | 2.99x |\r\n| Perlin 2D + derivatives | 0.043 | 1.00x | 0.274 | 6.81x |\r\n| Simplex 2D | 0.046 | 1.07x | 0.153 | 3.80x |\r\n| Simplex 2D + derivatives | 0.054 | 1.26x | 0.224 | 5.57x |\r\n| Voronoi 2D | 0.108 | 2.51x | 0.405 | 10.07x |\r\n| Voronoi cell2D (F1, F2, ID) | 0.133 | 3.11x | 0.447 | 11.10x |\r\n| Island 2D | 0.043 | 1.00x | 0.093 | 2.32x |\r\n| fBm 2D (4 Simplex octaves) | 0.198 | 4.62x | 0.634 | 15.77x |\r\n| math.noise 3D | 0.042 | 1.00x | 0.043 | 1.00x |\r\n| Perlin 3D | 0.043 | 1.01x | 0.312 | 7.27x |\r\n| Perlin 3D + derivatives | 0.060 | 1.43x | 0.597 | 13.93x |\r\n| Simplex 3D | 0.060 | 1.43x | 0.280 | 6.52x |\r\n| Simplex 3D + derivatives | 0.073 | 1.74x | 0.483 | 11.28x |\r\n| Voronoi 3D | 0.335 | 7.94x | 1.515 | 35.34x |\r\n\r\n### Bulk grids and volumes\r\n\r\nMilliseconds per **whole result array**, including allocation. Every path\r\nfills the same number of entries at the same coordinates. Ratios compare\r\nwith a loop of `math.noise` calls producing that same array; outputs differ\r\nbetween noise algorithms. These gains require using the bulk APIs.\r\n\r\n| Workload | Native CLI ms/grid | vs math.noise | Studio interpreter ms/grid | vs math.noise |\r\n|---|---:|---:|---:|---:|\r\n| math.noise grid2D (128x128) | 0.676 | 1.00x | 0.808 | 1.00x |\r\n| Perlin.sampleGrid2D (128x128) | 0.209 | 0.31x | 1.218 | 1.51x |\r\n| Simplex.sampleGrid2D (128x128) | 0.479 | 0.71x | 2.407 | 2.98x |\r\n| math.noise grid3D (32x32x32) | 1.350 | 1.00x | 1.703 | 1.00x |\r\n| Perlin.sampleGrid3D (32x32x32) | 0.787 | 0.58x | 8.071 | 4.74x |\r\n| Simplex.sampleGrid3D (32x32x32) | 1.599 | 1.18x | 8.803 | 5.17x |\r\n\r\nNative CLI Perlin's 128x128 bulk path took about **31% of the `math.noise`\r\nloop's time** in this run. This is not a Studio native result; the actual\r\nStudio interpreter results above are slower than its built-in `math.noise`.\r\n\r\n### Other operations\r\n\r\nMicroseconds per complete operation; these units differ from one noise sample.\r\n\r\n| Operation | Native CLI us/op | Studio interpreter us/op |\r\n|---|---:|---:|\r\n| Curve.evaluate (8 points) | 0.074 | 0.124 |\r\n| Sampling.uniform (256 points) | 4.340 | 13.286 |\r\n| Sampling.poissonDisc (100x100, r=5) | 2559.592 | 2505.496 |\r\n| Sampling.blueNoiseGrid (100x100, cellSize=3) | 28.074 | 183.560 |\r\n| Visualizer render math (128x128) | 1057.525 | 3592.990 |\r\n\r\n### Usage and reproducibility\r\n\r\n```lua\r\nlocal perlin = Atlas.Noise.Perlin.new(42)\r\nlocal simplex = Atlas.Noise.Simplex.new(42)\r\nlocal heights = perlin:sampleGrid2D(128, 128, 0, 0, 0.02, 0.02)\r\nlocal surface = simplex:sampleGrid2D(128, 128, 0, 0, 0.02, 0.02)\r\nlocal volume = perlin:sampleGrid3D(32, 32, 32, 0, 0, 0, 0.02, 0.02, 0.02)\r\n-- simplex:sampleGrid3D takes the same arguments.\r\n-- 2D index: row * width + column + 1 (zero-based row/column).\r\n-- 3D index: (slice * height + row) * width + column + 1.\r\n```\r\n\r\n- Scalar samples are allocation-free. Bulk calls allocate their result arrays;\r\n  Perlin uses an additional temporary buffer of 24 bytes per column.\r\n- Perlin and Simplex prepare 20 KiB of gradient buffers per instance. Construct\r\n  samplers once and reuse them; keep repeated method calls localized in hot loops.\r\n- Bulk outputs match the corresponding Atlas scalar methods exactly, including\r\n  negative/zero steps. This does not mean Atlas matches Roblox's noise field.\r\n- Benchmarks vary by runtime, native settings, workload and hardware. Raw logs\r\n  retain trial ranges and checksums; small differences should not be generalized.\r\n\r\n[Complete release measurements and methodology](benchmarks/2026-10-17/release-v0.2.0/README.md),\r\n[optimization history](benchmarks/2026-10-16/README.md),\r\n[Perlin 2D trials](benchmarks/2026-10-16/research/README.md), and\r\n[Simplex/3D trials](benchmarks/2026-10-17/bulk-noise/README.md).\r\n\r\nBuild the test place with `rojo build test.project.json -o AtlasTest.rbxl` and\r\npress Play in Studio to run smoke checks and the original benchmark suite.\r\nThe release benchmark harness is `test/release-performance.luau`.\r\n\r\n## License\r\n\r\nAtlas is licensed under the [MIT License](LICENSE).\r\n","readmeTruncated":false}