pet.trezy.species
Schema Diff
+9 -3
Compatibility Analysis
Breaking Changes Detected
1 breaking change, 2 non-breaking changes.
Breaking Changes (1)
- ConstraintTightened ConstraintTightened { vertex_id: "pet.trezy.species#behavior.type", sort: "knownValues", old_value: "[\"idle\",\"move\",\"slide\",\"jump\"]", new_value: "[\"idle\",\"move\",\"slide\",\"jump\",\"fly\"]" }
Non-Breaking Changes (2)
- AddedVertex AddedVertex { vertex_id: "pet.trezy.species#behavior.hoverAnimation" }
- AddedEdge AddedEdge { src: "pet.trezy.species#behavior", tgt: "pet.trezy.species#behavior.hoverAnimation", kind: "prop", name: Some("hoverAnimation") }
Migration Guidance
Added Elements
AddedVertex { vertex_id: "pet.trezy.species#behavior.hoverAnimation" }
Constraint Changes
- ConstraintTightened ConstraintTightened { vertex_id: "pet.trezy.species#behavior.type", sort: "knownValues", old_value: "[\"idle\",\"move\",\"slide\",\"jump\"]", new_value: "[\"idle\",\"move\",\"slide\",\"jump\",\"fly\"]" }
Additional Notes
- Non-breaking: AddedEdge { src: "pet.trezy.species#behavior", tgt: "pet.trezy.species#behavior.hoverAnimation", kind: "prop", name: Some("hoverAnimation") }
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
218
"size": {
219
219
"ref": "#size",
220
220
"type": "ref",
221
221
"description": "The atlas's own pixel dimensions. Needed to place background-position offsets without waiting for the image to load."
222
222
},
223
223
"atlas": {
224
224
"type": "blob",
225
225
"accept": [
226
226
"image/png"
227
227
],
228
228
"maxSize": 1000000,
229
229
"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
230
},
231
231
"slices": {
232
232
"type": "array",
233
233
"items": {
234
234
"ref": "#slice",
235
235
"type": "ref"
236
236
},
237
237
"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
238
},
239
239
"frameSize": {
240
240
"ref": "#size",
241
241
"type": "ref",
242
242
"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
243
},
244
244
"animations": {
245
245
"type": "array",
246
246
"items": {
247
247
"ref": "#animation",
248
248
"type": "ref"
249
249
},
250
250
"minLength": 1,
251
251
"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
252
}
253
253
},
254
254
"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
255
},
256
256
"behavior": {
257
257
"type": "object",
258
258
"required": [
259
259
"type",
260
260
"weight"
261
261
],
262
262
"properties": {
263
263
"type": {
264
264
"type": "string",
265
265
"maxLength": 32,
266
266
"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
267
"knownValues": [
268
268
"idle",
269
269
"move",
270
270
"slide",
271
-
"jump"
271
+
"jump",
272
+
"fly"
272
273
]
273
274
},
274
275
"speed": {
275
276
"type": "integer",
276
277
"minimum": 0,
277
278
"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."
278
279
},
279
280
"weight": {
280
281
"type": "integer",
281
282
"minimum": 0,
282
283
"description": "Relative likelihood against the species's other options. Zero is a legitimate way to keep a behaviour published but dormant."
283
284
},
284
285
"animation": {
285
286
"type": "string",
286
287
"maxLength": 64,
287
288
"description": "For `idle` and `move`: the animation to play throughout."
288
289
},
289
290
"maxDuration": {
290
291
"type": "integer",
291
292
"minimum": 0,
292
-
"description": "For `idle`: seconds, the longest."
293
+
"description": "For `idle`: seconds, the longest. For `fly`: the longest it stays up."
293
294
},
294
295
"minDuration": {
295
296
"type": "integer",
296
297
"minimum": 0,
297
-
"description": "For `idle`: seconds, the shortest the pet will stand still."
298
+
"description": "For `idle`: seconds, the shortest the pet will stand still. For `fly`: seconds aloft before it looks for somewhere to land."
298
299
},
299
300
"endAnimation": {
300
301
"type": "string",
301
302
"maxLength": 64,
302
303
"description": "For `slide` and `jump`: the recovery, played once."
303
304
},
304
305
"endMoveFrame": {
305
306
"type": "integer",
306
307
"minimum": 0,
307
308
"description": "For `jump`: the frame of the end animation at which it lands."
308
309
},
309
310
"loopAnimation": {
310
311
"type": "string",
311
312
"maxLength": 64,
312
313
"description": "For `slide` and `jump`: the sustained middle, repeated while travelling."
313
314
},
315
+
"hoverAnimation": {
316
+
"type": "string",
317
+
"maxLength": 64,
318
+
"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
+
},
314
320
"startAnimation": {
315
321
"type": "string",
316
322
"maxLength": 64,
317
323
"description": "For `slide` and `jump`: the wind-up, played once."
318
324
},
319
325
"startMoveFrame": {
320
326
"type": "integer",
321
327
"minimum": 0,
322
328
"description": "For `jump`: the frame of the start animation at which the pet actually leaves the ground, so the launch matches the drawing."
323
329
}
324
330
},
325
331
"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."
326
332
},
327
333
"animation": {
328
334
"type": "object",
329
335
"required": [
330
336
"name",
331
337
"frames"
332
338
],
333
339
"properties": {
334
340
"name": {
335
341
"type": "string",
336
342
"maxLength": 64,
337
343
"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."
338
344
},
339
345
"frames": {
340
346
"type": "array",
341
347
"items": {
342
348
"ref": "#frame",
343
349
"type": "ref"
344
350
},
345
351
"minLength": 1
346
352
}
347
353
}
348
354
}
349
355
},
350
356
"$type": "com.atproto.lexicon.schema",
351
357
"lexicon": 1
352
358
}