This document describes the experimental noa-engine adapter for Nova64's Babylon.js voxel backend.
Nova64 includes an optional, guarded integration with noa-engine, an experimental voxel game engine built on Babylon.js. The adapter is opt-in and must not replace Nova64's shared voxel API: existing carts should continue to call the normal voxel functions whether NOA is active or unavailable.
┌─────────────────────────────────────────────────────────────────┐
│ Cart (game code) │
│ uses nova64.voxel API (api-voxel.js) │
└─────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────┐
│ runtime/api-voxel.js │
│ Shared voxel API - backend agnostic │
│ (terrain gen, physics, entities, lighting, persistence) │
└─────────────────────────────────────────────────────────────────┘
│
┌───────────────┼───────────────┐
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Three.js GPU │ │ Babylon.js GPU │ │ Babylon.js GPU │
│ (gpu-three.js) │ │ (voxel.js) │ │ + NOA Adapter │
│ │ │ │ │ (noa-adapter.js)│
└──────────────────┘ └──────────────────┘ └──────────────────┘
│ │ │
▼ ▼ ▼
┌──────────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ Three.js │ │ Babylon.js │ │ noa-engine │
│ WebGL Renderer │ │ WebGL Engine │ │ (optional) │
└──────────────────┘ └──────────────────┘ └──────────────────┘
noa-engine is an optional dependency pinned to the latest published 0.33.x line. In the Nova64 repo, install through the normal WSL workflow:
pnpm install
If a package manager skips optional dependencies, the adapter reports a graceful inactive status and Babylon continues to use Nova64's built-in voxel renderer.
// Check if NOA adapter is available (Babylon.js backend only)
const status = getVoxelNoaAdapterStatus();
console.log(status);
// { initialized: false, active: false, version: '0.1.0', ... }
// Enable NOA adapter (async; Babylon.js backend only)
const result = await enableVoxelNoaAdapter({
debug: false,
chunkSize: 16,
renderDistance: 4,
});
if (result.active) {
console.log('NOA adapter is now active!');
console.log('Features:', result.features);
// { physics: true, entities: true, terrain: true, meshing: true }
}
// Check if NOA is currently active
if (isVoxelNoaActive()) {
console.log('Using NOA-enhanced voxel backend');
} else {
console.log('Using standard voxel backend');
}
// Disable NOA and return to standard backend
disableVoxelNoaAdapter();
Existing cart-facing voxel APIs must keep working whether NOA is active or not:
updateVoxelWorld(x, z) - Load/unload chunks around positiongetVoxelBlock(x, y, z) - Get block type at positionsetVoxelBlock(x, y, z, blockId) - Set block at positionraycastVoxelBlock(origin, direction, distance) - Raycast for block selectionmoveVoxelEntity(pos, velocity, size, dt) - Physics with collision detectionspawnVoxelEntity(type, pos, opts) - Spawn entitiesconfigureVoxelWorld(opts) - Configure world settingsWhen NOA is active, backend-level diagnostics can access additional NOA state:
// These only work when isVoxelNoaActive() returns true
const engine = gpu.noaEngine; // advanced backend diagnostics only
When enabling the NOA adapter:
await enableVoxelNoaAdapter({
// Debug mode - shows FPS, chunk boundaries, etc.
debug: false,
// Chunk size (must match Nova64's CHUNK_SIZE)
chunkSize: 16,
// Render distance in chunks
renderDistance: 4,
// Advanced NOA configuration (optional)
noaConfig: {
playerHeight: 1.8,
playerWidth: 0.6,
tickRate: 30,
// ... see noa-engine docs for full options
},
});
You can enable NOA probing via URL parameters:
?noaVoxel=probe Enable NOA feature detection
?noaVoxel=true Enable NOA adapter if available
?noaVoxel=false Disable NOA adapter
NOA preference can also be stored:
localStorage.setItem('nova64:noaVoxel', 'probe');
| File | Description |
|---|---|
runtime/api-voxel.js |
Cart-facing voxel API (shared between backends) |
runtime/backends/babylon/voxel.js |
Standard Babylon.js voxel backend |
runtime/backends/babylon/noa-adapter.js |
NOA engine adapter for Babylon.js |
runtime/backends/babylon/noa-prototype.js |
NOA feature detection and probing |
Run the voxel examples to test NOA integration:
# Test minecraft-demo with Babylon.js backend
pnpm dev
# Navigate to: http://localhost:5173/babylon_console.html?demo=minecraft-demo
# Test with NOA probing enabled
# Navigate to: http://localhost:5173/babylon_console.html?demo=minecraft-demo&noaVoxel=probe
babylon_console.html)pnpm installpnpm update noa-enginedisableVoxelNoaAdapter();
noa-engine@0.33.0 currently declares an older Babylon peer range than Nova64 uses. Treat pnpm's peer warning as part of the experiment, keep the adapter opt-in, and validate Babylon voxel carts before expanding NOA ownership.