# Sharing a game

How a finished game reaches other people, from most private to most social. The workflow ends
with `vp share` (§2): it uploads the game and puts it on the user's page.

## 1. The file

`bunx vp pack` builds `dist/<id>.vpgame`. Anyone can drag it onto https://voxelparty.io
(or press **M** there → **"+ Add a game file"**). It's saved in that browser's **My Games** and
plays there solo (with CPUs). Good for trying it on another computer; clumsy for friends, and a
file alone can't be played online: the other players have no way to load it.

## 2. Links: `vp share`

```sh
bunx vp share
```
It packs the game (exactly what `vp pack` builds), uploads it **unlisted**, opens its claim link in
the browser and prints:
```
Sky Charge is online (unlisted).
  Put it on your page: https://voxelparty.io/#claim/<hash>/<key>
    (opened in your browser: sign in, and it's in "Your games" with Play and Publish)
  Play it: https://voxelparty.io/?play=<hash>
    (opens a lobby for it: press Invite there and send friends the party link, or add CPUs and Start)
```
- **Put it on your page** (opened for you; `--no-open` only prints it): the user signs in there
  (Discord) and the game lands in **Your games** on the site's Create page, with **▶ Play** and
  **Publish**. The link is secret, and it's the only way to claim the upload: whoever opens it
  signed in first owns it, so don't post it anywhere. If no browser opened (a remote machine), give
  the user the link.
- **Play it** (`?play=<hash>`): opens a party with a **lobby** for this game (a session, `vp docs
  sessions`). Press **＋ Invite** to copy the party's link (`?room=CODE`, it shows the game's
  picture when pasted in Discord) and send it: friends who open it land in the same lobby. Add
  CPUs there, or press **Start** to play right away. It also adds the game to the opener's My Games.
  This is the way to play a game together, and alone.
- **Unlisted** means only people with a link can find it: nothing lists it.
- The hash is that exact build. Uploading the same build again says "this exact version was
  already uploaded" and gives the same links (the claim link only to the address that first shared
  it, until it's claimed). After any change, `vp share` again and send the new links: old links
  keep playing the old version.
- Share only after `bunx vp check` is clean (all ✔, no ⚠) and the user has played it: the link
  is how other people first meet the game.

The first real online test is usually the user plus a friend in one party (`vp dev`
and `vp check` run one client). Ask them to report desyncs, stalls, joins that go wrong, or a
round that never ends; the `FakeRoom` tests (`vp docs netcode` §6) are how you reproduce and fix those.

## 3. Timed games

A game with a `board` block in `game.json` has a round time limit. It plays in sessions like every
other game, and its store page shows the round length.

## 4. Publishing to the community

**The store listing is yours to write**, in `game.json`, before `vp share`:
```json
{ "id": "goose-chase", "name": "Goose Chase", "players": { "min": 1, "max": 8 }, "input": ["mouse"],
  "description": "You're a goose. Steal hats, honk at villagers and get away before the farmer catches you.",
  "tags": ["stealth", "comedy", "chase"] }
```
- `description`: 1-2 sentences, at most 280 characters: what you do and how you win, in plain
  words a player gets at a glance. Not a feature list.
- `tags`: 3 of your own words for what the game is (genre, mood, how it's played), the words
  someone would search for. Lowercase, dashes for spaces (`"tower-defense"`, `"co-op"`); anything
  else is cleaned up that way. The store's tag filters are the tags games use most, so a common
  word (`racing`, `shooter`, `party`, `puzzle`, `co-op`, `chaos`) gets found more than a made-up one.
- Both in genre words, never another game's: no franchise or game names, none of its character,
  item or map names, no "X-like" or "clone of X". A game inspired by one you love is welcome (any
  genre, rules and feel are free to use); its title and listing are its own.

They ride along in the package (outside its hash, so changing them isn't a new version), and the
site's Publish form starts from them. `vp check` and `vp share` warn (⚠) while either is missing.

`vp share` is unlisted. To list a game publicly, the user does it on the site (there's no CLI
command for it):

1. Open https://voxelparty.io (the store is the home page) and press **Sign in** (Discord)
   in the top bar.
2. In **Create**, drop the `.vpgame` (or pick it from My Games) and press **Publish**. That asks
   for a title, a short description and up to 3 tags, already filled in from `game.json`'s
   `description` and `tags` (above): the user checks them and can change anything. Uploads made from
   the site while signed in belong to that account. A `vp share` upload is anonymous until its
   claim link is opened signed in; nothing else claims it (dropping the same file on the site
   doesn't).
3. Listed games show up in the store: shelves (trending, new this week, most played, top rated),
   tag filters, search, and a page per game and per creator. Each game's page has **▶ Play** (a
   lobby for it; a guest in someone's party suggests it to the host instead), and says "N players",
   the round length and "Mouse" as they apply. Players can vote once they've played, and report a game; games with enough reports are
   hidden for review.

**The pictures are taken automatically.** Nobody uploads a thumbnail. On publish, the server plays
the game with your seat on autopilot (`input.autopilot`: your CPU plays it, the view is yours) and
CPUs in the others, and screenshots it:
- stills at about 6, 16 and 30 s into play (the first is the cover);
- a short looping clip right after the cover.

So the pictures are what a player sees, a few seconds in: first person in a first-person game, your
character's camera in a third-person one. The action should be on screen, the HUD readable, nothing
blank or waiting on a human. A game that never reads `input.autopilot` is photographed with CPUs
only instead, where a first-person game must still point its camera at something. That's the same
thing `vp check`'s autopilot screenshots show, so check those with this in mind. They appear a minute or two
after publishing; until then the card shows a generated cover.

Publishing a new version (a new file) moves the listing to it, keeps its votes and tags, and
retakes the pictures. Tell the user this; don't invent commands or promise features beyond it.
