game.json describes your game to the portal: its name, description, classification, screen orientation, thumbnail, and the score limits the server uses against cheating. The file sits at the root of your game folder, next to the build folder. The operations team checks it with wsg validate before release; any field you leave out gets its default value.
Full example
{
"slug": "flappy-demo",
"version": "1.0.0",
"title": "Flappy Demo",
"description": {
"vi": "Chạm để bay qua ống. Ống càng lúc càng hẹp.",
"en": "Tap to fly through the pipes. Gaps get tighter."
},
"category": "arcade",
"tags": ["flappy", "one-tap", "pixel", "tap"],
"orientation": "portrait",
"controls": ["tap", "keyboard"],
"thumbnail": "./thumbnail.png",
"cover": null,
"sdk": { "major": 1 },
"limits": {
"maxScore": 9999,
"maxScorePerSecond": 3,
"minDurationMs": 1000,
"scoreOrder": "desc"
},
"build": { "command": "pnpm build", "outDir": "dist" },
"features": { "leaderboard": true, "rewarded": true, "interstitial": true, "storage": true },
"minPlayers": 1,
"maxPlayers": 1,
"author": { "name": "WSG", "url": null },
"generated": { "by": null, "pipelineRunId": null }
}game.json is plain JSON: no comments and no trailing commas.
Fields
| Field | Type | Required | Default | Constraints |
|---|---|---|---|---|
slug | string | Yes | — | Matches ^_?[a-z0-9][a-z0-9-]{1,48}$: 2–49 lowercase letters, digits and hyphens, not starting with a hyphen. The _ prefix is reserved for internal games. Must equal the game folder name |
version | string | Yes | — | Semver MAJOR.MINOR.PATCH, suffixes such as 1.2.0-beta.1 allowed. Every release uses a new version |
title | string | Yes | — | 1–80 characters. A single string, not per language |
description | { vi, en } | Yes | — | Both vi and en are required, 1–500 characters each |
category | string | Yes | — | One slug from the category table |
tags | string[] | Yes | — | 1–8 slugs from the tag table; repeated slugs get a warning |
orientation | string | Yes | — | portrait, landscape or any |
controls | string[] | Yes | — | At least one of tap, swipe, keyboard, mouse, gamepad |
thumbnail | string | Yes | — | A relative path inside the game folder to a .png, .jpg, .jpeg or .webp image; 512×512, at most 150 KB |
cover | string | null | No | null | A relative path to a cover image, ideally 1200×630 |
sdk.major | integer | No | 1 | ≥ 1; the SDK major version the game uses |
limits | object | Yes | — | See Choosing limits |
build.command | string | No | "pnpm build" | The build command, run inside the game folder |
build.outDir | string | No | "dist" | The bundle folder, which must be inside the game folder; "." means no build step |
features | object | No | all four true | leaderboard, rewarded, interstitial, storage as booleans |
minPlayers, maxPlayers | integer | No | 1, 1 | ≥ 1 and minPlayers ≤ maxPlayers |
author.name | string | No | "unknown" | 1–80 characters |
author.url | string | null | No | null | A valid URL or null |
generated | object | No | { "by": null, "pipelineRunId": null } | Reserved for the automated game-generation pipeline; leave it null |
Notes on some fields:
slugis your game's permanent identifier: the bundle path/<slug>/<version>/, the pagehttps://leonogames.com/games/<slug>and thegameIdpassed toWSG.init(). Changing the slug creates a different game.orientationsets the iframe frame on the portal:portraitkeeps a 9:16 ratio at most as tall as the screen,landscapekeeps 16:9, andanyfills the play area. On phones the portal suggests rotating the device when the player holds it the wrong way.thumbnailandcoverare only used for listings and don't need to be in the bundle. On release the images are uploaded tohttps://games.leonogames.com/<slug>/media/and thegame.jsonsent to the API carries their real URLs.wsg validatecan only read the dimensions of PNG images; other formats only get a warning.featuresis only reflected throughWSG.isAvailable(); the portal currently doesn't block calls based on these flags.build: for a pre-built submission, setcommandto a no-op (for example"echo prebuilt") and pointoutDirat your build folder. See Submitting and publishing.
Categories
category takes exactly one value from this table:
| Slug | Name |
|---|---|
arcade | Arcade |
puzzle | Puzzle |
action | Action |
casual | Casual |
sports | Sports |
racing | Racing |
strategy | Strategy |
card-board | Card & Board |
kids | Kids |
io | .io |
Tags
tags takes 1–8 slugs from any of the kinds below. The controls field only accepts slugs of the controls kind. The swipe slug appears both as a mechanic and as a control, but it is a single value.
| Kind | Valid slugs |
|---|---|
Genre (genre) | endless-runner, flappy, match-3, merge, stack, snake, breakout, 2048, shooter, platformer, idle, quiz, word |
Mechanic (mechanic) | one-tap, timing, physics, drag-drop, swipe, aim, rhythm |
Theme (theme) | space, animals, food, pixel, neon, fantasy, sports |
Controls (controls) | tap, swipe, keyboard, mouse, gamepad |
The taxonomy grows over time; if you need a new category or tag, suggest it to the operations team instead of picking an approximate value.
Choosing limits
The server uses limits to reject scores that can't be reached by real play. Too strict and skilled players get rejected unfairly; too loose and the leaderboard is easy to cheat. The full rules are on the Scores and leaderboards page.
| Field | Type | Meaning | Rejection reason |
|---|---|---|---|
maxScore | integer, 0–2^53 | The highest score a single run can reach | over_max |
maxScorePerSecond | number > 0 | The maximum scoring rate: score divided by seconds played | rate_too_high |
minDurationMs | integer ≥ 0 | The minimum play time before a score can be submitted | too_fast |
scoreOrder | desc | asc | desc (default): higher is better; asc: lower is better, e.g. a time | — |
The server measures play time (elapsed) as the session's total gameplay time up to the moment the score arrives (every stretch from gameplayStart() to gameplayStop() added up, pauses excluded), with a minimum of 1 second. That is why a minDurationMs of 1000 or less can never cause too_fast (wsg validate warns when the value is below 1000).
The recommended method:
- Derive the maximum scoring rate from your design, not from human hands: item spawn rates, lockouts between two scoring actions, end-of-level bonuses. If your game lets players tap as fast as they like, add a cap inside the game.
- Multiply by 1.5 for headroom to get
maxScorePerSecond. maxScoreis the highest reachable score; for games without a ceiling (endless runners) estimate generously, sincemaxScorePerSecondalready caps scores over time. Clamp the score in-game atmaxScoreso you never submit above it.minDurationMsis the fastest time in which a valid run can end, minus a few seconds for network delay.
Worked examples
Endless runner. +1 point per 300 ms survived (3.33 points per second) and +5 per coin; the game spawns at most one coin every 2 seconds (≤ 2.5 points per second). The maximum rate is 5.83 points per second; times 1.5 gives maxScorePerSecond: 9. The earliest possible death is around 4 seconds in, so choose minDurationMs: 3000. The score is clamped in-game at 5000, so maxScore: 5000.
Puzzle with an end-of-level bonus. Each matched pair is +10, every flip is locked for at least 750 ms, and clearing a level adds a bonus. A bot that knows every card clears level 1 with 148 points in 6.9 seconds, i.e. 21.4 points per second; set maxScorePerSecond: 25 (less than 1.5× headroom because that figure is already the absolute design limit). Note that a bonus landing at the end of a level is still divided by the whole play time.
Time trial (asc). The score must be the number of milliseconds taken to finish. The server doesn't use maxScorePerSecond for asc (it must still be positive, for example 1200); instead it checks that the score is not below minDurationMs and not shorter than the gameplay stretch the server measured by more than max(2 seconds, 10 %), see Time scores. minDurationMs is the fastest possible finish (for example 20000) and maxScore the slowest time you still want to record (for example 600000, i.e. 10 minutes).
{
"limits": { "maxScore": 600000, "maxScorePerSecond": 1200, "minDurationMs": 20000, "scoreOrder": "asc" }
}Validating game.json
The operations team (or you, if you have the repository) runs wsg validate on the game folder. It checks: valid JSON matching the schema; slug equals the folder name; category and tags exist in the taxonomy (duplicate tags only warn); the thumbnail image exists inside the game folder, has an allowed format, is at most 150 KB and exactly 512×512 if it is a PNG; cover ideally 1200×630 (warning only); build.outDir is inside the game folder; minPlayers ≤ maxPlayers; a minDurationMs below 1000 gives a warning. The CLI prints its messages in Vietnamese.
$ pnpm wsg validate tap-rush
OK game.json hợp lệ: tap-rush@1.0.0 "Tap Rush"
OK thumbnail ./thumbnail.png 512×512, 3.6 KB
validate: OK (0 lỗi, 0 cảnh báo)$ pnpm wsg validate tap-rush
ERR game.json version: version phải là semver, ví dụ 1.0.0
ERR game.json category: "shooter" không có trong category trong taxonomy (arcade, puzzle, action, casual, sports, racing, strategy, card-board, kids, io)
validate: FAIL (2 lỗi, 0 cảnh báo)