npm.io
0.3.0 • Published 2d agoCLI

@pietrovich/wot-utils

Licence
Version
0.3.0
Deps
11
Size
352 kB
Vulns
0
Weekly
0

pie-wot

A CLI toolkit for World of Tanks modders. Fetches fresh vehicle data from the Wargaming API, manipulates DDS textures and texture atlases, and generates custom icon sets — all from the terminal, no build step required.

The long-term goal is to make it trivial to maintain and publish a custom icon set: when new vehicles are added to the game or tank characteristics change, re-running a handful of commands should be enough to produce an updated, publish-ready set. The PogS icon set by @pavelmaca served as the reference implementation and first supported style.

Pre-baked, ready-to-use sets

If you just want the icons without running the pipeline yourself, pre-baked sets are published periodically at pietrovich/wot-pogs-like-icon-sets and kept in sync with game updates.

Install

npm install -g @pietrovich/wot-utils
cp .env.example .env  # add your WG_APP_ID

Get a free application ID at developers.wargaming.net. WG_APP_ID accepts a comma-separated list of IDs — requests are round-robined across them to spread load across multiple quotas.

Node.js ≥ 24 recommended. May work with older versions

Uninstall

npm uninstall -g @pietrovich/wot-utils

Commands

pie-wot vehicle list              # list vehicles from the WG encyclopedia (table)
pie-wot vehicle export            # save full vehicle data to JSON
pie-wot vehicle fetch-icons       # download official vehicle icons
pie-wot vehicle stats             # short-name character statistics
pie-wot vehicle best-config       # best module configuration per vehicle
pie-wot vehicle chars             # character distribution in short names

pie-wot game extract-icon-assets  # extract battle atlas files from a WoT installation
pie-wot game extract-icons        # (alias for extract-icon-assets)

pie-wot atlas inspect <map>       # list texture names in an atlas XML
pie-wot atlas pick <map> <img>    # extract a single named texture
pie-wot atlas extract             # extract all textures to a directory
pie-wot atlas pack                # pack a directory of PNGs into a texture atlas

pie-wot dds decode <file>         # decode a DDS texture to PNG
pie-wot dds encode <file>         # encode a PNG to DXT5/BC3 DDS

pie-wot icon dump-background      # generate per-type background images (PogS style)
pie-wot icon render <query>       # render a vehicle icon (use --simple for simplified variant)

pie-wot font render [font] [text] # render text as PNG using a pixel font

pie-wot cache purge               # clear the local WG API response cache
pie-wot cache warm                # pre-fetch vehicle + profile data into the cache

pie-wot bake <script>             # run a bundled build script (see below)

Vehicle commands accept --app-id <id> (overrides WG_APP_ID) and --no-cache.

cache warm accepts --batch-size <n> (vehicles fetched per batch, default 1) and --delay <seconds> (pause after a failed request, default 60).

bake

Runs a bundled shell script that drives the full icon-bake pipeline. All arguments after the script name are forwarded to the script unchanged.

pie-wot bake clear --src ./in/wot-2.3/ --out ./out/clear
pie-wot bake color --src ./in/wot-2.3/ --out ./out/color

Available scripts:

Name Description
clear PogS clear variant (no colour background)
color PogS colour variant with DMG/FSR/VR/RLD labels
Customizing battle atlases

To replace vehicle icons in the Player Panels on the battle screen, you need to work with the game's atlas files. These are large texture sheets containing many icons packed together, defined by an XML location map.

Step 1: Extract original atlases from the game installation

pie-wot game extract-icon-assets /path/to/wot /path/to/atlas-work

This extracts four files and converts the DDS textures to PNG for easier manipulation:

  • battleAtlas.dds (Player Panel icons)
  • battleAtlas.xml (location map)
  • battleAtlas.ddsbattleAtlas.png
  • vehicleMarkerAtlas.dds (vehicle marker icons)
  • vehicleMarkerAtlas.xml (location map)
  • vehicleMarkerAtlas.ddsvehicleMarkerAtlas.png

Step 2–4: Split, replace, reassemble

Use the XML files to split the atlases into individual icon pieces, replace them with your custom versions, and reassemble into new atlases. The final PNG can be saved with a .dds extension — the game will load PNG-compressed assets transparently, giving you better quality than DDS without needing to encode to DXT5.

Development

Running from source

No build step needed — tsx runs TypeScript directly:

npm start -- <command>
# e.g.
npm start -- vehicle list

Credits


GL, HF

wtfpl-badge-2.png