pet.trezy.species
Schema Diff
+10 -0
Compatibility Analysis
Backward Compatible
Backward compatible. 6 non-breaking changes.
Non-Breaking Changes (6)
- AddedVertex AddedVertex { vertex_id: "pet.trezy.species#sprite.box" }
- AddedVertex AddedVertex { vertex_id: "pet.trezy.species#sprite.portrait" }
- AddedEdge AddedEdge { src: "pet.trezy.species#sprite", tgt: "pet.trezy.species#sprite.box", kind: "prop", name: Some("box") }
- AddedEdge AddedEdge { src: "pet.trezy.species#sprite", tgt: "pet.trezy.species#sprite.portrait", kind: "prop", name: Some("portrait") }
- AddedEdge AddedEdge { src: "pet.trezy.species#sprite.box", tgt: "pet.trezy.species#size", kind: "ref", name: None }
- AddedEdge AddedEdge { src: "pet.trezy.species#sprite.portrait", tgt: "pet.trezy.species#size", kind: "ref", name: None }
Migration Guidance
Added Elements
AddedVertex { vertex_id: "pet.trezy.species#sprite.box" }AddedVertex { vertex_id: "pet.trezy.species#sprite.portrait" }
Additional Notes
- Non-breaking: AddedEdge { src: "pet.trezy.species#sprite", tgt: "pet.trezy.species#sprite.box", kind: "prop", name: Some("box") }
- Non-breaking: AddedEdge { src: "pet.trezy.species#sprite", tgt: "pet.trezy.species#sprite.portrait", kind: "prop", name: Some("portrait") }
- Non-breaking: AddedEdge { src: "pet.trezy.species#sprite.box", tgt: "pet.trezy.species#size", kind: "ref", name: None }
- Non-breaking: AddedEdge { src: "pet.trezy.species#sprite.portrait", tgt: "pet.trezy.species#size", kind: "ref", name: None }
1
1
{
2
2
"id": "pet.trezy.species",
3
3
"defs": {
4
4
"main": {
5
5
"key": "any",
6
6
"type": "record",
7
7
"record": {
8
8
"type": "object",
9
9
"required": [
10
10
"id",
11
11
"displayName",
12
12
"tier",
13
13
"sprite",
14
14
"behaviors"
15
15
],
16
16
"properties": {
17
17
"id": {
18
18
"type": "string",
19
19
"maxLength": 64,
20
20
"description": "The species key. Stored on every ledger row already sold, so renaming one is not safe — a rename is a new species plus a migration, never an edit."
21
21
},
22
22
"tier": {
23
23
"type": "string",
24
24
"maxLength": 64,
25
25
"description": "The id of a pet.trezy.tier record, which carries the price. Deliberately NOT an enum: adding a tier must be publishing one record, not editing this file, regenerating and redeploying the client. knownValues documents the tiers that exist today and constrains nothing.",
26
26
"knownValues": [
27
27
"common",
28
28
"uncommon",
29
29
"rare",
30
30
"epic",
31
31
"legendary"
32
32
]
33
33
},
34
34
"price": {
35
35
"type": "integer",
36
36
"minimum": 0,
37
37
"description": "Overrides the tier's price for this species alone. Absent is the normal case — an override per species would mean the tiers are wrong."
38
38
},
39
39
"groups": {
40
40
"type": "array",
41
41
"items": {
42
42
"type": "string",
43
43
"maxLength": 64
44
44
},
45
45
"description": "The `pet.trezy.group` records this species belongs to, by id. AN ARRAY BECAUSE MEMBERSHIP OVERLAPS AND MIXES LEVELS: a bat is `mammals`, `bats`, `fliers` and `nocturnal`, and a penguin is `birds` and `swimmers` without being a mammal at all. A single field would have forced a species to pick one true thing about itself and drop the others — which is why the vocabulary can hold a class, a family and a habit side by side rather than having to settle on one rank. Order is not significant; readers sort by the group's own `rank`."
46
46
},
47
47
"sprite": {
48
48
"ref": "#sprite",
49
49
"type": "ref",
50
50
"description": "Everything needed to draw the animal, including the atlas itself as a blob. Generated from the artist's Aseprite export by scripts/build-species.ts and never hand-edited."
51
51
},
52
52
"starter": {
53
53
"type": "boolean",
54
54
"description": "Offered as a first pet. ABSENT MEANS NO, and the flag is a whitelist rather than a hint: when any species carries it, the starter picker offers exactly those and the price rule is not consulted. When none does, the picker falls back to everything the starter grant can afford, which is what it did before this field existed. Kept here rather than as a list on gameConfig because it is a fact about the species, and because a full species record already travels to every client in getDefinitions — a list elsewhere would need the query, its output lexicon and its Lua changed to say the same thing."
55
55
},
56
56
"activity": {
57
57
"type": "string",
58
58
"maxLength": 64,
59
59
"description": "When the animal keeps its hours. ⚠ A FIELD RATHER THAN A GROUP, BECAUSE THESE ARE MUTUALLY EXCLUSIVE AND GROUPS ARE NOT. `groups` overlap on purpose — a bat is a mammal and a flier at once — so nothing there can enforce exactly-one, and a species tagged both `nocturnal` and `diurnal` would be nonsense no reader could resolve. It also has to be exactly one for the mechanic that will read it: a pet dozes outside its own hours, and 'outside' is undefined for an animal with two answers.\n\nThe vocabulary, widest first: `diurnal` is daylight; `nocturnal` is night; `crepuscular` is both twilights; `matutinal` is dawn ONLY and `vespertinal` is dusk ONLY, the two halves crepuscular rolls together; `cathemeral` is no fixed rhythm, which is the honest answer for a slime.\n\n⚠ `matutinal` AND `vespertinal` ARE PUBLISHED AHEAD OF ANY USER, DELIBERATELY. No species on the roster is either one today. They are listed so the vocabulary is settled before somebody needs it — a reader implementing dozing should handle all six now rather than discover two of them later. NOT an enum, for the same reason `tier` is not: the list documents what exists and constrains nothing, so a seventh is a record edit rather than a client deploy.\n\n(Spelled `vespertinal` to match the -al pattern of the others; `vespertine` is the commoner form in the literature and means the same thing. Do not 'correct' one to the other — the string is stored on records.)",
60
60
"knownValues": [
61
61
"diurnal",
62
62
"nocturnal",
63
63
"crepuscular",
64
64
"matutinal",
65
65
"vespertinal",
66
66
"cathemeral"
67
67
]
68
68
},
69
69
"behaviors": {
70
70
"type": "array",
71
71
"items": {
72
72
"ref": "#behavior",
73
73
"type": "ref"
74
74
},
75
75
"minLength": 1,
76
76
"description": "How the species acts when left alone, as weighted options for the behaviour tree. Authored, unlike `sprite` — this is temperament, a game-design judgement that no export contains."
77
77
},
78
78
"displayName": {
79
79
"type": "string",
80
80
"maxLength": 64
81
81
},
82
82
"purchasable": {
83
83
"type": "boolean",
84
84
"description": "ABSENT MEANS TRUE. False means the species exists in every other sense — tier, sprite, ownable, on the leaderboard — but the shop will not sell it because it is reached another way. A reader writing `if purchasable then` makes every species unsellable."
85
85
}
86
86
}
87
87
},
88
88
"description": "A species the game knows about, published in the game's own repo (did:plc:ollch4g7tes2reb5eceiwuol). Only records from that DID are ever read — record.index:pet.trezy.species refuses the rest. THIS RECORD IS THE WHOLE SPECIES: identity, economy, artwork and temperament. The client compiles in nothing about any species and derives nothing from a filename; it draws what these records say and caches the answer. A species not published here does not exist to the game, and changing one here changes it for every client without an app deploy."
89
89
},
90
90
"rect": {
91
91
"type": "object",
92
92
"required": [
93
93
"x",
94
94
"y",
95
95
"w",
96
96
"h"
97
97
],
98
98
"properties": {
99
99
"h": {
100
100
"type": "integer",
101
101
"minimum": 0
102
102
},
103
103
"w": {
104
104
"type": "integer",
105
105
"minimum": 0
106
106
},
107
107
"x": {
108
108
"type": "integer"
109
109
},
110
110
"y": {
111
111
"type": "integer"
112
112
}
113
113
}
114
114
},
115
115
"size": {
116
116
"type": "object",
117
117
"required": [
118
118
"w",
119
119
"h"
120
120
],
121
121
"properties": {
122
122
"h": {
123
123
"type": "integer",
124
124
"minimum": 1
125
125
},
126
126
"w": {
127
127
"type": "integer",
128
128
"minimum": 1
129
129
}
130
130
}
131
131
},
132
132
"datum": {
133
133
"type": "object",
134
134
"required": [
135
135
"key",
136
136
"value"
137
137
],
138
138
"properties": {
139
139
"key": {
140
140
"type": "string",
141
141
"maxLength": 64
142
142
},
143
143
"value": {
144
144
"type": "string",
145
145
"maxLength": 256
146
146
}
147
147
}
148
148
},
149
149
"frame": {
150
150
"type": "object",
151
151
"required": [
152
152
"x",
153
153
"y",
154
154
"w",
155
155
"h",
156
156
"duration"
157
157
],
158
158
"properties": {
159
159
"h": {
160
160
"type": "integer",
161
161
"minimum": 1
162
162
},
163
163
"w": {
164
164
"type": "integer",
165
165
"minimum": 1
166
166
},
167
167
"x": {
168
168
"type": "integer",
169
169
"minimum": 0
170
170
},
171
171
"y": {
172
172
"type": "integer",
173
173
"minimum": 0
174
174
},
175
175
"duration": {
176
176
"type": "integer",
177
177
"minimum": 1,
178
178
"description": "Milliseconds, as Aseprite exports it."
179
179
}
180
180
},
181
181
"description": "One frame: where it sits in the atlas, and how long it is held."
182
182
},
183
183
"slice": {
184
184
"type": "object",
185
185
"required": [
186
186
"name",
187
187
"bounds"
188
188
],
189
189
"properties": {
190
190
"data": {
191
191
"type": "array",
192
192
"items": {
193
193
"ref": "#datum",
194
194
"type": "ref"
195
195
},
196
196
"description": "The slice's user-data, as key/value pairs. Aseprite stores this as a free-text string like `type=ground-contact`; it is split at build time so no reader has to. `type` is the only key the game reads today, and unknown keys are carried through rather than dropped."
197
197
},
198
198
"name": {
199
199
"type": "string",
200
200
"maxLength": 64
201
201
},
202
202
"bounds": {
203
203
"ref": "#rect",
204
204
"type": "ref"
205
205
}
206
206
}
207
207
},
208
208
"sprite": {
209
209
"type": "object",
210
210
"required": [
211
211
"atlas",
212
212
"size",
213
213
"frameSize",
214
214
"animations",
215
215
"slices"
216
216
],
217
217
"properties": {
218
+
"box": {
219
+
"ref": "#size",
220
+
"type": "ref",
221
+
"description": "Tight opaque bounds across EVERY FRAME OF EVERY ANIMATION, in source pixels, with the creature centred on its ground contact. The box a crowd view packs cells from.\n\n⚠ MEASURED FROM THE ATLAS AT BUILD TIME, NEVER AUTHORED. It lived in the client as a 76-entry table for exactly as long as the client also held the art; once the art moved to its own repo nothing in the client could re-derive it, and a table of measurements nobody can check is a table that rots silently — a clipped ear, a crowd quietly back to overlapping.\n\n⚠ NOT `frameSize`, WHICH IS THE CANVAS RATHER THAN THE ANIMAL. Widths here run from 13 to 69 against a frame that is typically 64×64, so sizing a cell from the frame leaves a piglin swimming in five times its own area.\n\nOPTIONAL, AND ABSENCE IS NOT AN ERROR: a reader without it falls back to a box large enough for anything drawn. Records published before this field existed simply do not have it."
222
+
},
218
223
"size": {
219
224
"ref": "#size",
220
225
"type": "ref",
221
226
"description": "The atlas's own pixel dimensions. Needed to place background-position offsets without waiting for the image to load."
222
227
},
223
228
"atlas": {
224
229
"type": "blob",
225
230
"accept": [
226
231
"image/png"
227
232
],
228
233
"maxSize": 1000000,
229
234
"description": "The packed spritesheet PNG, stored in this repo. A blob rather than a URL into the app's public directory, so the artwork and the frame rectangles that index into it version together and CANNOT disagree — a repacked atlas with stale coordinates draws slivers of the wrong animal, which is the exact drift this record exists to end. Pixel-art atlases are a few KB; the cap is generous by three orders of magnitude and is only there to catch a mistake."
230
235
},
231
236
"slices": {
232
237
"type": "array",
233
238
"items": {
234
239
"ref": "#slice",
235
240
"type": "ref"
236
241
},
237
242
"description": "Authored regions: the hitbox a pointer can grab, and the ground-contact box that decides where the animal's feet are. Absent or unlabelled slices fall back to a measured box, so this may be empty."
238
243
},
244
+
"portrait": {
245
+
"ref": "#size",
246
+
"type": "ref",
247
+
"description": "Tight opaque bounds of the FIRST FRAME OF THE `idle` TAG alone, same centring as `box`. The crop a single-pet portrait uses.\n\n⚠ A SECOND MEASUREMENT RATHER THAN A DERIVATION OF `box`, BECAUSE ONE FRAME IS NOT THE LOOP. The widest animal reaches 69 across its full run and 59 on its idle frame; a portrait cropped to 69 leaves every pet floating, and a crowd cell sized at 59 clips the frames the idle pose does not reach. Neither number can be computed from the other.\n\nOPTIONAL on the same terms as `box`."
248
+
},
239
249
"frameSize": {
240
250
"ref": "#size",
241
251
"type": "ref",
242
252
"description": "One frame's dimensions — the window the animal is drawn inside, typically 64×64 with the creature somewhere within it rather than filling it."
243
253
},
244
254
"animations": {
245
255
"type": "array",
246
256
"items": {
247
257
"ref": "#animation",
248
258
"type": "ref"
249
259
},
250
260
"minLength": 1,
251
261
"description": "Named animations. AN ARRAY, NOT A MAP, because lexicon has no map type and an `unknown` blob here would put this back to being parsed by hand at both ends. The client keys it by name on read."
252
262
}
253
263
},
254
264
"description": "The drawable half of a species. Mirrors the client's SpriteSheet shape exactly so the client does no parsing: it reads these fields straight into the renderer. The Aseprite JSON is NOT carried verbatim — that format numbers frames per tag and stores tag membership as index ranges into an insertion-ordered object, which has caused two separate animation bugs in this project. The ranges are resolved here, once, at build time."
255
265
},
256
266
"behavior": {
257
267
"type": "object",
258
268
"required": [
259
269
"type",
260
270
"weight"
261
271
],
262
272
"properties": {
263
273
"type": {
264
274
"type": "string",
265
275
"maxLength": 32,
266
276
"description": "NOT an enum, for the same reason `tier` is not: a new behaviour should be publishable. A client that meets a type it does not implement must skip that option and keep the rest, never refuse the species.",
267
277
"knownValues": [
268
278
"idle",
269
279
"move",
270
280
"slide",
271
281
"jump",
272
282
"fly"
273
283
]
274
284
},
275
285
"speed": {
276
286
"type": "integer",
277
287
"minimum": 0,
278
288
"description": "World pixels per second. Characterisation rather than realism — the turtle is slow because a slow turtle is funny, and the spread across species is what makes a mixed stage read as a menagerie."
279
289
},
280
290
"weight": {
281
291
"type": "integer",
282
292
"minimum": 0,
283
293
"description": "Relative likelihood against the species's other options. Zero is a legitimate way to keep a behaviour published but dormant."
284
294
},
285
295
"animation": {
286
296
"type": "string",
287
297
"maxLength": 64,
288
298
"description": "For `idle` and `move`: the animation to play throughout."
289
299
},
290
300
"maxDuration": {
291
301
"type": "integer",
292
302
"minimum": 0,
293
303
"description": "For `idle`: seconds, the longest. For `fly`: the longest it stays up."
294
304
},
295
305
"minDuration": {
296
306
"type": "integer",
297
307
"minimum": 0,
298
308
"description": "For `idle`: seconds, the shortest the pet will stand still. For `fly`: seconds aloft before it looks for somewhere to land."
299
309
},
300
310
"endAnimation": {
301
311
"type": "string",
302
312
"maxLength": 64,
303
313
"description": "For `slide` and `jump`: the recovery, played once."
304
314
},
305
315
"endMoveFrame": {
306
316
"type": "integer",
307
317
"minimum": 0,
308
318
"description": "For `jump`: the frame of the end animation at which it lands."
309
319
},
310
320
"loopAnimation": {
311
321
"type": "string",
312
322
"maxLength": 64,
313
323
"description": "For `slide` and `jump`: the sustained middle, repeated while travelling."
314
324
},
315
325
"hoverAnimation": {
316
326
"type": "string",
317
327
"maxLength": 64,
318
328
"description": "For `fly`: held on the spot after arriving somewhere, before it picks the next destination or comes down. Optional — a species without one simply turns and goes again."
319
329
},
320
330
"startAnimation": {
321
331
"type": "string",
322
332
"maxLength": 64,
323
333
"description": "For `slide` and `jump`: the wind-up, played once."
324
334
},
325
335
"startMoveFrame": {
326
336
"type": "integer",
327
337
"minimum": 0,
328
338
"description": "For `jump`: the frame of the start animation at which the pet actually leaves the ground, so the launch matches the drawing."
329
339
}
330
340
},
331
341
"description": "One weighted option in the behaviour tree. The params a type needs differ by type, which lexicon cannot express as a discriminated union, so every param is optional here and build-species.ts validates the combination that each type actually requires."
332
342
},
333
343
"animation": {
334
344
"type": "object",
335
345
"required": [
336
346
"name",
337
347
"frames"
338
348
],
339
349
"properties": {
340
350
"name": {
341
351
"type": "string",
342
352
"maxLength": 64,
343
353
"description": "The tag name from Aseprite — `idle`, `run`, `slide-loop`. Behaviours reference these by name, and a behaviour naming an animation that is not here does not throw: the pet simply stops animating. build-species.ts refuses to emit that combination."
344
354
},
345
355
"frames": {
346
356
"type": "array",
347
357
"items": {
348
358
"ref": "#frame",
349
359
"type": "ref"
350
360
},
351
361
"minLength": 1
352
362
}
353
363
}
354
364
}
355
365
},
356
366
"$type": "com.atproto.lexicon.schema",
357
367
"lexicon": 1
358
368
}