@indiegems/gem-web-sdk 7.9.1 → 8.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/README.md +1 -0
- package/dist/function.d.ts +26 -1
- package/dist/game.d.ts +44 -1
- package/dist/gem-web-sdk.bridge.js +1 -1
- package/dist/gem-web-sdk.esm.js +2 -2
- package/dist/gem-web-sdk.function.js +2 -2
- package/dist/gem-web-sdk.game.js +2 -2
- package/dist/gem-web-sdk.min.js +2 -2
- package/dist/gem-web-sdk.sdk.js +2 -2
- package/dist/gem-web-sdk.server.js +2 -2
- package/dist/index.d.ts +21 -3
- package/dist/sdk.d.ts +44 -1
- package/docs/achievements.md +72 -5
- package/docs/api/api-reference-game.md +719 -24
- package/docs/api/api-reference-server.md +1 -1
- package/docs/api/reference.json +671 -15
- package/docs/changelog.md +45 -0
- package/docs/cross-promotion.md +38 -2
- package/docs/friends.md +86 -11
- package/docs/getting-started.md +12 -7
- package/docs/manifest.json +25 -20
- package/docs/saving-player-progress.md +41 -0
- package/docs/server-bundles.md +2 -2
- package/docs/serverless-functions-js.md +3 -2
- package/docs/serverless-functions.md +53 -7
- package/docs/vibration.md +141 -0
- package/docs/what-a-game-must-do.md +136 -3
- package/package.json +1 -1
- package/schema/bridge.v1.json +102 -1
- package/schema/capabilities.public.json +15 -0
package/docs/achievements.md
CHANGED
|
@@ -49,9 +49,20 @@ one progression, not three progressions.
|
|
|
49
49
|
|
|
50
50
|
What the upload enforces, so you are not surprised by it:
|
|
51
51
|
|
|
52
|
-
- **A budget
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
- **A budget, set by the platform.** The platform limits the points your game's achievements may
|
|
53
|
+
award in total, how many achievements it may release, how many of them may award an icon and how
|
|
54
|
+
many distinct icons, how many one upload may declare, and how many items your game may own. It
|
|
55
|
+
can change any of those numbers, so none is written here: read your game's current limits, and
|
|
56
|
+
what it has used of each, with `gemctl achievement limits`, or from
|
|
57
|
+
`GET /v1/games/{game_id}/achievements/limits`. That endpoint answers an open map,
|
|
58
|
+
`{ game_id, limits: { <name>: { limit, used?, description } } }` — show every limit it returns,
|
|
59
|
+
not only the names you know, and read `description` for what each bounds. `used` can exceed
|
|
60
|
+
`limit` when the platform lowers one: nothing released is taken back, and nothing new fits until
|
|
61
|
+
usage is under it again. The budgets on points, achievements and icons are **lifetime**: they
|
|
62
|
+
count every achievement your game has put on the `release` channel, including ones you have since
|
|
63
|
+
removed, so retiring an achievement never frees room for another, and a config on `dev` or `test`
|
|
64
|
+
uses nothing. The item limit counts the items your game has now, and deleting a `failed` one frees
|
|
65
|
+
its slot. Points are identity, not
|
|
55
66
|
currency — a player cannot spend them, and a game cannot mint them freely.
|
|
56
67
|
- **Nothing in your config may put value into its progression.** An achievement that awards
|
|
57
68
|
points or rewards may not sit on a progression that a recipe's cost or grant, a loot-table
|
|
@@ -73,10 +84,66 @@ What the upload enforces, so you are not surprised by it:
|
|
|
73
84
|
|
|
74
85
|
- **Released achievements are fixed.** Once a release carries an achievement, its `points`,
|
|
75
86
|
`rewards`, `visibility` and _where it sits_ — which progression, which level, and that threshold —
|
|
76
|
-
cannot change. Its copy can. Removing it retires it: players who hold it keep it, and
|
|
77
|
-
|
|
87
|
+
cannot change. Its copy can. Removing it retires it: players who hold it keep it, and it still
|
|
88
|
+
counts against every budget.
|
|
78
89
|
- **The text is screened.** Copy that impersonates the platform or its staff is refused, and the
|
|
79
90
|
refusal names the rule it broke.
|
|
91
|
+
- **`icon_url` is refused.** The platform does not host list art for achievements, so leave the
|
|
92
|
+
field out. An achievement awards an icon through `rewards`, below.
|
|
93
|
+
|
|
94
|
+
### Awarding items (rewards)
|
|
95
|
+
|
|
96
|
+
An achievement can award items when it unlocks, listed in its `rewards` by slug. These are platform
|
|
97
|
+
items the player wears across the arcade, not your game's currency or inventory — those belong in
|
|
98
|
+
the threshold's own payout — a level's `rewards` or the progression's `rewards_on_complete` — which
|
|
99
|
+
is a different list (§3). Each `rewards[].item` names exactly one of:
|
|
100
|
+
|
|
101
|
+
- **One of your game's own items, whose art is `ready`.** Usually an avatar icon: the player earns
|
|
102
|
+
it in your game and can wear it anywhere on the arcade, as their portrait or as one of their
|
|
103
|
+
badges. You upload it with `gemctl item upload`; it is never written in the config file. A game
|
|
104
|
+
item can also be a text-only title — gemctl does not create one, but one your game already has
|
|
105
|
+
(see `gemctl item list`) is named the same way.
|
|
106
|
+
- **A platform name-style preset open to games** — a name colour (`preset-color-…`) or a name
|
|
107
|
+
animation (`preset-anim-…`). The platform owns these, so there is nothing to upload.
|
|
108
|
+
|
|
109
|
+
The workflow for art of your own is **upload it → wait until it is `ready` → name its slug in
|
|
110
|
+
`rewards` → upload and promote the config**:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
gemctl achievement limits # the item and icon limits, and what this game has used
|
|
114
|
+
gemctl item upload icon.png --slug first-clear --name "First Clear" # waits until ready
|
|
115
|
+
gemctl config upload --wait # the config that names first-clear in rewards
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
```yaml
|
|
119
|
+
- achievement:
|
|
120
|
+
id: 91ac…
|
|
121
|
+
points: 20
|
|
122
|
+
display_name: Getting the Hang of It
|
|
123
|
+
description: Clear 10 boards.
|
|
124
|
+
rewards:
|
|
125
|
+
- item: first-clear # your game's own icon, uploaded above
|
|
126
|
+
- item: preset-color-ember # a platform name colour
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
- **What the upload refuses in `rewards`:** a slug that names no item your game may award — another
|
|
130
|
+
game's item and every platform item not open to games answer the same way, as unknown — one of
|
|
131
|
+
your own items still `processing`, `failed` or taken down, and the same slug twice. How many items
|
|
132
|
+
one achievement may award is in `gemctl config schema`.
|
|
133
|
+
- **`preset-` is reserved.** Your own items can never take a slug starting with it — the platform
|
|
134
|
+
and `gemctl item upload` refuse one — so a slug can never name both your item and a preset.
|
|
135
|
+
- **Rewards are fixed at release.** The slugs are resolved to items when the achievement first
|
|
136
|
+
reaches `release`, and its `rewards` cannot change afterwards. A later rename, takedown or new
|
|
137
|
+
preset never changes what it awards.
|
|
138
|
+
- **Icons count against the icon budgets** — how many achievements may award an icon, and how many
|
|
139
|
+
distinct icons your game may award — and every item you upload counts against your game's item
|
|
140
|
+
limit, a `failed` one until you delete it. Titles and name styles cost nothing against the icon
|
|
141
|
+
budgets. `gemctl achievement limits` reports each limit and what your game has used.
|
|
142
|
+
- **A hidden achievement withholds its rewards**, like its name and description, until the player
|
|
143
|
+
unlocks it.
|
|
144
|
+
|
|
145
|
+
The image rules, who may upload and what to do about a `failed` item are in the gemctl `game-config`
|
|
146
|
+
skill.
|
|
80
147
|
|
|
81
148
|
## 2. Who unlocks it
|
|
82
149
|
|