Game Modes¶
A game can have more than one kind of multiplayer match, such as Pong and Super Pong. Each kind is a game mode. Every game mode has its own room code and its own live version, so you can change one without touching the others.
The rule in one line¶
The queue name is the game mode. A player who calls joinQueue('superpong') gets a room running the room code you uploaded from the superpong folder (gamefuse multiplayer init --game-mode superpong).
| You upload | Players join | They get |
|---|---|---|
deploy from pong-pong-gamefuse-multiplayer/ |
mp.joinQueue('pong') |
the pong room code |
deploy from pong-superpong-gamefuse-multiplayer/ |
mp.joinQueue('superpong') |
the superpong room code |
deploy from pong-default-gamefuse-multiplayer/ |
any queue with no room code of its own | the default room code |
One game, one upload key, many modes¶
You do not need a new key for each mode. The game's upload key (on the Multiplayer tab of the dashboard) uploads, lists and switches versions for every mode of that game.
# the key is GAMEFUSE_UPLOAD_KEY in your project's .env
gamefuse multiplayer init --game-name pong --game-mode pong --game 123
gamefuse multiplayer init --game-name pong --game-mode superpong --game 123
# ...write each folder's room.js...
gamefuse multiplayer deploy --dir pong-pong-gamefuse-multiplayer --notes "Classic rules"
gamefuse multiplayer deploy --dir pong-superpong-gamefuse-multiplayer --notes "Two balls, power-ups"
Each game mode gets its own folder, <game-name>-<game-mode>-gamefuse-multiplayer, with its own room.js. Its multiplayer.json records the mode, so deploy always uploads to the right one. Running the command inside a folder works too, without --dir.
Each mode keeps its own history of versions. Version numbers are counted across the whole game (v1, v2, v3…), and gamefuse multiplayer list shows which mode each one belongs to:
ver mode status uploaded
* v3 superpong active 2026-11-30 09:12 11.2 KB Two balls, power-ups
* v2 pong active 2026-11-30 09:10 10.4 KB Classic rules
v1 pong retired 2026-11-30 09:02 10.1 KB First try
(* = live in its mode)
Making a version live only replaces the live version of its own mode. Rolling pong back to v1 (gamefuse multiplayer activate 1) leaves superpong on v3.
Setting the mode¶
Pick one:
- When you make the folder:
gamefuse multiplayer init --game-name pong --game-mode superpong. It is saved as"gameMode"in the folder'smultiplayer.json, so every deploy from that folder goes to that mode:
-
For one deploy, on the command line:
gamefuse multiplayer deploy --game-mode pong-devuploads the folder's code to another mode. -
On the dashboard's Upload Room Code By Hand form, in the Game mode box.
- In the upload API:
"mode": "superpong"in the body ofPOST /api/v3/multiplayer/deployments.
A mode name is lowercase letters, numbers, - and _, up to 40 characters, starting with a letter or number. For example pong, superpong, pong-dev, 2v2, ranked_1v1.
The default mode¶
An upload with no mode goes to default. Its room code runs for any queue that has no room code of its own. A game with only one kind of match never has to think about modes: upload without --mode and use any queue name you like.
If a player joins a queue that has no room code of its own and there is no default room code, the join fails with a message naming the missing mode.
Private rooms¶
A private room runs the mode you open it with:
const room = await mp.createRoom('superpong', { skin: 'red' }); // the superpong room code
const room = await mp.createRoom({ skin: 'red' }); // the default room code
Friends join with the room's 6-character code as usual (mp.joinRoom('K7M2QX')). The code already belongs to that room, so they do not pass a mode.
Developing without touching your live game¶
Use a separate mode name while you work, such as pong-dev:
const QUEUE = import.meta.env.DEV ? 'pong-dev' : 'pong';
const room = await mp.joinQueue(QUEUE, { clientVersion: '1' });
Players on pong never see your pong-dev code, and uploading to pong-dev never changes pong. When it works, deploy it again without --game-mode, so it goes to the folder's own mode, pong.
Dev modes share the game's data
A dev mode is part of the same GameFuse game, so its rounds, leaderboard entries and guest players are mixed in with your real ones. If you want test data kept apart completely, make a second GameFuse game (for example "Pong Dev") with its own game ID, token and upload key, and point your development build at it.
On the dashboard¶
The Multiplayer tab shows:
- Versions: one card per mode with its live version, and a Game Mode column on every version. Make live on an older version rolls back that mode only.
- Live Activity: how many modes are live, and the mode of every open room.
- Recent Rooms: the mode and version each room ran.