NET FORGE DOCS

Net Forge guides

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.

Each guide answers one job and names the template that already does it, so you start from a working game.

  • Multiplayer browser game: Start from a finished multiplayer game with one command: the server runs the simulation, every browser predicts its own player from the same code, and you change the rules in one TypeScript file.
  • .io-style arena shooter: Make a .io-style browser shooter where players join a room from a link, the server owns all movement and hits, and bots fill empty seats so a lone player still gets a fight. One command starts it.
  • Authoritative multiplayer for three.js: Put the rules in one simulation that the server runs as the authority and the browser runs again to predict, and send only inputs from each client. With Net Forge that simulation is one game file shared by server and browser, so there is no separate server codebase; three.js only draws what it says.
  • Three.js netcode: How client-side prediction, server reconciliation, interpolation and delta snapshots work in a three.js multiplayer game, with a runnable TypeScript example that converges exactly under 80 ms latency and 5% packet loss.
  • Deterministic Rapier physics: Use @netforge/engine-sim's createPhysics for Rapier rigid bodies, triggers, ray casts and a character controller on a fixed tick, with bit-exact snapshots and a state hash, so the server and every browser compute the same world.
  • Shared client and server simulation: @netforge/engine-sim is one TypeScript module that steps the same world on a Node server and in the browser: fixed tick, quantized inputs, integer state and snapshots that restore bit-exact. A runnable example proves two worlds stay identical.
  • Free CC0 models and sounds: The Net Forge asset library gives a web game CC0 characters, creatures, vehicles, props, sprites and sound effects addressed by id, in four model sets and six art styles, with each pack's licence verified and every file pinned by hash.
  • WebGPU with a WebGL2 fallback: Net Forge draws with three.js's WebGPURenderer, which uses WebGPU where the browser has it and WebGL 2 everywhere else, and wraps it in a render stack with lighting, post effects, GPU particles and quality tiers that adapt to the device.
  • Test locally with bots: Open one room in several browser tabs with npm run play, let phones on your network join, and run headless playtest bots with npm test and npm run check. Everything runs on your computer with play money.
  • Let an AI agent build your game: Scaffold a Net Forge game with npm create netforge, open it in Claude Code, Cursor or Copilot, and ask for changes in plain words. The agent edits one typed file, src/game.ts, and checks every edit with npm run check, a headless bot playtest that prints JSON.
  • Deploy and host: Two honest options: play and playtest on your own computer and network with the kit-play local host, or publish through the hosted Net Forge studio, which runs the production room servers, lag compensation and run verification.
  • Survivor-like with thousands of enemies: Start from the EMBERWATCH template with one command: a four-player co-op survivor-like that holds 2,000 enemies on an authoritative server at 30 Hz, drawn with instanced three.js crowds. Then tune the swarm, the weapons and the waves in src/game.ts.
  • Co-op game joined with a link: Start a four-player co-op game with one command, share a room link so friends drop into the same run, and tune revives, shared XP and boss scaling in src/game.ts. Rooms, the authoritative server and prediction come with the template.
  • Host a game server: What a browser game server needs (WebSockets, a fixed-tick authoritative loop, TLS, rooms that stay on one process), how Net Forge's local room host does it on one port, and which hosted and self-hosted options fit a public game.
  • Vibe-code a multiplayer game: Start from a finished multiplayer template instead of a blank page, let your agent change only the declarative game file, and gate every change on a headless bot playtest. The netcode, rendering and server authority are already done, so prompts change the game, not the plumbing.
  • In-game store and currency: Declare store items, coin prices and earn rules in src/game.ts with store.sku and earn.rule. Locally they run with play money; on the hosted Net Forge service a game can optionally upgrade its coins to its own token.
  • Online card battler with AI opponents: Start the INKWRIT card battler with one command: one-against-one duels with turns, a turn timer, hidden hands shuffled on the server, a draft between duels and AI opponents in four tiers. Change cards, the table and the AI in src/game.ts.
  • Turn-based multiplayer game: Start from a turn-based template (the card battler or the monster collector) with one command. Turns, validated actions, hidden information and replays come from Net Forge rules genres: deterministic modules the room server runs at 30 Hz behind the same netcode as the action games.
  • Co-op tower defense: Start the COGSPIRE tower defense template with one command: up to four players build and upgrade towers on one shared board against twenty waves. Change the road, towers, creeps and waves in src/game.ts; targeting, gold, co-op and netcode come with it.
  • Online kart racer: Start the TORQUEBAY kart racer with one command: up to eight karts race laps with drift boosts, boost pads and coins, seat bots fill the grid, and the server runs arcade kart physics at 60 Hz. Add circuits and tune the handling in src/game.ts.
  • Dungeon crawler with procedural rooms: Start the CRYPTWICK template with one command: a four-player co-op crawl through a crypt grown from a seed, with rooms that wake as you approach, flow-field pathing round walls, reliquary upgrades and permadeath. Change the seed, the rooms and the encounters in src/game.ts.
  • Multiplayer idle game: Start the BRINEWORKS idle template with one command: up to eight players each run a works on one shared salt flat and fill a contract together. Production runs only on the server's clock while you are in the room, so the game cannot be farmed. Tune plants, costs and shifts in src/game.ts.
  • Multiplayer 3D platformer: Start the SKYLEDGE platformer with one command: up to eight climbers race cliffside courses with coyote time, jump buffering, variable jump height, dashes, springs and moving platforms. The movement is predicted bit for bit, and a route planner checks every course. Tune the feel in src/game.ts.
  • Monster collector with battles: Start the MOSSBOUND monster collector with one command: up to eight players walk a shared marsh, meet wild creatures in tall grass, battle them turn by turn with a team of three, catch the ones worth keeping and wear down one shared boss. Add creatures, moves and grass zones in src/game.ts.
  • Party game for 2 to 8 players: Start the ROMPHOUSE party template with one command: two to eight friends in one playroom play five quick co-op minigame rounds a show, on phones or laptops. Each minigame is an entry in a ROUNDS list in src/game.ts that you can add to or change.