Games built elsewhere
A game that is not a PocketJS app made in the room, such as a Pocket3D game with its own renderers, can still live in Pocket Studio: a case on the shelf, an address, a page, and packages for members. Pocket Tokyo and Pocket Atlas are published this way. Its author builds it with its own tools and uploads the results with the pocket-studio command.
#Register the game
In the game's repository, on a computer linked to your account (pocket-studio link <CODE>):
pocket-studio register --title "Native Game" --tagline "A game built elsewhere." --repository https://github.com/example/native-game
Registered "Native Game" as docs-writer
It writes .pocket-studio.json with the server and the game's id. The file holds no token, so it can be committed. A guest account cannot register a game.
| Option | What it sets |
|---|---|
--title | The game's title. |
--tagline | One line under the title. |
--colors <a,b> | The two cover colours, #rrggbb each. |
--cover <png> | The cover picture. |
--repository <url> | Its public source, so others can remix it once it is published. pocket-studio repository <url> sets it later, --remove takes it off. |
#Upload packages
pocket-studio package dist/release/native-game-0.1.0.3dsx --target 3ds --version 0.1.0
One package a device; a new one replaces the one before. Packages lists the files each device takes. Then pocket-studio downloads on lets members download them.
#Publish
pocket-studio publish --slug native-game
A registered game is published once it has a package or a web build: before that the command answers Upload a package before publishing.
#A web build
pocket-studio site dist/web
deploys a directory of static files to the game's address. Only a game Pocket Nexus verified may deploy one: for any other game the command answers that Pocket Nexus has not verified the project, and its address shows a page of the Studio's with the game's title and a link to its card. Write to support@pocket.nexus to ask for verification.
A deployment holds at most 4000 files, 32 MiB each and 1 GiB together. --entry <file> names the file the address serves at / (default index.html). The top-level directories play/ and runtime/ belong to the Studio on every game address.
#The game's page
The page at /games/<name> shows the game's listing: clips, pictures, a description and a share picture. A listing is a directory with listing.json and the files it names:
pocket-studio listing dist/listing
{
"tagline": "A flight over Shiba, around Tokyo Tower.",
"description": ["One to six paragraphs of plain text."],
"media": [
{ "kind": "video", "file": "flight.mp4", "poster": "flight.jpg", "width": 960, "height": 544,
"seconds": 14, "from": "browser", "caption": "Dusk over Shiba, from the tower to the bay." },
{ "kind": "image", "file": "station.jpg", "width": 960, "height": 544,
"from": "vita", "caption": "Hamamatsucho station from 80 metres." }
],
"card": "card.jpg",
"translations": {
"ja": { "tagline": "…", "description": ["…"], "captions": { "flight.mp4": "…" } }
}
}
| Field | Rule |
|---|---|
tagline | 1 to 120 characters. It becomes the game's tagline everywhere. |
description | 1 to 6 paragraphs of plain text, each at most 600 characters. |
media | 2 to 12 clips and pictures, in the order the page shows them. The first is the lead: the top of the page plays it, and so does the landing page's shelf when Pocket Nexus features the game. |
| A clip | .mp4, H.264, no sound track, -movflags +faststart, 6 to 30 seconds at 30 or 60 frames a second, at most 12 MiB. seconds is its length in whole seconds. poster is a .jpg of the same size. |
| A picture | .jpg, .webp or .png, at most 2 MiB. |
width, height | The file's own size: landscape, 4:3 to 2:1, the longer side 320 to 2560 pixels. |
from | What drew it: browser, or a device id (psp, vita, 3ds, ipod-touch, android). The page says where each picture came from. |
caption | At most 140 characters: what the picture shows. |
card | The share picture: a .jpg of 1200 × 630 pixels with no text on it, at most 1 MiB. |
translations.ja | The words in Japanese, each part optional, with the same limits. A part left out shows in English. |
File names are lowercase letters, digits and hyphens. All files together are at most 96 MiB. The command checks every rule on your computer, reading the files' own bytes, before it sends anything. pocket-studio listing --remove takes the listing off.
A PocketJS game made in the room can have a listing too: run the same command in its project.