glitchless-dsh 0.1.3 → 0.1.4

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/README.md CHANGED
@@ -15,7 +15,7 @@ This plugin adds Glitchless to [DeepSeek Harness](https://github.com/deepseek-ai
15
15
 
16
16
  | Skill | What it does |
17
17
  | --- | --- |
18
- | `glitchless-setup` | Adds Glitchless to a game in Unity, Godot, Unreal, Three.js, Phaser, Babylon.js, PlayCanvas or GameMaker: the SDK, levels, events, bots, privacy settings |
18
+ | `glitchless-setup` | Adds Glitchless to a game in Unity, Godot, Unreal, Three.js, Roblox, Phaser, Babylon.js, PlayCanvas or GameMaker: the SDK, levels, events, bots, privacy settings |
19
19
  | `glitchless-dashboard` | Works out what you want to know about your game, adds what's needed to measure it, and designs its dashboard |
20
20
  | `glitchless-triage` | Finds the problem that hits the most players, fixes it, and checks the fix with the next version |
21
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitchless-dsh",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Let your agent understand your players. Glitchless for DeepSeek Harness: game observability tools over MCP (ranked findings, frame times, errors, where players quit, each game's own dashboard) and skills that add Glitchless to a game in Unity, Godot, Unreal, Three.js and more, design its dashboard and fix what players hit.",
5
5
  "icon": "./icon.svg",
6
6
  "type": "module",
@@ -27,9 +27,11 @@ stage is too hard?", "Does it stutter on phones?". Leave out what nobody would a
27
27
  | how often something happens, or which option players choose | `track(name, attrs)` | `stat`, `series`, `breakdown` |
28
28
  | how much: revenue, coins, seconds | a number in `track`'s attributes (`purchase` with `amount` and `currency`) | `stat` or `breakdown` with `sum` |
29
29
  | how many players do it at all (conversion) | `track(name)` | `stat` with `per: "$players"` |
30
+ | how long until players first do something (leave the lobby, open the shop, first purchase), and how many never do | `track(name)` when it happens: nothing timed by hand | `stat` with `first: "hall_left"` (the median seconds from a session's start to its first one), `stat` with `never: "hall_left"` (the share of ended sessions that never sent it) |
30
31
  | a sequence (tutorial → first win, paywall → purchase) | one `track` per step | `funnel` |
31
32
  | progress or difficulty through stages, puzzles, waves, stops | `levelStart` / `levelComplete` / `levelFail` | `levels` |
32
- | dying, and where | `death` (and `setPosition` for places) | `deaths`, `positions` (one level), the Heatmaps view |
33
+ | dying, and where | `death` (and `setPosition` for places) | `deaths`, `positions` (one level, one zone, or the whole game), the Heatmaps view |
34
+ | where players go in a hub, a lobby or an open world with no levels | `setPosition`, and `setZone` for its areas (never a pretend level: it would show up in the levels funnel) | `positions` with `zone`, or with neither level nor zone, over a background picture (below) |
33
35
  | smoothness, and what makes it worse | automatic frame times, plus `setContext` gauges (enemies, particles) | `frame_time`, `stat: frame_p95` |
34
36
  | crashes and errors | automatic, plus `error()` for handled ones | `errors`, `stat: crash_free_pct` |
35
37
  | whether players come back (D1, D7, D30) | install mode: privacy `install` in the SDK, a stored random player ID (ask the user first: the privacy page must say so) | `retention`, the Players view |
@@ -44,7 +46,7 @@ stage is too hard?", "Does it stutter on phones?". Leave out what nobody would a
44
46
  | clears and wipes by difficulty, tier, group size or build | `levelStart(id, { tier, party_size, build: [...] })` | `levels` with `by: "tier"` (one level's rows: `level`), `deaths` with `by` |
45
47
  | runs that cross several levels (a roguelite) | `setGroup('run')` at the run's start | `levels` with `count: "runs"` (runs that reach each biome), `stat: runs` |
46
48
  | one match from every side, and whether the lobby or one player lagged | `setGroup('match', id)` with the ID the game's server made (`'party'` for a party; its size goes on `levelStart` as `party_size`) | the Matches view (each match's page), the lobby finding; clears by group size: `levels` by `party_size` |
47
- | where the player is in an open world (an MMO zone, a room) | `setZone(name)` | `by: "$zone"` on breakdowns and series (kept like levels: any range) |
49
+ | where the player is in an open world or a hub (an MMO zone, a room, a lobby hall), and how long they stay | `setZone(name)`; nothing else: time in a zone is the frames drawn there, so never send zone timing as events | `breakdown` with `by: "$zone"` and no `event` (each zone's share of play time, the sessions that went there, their median time in it), `stat` `zone_time_pct` or `zone_median_s` with `zone`, `frame_time` with `by: "$zone"` (frame time and hitches per zone), `by: "$zone"` on any breakdown or series (kept like levels: any range) |
48
50
  | lag, packet loss and dropped players | read from the netcode by the SDK, or `netSample` / `disconnect` (the `instrument` skill) | `net` (ping, loss, disconnects), `stat: ping_p95`, `disconnect_pct`, the Network section of Performance |
49
51
  | dedicated servers: tick rate under load, crashes that end matches, leaks | the SDK in server mode on the server build (the `instrument` skill) | `servers` panels, `stat: servers_now` / `server_tick_p95` / `server_crash_free_pct`, the Servers view |
50
52
 
@@ -78,17 +80,21 @@ Rules that keep the numbers useful:
78
80
  - Never send anything that identifies a player: no names, emails, account ids or anything they typed.
79
81
  - Purchases: one `purchase` event when the store confirms it (not when the button is tapped), with `amount` (a
80
82
  number, in the currency's units: 4.99, not 499), `currency` (the ISO code the store charged in) and `item`. A
81
- number sent next to `currency` counts as money, so put other numbers (gems granted) on an event of their own.
82
- Never send receipts, order ids or payment details. Taps and failures are other events (`buy` with `step`).
83
+ Roblox game sells for Robux: `currency: "ROBUX"` and the price in Robux (`amount: 99`); Robux are kept apart and
84
+ never added to dollars. A game that also reports purchases that didn't go through sends them as the same event
85
+ with a `result` (`"done"`, `"cancelled"`) and the amount on each, and its revenue panels read
86
+ `"purchase:result=done"`. A number sent next to `currency` counts as money, so put other numbers (gems granted)
87
+ on an event of their own. Never send receipts, order ids or payment details. Taps are other events (`buy` with
88
+ `step`).
83
89
 
84
90
  Add the calls where the moment happens in code, then run the game (or let the bots play it) and check with
85
91
  `glitchless_events` that every event arrives with the attributes you expect.
86
92
 
87
93
  ## 3. Design the dashboard
88
94
 
89
- A dashboard is the game's pages, in the order its sidebar shows them; the first opens first. Each page is a
95
+ A dashboard is the game's pages, at most 20, in the order its sidebar shows them; the first opens first. Each page is a
90
96
  board, panels you choose, or a built-in view the game keeps: `events` (every event, breakdowns, funnels),
91
- `performance` (frame time and hitches), `errors`, `players`, `heatmaps` (positions on the level), `sessions`
97
+ `performance` (frame time and hitches), `errors`, `players`, `heatmaps` (positions on a level, in a zone or anywhere), `sessions`
92
98
  (each with its replay), `versions`, `live` (events as they arrive; `options.events` keeps only some), `reports`
93
99
  (bug reports players sent, with screenshots), `matches` (a multiplayer game's matches, each opening a page with every
94
100
  player's ping slot by slot and the server's ticks under it) and `servers` (a game whose dedicated servers run the SDK
@@ -104,14 +110,16 @@ one line on why it matters. People see the note behind the info icon next to the
104
110
  in the title. Panels keep their order and pack under each other, so a short panel can sit next to a tall one.
105
111
  Give the game its own colour with `accent` ("#rrggbb", such as the main colour of its logo or key art) in
106
112
  `glitchless_set_dashboard`, alone or with the pages: it colours the links, the selected page, stats, the main chart
107
- series and the map on its boards and share links. The logo and a banner (key art) are uploaded by people in the
108
- dashboard (Edit pages → Look); `glitchless_dashboard` says whether the game has them.
113
+ series and the map on its boards and share links. `logo` and `banner` (its key art, the header behind each board's
114
+ title, cropped to a strip around its `focus`) take the game's own pictures, a file or base64, also alone; use what the
115
+ game already has (its icon, its store or itch.io art) and ask before making one. `glitchless_dashboard` says whether
116
+ the game has them.
109
117
 
110
118
  | type | fields |
111
119
  | --- | --- |
112
- | `stat` | `metric` (sessions, players, avg_session_s, median_session_s, crash_free_pct, error_free_pct, frame_p95, avg_fps, hitches_per_min, errors, deaths, rage_quit_pct, hours_played, players_now: playing now, whatever the range; runs; for a multiplayer game ping_p50, ping_p95, loss_pct, disconnects_per_hour, disconnect_pct; with servers in server mode servers_now, server_tick_p95, server_crash_free_pct, players_per_server), or `event` with an optional `per`: another event (a percentage), `$players` / `$sessions` (the share of them that sent it: conversion) or `$hours` (per hour played: matches per hour; `deaths` and `errors` take it too). With `sum` (a numeric attribute), it adds that up instead, and `per: "$players"` gives it per player, `"$hours"` per hour played (gold per hour). `rate`: the share of the events where a flag holds (`"won"`) or a word is sent (`"result=win"`), with `expect` for a rate the game intends; `avg`: a numeric attribute's average; `of` with `quantile` (1 to 99) and `unit`: one percentile (the median match) |
120
+ | `stat` | `metric` (sessions, players, avg_session_s, median_session_s, crash_free_pct, error_free_pct, frame_p95, avg_fps, hitches_per_min, errors, deaths, rage_quit_pct, hours_played, players_now: playing now, whatever the range; runs; for a multiplayer game ping_p50, ping_p95, loss_pct, disconnects_per_hour, disconnect_pct; with servers in server mode servers_now, server_tick_p95, server_crash_free_pct, players_per_server; with `zone` (a zone's name from `setZone`) zone_time_pct, its share of play time, and zone_median_s, the median time in it of the sessions that went there), or `event` with an optional `per`: another event (a percentage), `$players` / `$sessions` (the share of them that sent it: conversion) or `$hours` (per hour played: matches per hour; `deaths` and `errors` take it too). With `sum` (a numeric attribute), it adds that up instead, and `per: "$players"` gives it per player, `"$hours"` per hour played (gold per hour). `rate`: the share of the events where a flag holds (`"won"`) or a word is sent (`"result=win"`), with `expect` for a rate the game intends; `avg`: a numeric attribute's average; `of` with `quantile` (1 to 99) and `unit`: one percentile (the median match). Instead of `event`, `first` (an event: the median seconds from a session's start to its first one, or `quantile`) or `never` (an event: the share of ended sessions that never sent it), 31 days or less. A money stat in Robux takes `devex: true`: an estimate in dollars at Roblox's DevEx rate under it, always labelled one |
113
121
  | `series` | `event`, optional `by` (split by an attribute, or `$version` / `$level` / `$zone`, or the sessions' `$platform` / `$browser` / `$device_tier` / `$link` or a property, `$rank`), `limit`, `sum`, `rate` or `avg`, `per: "$hours"` |
114
- | `breakdown` | `event`, `by`, `limit`, `sum` (each value's sum, largest first). `by` can split the sessions themselves: `$platform` (Windows, macOS, Linux, Steam Deck, iOS, Android, Web…), `$browser` (Chrome, Safari, Firefox, Edge…; a native build shows as "Godot app", a web build of an engine as "Unity web build") or `$device_tier` (High-end, Mid-range, Low-end GPU, Software rendering, high to low), `$link` (Wi-Fi, Mobile data, Wired), or a property the game sets (`$rank`, `$class`; sessions without it are "(none)"). Without `event` it counts the sessions in each, and their players when the game sends player IDs. Ranges of 31 days or less. With `rate` (`"won"`, `"result=win"`) or `avg`, each row's rate with its likely range (or its average) next to the overall one: `min` leaves out rows of fewer events (default 30 for a rate), `expect` draws the rate the game intends (a gacha's published odds, as a percentage: 0.6), `order` is `rate` (default), `count` or `value` (heat 0, 1, 2). `per: "$hours"` makes each row per hour played. By a list attribute (a deck), each element is a row |
122
+ | `breakdown` | `event`, `by`, `limit`, `sum` (each value's sum, largest first). `by` can split the sessions themselves: `$platform` (Windows, macOS, Linux, Steam Deck, iOS, Android, Web…), `$browser` (Chrome, Safari, Firefox, Edge…; a native build shows as "Godot app", a web build of an engine as "Unity web build") or `$device_tier` (High-end, Mid-range, Low-end GPU, Software rendering, high to low), `$link` (Wi-Fi, Mobile data, Wired), or a property the game sets (`$rank`, `$class`; sessions without it are "(none)"). Without `event` it counts the sessions in each, and their players when the game sends player IDs. Ranges of 31 days or less. With `rate` (`"won"`, `"result=win"`) or `avg`, each row's rate with its likely range (or its average) next to the overall one: `min` leaves out rows of fewer events (default 30 for a rate), `expect` draws the rate the game intends (a gacha's published odds, as a percentage: 0.6), `order` is `rate` (default), `count` or `value` (heat 0, 1, 2). Any breakdown takes `order: "value"` (the values' own order: streak day 1, 2 … 10) or `"count"`. `per: "$hours"` makes each row per hour played. By a list attribute (a deck), each element is a row. With `sum` in Robux, `devex: true` gives each row and the total an estimate in dollars. `by: "$zone"` without `event`: the time played in each zone, most first (share of play time, sessions that went there, their median time; time outside every zone is "(none)"), any range |
115
123
  | `distribution` | `event`, `of` (a numeric attribute), optional `by` (an attribute, `$version`, `$level`, a session split), `limit` (rows, up to 8), `bins` (bars, up to 40), `unit` (`"s"` shows minutes and hours; or the game's word, `"floors"`). How it spreads: half under, 1 in 10 over, and a histogram |
116
124
  | `funnel` | `steps`: events in order, comma-separated |
117
125
  | `levels` | `label`: what the game calls a level ("Stop", "Puzzle", "Wave"); shows each one's median clear time and the slowest 1 in 10, and the attempts a disconnect ended. `by` splits each level's attempts: an attribute of its `levelStart` (`"tier"`, `"party_size"`, a list such as `"build"`), a property (`"$class"`) or a split; `level` keeps one level; `count: "runs"` counts each run once at each level it reached |
@@ -120,17 +128,19 @@ dashboard (Edit pages → Look); `glitchless_dashboard` says whether the game ha
120
128
  | `sessions` | `sent`: only sessions that sent this event ("buy=done"), `limit` |
121
129
  | `versions` | none: this board's stats, version by version; `by` a property (`$class`) compares its values instead |
122
130
  | `live` | `events`: only these names or types, as they arrive |
123
- | `findings`, `frame_time`, `errors`, `deaths`, `events`, `reports` | none (`limit` for findings, errors and reports; `by` and `level` for deaths, as on `levels`) |
124
- | `retention` | `limit`: how many of the latest first-seen days (default 14); `by` a property (`$spender`): each value's D1, D7 and D30. Needs player IDs: a game in anonymous mode gets a panel saying to turn install mode on |
125
- | `store_revenue` | `measure` (required): `revenue`, `per_player`, `by_day`, `by_version` or `by_country` (a world map of installs or revenue by country with the countries ranked: installs, revenue, purchases; `show: "revenue"` opens it on revenue; size `l`); RevenueCat's `installs`, `active_users`, `mrr`, `actives`, `trials`, `players_by_day` and `by_store` (revenue in the App Store and Google Play next to the iOS and Android sessions measured); Stripe's `refunds`, `customers` (new paying customers) and `by_product`. `store`: `revenuecat` or `stripe` (default: the first connected). Real revenue from RevenueCat or the game's own Stripe account, for a game connected to it in Glitchless Cloud |
126
- | `store_score` | `store` (`app_store`, `google_play` or `steam`): a store's rating, one small panel per store. The average stars of the written reviews synced in the window and how many, next to Apple's own rating on the App Store. Google Play has no API for its overall rating, so its panel is the reviews' average and says so |
127
- | `positions` | `level` (required), `show`: `deaths` (default), `path` or `both`, `bin`: a bin's width in world units (default about a hundredth of the level). Where players died on that level, counted per bin, and where they went on a coarser grid: one panel per level |
131
+ | `frame_time` | none: p50 and p95 over time against players' screens; `by: "$zone"` or `"$level"`: a row per zone or level with its p50, p95, frames over budget, hitches per minute and share of play time, most played first (`limit`, up to 20) |
132
+ | `findings`, `errors`, `deaths`, `events`, `reports` | none (`limit` for findings, errors and reports; `by` and `level` for deaths, as on `levels`) |
133
+ | `retention` | `limit`: how many of the latest first-seen days (default 14); `by` a property (`$spender`): each value's D1, D7 and D30. Needs player IDs: a game in anonymous mode gets a panel saying to turn install mode on, except a Roblox game connected to Roblox, whose panel shows Roblox's own retention |
134
+ | `store_revenue` | `measure` (required): `revenue`, `per_player`, `by_day`, `by_version` or `by_country` (a world map of installs or revenue by country with the countries ranked: installs, revenue, purchases; `show: "revenue"` opens it on revenue; size `l`); RevenueCat's `installs`, `active_users`, `mrr`, `actives`, `trials`, `players_by_day` and `by_store` (revenue in the App Store and Google Play next to the iOS and Android sessions measured); Stripe's `refunds`, `customers` (new paying customers) and `by_product`; Roblox's (in Robux) `installs` (new users), `active_users` (daily active users), `players_by_day` and `retention` (D1, D7, D30 by cohort day, size `m`), no `by_version`. `store`: `revenuecat`, `stripe` or `roblox` (default: the first connected). Real revenue from RevenueCat or the game's own Stripe account, or Roblox's Robux, for a game connected to it in Glitchless Cloud |
135
+ | `store_score` | `store` (`app_store`, `google_play`, `steam` or `roblox`): a store's rating, one small panel per store. The average stars of the written reviews synced in the window and how many, next to Apple's own rating on the App Store. Google Play has no API for its overall rating, so its panel is the reviews' average and says so. Roblox has no reviews: its thumbs up and down, favorites and visits |
136
+ | `positions` | `level`, or `zone` (what the game passes to `setZone`), or neither: every position and death in the game, for a hub with no levels; `show`: `deaths` (default), `path` or `both`, `bin`: a bin's width in world units (default about a hundredth of the place). Where players died there, counted per bin, and where they went on a coarser grid, over the place's background: one panel per place |
128
137
  | `table` | `event` (required), `columns` (up to 12: attributes, `$time`, `$version`, `$platform`, `$level`, `$session`; `{ "key": "duration_s", "unit": "s" }` for a unit; default the event's own attributes, up to 8), `group_by` (an attribute, `$version`, `$level` or `$platform`), `sort` (`"-score"`: highest first; default newest first), `of` (a number whose lowest, average and highest each group shows), `limit` (rows a group, up to 100; default 20). The event's events one by one, size `l` |
129
138
 
130
139
  An event is written `name`, `name=value` (any attribute has that value) or `name:key=value`. A list matches when it
131
140
  has the value (`battle_end:deck=hog_rider`), and `battle_end:deck=hog_rider+ice_spirit` when it has all of them:
132
- ask about any pair or trio this way. With `sum` and `by` an attribute, the event is a name only (`purchase`, not
133
- `purchase=done`).
141
+ ask about any pair or trio this way. A filtered event can be added up by an attribute too: completed purchases by
142
+ item is `event: "purchase:result=done"`, `by: "item"`, `sum: "amount"`. A dashboard's `currency` is an ISO code or
143
+ `"ROBUX"`.
134
144
 
135
145
  For a game with heroes, decks or builds to balance, money, player properties, online play, or several platforms
136
146
  and devices, read [references/genres.md](references/genres.md): the panels each of those asks for.
@@ -142,10 +152,21 @@ Whole dashboards to start from, a mobile game, a competitive game, a battle roya
142
152
  are in [references/examples.md](references/examples.md). Take the shape, not the words: every page and panel uses
143
153
  this game's own names.
144
154
 
155
+ **A background for a heatmap.** A positions panel and the Heatmaps view draw a place over its picture: one an SDK
156
+ captured (`captureMap`), or one you upload with `glitchless_set_dashboard`'s `background` (it can be sent alone),
157
+ which needs no game code. Give it
158
+ a top-down picture of the level, zone or whole hub (a screenshot from the editor's top view, or the level's own map
159
+ art) as a PNG or JPEG of at most 256 KB, and the world coordinates its edges stand for: with `axis` `xz` (seen from
160
+ above) the left edge is `bounds.min[0]` (x), the right `bounds.max[0]`, the top `bounds.min[1]` (z) and the bottom
161
+ `bounds.max[1]`. Read those from the level's own data (the floor's corners), never guess them; the tool says when
162
+ the picture's shape doesn't match the bounds. One picture of the whole hub (no level, no zone) serves its zones too:
163
+ a zone without a picture of its own is drawn over it, and one of its own gives a closer look. Through the hosted
164
+ server, which can't read your files, it gives the `curl` to run instead (`PUT /v1/maps` with a secret key).
165
+
145
166
  **A game that reads its own board.** A `positions` panel is only counts per bin (`deaths: [[a, b, n], …]` on the
146
167
  level's plane, `axis` xy or xz, `bounds`, `bin`, `total`, `truncated`), so it can go on a board shared with a link,
147
168
  and the game itself can poll that link to draw everyone's deaths without a backend of its own: one board, one
148
- positions panel per level, a share link, and the game fetches `https://api.glitchless.gg/v1/query/board?share=gl_share_…&days=30`
169
+ positions panel per level (or zone), a share link, and the game fetches `https://api.glitchless.gg/v1/query/board?share=gl_share_…&days=30`
149
170
  about once a minute, always the same URL (no `from` or `to`, no header). The answer is cached for a minute, so
150
171
  every player can poll it. Fix `bin` in the panel so the dead stay where they fell as more arrive.
151
172
 
@@ -96,3 +96,8 @@ and Errors. No Performance unless it's slow, no Heatmaps, no deaths.
96
96
  A platformer or shooter: an Overview with `stat` frame_p95 and crash_free_pct, `findings`, `frame_time`, `levels`,
97
97
  `deaths` and a `breakdown` of `weapon` or `powerup`; then Performance, Heatmaps, Errors, Sessions and Versions. A
98
98
  level whose deaths tell its story gets a `positions` panel (`"show": "both"` to see where players went too).
99
+
100
+ An avatar hub with puzzle levels (a Roblox experience): the lobby is no level, so the `levels` panel shows only the
101
+ puzzles. A Lobby board has a `positions` panel with no level or zone (`"show": "path"`, over a background uploaded
102
+ with `glitchless_set_dashboard`'s `background`), a `breakdown` of what players do there by `$zone`, and the hub's purchases;
103
+ the Heatmaps view picks a puzzle, a zone or Everywhere.
@@ -25,7 +25,20 @@ and active users next to the players Glitchless measures, so keep it, and read i
25
25
  own `purchase` sums are for revenue by item, level or player. A game that sells through its own Stripe account gets a
26
26
  Stripe one (refunds, fees, new paying customers, revenue by product). For its revenue by version, the game's server puts
27
27
  the player's Glitchless session ID (`Glitchless.instance.sessionId` in a web game) in the Checkout Session's
28
- `client_reference_id`, or `glitchless_session` metadata on it or the PaymentIntent.
28
+ `client_reference_id`, or `glitchless_session` metadata on it or the PaymentIntent. A Roblox game connected to Roblox
29
+ gets a Roblox page (thumbs up, daily active and new users, Roblox's retention, players now, Roblox's crash rate and
30
+ frame rate by place version) and a Revenue page in Robux: keep both, since its SDK is anonymous and Roblox's retention
31
+ is the only one it has.
32
+
33
+ **A Roblox game's own money and lobby.** Its purchase events carry `currency: "ROBUX"` and the price in Robux, and its
34
+ dashboard takes `currency: "ROBUX"`: the board shows Robux with ⬡ and never adds them to dollars. `devex: true` on a
35
+ Robux stat, breakdown or series adds what they'd be worth through Roblox's Developer Exchange, always as an estimate
36
+ (the price players paid at DevEx's standard rate; the experience earns less). Revenue of completed purchases by item,
37
+ when cancelled ones carry their amount too: a breakdown with `event: "purchase:result=done"`, `by: "item"`, `sum:
38
+ "amount"`. A hub with a lobby asks how long players stay in it and how many never leave: the game sends one event when
39
+ a player first leaves (`hall_left`, from the server for that player), and the board has a stat with `first:
40
+ "hall_left"` (the median seconds from joining) and one with `never: "hall_left"` (the share of ended sessions that
41
+ never left). A streak or a step number reads best in its own order: a breakdown by `day` with `order: "value"`.
29
42
 
30
43
  **Who is playing.** A game that sets properties splits anything by them (`by: "$rank"`): win rate by hero at each
31
44
  rank is a page with `"where": { "$rank": ["diamond", "master"] }` and the same breakdown on it; retention by
@@ -38,7 +51,13 @@ ranges of 31 days or less.
38
51
  whole lobby lagging at once (the server) and one player lagging (their connection) are findings of their own. With
39
52
  match groups, keep the `matches` view. With dedicated servers in server mode, a Servers page (`servers_now`,
40
53
  `server_tick_p95`, `server_crash_free_pct`, a `servers` panel `by: "players"`) or the built-in `servers` view; the
41
- servers' sessions are kept under `<game>.server`, never counted as players. An open world splits by `$zone`.
54
+ servers' sessions are kept under `<game>.server`, never counted as players.
55
+
56
+ **Open worlds and hubs.** A game with zones (an MMO's regions, a metroidvania's rooms, an avatar hub's hall and the
57
+ zones around it) gets a Zones page: a `breakdown` by `$zone` without `event` (where play time goes, and how long the
58
+ sessions that go to each zone stay), `stat` `zone_median_s` with `zone` for the zone that matters most (the hall),
59
+ `frame_time` by `$zone` (which zone hitches), and its own events by `$zone` (purchases by zone). Levels inside zones
60
+ (a puzzle in the garden) keep their `levels` panel; `frame_time` by `$level` reads them apart.
42
61
 
43
62
  **Platforms, browsers, devices.** A web game: `breakdown` by `$browser`. A game on PC, Mac and Steam Deck: by
44
63
  `$platform`. Any game whose frame times vary: by `$device_tier`, next to frame time. For a game on iOS and Android, put the split on its main page: `breakdown` by `$platform` (players or
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: instrument
3
- description: Add Glitchless observability to a game (Three.js or React Three Fiber, Phaser 3 or 4, Babylon.js, PlayCanvas, Unity 6.3+, Godot 4.5+, Unreal Engine 5.8 or GameMaker 2024.2+). Frame-time percentiles, hitch attribution, errors, gameplay events, level heatmaps, and tools that let coding agents measure the running game. Use when the user wants telemetry, analytics, performance monitoring or "observability" in a game, or asks to add Glitchless.
3
+ description: Add Glitchless observability to a game (Unity 6.3+, Godot 4.5+, Unreal Engine 5.8, Three.js or React Three Fiber, Roblox, Phaser 3 or 4, Babylon.js, PlayCanvas or GameMaker 2024.2+). Frame-time percentiles, hitch attribution, errors, gameplay events, level heatmaps, and tools that let coding agents measure the running game. Use when the user wants telemetry, analytics, performance monitoring or "observability" in a game, or asks to add Glitchless.
4
4
  ---
5
5
 
6
6
  # Instrument a game with Glitchless
@@ -13,13 +13,14 @@ have a way to measure the running game before and after a change.
13
13
 
14
14
  | You find | Engine | Follow |
15
15
  | --- | --- | --- |
16
+ | `ProjectSettings/ProjectVersion.txt` and `Packages/manifest.json` | Unity 6.3+ | [references/unity.md](references/unity.md) |
17
+ | `project.godot` | Godot 4.5+ | the Godot addon's README: `godot/addons/glitchless/README.md` in the Glitchless repo (`~/.glitchless/godot/addons/glitchless/README.md` if it's cloned there), then [references/godot.md](references/godot.md) for bug reports, streams, properties and multiplayer |
18
+ | a `*.uproject` file | Unreal Engine 5.8 (5.7 untested) | [references/unreal.md](references/unreal.md) |
16
19
  | `three` or `@react-three/fiber` in package.json | Three.js | [references/threejs.md](references/threejs.md) |
20
+ | a Rojo `default.project.json` (or `*.project.json`), `wally.toml`, `*.rbxl` / `*.rbxlx`, or `.luau` scripts that call `game:GetService` | Roblox | [references/roblox.md](references/roblox.md) |
17
21
  | `phaser` in package.json, or a `<script>` that loads Phaser | Phaser 3.60+ or 4 | [references/phaser.md](references/phaser.md) |
18
22
  | `@babylonjs/core` or `babylonjs` in package.json, or a `<script>` that loads Babylon.js | Babylon.js 5+ | [references/babylon.md](references/babylon.md) |
19
23
  | `playcanvas` in package.json, a PlayCanvas Editor project (scripts using `pc.createScript` or `pc.Script`), or a `<script>` that loads PlayCanvas | PlayCanvas 2.x | [references/playcanvas.md](references/playcanvas.md) |
20
- | `ProjectSettings/ProjectVersion.txt` and `Packages/manifest.json` | Unity 6.3+ | [references/unity.md](references/unity.md) |
21
- | `project.godot` | Godot 4.5+ | the Godot addon's README: `godot/addons/glitchless/README.md` in the Glitchless repo (`~/.glitchless/godot/addons/glitchless/README.md` if it's cloned there), then [references/godot.md](references/godot.md) for bug reports, streams, properties and multiplayer |
22
- | a `*.uproject` file | Unreal Engine 5.8 (5.7 untested) | [references/unreal.md](references/unreal.md) |
23
24
  | a `*.yyp` file | GameMaker 2024.2+ | [references/gamemaker.md](references/gamemaker.md) |
24
25
 
25
26
  Read only the file for this game's engine: each one walks through reading the game, installing,
@@ -40,12 +41,17 @@ Settings, for every engine:
40
41
  PRIVACY.md lists every field and has the wording). If they want to know whether players come back (retention:
41
42
  D1, D7, D30), offer install mode: it adds only a random player ID kept on the device (`privacy: 'install'`;
42
43
  Godot `"privacy": "install"`; Unity `Privacy = Privacy.Install`; Unreal `Privacy=Install`). Anonymous mode
43
- can't count returning players. Full mode adds a stored player ID, device detail and positions.
44
+ can't count returning players. Full mode adds a stored player ID, device detail and positions. The Roblox SDK is
45
+ anonymous only: on Roblox a stored ID would be kept against the player's account, which Roblox's rules protect. For
46
+ a Roblox game's retention, connect Roblox on Glitchless Cloud instead (Settings → Integrations → Roblox, with an Open
47
+ Cloud API key that has only `universe.analytics:read` for the experience): Roblox's own D1, D7 and D30, daily active
48
+ and new users, Robux and its crash rate by place version then sit next to what the SDK measures.
44
49
  - **A "share performance data" setting.** If the game has a settings or options menu, offer to add a toggle wired to
45
50
  Glitchless's off switch, so players can turn it off and back on at any time (store rules such as the Unity Asset
46
51
  Store's ask for it, and it lets the store forms answer "optional"): `glitchless.setEnabled(on)`; Godot
47
52
  `Glitchless.set_enabled(on)`; Unity `Glitchless.SetEnabled(on)`; Unreal `FGlitchless::SetEnabled(bOn)` or the
48
- Blueprint node Set Enabled; GameMaker `glitchless_set_enabled(on)`. Off stops measuring and sending at once and drops
53
+ Blueprint node Set Enabled; GameMaker `glitchless_set_enabled(on)`; Roblox `Glitchless.setEnabled(on)` from the
54
+ LocalScript that runs the menu (or `Glitchless.setEnabled(player, on)` on the server). Off stops measuring and sending at once and drops
49
55
  what was waiting; on starts a new session. Glitchless saves the choice on the device itself, so it holds from the
50
56
  first frame of the next launch: show the toggle from the game's own saved setting and call the switch when it
51
57
  changes (calling it with the saved value at start changes nothing when they agree). If the user wants players to
@@ -59,7 +65,10 @@ Settings, for every engine:
59
65
  Android the Godot SDK marks debug builds and sideloaded ones (adb, an APK file) `tester` the same way; a game sold
60
66
  as an APK outside the stores (itch.io) passes `session_type: "user"`. Google Play's testing tracks can't be told
61
67
  apart on the device: if the developer ships test builds there, give the testing-track build its own env (`beta`)
62
- from a build flag.
68
+ from a build flag. The developer's own play (checking the setup, a playtest) counts as a player's: on Glitchless
69
+ Cloud, once it arrives, offer to mark their player as the team's with `glitchless_mark_known`'s `player` (`glitchless_session`
70
+ without a session id lists the latest sessions with their `player_id`). It then reads as `tester` everywhere, past
71
+ sessions too.
63
72
  - **Version.** Find where the game's version lives and pass it; bump it on every release so Glitchless can compare versions.
64
73
 
65
74
  ## Every engine: the game's own metrics, and its board
@@ -75,6 +84,8 @@ purchases, a platformer about where players die. Glitchless doesn't assume a gen
75
84
  - Unreal: `FGlitchless::Track(TEXT("play"), TEXT("endless"));` (the attribute `what`) or a `TMap` of attributes
76
85
  and one of numbers; in Blueprint, Track Event (What) or Track Event
77
86
  - GameMaker: `glitchless_track("play", "endless");` (the attribute `what`) or a struct
87
+ - Roblox: `Glitchless.track(player, "play", { mode = "endless" })` in a server script, or
88
+ `Glitchless.track("play", { mode = "endless" })` in a LocalScript
78
89
 
79
90
  Good candidates: the game opening (with the edition, free or full), a mode or run starting, a run ending and
80
91
  how, shop and paywall views and where they were opened, purchases started and finished, hints, choices that
@@ -117,8 +128,9 @@ purchases, a platformer about where players die. Glitchless doesn't assume a gen
117
128
  - **Groups and zones.** `setGroup('match', id)` with the match ID the game's server made, the same on every
118
129
  player and on the server (the SDKs hash it the same way before sending it, by default); `setGroup('match', null)`
119
130
  ends it. `setGroup('party', id)` for a party (never a guild or friends list), `setGroup('run')` for a roguelite
120
- run (the SDK makes its ID). `setZone(name)` for where the player is in an open world (an MMO zone, a room): not a
121
- level, it never ends in a win or a fail.
131
+ run (the SDK makes its ID). `setZone(name)` for where the player is in an open world or a hub (an MMO zone, a room, a
132
+ lobby hall): not a level, it never ends in a win or a fail. Time in each zone and frame time per zone come from the
133
+ frames drawn there, so don't send zone entries or zone timing as events.
122
134
 
123
135
  Purchases have one convention in every engine, so boards can add them up into revenue: a `purchase` event
124
136
  when the store confirms it, with `amount` (a number in the currency's units: 4.99, not 499), `currency` (the
@@ -133,18 +145,21 @@ purchases, a platformer about where players die. Glitchless doesn't assume a gen
133
145
  - Unity: `Glitchless.Track("purchase", new Dictionary<string, object> { ["amount"] = 4.99, ["currency"] = "USD", ["item"] = "gems_500" });`
134
146
  - Unreal: `FGlitchless::Track(TEXT("purchase"), {{TEXT("currency"), TEXT("USD")}, {TEXT("item"), TEXT("gems_500")}}, {{TEXT("amount"), 4.99}});`
135
147
  (in Blueprint, Track Event with `amount` in Numbers)
148
+ - Roblox: the price in Robux, `Glitchless.track(player, "purchase", { item = "gems_500", amount = 99, currency = "ROBUX" })`
149
+ in `ProcessReceipt` (boards show Robux with ⬡, never added to dollars; give the dashboard `currency: "ROBUX"`)
136
150
  2. A multiplayer game also reports its network, and its dedicated servers (follow the engine reference's
137
151
  multiplayer section):
138
152
  - **Ping, loss and disconnects.** The Unity SDK reads Netcode for GameObjects and Mirror by itself, Godot its
139
153
  MultiplayerAPI with ENet or WebSocket, Unreal its own net driver; a web game passes its ping with
140
154
  `netSample({ rtt_ms })` about once a second (or `instrumentNet` for WebRTC), GameMaker with
141
- `glitchless_net_sample`, and any engine on another library (Steam Networking Sockets, Photon, Nakama, a game's
155
+ `glitchless_net_sample`, the Roblox SDK reads each player's ping by itself, and any engine on another library (Steam Networking Sockets, Photon, Nakama, a game's
142
156
  own) the same way. Call `disconnect({ reason })` when the connection drops and `reconnect()` when it comes back,
143
157
  where the netcode doesn't say: a disconnect ends a level attempt as an abandon, never a fail. Nothing about the
144
158
  other end is sent (no addresses).
145
159
  - **Server mode.** A dedicated or authoritative server runs the SDK as a server: `glitchless/server` on a Node
146
160
  server (with `instrumentWs`, `instrumentSocketIO` or `glitchlessRoom` for Colyseus), the Unity and Godot SDKs in a
147
- dedicated-server build (or `--glitchless-server`), the Unreal plugin on a dedicated server. It sends its tick time
161
+ dedicated-server build (or `--glitchless-server`), the Unreal plugin on a dedicated server; on Roblox the server
162
+ is always measured, since it is the one that sends. It sends its tick time
148
163
  against its tick rate, players connected, CPU, memory and crashes, never anything about players, and Glitchless
149
164
  keeps it apart from players under `<game>.server`. It uses the game's own service and client token, and sets
150
165
  the same match groups as its players. It needs a Glitchless server that lists `server_mode` in `GET /v1/health`
@@ -153,6 +168,23 @@ purchases, a platformer about where players die. Glitchless doesn't assume a gen
153
168
  turns the developer's questions into collectors, panels and pages and saves them with the
154
169
  `glitchless_set_dashboard` MCP tool.
155
170
 
171
+ ## In a jam room
172
+
173
+ When the user is at a Glitchless jam and gives you a room code (5 letters and digits, such as `K7Q2M`), the game also
174
+ goes to the room's arcade, where everyone plays everyone's game on their phones:
175
+
176
+ - Add the `glitchless-jam` MCP server (`npx -y glitchless-jam`, the same `GLITCHLESS_URL`; it uses the same sign-in as
177
+ `glitchless-mcp`). It is the jam's own tool, kept apart from the production one.
178
+ - Build with relative paths, since the room serves the game from a folder of its own: `vite build --base ./` (or
179
+ `base: './'` in `vite.config.js`), and no `fetch('/…')` of the game's own files. Keep `localStorage` keys prefixed
180
+ with the game's name: every game in a room shares one origin.
181
+ - Keep the default anonymous mode; the room counts plays.
182
+ - Publish the build folder with `glitchless_jam` (`action: "publish"`, `dir: "dist"`, `room`), or
183
+ `npx -y glitchless-jam publish dist --room <code>` in a terminal. It joins the room, checks the folder, reads the
184
+ version from `Glitchless.init`, and answers with the game's link and a QR code: show both to the user.
185
+ - Before publishing a fix, bump the version passed to `Glitchless.init`: a room takes each version once, and its
186
+ "biggest improvement" award compares the first version with the last.
187
+
156
188
  ## Report
157
189
 
158
190
  Tell the user what you wired (with file:line), the gauges you chose and why, the events you track and count, the
@@ -28,6 +28,15 @@ there: it is false in a debug build without `--glitchless`. Glitchless saves the
28
28
  collecting anything, pass `"opt_in": true` to `init` and call `set_enabled(true)` when the player says yes. With the
29
29
  toggle, Google Play's Data safety form can say collection is optional (PRIVACY.md, "For the store forms").
30
30
 
31
+ ## Runs from the editor
32
+
33
+ Every run the Godot editor starts is a debug build, and a debug build sends nothing without `--glitchless` (README,
34
+ "Off in debug builds"). So a game with no players yet sends nothing at all, and Glitchless looks empty to its developer.
35
+ If the game has no players yet, or the user asks for their own runs or playtests to show, add `--glitchless` to
36
+ `run/main_run_args` in the `[editor]` section of `project.godot` (after any arguments already there; the editor adds
37
+ them to every run). Tell the user it's there, that it counts their runs as a player's, and to take it out once the game
38
+ has players. Don't pass `"enabled": true` to `init` instead: that turns on every debug build for good.
39
+
31
40
  ## Streams, properties, matches and zones
32
41
 
33
42
  - **Count a stream, track a moment.** Shots, hits, kills, loot and gold go through
@@ -0,0 +1,237 @@
1
+ # Roblox
2
+
3
+ Part of the `instrument` skill. Apply its settings first (section 0 of [SKILL.md](../SKILL.md): the
4
+ intake URL and client token, privacy, bots, testers and the version), and finish with its last two
5
+ sections: the game's own metrics and dashboard, and the report.
6
+
7
+ The Glitchless SDK for Roblox (`roblox/` in the Glitchless repo; `~/.glitchless/roblox` if it's cloned there) is one
8
+ Luau ModuleScript, `Glitchless`, with a server half and a client half. Its README (`roblox/README.md`) has the whole
9
+ API; this is the order to wire it in.
10
+
11
+ How it works, because it shapes everything below: only server scripts can make HTTP requests on Roblox. So the
12
+ server sends everything: it keeps a session for each player (from joining to leaving) and one for itself, and each
13
+ player's client measures frames, stutters, errors and ping and hands them to the server over a RemoteEvent the module
14
+ makes. Calls from server scripts take the player first; calls from LocalScripts take no player.
15
+
16
+ ## 1. Read the project
17
+
18
+ A Roblox game an agent can edit is usually files synced into Studio: a `default.project.json` (Rojo), often a
19
+ `wally.toml` (Wally packages in `ReplicatedStorage.Packages`), `aftman.toml` or `rokit.toml`, and `.luau` or `.lua`
20
+ files named `*.server.luau` (Scripts) and `*.client.luau` (LocalScripts). Note:
21
+
22
+ - where server code starts (ServerScriptService), where client code starts (StarterPlayerScripts, StarterGui,
23
+ ReplicatedFirst), and where shared modules live (ReplicatedStorage);
24
+ - the game's rounds, races, stages or levels, and where each starts and ends (a round manager, checkpoints in an
25
+ obby, a race finish line). On Roblox these are almost always in server scripts;
26
+ - deaths (`Humanoid.Died`, or the game's own health system), respawns, pickups, purchases (`MarketplaceService`
27
+ `ProcessReceipt`, game passes, developer products);
28
+ - anything that creates many instances at once (projectiles, effects, map loading, Clone() in loops);
29
+ - any analytics the game already sends (`AnalyticsService`, `HttpService` calls, other SDKs).
30
+
31
+ If the game only lives in Studio (a `.rbxl` with no project files), you can't edit its scripts as files: work through
32
+ Studio's own MCP server (below), or ask the user to insert the module and paste the scripts.
33
+
34
+ ### Studio's MCP server
35
+
36
+ Roblox Studio has an MCP server built in ([docs](https://create.roblox.com/docs/studio/mcp)): the user turns it on in
37
+ Assistant → … → Manage MCP Servers → **Enable Studio as MCP server**, and it is the stdio command
38
+ `/Applications/RobloxStudio.app/Contents/MacOS/StudioMCP` on a Mac (`cmd.exe /c %LOCALAPPDATA%\Roblox\mcp.bat` on
39
+ Windows), or one switch for Claude Code, Codex, Cursor and others under Quick connect. Every tool takes a `studio_id`
40
+ from `list_roblox_studios` (it can be empty for a second while the server finds Studio: ask again). With it you can:
41
+
42
+ - read and write the open place's scripts (`script_read`, `script_grep`, `multi_edit` in Edit), or set any script's
43
+ `Source` with `execute_luau` (`datamodel_type: "Edit"`), so a Studio-only game can be instrumented;
44
+ - play it: `start_stop_play` (`is_start: true`, then `false`), `get_studio_state` (the mode), and
45
+ `get_console_output`, which during a play test holds that test's Output only (Glitchless's `[glitchless]` warnings
46
+ are there), and keeps it after Stop;
47
+ - look inside a running test: `execute_luau` with `datamodel_type: "Server"` or `"Client"`.
48
+
49
+ It reads and changes the user's open places: say what you will do before you do it.
50
+
51
+ ## 2. Install
52
+
53
+ Put the module in ReplicatedStorage, the way the project manages code:
54
+
55
+ - **Wally** (a `wally.toml`): add `Glitchless = "glitchless-gg/glitchless@0.2.0"` under `[dependencies]`, run
56
+ `wally install`, and require `ReplicatedStorage.Packages.Glitchless`.
57
+ - **Rojo without Wally**: copy `~/.glitchless/roblox/src` into the project (for example `src/shared/Glitchless`) so it
58
+ syncs to `ReplicatedStorage.Glitchless`. Keep the files as they are: `init.luau` makes the folder the module, and
59
+ `GlitchlessClient.client.luau` must stay a LocalScript inside it.
60
+ - **Studio only**: build the model with `rojo build ~/.glitchless/roblox/default.project.json -o Glitchless.rbxm`
61
+ and ask the user to insert it into ReplicatedStorage (right-click → Insert from File).
62
+
63
+ Then the user turns on **Allow HTTP Requests** (Game Settings → Security). Tell them: without it nothing is sent, and
64
+ it can't be turned on from a script in a published game.
65
+
66
+ ## 3. Initialize
67
+
68
+ One server Script that runs when the server starts (ServerScriptService):
69
+
70
+ ```lua
71
+ local ReplicatedStorage = game:GetService("ReplicatedStorage")
72
+ local Glitchless = require(ReplicatedStorage.Glitchless) -- ReplicatedStorage.Packages.Glitchless with Wally
73
+
74
+ Glitchless.init({
75
+ service = "<the game's name in Glitchless>",
76
+ clientToken = "<client token>",
77
+ intake = "<intake URL>", -- leave out for Glitchless Cloud (https://api.glitchless.gg)
78
+ properties = { mode = "classic" }, -- optional: what holds for every session
79
+ })
80
+ ```
81
+
82
+ - The client token goes in this server Script only. It never reaches players' devices.
83
+ - `http://localhost:7777` works while the user tests in Studio (Studio runs on their computer); a published game's
84
+ servers can't reach it. For a published game use Glitchless Cloud or the user's own server's `https://` address.
85
+ - The version defaults to the place's published version (`game.PlaceVersion`), which changes with every publish. Pass
86
+ `version` only if the game has its own version string.
87
+ - No client code is needed: `init` puts the module's `GlitchlessClient` LocalScript in StarterPlayerScripts. If the
88
+ game already has its own client bootstrap and wants it there, pass `client = false` and call
89
+ `require(ReplicatedStorage.Glitchless).init()` from a LocalScript.
90
+ - In Studio, sessions are marked `tester` and `env` is `dev`, so test plays stay out of player numbers. Nothing else
91
+ marks bots: Roblox has none.
92
+ - Calls made before Glitchless starts wait for it: a LocalScript that runs before `GlitchlessClient`, a server Script
93
+ that runs before the one calling `init`, a `PlayerAdded` handler that runs before Glitchless's. Don't poll
94
+ `isEnabled()` before calling, and don't call `init()` from the game's LocalScripts to hurry it.
95
+
96
+ ## 4. Levels, deaths and the game's own events
97
+
98
+ From server scripts, the player first:
99
+
100
+ ```lua
101
+ Glitchless.levelStart(player, "desert_loop", { mode = "ranked", laps = 3 })
102
+ Glitchless.levelComplete(player, "desert_loop", { score = placement, durationS = raceTime })
103
+ Glitchless.levelFail(player, "desert_loop", { cause = "out_of_time" })
104
+ Glitchless.track(player, "boost_used", { kind = "nitro" })
105
+ Glitchless.count(player, "coin", { source = "track" }, amount) -- a stream: added up, sent once a window
106
+ Glitchless.setProperties(player, { car_class = "s", rank_band = "gold" })
107
+ ```
108
+
109
+ From a LocalScript (UI, input, client-side effects), the same calls without the player:
110
+
111
+ ```lua
112
+ Glitchless.track("settings_opened", { from = "pause" })
113
+ Glitchless.setContext({ effects = #workspace.Effects:GetChildren() }) -- gauges on this device's frame windows
114
+ ```
115
+
116
+ - **Levels**: an obby's stages, a race, a round, a dungeon floor. Use the game's own names. A player who leaves
117
+ mid-level gets a `level_abandon` by itself; never send a fail for leaving.
118
+ - **Deaths** are sent by themselves when a player's Humanoid dies. If the game knows why (lava, fell, an enemy), call
119
+ `Glitchless.death(player, { cause = "lava" })` where it handles the death: the first such call turns the automatic
120
+ ones off, so each death is sent once, with its cause.
121
+ - **Purchases**: in `ProcessReceipt`, after granting the item:
122
+ `Glitchless.track(player, "purchase", { item = productName, amount = price, currency = "ROBUX" })`, the price in
123
+ Robux. Boards keep Robux apart from dollars (the dashboard's `currency: "ROBUX"`), and a panel can add an estimate in
124
+ dollars at Roblox's DevEx rate. A purchase that didn't go through can be the same event with `result = "cancelled"`
125
+ (and `result = "done"` on the ones that did); never send the receipt or purchase ID.
126
+ - **The server's own session** (the map it runs, its rounds): `Glitchless.server.levelStart(mapName)`,
127
+ `Glitchless.server.track("round_started", { players = #Players:GetPlayers() })`.
128
+ - Never put a player's name, display name or user ID in an event, a level name or a property. The server scrubs
129
+ the ones it can see, but a name it doesn't know (a friend who isn't in the server) would go through.
130
+
131
+ ## 5. Multiplayer: matches and the server
132
+
133
+ Every Roblox game is multiplayer, and Glitchless measures the server (its frame rate, late frames, players, memory,
134
+ data rates, errors) and each player's ping by itself. Until the game sets a match of its own, everyone in a server and
135
+ the server share one match: the server. A game with rounds or races inside one server sets each as the match, on the
136
+ server and on every player in it, with the same ID:
137
+
138
+ ```lua
139
+ local roundId = HttpService:GenerateGUID(false)
140
+ Glitchless.server.setGroup("match", roundId, { mode = "ranked" })
141
+ for _, player in Players:GetPlayers() do
142
+ Glitchless.setGroup(player, "match", roundId)
143
+ end
144
+ -- when the round ends
145
+ Glitchless.server.endGroup("match")
146
+ for _, player in Players:GetPlayers() do
147
+ Glitchless.endGroup(player, "match")
148
+ end
149
+ ```
150
+
151
+ Parties (players who queued together) use `"party"`. IDs are hashed before they're sent.
152
+
153
+ ### Extras for hangouts and hubs
154
+
155
+ Four more things the server reads by itself once `init` turns them on, each off by default. Ask the user which fit,
156
+ and turn on those:
157
+
158
+ | Option | Turn it on when | What arrives |
159
+ | --- | --- | --- |
160
+ | `prompts = true` | the game uses ProximityPrompts (doors, shops, NPCs, machines) | `prompt` counts by `action` and `object` (the prompt's ActionText and ObjectText) |
161
+ | `seats = true` | players sit (sofas, cars, rides, arcade cabinets) | `sit` counts by `seat` (the seat's or its model's name) and `vehicle` |
162
+ | `joinedWithFriend = true` | it's social: do players who follow a friend in stay longer? | the session property `joined_with_friend`, to split anything by |
163
+ | `friendsInServer = true` | the same, while they play | the gauge `friends_in_server` on every frame window |
164
+
165
+ They replace hand-written `count` calls for prompts and seats: don't add both. Name prompts' ActionText and
166
+ ObjectText, and seats' models, in words a board can show ("Open", "Starter Pack"; "Sofa", "Kart").
167
+
168
+ Glitchless uses up to 100 of a server's 500 HTTP requests a minute (`requestsPerMinute`). If the game makes many
169
+ HTTP requests of its own, lower it; with many players, each one's batches simply come less often.
170
+
171
+ ## 6. The player's off switch
172
+
173
+ If the game has a settings menu, add a "Share performance data" toggle. From the LocalScript that runs the menu:
174
+
175
+ ```lua
176
+ toggle.Activated:Connect(function()
177
+ local on = not Glitchless.isEnabled()
178
+ Glitchless.setEnabled(on)
179
+ -- show `on` in the toggle
180
+ end)
181
+ ```
182
+
183
+ Glitchless keeps the choice in the game's DataStore (`Glitchless` store, key `u<UserId>`) and reads it when the player
184
+ joins, so it holds on every server. Tell the user: in Studio this needs Enable Studio Access to API Services and a
185
+ published place, and the key is the player's data under Roblox's erasure requests (delete it with the rest). With
186
+ `optIn = true` in `init`, nothing is sent for a player until the game calls `Glitchless.setEnabled(player, true)`
187
+ (after asking them).
188
+
189
+ ## 7. Privacy
190
+
191
+ The Roblox SDK is anonymous only: there is no install or full mode, so it can't count returning players. Roblox can,
192
+ by account: on Glitchless Cloud, connect the experience in Settings → Integrations → Roblox (its universe ID, or its
193
+ roblox.com address) with an Open Cloud API key the user makes in Creator Dashboard → Open Cloud → API Keys, with the
194
+ experience under Access Permissions → `universe-analytics` and only `universe.analytics:read`. Roblox's D1, D7 and D30
195
+ retention, daily active and new users, Robux and its crash rate and frame rate by place version then show on the
196
+ game's Roblox page and in `glitchless_store` (`show: "vitals"`, `store: "roblox"`) and `glitchless_revenue`. Without a
197
+ key it still brings players now and the thumbs up and down. The user pastes the key there themselves; it never goes in
198
+ the game. Every session has a random ID, and no user ID, name or display name is sent.
199
+ Roblox's rules count those identifiers as protected data; `roblox/PRIVACY.md` has what Roblox's policies say, every
200
+ field sent, and a paragraph for the game's privacy notice. If the game sets properties, the notice needs the
201
+ properties line.
202
+
203
+ Positions are off. With `positions = true` in `init`, the server samples each player's character position for
204
+ heatmaps and puts deaths on the map; ask the user first. The extras (section 5) are counts and true/false only; with
205
+ `friendsInServer` or `joinedWithFriend`, the privacy notice gets the friends line in `roblox/PRIVACY.md`.
206
+
207
+ ### A map under the heatmap
208
+
209
+ With positions on, give the heatmap a map. The server draws one itself, from the place's parts, one ray down per
210
+ pixel; call it once the place is built, from a server Script:
211
+
212
+ ```lua
213
+ task.spawn(Glitchless.captureMap) -- the whole place
214
+ task.spawn(Glitchless.captureMap, { zone = "hall", area = workspace.Zones.Hall }) -- a zone, by its volume
215
+ task.spawn(Glitchless.captureMap, { level = "obby_1", area = workspace.Obby1 }) -- a level, by its folder
216
+ ```
217
+
218
+ Its map is the parts' colours, lit and outlined (no textures or decals). For a picture that looks like the game,
219
+ take one in Studio with Studio's MCP server: `execute_luau` (`datamodel_type: "Edit"`) with
220
+ `return require(game.ReplicatedStorage.Glitchless).mapBounds(workspace.Zones.Hall)` for the rectangle on x and z,
221
+ then `screen_capture` with `camera_position` high above its centre and `look_at_position` straight below. The
222
+ picture's top edge is the smallest z, its left edge the smallest x. Hand it and the bounds to the game's map upload.
223
+
224
+ ## 8. Check that it works
225
+
226
+ 1. In Studio, press Play (Test → Start Test Session → Test) with the intake set (`http://localhost:7777` for a local
227
+ server), play for half a minute, then Stop. Stop closes the server, which sends everything. With Studio's MCP
228
+ server, do it yourself: `start_stop_play` with `is_start: true`, wait, then `false`.
229
+ 2. The Output window shows `[glitchless]` warnings if something is off (HTTP requests off, a token refused, a
230
+ property dropped). One about DataStore in an unpublished place is expected.
231
+ 3. Call `glitchless_list_games`: the game is listed, with its server under it (`<game>.server`). Then
232
+ `glitchless_triage` (game set) shows the sessions, `glitchless_servers` the server's frames, and
233
+ `glitchless_session` one player's frame windows, level and errors.
234
+
235
+ A published game's first sessions arrive once real players join a server running the new version. Each publish is a
236
+ new place version (`game.PlaceVersion`), which the SDK sends as the game's version, so `glitchless_compare_versions`
237
+ and Roblox's own vitals line up version by version.
@@ -22,7 +22,7 @@ Add one line to `dependencies` in `Packages/manifest.json`:
22
22
  "gg.glitchless.sdk": "https://github.com/glitchless-gg/glitchless.git?path=unity/Packages/gg.glitchless.sdk"
23
23
  ```
24
24
 
25
- Unity resolves it the next time the Editor has focus. Pin a release by adding `#gg.glitchless.sdk/v0.6.2`.
25
+ Unity resolves it the next time the Editor has focus. Pin a release by adding `#gg.glitchless.sdk/v0.7.0`.
26
26
 
27
27
  ## 3. Initialize, without touching a scene file
28
28
 
@@ -68,11 +68,20 @@ call `Glitchless.LevelStart("world-1-2")` where a level begins (that turns scene
68
68
  | where the player is in an open world | `Glitchless.SetZone("westfall")` |
69
69
  | a purchase the store confirmed | `Glitchless.Track("purchase", new Dictionary<string, object> { ["amount"] = 4.99, ["currency"] = "USD", ["item"] = "gems_500" })` |
70
70
  | counts of anything that scales, each frame | `Glitchless.SetContext("enemies", enemies.Count)` |
71
- | the player's place, each frame | `Glitchless.SetPosition(player.position)` |
71
+ | the player's place, each frame | `Glitchless.SetPosition(player.position)` (sent with `Positions = true` in the options, or Full mode) |
72
+ | a level is built (its picture under the heatmaps) | `Glitchless.CaptureMap("level-2", new Rect(0, 0, width, height))`: 2D or a side view; a 3D level from above: `Glitchless.CaptureMap("arena", bounds)` |
72
73
  | a caught exception | `Glitchless.Error(e)` |
73
74
 
74
75
  Uncaught exceptions, `Debug.LogError` and engine errors are reported without any code.
75
76
 
77
+ **Heatmaps.** With positions on, call `CaptureMap` where a level is built, so the dashboard draws deaths and paths
78
+ over a picture of it. Give it the level's area in world units: a tile room `new Rect(0, 0, room.Width, room.Height)`
79
+ (a long stage whole, not the screen the camera shows); a 3D level its renderers' bounds put together
80
+ (`var b = renderers[0].bounds; foreach (var r in renderers) b.Encapsulate(r.bounds);`), whose top is where the camera
81
+ looks down from, so leave a roof above it out. Pass what shouldn't be in the picture:
82
+ `new MapOptions { Exclude = new[] { player.gameObject, backdrop.gameObject } }` (a backdrop that follows the camera
83
+ would cover the level). Calling it every time the level starts is fine: each level's map goes once per version.
84
+
76
85
  Track a moment, count a stream: anything that happens several times a second (each bullet, each coin) goes through
77
86
  `Count`, which adds it up on the device; a `Track` for each would fill the SDK's queue. Properties hold for the whole
78
87
  session: set them where the game knows them (after sign-in, at the menu, at matchmaking), as bands (`"30-39"`) rather
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: triage
3
- description: Find and fix the most important problem in a game (Three.js, Phaser, Babylon.js, PlayCanvas, Unity, Godot or Unreal) using Glitchless player telemetry — frame-time hitches, leaks, errors, difficulty spikes and rage quits — then verify the fix with measurements. Use when the user asks what's wrong with their game, why it stutters or lags, why players quit, or to "fix the Glitchless findings".
3
+ description: Find and fix the most important problem in a game (Three.js, Phaser, Babylon.js, PlayCanvas, Unity, Godot, Unreal or Roblox) using Glitchless player telemetry — frame-time hitches, leaks, errors, difficulty spikes and rage quits — then verify the fix with measurements. Use when the user asks what's wrong with their game, why it stutters or lags, why players quit, or to "fix the Glitchless findings".
4
4
  ---
5
5
 
6
6
  # Triage a game with Glitchless
@@ -18,9 +18,16 @@ You have two sources of truth:
18
18
  - performance → `glitchless_performance` with `level`: look at `hitch_context` (which gauges spike during hitches, which events precede them) and `slowest_recent_hitches[].loaf` (script attribution).
19
19
  - memory → `glitchless_performance` `memory` + `by_level.geometries_max`.
20
20
  - stability → `glitchless_get_error` with the fingerprint: stack, `location`, breadcrumbs.
21
- - design → `glitchless_player_funnel` with the level and `hotspots: true` for where players die, then without it for the level's funnel.
21
+ - design → `glitchless_player_funnel` with the level and `hotspots: true` for where players die, then without it for the level's funnel (`recent_rage_inputs` says where players mashed a key).
22
+ - one session (a crash, a rage quit, a playtest) → `glitchless_session`: a summary level by level; `level` or `types` gives its events.
22
23
  - the game's own metrics (plays, purchases, the paywall, whatever it sends with `track`) → `glitchless_events`,
23
24
  with a `funnel` for drop-off between steps; `glitchless_dashboard` shows the pages and panels this game cares about.
25
+ - **a Roblox game** connected to Roblox (Settings → Integrations → Roblox) → `glitchless_store` with `show: "vitals"` and
26
+ `store: "roblox"`: Roblox's own crash rate and frame rate by place version and by platform next to Glitchless's,
27
+ with a line where they disagree (a crash of the Roblox app itself, or out of memory, shows only on Roblox's side),
28
+ and its D1, D7 and D30 retention. The Roblox SDK is anonymous, so "do players come back?" is answered by Roblox's
29
+ retention, never by Glitchless's; `glitchless_revenue` with `source: "roblox"` has Robux, paying users and daily
30
+ active users. Not connected: say that connecting it (with an Open Cloud key) brings these.
24
31
  3. **Find the code.** Use the evidence as search keys: event names from `preceding_events` (e.g. the `glitchless.track('powerup')` call site), gauge names passed to `glitchless.setContext`, the error's function/file, level data near the hotspot's x range.
25
32
  4. **Reproduce and baseline.** Web: load the level / trigger the effect with the game's tools, then run `glitchless_measure` for 5–10s. Unity, Godot and Unreal: build (Unreal: a packaged Development build), then run the measure flag on the level in question. Record p95, worst frame, draw calls, render and update CPU, peak gauges, the memory delta. For errors, reproduce and confirm with `glitchless_errors` (web) or the session in `glitchless_session`.
26
33
  5. **Save a playtest baseline before touching code** (web games). Call `glitchless_playtest` with `save_as: "baseline"`. The game's autoplay bots play fixed-seed runs on the current code so you can prove later that your change made nothing else worse. It needs the game and Glitchless server running and Playwright in the project; if it can't run, say so and continue. For Unity, Godot and Unreal, keep the measure JSON from step 4 as the baseline.
@@ -32,10 +39,11 @@ You have two sources of truth:
32
39
  - **Phaser:** objects and bodies that pile up → destroy them or recycle through a Group, one collider per group; `listeners` growing per restart → remove handlers on `shutdown` (scene events outlive a restart); `texture_upload` hitches → make textures once in the preloader; `game_loop_stopped` → the uncaught error stopped Phaser's loop for good, so make that callback fail safe
33
40
  - **Unity:** `gc` hitches → stop per-frame allocations (LINQ, string building, new lists); `object_spawn` → pool with `UnityEngine.Pool.ObjectPool`; mesh or material counts growing per level → `Destroy()` runtime meshes and materials, use `sharedMaterial`; `physics` → fewer rigidbodies, simpler colliders; `exception` → the rest of that `Update` never ran: guard the null or missing key
34
41
  - **Godot:** follow the finding's suggestion; it names Godot APIs
42
+ - **Roblox:** follow the finding's suggestion (it names Roblox's fixes: StreamingEnabled, pooling instead of Clone and Destroy, anchoring, draw calls and shadows); a crash rate Roblox counts high on Phone or Tablet, with Glitchless seeing few crashes, is usually memory: lower texture and mesh detail, turn on StreamingEnabled, check `memory_mb` in `glitchless_session`
35
43
  - **Unreal:** `pso_compile` hitches → keep PSO precaching on, ship a bundled PSO cache (record with `-logPSO`), spawn first-use effects behind the loading screen; `-LogCmds="LogPSOHitching Verbose"` names each material; `gc` hitches → pool actors and objects instead of SpawnActor/NewObject per shot, keep short-lived data out of UObjects; `ensure` or `crash` → a UObject that is null or pending kill: test with `IsValid()`, keep it in a `UPROPERTY()`; `script` → a Blueprint read None: add an Is Valid node. With Unreal MCP connected, make Blueprint changes through it
36
44
  - **design findings** (a jump nobody makes): propose 1–2 concrete level-data changes with the numbers, and ask the user before changing game design.
37
45
  7. **Verify.** Repeat the exact reproduction and measure again (web: reload and `glitchless_measure`; Unity, Godot and Unreal: rebuild and run the measure flag). Show a before/after table. On the web, drop a breadcrumb with `glitchless_annotate` (e.g. "agent: confetti → InstancedMesh, p95 48→15ms").
38
46
  8. **Playtest the change** (web games). Call `glitchless_playtest` with no arguments to compare every scenario against the baseline. A FAIL means the work isn't done: read the regressions and new errors, fix them, and run it again. Report the verdict and the improvements table to the user.
39
- 9. **Version it.** Bump the patch version the game reports (`version` in `Glitchless.init`; Unity's `Application.version`; Godot's `application/config/version`; Unreal's `ProjectVersion` in `DefaultGame.ini`) so production data from the fix is separable, and tell the user to run `glitchless_compare_versions` (or open Versions in the dashboard) once players have played the new build.
47
+ 9. **Version it.** Bump the patch version the game reports (`version` in `Glitchless.init`; Unity's `Application.version`; Godot's `application/config/version`; Unreal's `ProjectVersion` in `DefaultGame.ini`; Roblox's place version goes up by itself on each publish) so production data from the fix is separable, and tell the user to run `glitchless_compare_versions` (or open Versions in the dashboard) once players have played the new build. In a jam room, publish the new build to the room straight after (`glitchless_jam` with `action: "publish"`), so the next round of players gets the fix.
40
48
 
41
49
  Never claim a fix worked without a measurement and a passing playtest; if you couldn't run either, say so and say what to watch in production.