@pietrovich/wot-utils 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -19
- package/dist/index.js +593 -204
- package/package.json +6 -3
- package/scripts/bake-color-dmg-fsr-vr-rld.sh +0 -81
- package/scripts/bake-pogs-clear.sh +0 -7
- package/scripts/bake-pogs-color-dmg-fsr-vr-rld.sh +0 -7
- package/scripts/baker-lib.sh +0 -165
- package/scripts/extract-atlas-assets.ps1 +0 -120
- package/scripts/extract-atlas-assets.sh +0 -116
- package/scripts/replace-suffixed-with-base.sh +0 -44
package/README.md
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
# pie-wot
|
|
2
2
|
|
|
3
|
-
A CLI toolkit for World of Tanks modders. Fetches
|
|
3
|
+
A CLI toolkit for World of Tanks modders. Fetches fresh vehicle data from the Wargaming API, manipulates DDS textures
|
|
4
|
+
and texture atlases, and generates custom icon sets — all from the terminal, no build step required.
|
|
4
5
|
|
|
5
|
-
The long-term goal is to make it trivial to maintain and publish a custom icon set: when new vehicles are added to
|
|
6
|
+
The long-term goal is to make it trivial to maintain and publish a custom icon set: when new vehicles are added to
|
|
7
|
+
the game or tank characteristics change, re-running a handful of commands should be enough to produce an updated,
|
|
8
|
+
publish-ready set. The [PogS icon set](https://github.com/pavelmaca/WoT-PogsIconSet) by @pavelmaca served as the reference implementation and first supported style.
|
|
6
9
|
|
|
7
|
-
## Pre-baked ready
|
|
10
|
+
## Pre-baked, ready-to-use sets
|
|
8
11
|
|
|
9
12
|
If you just want the icons without running the pipeline yourself, pre-baked sets are published periodically at [pietrovich/wot-pogs-like-icon-sets](https://github.com/pietrovich/wot-pogs-like-icon-sets) and kept in sync with game updates.
|
|
10
13
|
|
|
@@ -17,7 +20,7 @@ cp .env.example .env # add your WG_APP_ID
|
|
|
17
20
|
|
|
18
21
|
Get a free application ID at [developers.wargaming.net](https://developers.wargaming.net/).
|
|
19
22
|
|
|
20
|
-
> **Node.js ≥ 24**
|
|
23
|
+
> **Node.js ≥ 24** recommended. May work with older versions
|
|
21
24
|
|
|
22
25
|
## Uninstall
|
|
23
26
|
|
|
@@ -35,6 +38,9 @@ pie-wot vehicle stats # short-name character statistics
|
|
|
35
38
|
pie-wot vehicle best-config # best module configuration per vehicle
|
|
36
39
|
pie-wot vehicle chars # character distribution in short names
|
|
37
40
|
|
|
41
|
+
pie-wot game extract-icon-assets # extract battle atlas files from a WoT installation
|
|
42
|
+
pie-wot game extract-icons # (alias for extract-icon-assets)
|
|
43
|
+
|
|
38
44
|
pie-wot atlas inspect <map> # list texture names in an atlas XML
|
|
39
45
|
pie-wot atlas pick <map> <img> # extract a single named texture
|
|
40
46
|
pie-wot atlas extract # extract all textures to a directory
|
|
@@ -44,11 +50,11 @@ pie-wot dds decode <file> # decode a DDS texture to PNG
|
|
|
44
50
|
pie-wot dds encode <file> # encode a PNG to DXT5/BC3 DDS
|
|
45
51
|
|
|
46
52
|
pie-wot icon dump-background # generate per-type background images (PogS style)
|
|
47
|
-
pie-wot icon render <query> # render a vehicle icon
|
|
53
|
+
pie-wot icon render <query> # render a vehicle icon (use --simple for simplified variant)
|
|
48
54
|
|
|
49
55
|
pie-wot font render [font] [text] # render text as PNG using a pixel font
|
|
50
56
|
|
|
51
|
-
pie-wot cache purge # clear the local API response cache
|
|
57
|
+
pie-wot cache purge # clear the local WG API response cache
|
|
52
58
|
|
|
53
59
|
pie-wot bake <script> # run a bundled build script (see below)
|
|
54
60
|
```
|
|
@@ -71,6 +77,31 @@ Available scripts:
|
|
|
71
77
|
| `clear` | PogS clear variant (no colour background) |
|
|
72
78
|
| `color` | PogS colour variant with DMG/FSR/VR/RLD labels |
|
|
73
79
|
|
|
80
|
+
### Customizing battle atlases
|
|
81
|
+
|
|
82
|
+
To replace vehicle icons in the Player Panels on the battle screen, you need to work with the game's atlas files.
|
|
83
|
+
These are large texture sheets containing many icons packed together, defined by an XML location map.
|
|
84
|
+
|
|
85
|
+
**Step 1: Extract original atlases from the game installation**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pie-wot game extract-icon-assets /path/to/wot /path/to/atlas-work
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
This extracts four files and converts the DDS textures to PNG for easier manipulation:
|
|
92
|
+
- `battleAtlas.dds` (Player Panel icons)
|
|
93
|
+
- `battleAtlas.xml` (location map)
|
|
94
|
+
- `battleAtlas.dds` → `battleAtlas.png`
|
|
95
|
+
- `vehicleMarkerAtlas.dds` (vehicle marker icons)
|
|
96
|
+
- `vehicleMarkerAtlas.xml` (location map)
|
|
97
|
+
- `vehicleMarkerAtlas.dds` → `vehicleMarkerAtlas.png`
|
|
98
|
+
|
|
99
|
+
**Step 2–4: Split, replace, reassemble**
|
|
100
|
+
|
|
101
|
+
Use the XML files to split the atlases into individual icon pieces, replace them with your custom versions,
|
|
102
|
+
and reassemble into new atlases. The final PNG can be saved with a `.dds` extension — the game will load
|
|
103
|
+
PNG-compressed assets transparently, giving you better quality than DDS without needing to encode to DXT5.
|
|
104
|
+
|
|
74
105
|
## Development
|
|
75
106
|
|
|
76
107
|
### Running from source
|
|
@@ -83,19 +114,6 @@ npm start -- <command>
|
|
|
83
114
|
npm start -- vehicle list
|
|
84
115
|
```
|
|
85
116
|
|
|
86
|
-
### LOCAL_DEV
|
|
87
|
-
|
|
88
|
-
The bundled baker scripts (`scripts/`) detect whether the `pie-wot` global binary is available and use it by default. Set `LOCAL_DEV=true` in your `.env` (or environment) to force them to use `npm start` from the local clone instead:
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
LOCAL_DEV=true
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
This is useful when iterating on the CLI itself — changes to `src/` take effect immediately without a publish/reinstall cycle.
|
|
95
|
-
|
|
96
|
-
## How it works
|
|
97
|
-
|
|
98
|
-
API responses are cached locally (SHA-256 keyed, no TTL) so repeated runs don't hammer the Wargaming API. DDS encode/decode uses a trimmed BC1/BC3 codec derived from [photopea/UTEX.js](https://github.com/photopea/UTEX.js). Image compositing uses [sharp](https://sharp.pixelplumbing.com/).
|
|
99
117
|
|
|
100
118
|
## Credits
|
|
101
119
|
|