@adatechnology/game-items-goods

中文文档
0.3.11发布于 2026/11/08MITTypeScriptES Module构建来源已验证近 30 天下载 2914

Catalog of real-world items for @adatechnology/game-items: 327 items with real size and weight, categories, places, rarities, storage, recipes, containers, house pools, depletion and spawn numbers, use effects, ammo boxes and pt-BR and en texts. Generated

原始使用文档
文档目录7 节
  1. Install
  2. Usage
  3. What is in it
  4. Where the items come from
  5. Adding an item
  6. Português
  7. Tests

@adatechnology/game-items-goods

Catalog of real-world items for @adatechnology/game-items: 327 items with their true size (metres) and weight (kg), plus everything the engine needs to use them (17 categories, 24 places, 17 containers, 6 rarities, 7 storage kinds, 33 recipes, 9 use effects, the explicit pools of the house furniture, depletion and spawn numbers, ammo boxes, melee reach and noise) and the texts in pt-BR (the team's own names) and en. It is data and a thin typed wrapper: no logic, no renderer, no game.

The data is generated by tools/items-catalog from the Vale Cinzento delivery (Itens page, the game, the 3D house viewer) and the household items of the SDK; do not edit src/data/*.json by hand (except src/data/locales/en.json, the English translation, kinds.json, item-contracts.json and known-gaps.json, which are kept by hand; what the kinds add to each item lives in tools/items-catalog/kinds-overlay.json). Run pnpm --filter @adatechnology/items-catalog-tool catalog after changing decisions.json.

Install

pnpm add @adatechnology/game-items @adatechnology/game-items-goods

A plain <script src=".../dist/index.global.js"> exposes the GameItemsGoods global (the engine bundled in).

Usage

import { createGoodsItems, goodsPack, GOODS_STRINGS, goodsText } from '@adatechnology/game-items-goods'
import { createItems, createFindsProvider } from '@adatechnology/game-items'

const items = createGoodsItems({ patch: { canned_beans: { weight: 0.5 } }, remove: ['dvd'] })   // goods first, then your packs and options
// the same, by hand: createItems({ packs: [goodsPack, myPack], ... })
items.get('hammer').size                       // [w, h, d] in metres
createFindsProvider(items).findsFor({ place: 'house', container: 'fridge', state: 'normal', rng, day: 0 })

goodsText('item.canned_beans', 'pt-BR')        // 'Feijão em lata'
GOODS_STRINGS.en['place.pharmacy']             // 'Pharmacy'

What is in it

ExportContent
goodsPack, createGoodsItems(options?)the ItemPack (items, categories, places, containers, use effects, recipes, pools) and createItems with it first
GOODS_ITEMS, GOODS_CATEGORIES, GOODS_PLACES, GOODS_CONTAINERS, GOODS_RECIPES, GOODS_USE_EFFECTSthe typed data
GOODS_HOUSE_POOLSexplicit pools by the 3D viewer's furniture key, plus the keys that share a pool
GOODS_TABLESrarities, storage, depletion, spawn numbers and melee stats as read (the DEFAULT_RULES of the engine are proven equal to them by test)
GOODS_ARSENAL_RECORDSammo boxes, three firearms and two throwables of the game's EXTRA, for itemsFromArsenal(arsenal, { records })
GOODS_PROVENANCEper item: the team id, the household id, the viewer pool types, the game ids, and where the id and the measure come from
GOODS_KINDS, createGoodsKinds(options?), checkGoodsItems(options?), ITEM_CONTRACTS, createItemContracts(options?), GOODS_KNOWN_GAPSthe tree of kinds, its registry, the validator over the catalog, the contract checkers and the allowed gaps
GOODS_STRINGS, goodsText(key, locale?), pickGoodsLocaletexts by key: item.<id>, kind.<id>, kind.<id>.description, category.<id>, place.<id>, rarity.<id>, container.<id>, recipe.<id>

Where the items come from

327 = 245 of the team (the other 12 team items are story items that belong to the game) + 54 household items with no team equivalent + 28 items the catalog needed (pool entries and recipe terms the sources lacked). 38 household items were merged with their team equivalent and keep the household id. Measures are the household's where it had one, the model box times a real scale for the 24 modelled items, and a reference measure for the rest (provenance.sizeSource). Story items (diary, military map, evacuation order...) are not here: they live in the game's slice.

Adding an item

Every item has a kind (src/data/kinds.json, a tree: item > consumable > food_ready > canned_food, item > equipment > electronics...). The kind carries the defaults (parts and materials, impact response, use animation and sounds, leftover, raw effect...) and the contracts the item must meet (physical, destructible, impact, edible, use_animation, leftover, preparation, recipe_input, liquid_container, heat_resistant, weapon, wearable, battery: see src/contracts.ts). An item declares only what differs from its kind.

  1. Pick the closest kind (createGoodsKinds().ids(); each has a name and description in the locales as kind.<id>). Tuning a kind (say metal_can) changes every item of it.
  2. Add the item the way tools/items-catalog says (an extraItems decision plus its dimensions), and give it a row in tools/items-catalog/kinds-overlay.json: { "kind": "canned_food", ...only what differs }. The generator refuses an item without a row. A real-world value you filled in for lack of a team number goes in the row's "estimated": ["field", ...] list: it means "estimated from the real world, the teams may adjust it".
  3. Regenerate (pnpm --filter @adatechnology/items-catalog-tool catalog) and run pnpm check:items: it prints every problem (for example "x" (canned_food): missing nutrition, required by food_ready) and exits non-zero. known-gaps.json lists the few gaps allowed so far; it only shrinks (a test fails when a gap stops applying, and caps its size), so a new item has to meet its kind.
  4. A new kind, or a parent inserted between two kinds, is data too, never a change of the engine:
import { checkGoodsItems, createGoodsKinds } from '@adatechnology/game-items-goods'

const kinds = createGoodsKinds({
  extra: [{ id: 'sealed_can', extends: 'food_ready', defaults: { impact: { response: 'dent', pushImpulse: true, shed: false } } }],   // a new kind...
  patches: { canned_food: { extends: 'sealed_can' } },                                                                              // ...inserted above canned_food
})
const report = checkGoodsItems({ kinds, entries: myItems })    // { ok, problems, allowed }

Português

Adicionando um item. Todo item tem um kind (src/data/kinds.json, uma árvore). O kind traz os padrões (partes, impacto, animação de uso, sobra, efeito cru) e os contratos que o item tem de cumprir; o item só declara o que muda. Escolha o kind mais próximo, dê ao item uma linha em tools/items-catalog/kinds-overlay.json ("estimated": [...] marca o que foi estimado do mundo real e os times podem ajustar), regenere o catálogo e rode pnpm check:items: ele lista cada problema e sai com erro. Kind novo, ou um pai inserido no meio, é dado (extra e patches de createGoodsKinds), não mudança de motor.

Tests

pnpm --filter @adatechnology/game-items-goods test: the pack validates in createItems, ids are unique and English, every reference (category, place, rarity, pool, recipe, effect) exists, provenance covers every item, every key has a text in both languages. The tool's own tests prove the data against the team sources.

版本与发布记录

@adatechnology/game-items-goods 共发布 25 个版本,首次发布于 2026/10/24;过去 12 个月发布了 25 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.3.11latest2026/11/08今天
0.3.102026/11/07今天
0.3.92026/11/07今天
0.3.82026/11/07今天
0.3.72026/11/071 天前
0.3.62026/11/061 天前

关于 @adatechnology/game-items-goods 的常见问题

@adatechnology/game-items-goods 是什么?

Catalog of real-world items for @adatechnology/game-items: 327 items with real size and weight, categories, places, rarities, storage, recipes, containers, house pools, depletion and spawn numbers, use effects, ammo boxes and pt-BR and en texts. Generated

如何安装 @adatechnology/game-items-goods?

在项目目录运行 npm install @adatechnology/game-items-goods,或使用 pnpm add / yarn add / bun add。

@adatechnology/game-items-goods 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@adatechnology/game-items-goods 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@adatechnology/game-items-goods 可以商用吗?

@adatechnology/game-items-goods 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@adatechnology/game-items-goods 的下载量有多少?

根据 npm 官方下载统计,@adatechnology/game-items-goods 在 2026/10/05 – 2026/11/03 这 30 天内被下载 2,914 次,日均约 97 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adatechnology/game-items-goods 还在维护吗?

最新版本 0.3.11 发布于 2026/11/08(今天);至今共发布 25 个版本,其中过去 12 个月发布了 25 个;首次发布于 2026/10/24。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。