eve-fit-engine

中文文档
0.2.20发布于 2026/11/03GPL-3.0-or-laterTypeScriptESM + CJS零依赖

Pyfa-parity EVE Online ship & structure fitting calculation engine. Inject an SDE dataset + a fit, get the full derived stat block (offense, defense, capacitor, navigation, targeting, fitting, projected, structure).

原始使用文档
文档目录8 节
  1. Design
  2. Install
  3. Usage — zero-config (Node, batteries-included)
  4. Usage — bring-your-own dataset (browser / custom / always-f…
  5. What's NOT in this package
  6. Provenance / how parity is maintained
  7. Contributing
  8. Licence

Capsuleers emblem

eve-fit-engine

A Pyfa-parity EVE Online ship & Upwell-structure fitting calculation engine, extracted from capsuleers.app. Given a fit and an SDE dataset, it returns the full derived stat block you'd see in a fitting tool: offense (DPS / alpha / application), defense (EHP / resists / tank), capacitor (stability / sim), navigation, targeting, fitting (CPU / PG / calibration), projected effects, and structure fuel/service stats.

Licence: GPL-3.0-or-later. This engine is a derivative work of pyfa-org/Pyfa and is distributed under the same terms. See NOTICE and LICENSE. The complete corresponding source is this repository.

Design

  • Framework-free core. The base entry has no fetch, no fs, no window, no npm runtime deps. Runs in the browser, in Node, in a worker — anywhere.
  • Two entries. Base (.): inject your own FittingDataset. Node (./node): batteries-included — bundles a snapshot of the EVE SDE (under CCP's licence, by mere aggregation) + an fs loader, so it works out of the box on the server.
  • Validated against Pyfa two ways.
    • Fixture suite — npm run test:pyfa: 662 hand-curated assertions against Pyfa screenshots, All-V skills, zero tolerance overrides. This is the release gate and the engine's correctness ground truth.
    • Differential harness — npm run diff: generates 4 fits for every published ship and compares every stat against a headless pyfa-org/Pyfa oracle. 1662/1676 fits (99.2%) match exactly; the residual is a documented set of pyfa float/modelling/per-ship quirks (see test/diff/known-diffs.mjs). Exits 0 on no unexpected diffs; --strict re-lists the accepted set as failures.

Install

npm install eve-fit-engine

Usage — zero-config (Node, batteries-included)

The /node entry ships with the EVE SDE bundle (data/, ~8 MB) and a built-in loader. Give it an EFT string, get full stats — nothing else to set up:

import { computeFromEft } from 'eve-fit-engine/node'

const { fit, warnings, computed } = await computeFromEft(`
[Rifter, My Fit]
200mm AutoCannon II, Republic Fleet EMP S
200mm AutoCannon II, Republic Fleet EMP S
1MN Afterburner II
Gyrostabilizer II
`)

console.log(computed.derived.offense.totalDps)              // 197.6
console.log(computed.derived.defense.ehpTotalAgainstProfile)
console.log(computed.derived.navigation.maxVelocity)

Defaults to All-V skills; pass { skillProfile, damageProfile, targetProfile, … } as the second arg to override. loadBundledDataset() is also exported if you want the dataset directly.

The bundled SDE is CCP's, under CCP's EVE Online Developer License (see data/SDE-LICENSE.md) — included by mere aggregation, NOT under this package's GPL.

Usage — bring-your-own dataset (browser / custom / always-fresh SDE)

The base entry is environment-free (no fs, no bundled data). Inject a FittingDataset you build however you like:

import { computeFit, parseEft, type FittingDataset } from 'eve-fit-engine'

const dataset: FittingDataset = await buildYourDataset()   // your SDE bundle
const { fit } = parseEft(eftText, dataset)
const computed = computeFit(fit, dataset, { skillProfile /* … */ })

This is what capsuleers.app uses server-side: it builds its own always-fresh bundle and injects it, so it never depends on the (snapshot) bundled data.

What's NOT in this package

  • 3D ship models, UI components — those live in the consuming application.
  • The bundled SDE is a snapshot; for always-fresh data, inject your own via the base entry (see above).

Provenance / how parity is maintained

The engine mirrors Pyfa's eos calculation model: effect handlers keyed by EVE dogma effect IDs, stacking-penalty pools, a late-runtime resistance-adaptation pass, a discrete capacitor simulation (faithful port of eos/capSim.py — integer cycle times, turret-volley vs staggered drains, cap-booster injection), and spool-up handling. When CCP ships a new SDE, data-driven modifierInfo effects work automatically; new hardcoded mechanics in Pyfa's effects.py are tracked and ported, then re-checked against both the fixture suite (npm run test:pyfa) and the per-ship differential harness (npm run diff) before release. See MAINTENANCE.md for the update flows.

Releases follow two CI paths, both gated on parity + coverage: daily SDE-bundle refreshes auto-publish a patch when CCP's data changes and parity stays green (sde-refresh workflow), while code-only fixes ship via a manual workflow_dispatch release (engine changes don't touch data/, so they never trigger the data path). See RELEASE.md.

Contributing

See CONTRIBUTING.md — the step-by-step guide to setup, every internal command, the two validation suites (npm run test:pyfa + npm run diff), how to add fixtures / port effects, the pyfa-pin recalibration flow, and the project's hard rules.

Licence

GPL-3.0-or-later. Copyright (C) 2026 Capsuleers.app. This is free software; see LICENSE for details.

版本与发布记录

eve-fit-engine 共发布 56 个版本,首次发布于 2026/06/02;过去 12 个月发布了 56 个版本。

版本发布日期距今
0.2.20latest2026/11/03今天
0.2.192026/11/021 天前
0.2.182026/10/313 天前
0.2.172026/10/304 天前
0.2.162026/10/286 天前
0.2.152026/10/277 天前

关于 eve-fit-engine 的常见问题

eve-fit-engine 是什么?

Pyfa-parity EVE Online船舶与结构装配计算引擎。注入一个SDE数据集+一个匹配,获得完整的派生属性块(进攻,防御,电容,导航,瞄准,匹配,投影,结构)。

如何安装 eve-fit-engine?

在项目目录运行 npm install eve-fit-engine,或使用 pnpm add / yarn add / bun add。

eve-fit-engine 支持 TypeScript 吗?

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

eve-fit-engine 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

eve-fit-engine 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

eve-fit-engine 可以商用吗?

eve-fit-engine 使用 GPL-3.0-or-later 许可。强 Copyleft:分发包含该代码的软件时,整个作品需以 GPL-3.0 兼容许可开源,并附带专利与反锁定条款。仅内部使用不触发此义务。以上为概括,不构成法律意见,请以许可原文为准。

eve-fit-engine 还在维护吗?

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