@medieval-kit/registry 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Medieval Kit
2
2
 
3
3
  A lowpoly medieval model library for [Vibe3D](https://github.com/vibe-stack/vibe3d)
4
- and Three.js. Install a prop and you own its source: readable TypeScript in your
5
- own tree, not an opaque package boundary.
4
+ and Three.js. Installing a prop puts its source in your own tree, as readable
5
+ TypeScript you can edit.
6
6
 
7
7
  ![The whole kit in one scene](https://medieval.crt.fyi/kit.png)
8
8
 
@@ -35,8 +35,8 @@ so without it the source you just installed does not typecheck.
35
35
  }
36
36
  ```
37
37
 
38
- That map is how the namespace resolves `vibe3d add` stops with
39
- `Registry @medieval-kit is not configured in models.json` without it.
38
+ That map is how the namespace resolves. Without it `vibe3d add` stops with
39
+ `Registry @medieval-kit is not configured in models.json`.
40
40
 
41
41
  Then take one model, or the lot:
42
42
 
@@ -49,7 +49,7 @@ bunx vibe3d add @medieval-kit
49
49
 
50
50
  The installed source imports through the `@/` alias that `models.json` declares,
51
51
  and it imports `.ts` files by their extension. Both have to be true on your side
52
- as well in `tsconfig.json`:
52
+ as well. In `tsconfig.json`:
53
53
 
54
54
  ```json
55
55
  {
@@ -61,11 +61,11 @@ as well — in `tsconfig.json`:
61
61
  }
62
62
  ```
63
63
 
64
- No `baseUrl`: it was removed in TypeScript 7 and `paths` resolves relative to
64
+ No `baseUrl`. It was removed in TypeScript 7, and `paths` resolves relative to
65
65
  this file on its own. Verified against a clean project on 7.0.2.
66
66
 
67
- and in your bundler, because TypeScript's `paths` only teaches the type checker.
68
- For Vite:
67
+ The alias has to be set in your bundler too, because TypeScript's `paths` only
68
+ teaches the type checker. For Vite:
69
69
 
70
70
  ```ts
71
71
  resolve: { alias: [{ find: '@', replacement: fileURLToPath(new URL('./src', import.meta.url)) }] }
@@ -74,7 +74,7 @@ resolve: { alias: [{ find: '@', replacement: fileURLToPath(new URL('./src', impo
74
74
  ## Models
75
75
 
76
76
  37 models and one shared lib. Addresses are `@medieval-kit/<id>`. This table is
77
- generated from the models themselves with `bun scripts/catalog-table.ts` — a
77
+ generated from the models themselves with `bun scripts/catalog-table.ts`. A
78
78
  hand-written list goes stale on the first model you add, and this one already
79
79
  did once.
80
80
 
@@ -118,7 +118,7 @@ did once.
118
118
  | `market-stall` | Structure | 384 | 4 | 1.83×2.03×0.97 | oak, cloth | |
119
119
  | `post-mill` | Structure | 1672 | 4 | 6.60×7.23×6.98 | oak, iron | ✔ |
120
120
 
121
- **30 390 triangles** in total. The whole kit in one scene costs less than a
121
+ **39 518 triangles** in total. The whole kit in one scene costs less than a
122
122
  single mid-complexity character model.
123
123
 
124
124
  Every model depends on `@medieval-kit/core`, a shared support item holding the
@@ -156,7 +156,7 @@ Each model follows the Vibe3D protocol:
156
156
 
157
157
  - **`root`** keeps its object identity for the model's whole lifetime.
158
158
  - **`parts`** expose stable semantic anchors. Attach your own lights, labels, or
159
- gameplay objects to `part.anchor` they survive `configure()`, because only
159
+ gameplay objects to `part.anchor`. They survive `configure()`, because only
160
160
  `part.content` is rebuilt.
161
161
  - **`materials`** resolve per slot and can be overridden. Materials you supply
162
162
  are borrowed: the model never disposes them.
@@ -189,24 +189,23 @@ difference.
189
189
 
190
190
  | Slot | What it covers | Why it is separate |
191
191
  | --- | --- | --- |
192
- | `oak` | timber | |
192
+ | `oak` | timber | the baseline everything else is measured against |
193
193
  | `iron` | forged iron, oxidised and matte | separate from `steel`: the difference is not in colour but in ROUGHNESS, and vertex colour cannot carry roughness |
194
194
  | `steel` | steel polished by use | the anvil face, the shovel blade, the pitchfork tines |
195
195
  | `brass` | bronze and copper | the bell, the coins |
196
196
  | `straw` | straw, wicker, broom bristle | a bale declaring itself "oak" would be a lie told to the consumer |
197
- | `cloth` | linen, sackcloth, rope | |
198
- | `leather` | worked leather | |
197
+ | `cloth` | linen, sackcloth, rope | woven, so it takes light softly and never glints |
198
+ | `leather` | worked leather | darker and glossier than cloth at the same colour |
199
199
  | `glass` | blown glass | transparent, `depthWrite` OFF, `DoubleSide` |
200
200
  | `produce` | fruit and vegetable skin | given straw's roughness, an apple would look like dry grass |
201
- | `ember` | flame | `MeshBasicMaterial` it does not receive light, it emits |
202
- | `char` | charcoal and pitch | |
201
+ | `ember` | flame | `MeshBasicMaterial`: it does not receive light, it emits |
202
+ | `char` | charcoal and pitch | the darkest thing in the kit, and it has to stay readable against shadow |
203
203
  | `water` | standing water | a thin transparent film over whatever holds it: in the reference trough the basin reads hue 39.5, which is the hue of the STONE underneath, so it works through opacity rather than colour |
204
204
  | `stone` | dressed and rubble masonry | its colour is close to weathered oak; what separates them at a glance is that stone scatters light completely flat, and roughness is not something vertex colour can carry |
205
205
 
206
206
  `ember` also acts as a rule in two places: bodies in that slot are skipped
207
- entirely while ambient occlusion and mottle are baked. The reason is simple
208
- in an unlit material the vertex colour *is* the final colour, so darkening it
209
- puts the flame out. The rule is attached to the slot itself rather than to a
207
+ entirely while ambient occlusion and mottle are baked. The reason is simple: in an unlit material the vertex colour *is* the final
208
+ colour, so darkening it puts the flame out. The rule is attached to the slot itself rather than to a
210
209
  per-model flag, so it cannot be forgotten.
211
210
 
212
211
  Colour variation lives in the geometry, not in the materials: each of the
@@ -222,12 +221,12 @@ bunx vibe3d registry validate dist/registry.json
222
221
 
223
222
  The build walks `models/`. A folder containing `model.ts` becomes a
224
223
  `vibe3d:model`; any other folder becomes a `vibe3d:lib`. Registry dependencies
225
- are derived from the source an import from `../core/` makes
224
+ are derived from the source. An import from `../core/` makes
226
225
  `@medieval-kit/core` a dependency automatically, so there is no hand-maintained
227
226
  list to go stale.
228
227
 
229
228
  `drafts/` is deliberately outside that walk: the code is kept in the tree but
230
- never reaches the published package including its own `drafts/README.md`,
229
+ never reaches the published package, including its own `drafts/README.md`,
231
230
  which is why this sentence does not link to it. A relative link on an npm
232
231
  package page resolves against the repository, and there is nothing at the
233
232
  other end of it for a reader of this page.