World42 is a high-performance, multithreaded planet rendering engine that leverages a quadtree structure to dynamically manage Levels of Detail (LOD) for planetary surfaces. The project uses Web Workers for heavy geometry calculations and a floating-origin system to maintain precision even at vast distances. World42 is designed to render detailed, textured planetary surfaces with efficient LOD management. It uses a custom quadtree structure to subdivide the planet's surface and dynamically update patches based on the camera's distance and movement. By offloading geometry calculations to Web Workers, the engine maintains a smooth, responsive user experience.
- Floating origin camera
- Real-scale planet (1:1)
- Quadsphere with a uniform mesh
- Asynchronous CDLOD/Quadtree using Web Workers
World42/
│
├─ core/ # Reusable engine subsystems (indépendants du jeu)
│ ├─ camera/ # OriginCamera, FloatingEntity, etc.
│ ├─ scale/ # ScaleManager, conversions (km → sim units)
│ ├─ control/ # MouseSteerControlManager, input abstractions
│ ├─ render/ # PostProcessManager, shaders, WebGPU/WebGL setup
│ ├─ io/ # TextureManager, AssetLoader, network utils
│ └── ...
│
├─ game_objects/ # High-level engine systems built *from core*
│ └─ planet/ # CDLOD / Quadtree / ChunkTree logic
│ └─ rocky_planet/
│ ├─ quadtree/
│ ├─ chunks/
│ ├─ terrain/
│ └─ shaders/
│
├─ game_world/ # Game-specific logic built on top of engine/
│ ├─ entities/ # Planet entities, moons, satellites, etc.
│ ├─ solar_system/ # Multi-planet orchestration (Mercure, Terre, etc.)
│ └─ ...
│
├─systems/
│ └─ lod/ # Orchestrateur générique
│ ├─ LodController.ts # Décide quels patches sont requis
│ ├─ LodMetrics.ts # Erreurs écran, géo, hystérésis
│ ├─ LodScheduler.ts # File de maj, budgets (ms/frames)
│ ├─ LodCache.ts # Pool, eviction
│ └─ workers/ # Workers génériques (interfaces + impl par défaut)
│ ├─ LodWorker.ts
│ └─ worker-protocol.ts
│
│
├─ assets/ # Non-code resources
│ ├─ textures/
│ ├─ models/
│ ├─ skyboxes/
│ ├─ shaders/
│ └─ ...
│
├─ utils/ # Generic utilities (unit conversions, timing)
│ └─ log.ts
│
├─ screens/ # Game states (e.g. SolarSystemScreen, MenuScreen)
│ ├─ solar-system-screen.ts
│ ├─ intro-screen.ts
│ └─ ...
│
├─ public/ # Static assets served by the dev server
│
├─ main.ts # Entry point (creates Engine, Scene, Camera)
├─ app.ts # Initializes scene, event loop, GUI, etc.https://bpodwinski.github.io/World42/
- Press L to display LODs
- Press ² to display BabylonJS debug layer
Clone the repository:
git clone https://github.com/bpodwinski/World42.git
cd World42
npm iDev
npm run serve
http://localhost:3000/World42/https://joshanthony.info/2021/12/06/how-i-structure-my-game-projects/
Project scripts now expose Playwright CLI for terminal-driven browser debugging.
# install CLI workspace bits (first time)
npm run pw:install
npm run pw:install-browser
npm run pw:help
# open app in browser (headed)
npm run serve
npm run pw:open
# inspect and interact
npm run pw:snapshot
npm run pw -- click e1
npm run pw:screenshot
npm run pw:list
# one-shot smoke check for AI debugging
npm run pw:world42:smoke
# standard validation command for AI agents (blocking)
npm run pw:validateNotes:
- Override target URL with
PW_URL(default:http://localhost:19000/). - Reuse a browser session with
PW_SESSION=<name>. npm run pw:openauto-starts a local dev server when the target URL is unreachable.- Run smoke in headed mode with
PW_HEADED=1 npm run pw:world42:smoke. - Smoke auto-starts a dev server if URL is unreachable (
PW_AUTO_SERVE=0to disable). - Validation artifacts are exported per run under
output/playwright/<runId>/.
