@adatechnology/game-characters

中文文档
0.2.11发布于 2026/11/06MITTypeScriptES Module构建来源已验证近 30 天下载 4102

Engine-agnostic living bodies for games: body proportions, rig, an 11-kind segment tree with 6 crowd regions, and a damage model (protection, penetration, severity, dismemberment, death, bleeding) as a DestructibleImpl. Deterministic. Knows nothing about

原始使用文档

@adatechnology/game-characters

Living bodies for games, without an engine. Proportions (GUIDE, TEAM_GAME), a rig of 17 joints, the 17-segment tree (the 11 Arsenal kinds) with the 6 crowd regions of the game, preset registries filled by content packs, and the damage model as a DestructibleImpl: protection, penetration (physical P = √(E·m/A), or the game's team-game points), severity per segment, dismemberment, death rules and bleeding as leak events. Engine units: joules, metres, seconds. Knows nothing about any game.

import { createCharacters } from '@adatechnology/game-characters'

const kit = createCharacters()
const person = kit.create({ seed: 1, kind: 'person' })
person.segments // 17 segments with hit points and status
person.state().body // { alive, vitality, missing, limp, crawl }
person.hit({ type: 'ballistic', point: [0, 1.7, 0], direction: [0, 0, -1], energy: 500, mass: 7.5, caliber: 9 }) // destruction events
person.lastHit // { points, killed, headshot, through, exitEnergy }

Plain script: dist/index.global.js exposes the GameCharacters global.

Pose clips

Keyframed poses over the joint names of the rich body (lean, twist, side, drop, headX/Y/Z, armR/L, elbR/L, armRz/Lz, legL/R, kneeL/R). samplePoseClip(clip, t) is the Bestiário's sample (find the segment, clamp, smoothstep, lerpPose); clipEventsBetween(clip, t0, t1) gives the events crossed in (t0, t1] (impact for "the blow lands now", phase with a locale key). channels says what a clip drives: full, upper (the legs keep walking) or lower. POSE_CLIPS has the two clips of the "grab and bite" scene (grabbed_bitten_human, grab_bite_zombie, with x and run as extra channels), texts in POSE_CLIP_LOCALES (pt-BR, en). A game adds or replaces clips with createPoseClipRegistry(POSE_CLIPS).register(clip).

import { POSE_CLIPS, createPoseClipRegistry, samplePoseClip } from '@adatechnology/game-characters'

const clips = createPoseClipRegistry(POSE_CLIPS)
samplePoseClip(clips.get('grabbed_bitten_human')!, 2.5) // { lean, headY, armL, ... }

Clip format (JSON). A team can add clips, attacks included, as data and register them; the core has no clip of its own beyond the two Bestiário ones.

{
  "id": "my_clip", "duration": 1.2, "loop": false, "channels": "upper",
  "keys": [{ "t": 0, "pose": { "armR": -0.1 } }, { "t": 0.4, "pose": { "armR": -1.6, "lean": 0.3 } }, { "t": 1.2, "pose": { "armR": -0.1 } }],
  "events": [{ "t": 0.4, "type": "impact", "data": { "kind": "blow" } }]
}

Event types: impact is the moment the blow, bite or hit lands (the game applies the damage when it fires); phase carries data.label, a locale key. Any other type is the game's. clipEventsBetween returns an event once, for the interval it falls in (t0, t1].

版本与发布记录

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

版本发布日期距今
0.2.11latest2026/11/06今天
0.2.102026/11/042 天前
0.2.92026/11/042 天前
0.2.82026/11/042 天前
0.2.72026/11/033 天前
0.2.62026/11/015 天前

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

@adatechnology/game-characters 是什么?

Engine-agnostic living bodies for games: body proportions, rig, an 11-kind segment tree with 6 crowd regions, and a damage model (protection, penetration, severity, dismemberment, death, bleeding) as a DestructibleImpl. Deterministic. Knows nothing about

如何安装 @adatechnology/game-characters?

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

@adatechnology/game-characters 支持 TypeScript 吗?

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

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

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

@adatechnology/game-characters 可以商用吗?

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

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

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

@adatechnology/game-characters 还在维护吗?

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