NET FORGE DOCS

Net Forge and three.js: what Net Forge adds on top

Last updated Checked against @netforge/engine 0.2.0View as Markdown

Net Forge, the open-source multiplayer browser game engine built for AI coding agents, is published on npm under @netforge with source at github.com/netnetdev/net-forge.

Net Forge is three.js plus the game engine, physics, entity system and authoritative multiplayer you would otherwise build yourself: @netforge/engine-sim (a bitECS entity system with Rapier physics at a fixed tick), @netforge/engine/net (input commands, delta snapshots, prediction and reconciliation), and the room host in @netforge/kit-play, all under a three.js renderer (three 0.186.1, with WebGPURenderer and a WebGL2 fallback). Use three.js on its own when you want full control of a 3D scene; use Net Forge when you want a multiplayer game on three.js where the simulation, netcode, physics and a finished game are already done.

npm create netforge@latest my-game -- --template survivor --yes

At a glance

three.jsNet Forge
What it is"An easy-to-use, lightweight, cross-browser, general-purpose 3D library" (README)A game engine and ten multiplayer templates that render with three.js
LanguageJavaScript, with TypeScript typesTypeScript
RenderingWebGL and WebGPU renderers, with SVG and CSS3D as addonsthree.js WebGPURenderer, falling back to WebGL2
Game loop, physics, netcodeNot included; bring your ownIncluded: fixed tick (30 or 60 Hz), Rapier physics, authoritative rooms, prediction
LicenseMIT (npm)MIT
Latest version (checked 2026-10-23)0.186.1, released 2026-09-24@netforge/engine 0.2.0, on three 0.186.1
Best forAny 3D on the web: scenes, visualizations, games, toolsOnline games in ten genres

What Net Forge adds to three.js

LayerPackageWhat it does
Simulation@netforge/engine-simA bitECS world with Rapier physics at a fixed tick, no DOM and no clock, so the same code runs in Node and the browser
Netcode@netforge/engine/netSequence-numbered inputs, quantized delta snapshots, prediction, reconciliation and interpolation
Rendering stack@netforge/engine/runtimecreateRenderStack (lighting rig, bloom, colour grade, fog, quality tiers, GPU particles), instanced and vertex-animated crowds for thousands of enemies
Game feel@netforge/engine/runtimeFeelKit: hit-stop, screen shake, hit flash, damage numbers, procedural audio cues, rumble
Game API@netforge/enginegame, prefab, weapon, system, earn, store: declarative and validated
Games@netforge/template-*Ten finished multiplayer games

When to use three.js on its own

  • Your project is not a game, or not this kind of game. three.js is general purpose: product viewers, data visualization, art and any scene graph you can imagine.
  • You want to choose every layer yourself, including physics, networking and the game loop.
  • You want the largest pool of examples. The three.js examples cover most rendering techniques.

When to use Net Forge

  • You want one simulation on both sides. The room host and the browser step the same @netforge/engine-sim world, so there is no second copy of the rules to keep in sync. See Simulation and ECS.
  • You want to start from a finished game. See Templates.
  • Your coding agent writes the game. See The typed game API.

Honest limits of Net Forge

Net Forge is young (0.2.0) and covers ten genres. Game code in src/game.ts may import only @netforge/engine and never touches three.js directly; scene code lives in the template's client/ folder. The public repository's room host is for play on your own computer and network; the production room server is the hosted Net Forge service.

Using the simulation under your own three.js scene

@netforge/engine-sim has no rendering dependency, so you can step it under a scene you wrote yourself and draw its entities however you like. This runs one tick in Node or the browser:

sim.ts
import { initSim, createWorld, addPlayer, step, Button } from "@netforge/engine-sim";

await initSim(); // once per process (loads Rapier's WebAssembly)
const world = createWorld({ tickRate: 30, seed: 7 });
addPlayer(world, 1);

// One fixed tick with every player's input for that tick.
const { tick, events } = step(world, new Map([[1, { seq: 1, tick: 0, moveX: 0, moveZ: 1, yaw: 0, buttons: Button.Fire }]]));
console.log(tick, events.length);

For moving an existing scene over step by step, see Migrating a three.js scene to Net Forge. For a plain three.js scene with Net Forge's netcode under it, see the runnable example in How to add authoritative multiplayer to a three.js game. For three.js next to Babylon.js, PlayCanvas, Godot and Unity, see 3D multiplayer browser game engines compared.

FAQ

Is Net Forge built on three.js?

Yes. @netforge/engine depends on three 0.186.1 and renders with WebGPURenderer, which falls back to WebGL2.

Is three.js a game engine?

three.js describes itself as a general-purpose 3D library (README). It draws scenes; game loops, physics and networking come from other libraries. Net Forge is one way to add those.

Can I write three.js code inside a Net Forge game?

Not in src/game.ts, which may import only @netforge/engine. Scene code lives in the template's browser client, which you can read and fork.

How does Net Forge draw thousands of enemies with three.js?

With instanced meshes and vertex-animation crowds (InstancedCrowd, AnimatedCrowd, VatCrowd), so a whole crowd is one draw. The survivor-like template holds 2,000 enemies; see Templates.