@firestone-hs/simulate-bgs-battle

中文文档
1.1.779发布于 2026/11/12All rights reservedTypeScriptCommonJS近 30 天下载 8684
 npm install
 npm run test-board
原始使用文档

Test it

npm install
npm run test-board

Then you can just modify the test/full-game/game3.json file to change the boards initial compositions.

Get a board state from the app

Look for the MainWindow.html.log file located in %localappdata%\Overwolf\Log\Apps\Firestone. Do a search for [bgs-simulation] battle simulation request prepared, and this line should log the full JSON that you can use as an input (typically, this is what you put in the game3.json file referenced above).

Check a simulation output

You first need to download, build and run a local instance of Coliseum

Then, at the end of the test (e.g. full-test.test mentioned above), add / uncomment these lines:

const sample = simulationResult.outcomeSamples.lost[0];
const base64 = encode(JSON.stringify(sample));

(using won or tied instead of lost if that's what you're looking for).

A big base64 string will be output to the console.

Copy it, and open a new tab in your navigator at the following URL: file:///<path_to_your_coliseum_repo>/dist/index.html?bgsSimulation=<the_big_base64_string. It will then replay the simulation.

Deploy

npm run build && npm run package && npm run deploy

rm -rf dist && tsc && rm -rf dist/node_modules && 'cp' -rf dist/ /e/Source/zerotoheroes/firestone/node_modules/\@firestone-hs/simulate-bgs-battle/
rm -rf dist && tsc && rm -rf dist/node_modules && 'cp' -rf dist/ /e/Source/zerotoheroes/coliseum/node_modules/\@firestone-hs/simulate-bgs-battle/
rm -rf dist && tsc && rm -rf dist/node_modules && 'cp' -rf dist/ /e/Source/zerotoheroes/firestone-libs/node_modules/\@firestone-hs/simulate-bgs-battle/
rm -rf dist && tsc && rm -rf dist/node_modules && npm publish

Profiling

To profile a Node.js application using Chrome's DevTools, you can use the --inspect and --inspect-brk flags when running your script. Here's how you can do it:

  1. Run your script with the --inspect-brk flag. This will start the inspector and pause execution until you connect with the debugger.
node --inspect-brk -r ts-node/register test/full-game/full-test.ts
  1. Open Chrome and navigate to chrome://inspect.
  2. Click on the "Open dedicated DevTools for Node" link. This will open a new DevTools window.
  3. In the DevTools window, click on the "Performance" tab.
  4. Click on the "Start" button to start profiling.
  5. Once your script finishes executing, go back to the DevTools window and click on the "Stop" button to stop profiling.
  6. You can now analyze the CPU profile in the DevTools window.

Remember to replace node with npx ts-node if you're using TypeScript without compiling to JavaScript first.

Reference

Used this project as template: https://github.com/alukach/aws-sam-typescript-boilerplate

TODO

Some things are not done yet:

  • Some edge cases about minions spawning order, which won't be tackled for now
  • There's no guide on how to use it (either as a standalone package or via an API). Ping me if you'd like to use it

版本与发布记录

@firestone-hs/simulate-bgs-battle 共发布 773 个版本,首次发布于 2020/03/26;过去 12 个月发布了 122 个版本。

版本发布日期距今
1.1.779latest2026/11/122 天前
1.1.7782026/11/113 天前
1.1.7772026/11/0311 天前
1.1.7762026/11/0212 天前
1.1.7742026/10/2422 天前
1.1.7732026/10/1629 天前

关于 @firestone-hs/simulate-bgs-battle 的常见问题

@firestone-hs/simulate-bgs-battle 是什么?

npm install npm run test-board

如何安装 @firestone-hs/simulate-bgs-battle?

在项目目录运行 npm install @firestone-hs/simulate-bgs-battle,或使用 pnpm add / yarn add / bun add。

@firestone-hs/simulate-bgs-battle 支持 TypeScript 吗?

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

@firestone-hs/simulate-bgs-battle 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@firestone-hs/simulate-bgs-battle 可以商用吗?

@firestone-hs/simulate-bgs-battle 使用 All rights reserved 许可。声明的许可为 All rights reserved,请阅读许可原文确认使用条件。以上为概括,不构成法律意见,请以许可原文为准。

@firestone-hs/simulate-bgs-battle 的下载量有多少?

根据 npm 官方下载统计,@firestone-hs/simulate-bgs-battle 在 2026/10/15 – 2026/11/13 这 30 天内被下载 8,684 次,日均约 289 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@firestone-hs/simulate-bgs-battle 还在维护吗?

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