NET FORGE DOCS

Party game template for 2 to 8 players (ROMPHOUSE)

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.

ROMPHOUSE is a complete co-op party game for two to eight friends in one playroom: a show is five quick minigame rounds with one goal for the whole team (pop the poppers before the timer, crash every gift box, catch the runaway pup, hold the floor against a tide, and burst the Big Balloon as the finale). Win three and the show is a hit. Weapons fire by themselves, so every round is about where you stand and who you help up.

npm create netforge@latest my-game -- --template party --yes
cd my-game
npm run play -- --host 0.0.0.0

With --host 0.0.0.0, friends on the same network open your computer's address on their phones and join the same room. Keys: WASD or arrows, Space to dash, 1 2 3 to pick a card. On touch, drag on the left half and tap the DASH button.

What you get

PartWhat it doesWhere
The showA list of minigames, each with a name, length, a start() that spawns its crowd and a won() check; shuffled each show with the finale lastthe show system in src/game.ts
The playroomOne floor, four walls and party tables as cover, bigger than the screen so crowds arrive off screenfield in game({...})
Forgiving downs8 s down, crawl, two free get-ups a show, back in 3 s; everyone out returns between roundsplayers.downed
CombatAuto-firing weapons, level-up cards, a finale boss with telegraphed attacksweapon(...), prefab(...)
Netcode30 Hz authoritative room, your own player predictedthe template package
Playtest botsFour bots for four minutes: rounds won, kills, softlock check on every roundnpm test

Measured on an Apple M2 Pro, Node 22: four bots over four minutes (7,200 ticks at 30 Hz) played six rounds, cleared 305 enemies, reached level 10 and won the first-round earn rule, at 0.15 ms per server tick on average (p99 0.51 ms).

1. Add a minigame

Each entry in the show system's ROUNDS list is an object with name, seconds, start(), won() and an optional lastsOut. start() runs as the round opens (spawn its crowd with spawnEdge, scatter props with scatter, start a trickle with every). won() is checked every half second and ends the round early when it returns true. A lastsOut: true round is won at the bell if nobody went down.

For example, a dodgeball round is { name: "DODGEBALL", seconds: 35, lastsOut: true, start: () => spawnEdge("spritzer", { count: 6 + party() }), won: () => false }. Append it to ROUNDS and include it in the shuffle, which leaves the last entry (the finale) where it is. Keep 3 to 8 rounds, and make something happen every few seconds: a round with 30 quiet seconds fails the playtest as a softlock.

2. Add a crowd enemy

src/game.ts
import { prefab } from "@netforge/engine";

prefab("bouncer", {
  model: "style.lowpoly.blob_ninja",
  appearance: { tint: "#9be37a" },
  health: 30,
  speed: 3.2,
  radius: 0.45,
  damage: 5,
  ai: "charger",
  drops: ["star_small"],
});

Then spawn it from a round's start(), for example spawnEdge("bouncer", { count: 4 }).

3. Add an earn rule

src/game.ts
import { earn } from "@netforge/engine";

earn.rule("crowd_favourite", { when: "round.won", n: 4, pay: 20, oncePer: "run" });

Every won round emits round.won, every round's end emits wave.cleared, and a clean sweep emits show.perfect. A rule counts once per show per player.

4. Check it with bots

npm test

How it works

ROMPHOUSE runs on the survivor-like machinery (auto-firing weapons, level-up cards, co-op downs and revives, a boss with telegraphed attacks) inside one walled room. The show is ordinary code in src/game.ts, so you or your coding agent can add, remove or reorder minigames without touching the template. The room is authoritative and each player's own character is predicted, which keeps phones on a home network responsive. See Netcode and prediction.

The full guide is Make a party game for 2 to 8 players on phones and laptops.

Alternatives

  • Colyseus is a multiplayer server framework with rooms and matchmaking. Pick it when you already have a party game client and want a server for rooms and state.
  • Phaser is a 2D HTML5 framework. Pick it for a 2D party game where each minigame has its own scene and art.
  • Net Forge fits when you want a finished co-op show with rounds, revives and bots, where a new minigame is one object in a list.

FAQ

How many players can join a party game?

Two to eight per room. One player can also play a show alone; crowd sizes scale with the number of players.

Can friends join from their phones?

Yes. The client has touch controls. Run npm run play -- --host 0.0.0.0 and share your computer's address on the same network.

How long is a show?

Five rounds of 30 to 60 seconds with a short breather between them, so a show takes a few minutes.

What happens when a player goes down?

They are down for 8 seconds and can crawl to a friend to be revived, with two free get-ups a show. Anyone still out comes back between rounds.

Is it competitive or co-op?

Co-op. Every minigame has one goal for the whole team.