# How to make a party game for 2 to 8 players on phones and laptops

> 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.

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

Source: https://forge.netnet.capital/docs/guides/party-game-browser  
Last updated: 2026-10-23. Checked against @netforge/engine 0.2.0.

Run `npm create netforge@latest my-party -- --template party --yes` and you have a party game: two to eight friends in one playroom, five quick rounds a show, each a minigame with one goal for the whole team, and touch controls so phones work. A minigame is a small object in the `ROUNDS` list of the show system in `src/game.ts`: a name, a length, what starts and what counts as a win.

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

With `--host 0.0.0.0`, everyone on the same network opens the link on their phone or laptop and joins the room.

## What you get

| Part | Where | Notes |
|---|---|---|
| Minigames | `ROUNDS` in the `show` system | `{ name, seconds, start(), won(), lastsOut }`. The first four are shuffled each show; the finale is always last. |
| A show | `HIT_AT` | Win three rounds and the show is a hit; either way the next show starts. |
| Forgiving downs | `players.downed` | Short downs, a crawl, two free get-ups a show, everyone back between rounds. |
| The playroom | `game({ field })` | One floor, four walls and party tables, bigger than the screen so crowds arrive off screen. |
| Touch controls | template client | Every template plays on phones. |
| Server cost | measured | Four bots playing four minutes: 305 kills, 6 rounds, 0.42 ms per tick on average, p99 4.20 ms (Apple M2 Pro, Node 22). |

## 1. Start it

```sh
npm create netforge@latest my-party -- --template party --yes
cd my-party
npm run play -- --players 2
```

## 2. Add a minigame

Inside the `show` system, append a round to `ROUNDS`. This one is won if nobody goes down for 35 seconds:

```ts title=src/game.ts check=skip
{
  name: "DODGEBALL",
  seconds: 35,
  lastsOut: true,
  start: () => {
    spawnEdge("spritzer", { count: 6 + party() });
    every(4, () => { if (current === 5) spawnEdge("spritzer", { count: 2 }); });
  },
  won: () => false,
},
```

Its index in `ROUNDS` is its `current` value, and the shuffle leaves the last entry, the finale, where it is. `won()` is checked every half second and ends the round early when it returns true. Counters you can use include `kills`, `downs`, `alive("prefab")` and `on("<prefab>.killed")`. Keep 3 to 8 rounds, and give every round something to do every few seconds: a round with 30 quiet seconds fails the playtest as a softlock.

## 3. Reward the team

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

earn.rule("first_win", { when: "round.won", n: 1, pay: 5, oncePer: "run" });
earn.rule("clean_sweep", { when: "show.perfect", n: 1, pay: 25, oncePer: "run" });
```

Every won round emits `round.won`, every round's end emits `wave.cleared`, and a clean sweep emits `show.perfect`. Locally all of it is play money.

## 4. Test it

```sh
npm test
```

The playtest plays shows with four bots and checks that rounds are decided, players level and nothing goes quiet.

## How it works

The party game runs on the same action machinery as the survivor-like: the room is authoritative at 30 Hz, your own player is predicted, and weapons fire by themselves so every round is about where you stand and who you help up. The show is a system written in `src/game.ts`, not hidden machinery, so you and your agent can read every rule. See [The typed game API](https://forge.netnet.capital/docs/concepts/game-api.md) and the [party game template page](https://forge.netnet.capital/docs/templates/party-game.md).

## Alternatives

- **[Colyseus](https://docs.colyseus.io/)** is an authoritative room server with matchmaking and state sync, and client SDKs for the web and several engines. Pick it when you have your own minigames and want a room server under them.
- **[Godot](https://docs.godotengine.org/en/stable/tutorials/export/exporting_for_web.html)** exports to the web as WebAssembly with WebGL 2 and has a high-level multiplayer API. Pick it for an editor-first party game with a native build as well.

Pick Net Forge when you want a room of friends playing a finished co-op show within a minute, with minigames your agent can add.

## FAQ

### How many players can play together?

Two to eight in one room.

### Do players need to install anything?

No. They open the link in a browser on a phone or laptop. Only the person hosting runs `npm run play`.

### Is it competitive or co-op?

Co-op: each round has one goal for the whole team, and the show is a hit if the team wins three rounds.

### How do I make a round easier?

Lower its goal, give it more seconds or smaller trickles, or lower `HIT_AT`. More `selfRevives` and a longer `hitIframes` help too.

### Can I make the show longer?

Add rounds to `ROUNDS` (keep 3 to 8), or change `ROUND_SECONDS`, the default length of a round.
