Compare commits

...
180 Commits
Author SHA1 Message Date
TrèsAbhi 661aeb5067 New translations en.json (Russian)
[ci skip]
2026-12-04 19:54:13 -06:00
TrèsAbhi cb106d5ed9 New translations en.json (French)
[ci skip]
2026-12-04 17:31:07 -06:00
TrèsAbhi 3e3763a928 New translations en.json (Chinese Simplified)
[ci skip]
2026-12-04 01:32:35 -06:00
TrèsAbhi 471e036072 New translations en.json (Portuguese)
[ci skip]
2026-12-04 01:32:34 -06:00
TrèsAbhi b59365d5d3 New translations en.json (Polish)
[ci skip]
2026-12-04 01:32:32 -06:00
TrèsAbhi fa6a6dee8d New translations en.json (Japanese)
[ci skip]
2026-12-04 01:32:31 -06:00
TrèsAbhi fe7671f276 New translations en.json (French)
[ci skip]
2026-12-04 01:32:30 -06:00
TrèsAbhi d9e58bd6f5 New translations en.json (Ukrainian)
[ci skip]
2026-12-04 01:32:28 -06:00
TrèsAbhi f070641019 New translations en.json (Russian)
[ci skip]
2026-12-04 01:32:26 -06:00
TrèsAbhi 6edaf587a0 New translations en.json (Spanish)
[ci skip]
2026-12-04 01:32:25 -06:00
TrèsAbhi cf1640e042 New translations en.json (Ukrainian)
[ci skip]
2026-12-02 19:55:20 -06:00
TrèsAbhi 09af25819c New translations en.json (Ukrainian)
[ci skip]
2026-12-02 18:53:13 -06:00
TrèsAbhi 86391bd9d0 New translations en.json (Ukrainian)
[ci skip]
2026-12-02 17:55:38 -06:00
TrèsAbhi c71b41b848 New translations en.json (Russian)
[ci skip]
2026-12-02 17:55:36 -06:00
TrèsAbhi ca12a3879e New translations en.json (Russian)
[ci skip]
2026-12-02 16:21:51 -06:00
TrèsAbhi a9dafbac85 New translations en.json (Spanish)
[ci skip]
2026-11-28 20:00:16 -06:00
TrèsAbhi 91bdf538de New translations en.json (Ukrainian)
[ci skip]
2026-11-14 21:32:15 -06:00
TrèsAbhi 6bb707a0cd New translations en.json (Ukrainian)
[ci skip]
2026-11-14 19:47:44 -06:00
TrèsAbhi 05c5bf21cf New translations en.json (Russian)
[ci skip]
2026-11-14 04:32:19 -06:00
TrèsAbhi b9e5a2c7fd New translations en.json (Spanish)
[ci skip]
2026-11-10 17:35:19 -06:00
TrèsAbhi 8d07be57d0 New translations en.json (French)
[ci skip]
2026-11-09 13:21:31 -06:00
TrèsAbhi a8dab47452 New translations en.json (Chinese Simplified)
[ci skip]
2026-11-08 22:31:58 -06:00
TrèsAbhi cd665349e3 New translations en.json (French)
[ci skip]
2026-11-07 04:36:03 -06:00
TrèsAbhi 2557f06f01 New translations en.json (French)
[ci skip]
2026-11-07 03:37:51 -06:00
TrèsAbhi bbdb63fd7d New translations en.json (French)
[ci skip]
2026-11-06 14:51:30 -06:00
TrèsAbhi 7a9a1360f9 New translations en.json (Polish)
[ci skip]
2026-11-05 15:24:40 -06:00
TrèsAbhi bd26c172e3 New translations en.json (Polish)
[ci skip]
2026-11-05 13:03:38 -06:00
TrèsAbhi eeb65d926a New translations en.json (Polish)
[ci skip]
2026-11-05 11:00:48 -06:00
TrèsAbhi 9c82e846a1 New translations en.json (Polish)
[ci skip]
2026-11-05 09:17:22 -06:00
TrèsAbhi 44431c4011 New translations en.json (Polish)
[ci skip]
2026-11-05 07:40:11 -06:00
TrèsAbhi 051d846525 New translations en.json (Spanish)
[ci skip]
2026-11-03 17:18:23 -06:00
TrèsAbhi 31d77d395f New translations en.json (French)
[ci skip]
2026-11-03 13:23:59 -06:00
TrèsAbhi 056e0bead9 New translations en.json (French)
[ci skip]
2026-11-03 11:54:07 -06:00
TrèsAbhi 1db426399c New translations en.json (Russian)
[ci skip]
2026-11-01 13:52:17 -06:00
TrèsAbhi 6d98216a96 New translations en.json (Portuguese)
[ci skip]
2026-11-01 13:52:16 -06:00
TrèsAbhi cbe6e9ca48 New translations en.json (Polish)
[ci skip]
2026-11-01 13:52:14 -06:00
TrèsAbhi c7b21b8dfb New translations en.json (Japanese)
[ci skip]
2026-11-01 13:52:13 -06:00
TrèsAbhi cc8f893293 New translations en.json (Spanish)
[ci skip]
2026-11-01 13:52:11 -06:00
TrèsAbhi 0f5a5d275d New translations en.json (French)
[ci skip]
2026-11-01 13:52:10 -06:00
TrèsAbhi e787f00804 New translations en.json (Chinese Simplified)
[ci skip]
2026-11-01 13:52:08 -06:00
TrèsAbhi d30ccdcd6a New translations en.json (Ukrainian)
[ci skip]
2026-11-01 13:52:06 -06:00
TrèsAbhi 206733542f New translations en.json (Ukrainian)
[ci skip]
2026-11-01 09:32:25 -06:00
TrèsAbhi b9b4adde42 New translations en.json (Ukrainian)
[ci skip]
2026-10-31 07:32:22 -05:00
TrèsAbhi e2bfd1b688 New translations en.json (Ukrainian)
[ci skip]
2026-10-29 07:47:51 -05:00
TrèsAbhi 1d95f95155 New translations en.json (Ukrainian)
[ci skip]
2026-10-28 08:43:10 -05:00
TrèsAbhi a6f49c19f6 New translations en.json (Ukrainian)
[ci skip]
2026-10-27 20:08:01 -05:00
TrèsAbhi 74038e83fb New translations en.json (Russian)
[ci skip]
2026-10-27 19:08:55 -05:00
TrèsAbhi f5a5879d03 New translations en.json (Russian)
[ci skip]
2026-10-27 12:20:24 -05:00
TrèsAbhi a4e168dae9 New translations en.json (Russian)
[ci skip]
2026-10-27 10:57:49 -05:00
TrèsAbhi 29077d313b New translations en.json (Chinese Simplified)
[ci skip]
2026-10-25 19:10:38 -05:00
TrèsAbhi 3bdfc42754 New translations en.json (Ukrainian)
[ci skip]
2026-10-25 19:10:36 -05:00
TrèsAbhi b7c0eac30c New translations en.json (Russian)
[ci skip]
2026-10-25 19:10:35 -05:00
TrèsAbhi 4c6880bbdf New translations en.json (Portuguese)
[ci skip]
2026-10-25 19:10:33 -05:00
TrèsAbhi 9b1131e42f New translations en.json (Polish)
[ci skip]
2026-10-25 19:10:32 -05:00
TrèsAbhi 54432c1a25 New translations en.json (Japanese)
[ci skip]
2026-10-25 19:10:31 -05:00
TrèsAbhi 0e8db43eb5 New translations en.json (Spanish)
[ci skip]
2026-10-25 19:10:29 -05:00
TrèsAbhi f85daaf61b New translations en.json (French)
[ci skip]
2026-10-25 19:10:28 -05:00
TrèsAbhi 590f4a5df3 Merge pull request #407 from blitzkit/main-i18n
New Crowdin updates
2026-10-25 18:41:43 -05:00
TrèsAbhi e326985ec4 Merge pull request #411 from blitzkit/beg 2026-10-25 18:40:34 -05:00
TrèsAbhi dcd77d5666 Merge branch 'main' into beg 2026-10-25 18:38:48 -05:00
TrèsAbhi d45425ec57 Merge pull request #414 from blitzkit:simplify-navbar
simplify
2026-10-25 18:37:52 -05:00
tresabhi 46fd061aff simplify 2026-10-25 18:37:28 -05:00
TrèsAbhi 752b11e56d Merge pull request #413 from Hitjack007/legendary-camos-fix
Fix legendary camos
2026-10-25 18:25:40 -05:00
Mark Greene 049ef58691 Fix legendary camos
Fixed https://github.com/blitzkit/blitzkit/commit/b540ab781419cbaa693597bf89a2f62962d8295f @tresabhi
2026-10-26 12:22:51 +13:00
TrèsAbhi bb64d718c2 Merge branch 'main' into beg 2026-10-25 18:11:37 -05:00
tresabhi 0d6c508382 remove skins from api 2026-10-25 15:00:17 -05:00
tresabhi 7f77b4006d shit ass wargaming legacy systems 2026-10-25 13:31:12 -05:00
tresabhi c11285e985 exit code retry 2026-10-25 13:03:35 -05:00
tresabhi a4ee9cf2bd automatic url 2026-10-25 12:50:48 -05:00
tresabhi b3ad122542 fix CLIENT_PROVIDER 2026-10-25 12:36:39 -05:00
tresabhi 41fb822571 apply smart dlc 2026-10-25 12:27:57 -05:00
tresabhi 9236c54b4b rgba8888 2026-10-24 21:29:45 -05:00
tresabhi 92ef7f4020 force bun 2026-10-24 21:18:26 -05:00
TrèsAbhi 96c8d3d801 New translations en.json (Russian)
[ci skip]
2026-10-24 20:34:55 -05:00
TrèsAbhi 2cdbd0b810 New translations en.json (Portuguese)
[ci skip]
2026-10-24 20:34:54 -05:00
TrèsAbhi 61a4711029 New translations en.json (Polish)
[ci skip]
2026-10-24 20:34:52 -05:00
TrèsAbhi f04cfb8875 New translations en.json (Japanese)
[ci skip]
2026-10-24 20:34:51 -05:00
TrèsAbhi 7ea6032244 New translations en.json (Spanish)
[ci skip]
2026-10-24 20:34:49 -05:00
TrèsAbhi a1bc1bc630 New translations en.json (French)
[ci skip]
2026-10-24 20:34:48 -05:00
TrèsAbhi 34b96f4003 New translations en.json (Chinese Simplified)
[ci skip]
2026-10-24 20:34:46 -05:00
TrèsAbhi 3f4306b3b3 New translations en.json (Ukrainian)
[ci skip]
2026-10-24 20:34:45 -05:00
tresabhi 40b732803e retry time 2026-10-24 20:32:34 -05:00
TrèsAbhi ac673cd47f Merge pull request #392 from blitzkit/new-credits 2026-10-24 20:21:58 -05:00
tresabhi 76445c67b2 some updates 2026-10-24 20:21:07 -05:00
tresabhi 8f399e5c54 Merge branch 'main' into new-credits 2026-10-24 20:19:15 -05:00
TrèsAbhi 14dc40a3e7 New translations en.json (Ukrainian)
[ci skip]
2026-10-24 15:30:30 -05:00
TrèsAbhi 3daa56e100 New translations en.json (Polish)
[ci skip]
2026-10-23 09:57:28 -05:00
TrèsAbhi 37c257c8c4 New translations en.json (Russian)
[ci skip]
2026-10-22 17:04:11 -05:00
TrèsAbhi dfc6a2bada New translations en.json (Portuguese)
[ci skip]
2026-10-22 17:04:08 -05:00
TrèsAbhi 9b8b06ca70 New translations en.json (Polish)
[ci skip]
2026-10-22 17:04:06 -05:00
TrèsAbhi f7ffb2d34d New translations en.json (Japanese)
[ci skip]
2026-10-22 17:04:04 -05:00
TrèsAbhi 2b7e88e30c New translations en.json (Spanish)
[ci skip]
2026-10-22 17:04:00 -05:00
TrèsAbhi af172c95f2 New translations en.json (French)
[ci skip]
2026-10-22 17:03:59 -05:00
TrèsAbhi f8794de782 New translations en.json (Chinese Simplified)
[ci skip]
2026-10-22 17:03:57 -05:00
TrèsAbhi 5fe295b209 New translations en.json (Ukrainian)
[ci skip]
2026-10-22 17:03:55 -05:00
tresabhi 41418eb8e0 restrict branches 2026-10-22 17:03:05 -05:00
tresabhi f6f8e2b4df polish 2026-10-22 17:00:13 -05:00
tresabhi a4fca4085e dedicated tool 2026-10-22 16:49:03 -05:00
tresabhi 26f71df9f9 remove some... people... 2026-10-22 16:40:11 -05:00
tresabhi d32b8cc3f5 Merge branch 'main' into new-credits 2026-10-22 16:38:40 -05:00
tresabhi 0922614dbc finalize 2026-10-22 16:37:16 -05:00
tresabhi ae4b2e1bb3 Merge branch 'main' into beg 2026-10-22 16:25:11 -05:00
TrèsAbhi 3b75d7b523 New translations en.json (Russian)
[ci skip]
2026-10-22 15:56:13 -05:00
TrèsAbhi 0cbd67ff38 New translations en.json (Portuguese)
[ci skip]
2026-10-22 15:56:11 -05:00
TrèsAbhi 068f481b93 New translations en.json (Polish)
[ci skip]
2026-10-22 15:56:10 -05:00
TrèsAbhi 1430c32440 New translations en.json (Japanese)
[ci skip]
2026-10-22 15:56:08 -05:00
TrèsAbhi d14afc8b39 New translations en.json (Spanish)
[ci skip]
2026-10-22 15:56:07 -05:00
TrèsAbhi cba591b368 New translations en.json (French)
[ci skip]
2026-10-22 15:56:05 -05:00
TrèsAbhi 42b5ab6f02 New translations en.json (Chinese Simplified)
[ci skip]
2026-10-22 15:56:04 -05:00
TrèsAbhi c1363be70a New translations en.json (Ukrainian)
[ci skip]
2026-10-22 15:56:02 -05:00
tresabhi 72e358f034 add pr checks 2026-10-22 15:45:04 -05:00
tresabhi b4a689dfbb start adding tiers 2026-10-22 15:42:07 -05:00
tresabhi 19e535969e colors 2026-10-22 11:51:08 -05:00
tresabhi eebc373b46 better 2026-10-22 11:45:18 -05:00
tresabhi ecb1a7c21e base 2026-10-22 11:30:03 -05:00
tresabhi 625d8d1595 cleaner logic 2026-10-22 09:13:57 -05:00
TrèsAbhi 602bf37411 New translations en.json (Russian)
[ci skip]
2026-10-22 05:51:52 -05:00
tresabhi fc9050e7fe fix imports 2026-10-21 23:23:55 -05:00
tresabhi 654887dd66 versio 2026-10-21 23:06:18 -05:00
tresabhi b540ab7814 sk 2026-10-21 22:59:12 -05:00
tresabhi 0ee9c99a28 move tank models to models_tanks chunk 2026-10-21 22:56:40 -05:00
tresabhi ab9149a11f git keep 2026-10-21 22:48:33 -05:00
tresabhi 924c130516 git keep 2026-10-21 22:47:01 -05:00
tresabhi 33366a8f79 Merge branch 'main' into split-branches 2026-10-21 22:44:54 -05:00
TrèsAbhi 342497563f Merge pull request #373 from Hitjack007/legendary-camo-models 2026-10-21 22:42:53 -05:00
Mark Greene a495a5f208 Feature: Legendary camouflages in the Tankopedia viewer 2026-10-22 16:12:03 +13:00
TrèsAbhi 10b0e29a26 New translations en.json (Polish)
[ci skip]
2026-10-21 10:03:16 -05:00
tresabhi 007d4e9540 make tier 11's test tanks 2026-10-21 09:56:21 -05:00
tresabhi 273fea1599 promote preview 2026-10-21 09:36:06 -05:00
TrèsAbhi ed36eedbfb New translations en.json (Polish)
[ci skip]
2026-10-21 07:42:08 -05:00
tresabhi 7df53d845d vfs debug 2026-10-19 20:12:03 -05:00
tresabhi 1b5c79c2b8 Merge branch 'production' 2026-10-19 19:54:58 -05:00
tresabhi 51900f4c80 countdown 2026-10-19 19:22:20 -05:00
tresabhi b9388cc544 add basic xi compatibility 2026-10-19 19:08:25 -05:00
TrèsAbhi 05648ea040 Merge pull request #353 from Hitjack007/remove-imgur-references
Fix: migrate Imgur images to BlitzKit hosting
2026-10-18 14:12:50 -05:00
TrèsAbhi 73080fd60a Merge branch 'main' into remove-imgur-references 2026-10-18 14:03:19 -05:00
TrèsAbhi 14be326c41 Merge pull request #368 from Hitjack007/calculated-bounding-boxes 2026-10-18 14:02:34 -05:00
TrèsAbhi 8132f2d91e Merge branch 'main' into calculated-bounding-boxes 2026-10-18 13:59:49 -05:00
TrèsAbhi 1258cd1fa2 New Crowdin updates (#399) 2026-10-18 13:59:07 -05:00
TrèsAbhi 989e3d395a Merge pull request #385 from blitzkit/main
Production
2026-10-14 13:15:55 -05:00
tresabhi d8925a47b5 i am satisfied 2026-10-10 23:12:41 -05:00
tresabhi 60f482d820 hahaha 2026-10-10 20:48:37 -05:00
tresabhi c2fd81c98e remove old credits 2026-10-10 18:47:46 -05:00
tresabhi 0fbc868738 more colors 2026-10-10 18:43:44 -05:00
tresabhi ff0cfbaf0a target 2026-10-10 18:38:05 -05:00
tresabhi 4642b74bca colors! 2026-10-10 18:37:47 -05:00
tresabhi 88d49bd5a3 avenir 2026-10-10 18:24:14 -05:00
tresabhi 6fd2423445 more progress 2026-10-10 18:12:01 -05:00
tresabhi a0dba52649 complete list? 2026-10-10 17:49:06 -05:00
tresabhi 80d76e3729 more more more! 2026-10-10 17:34:07 -05:00
tresabhi 7915b39d9d more! 2026-10-10 17:17:57 -05:00
tresabhi c94a84222d add more 2026-10-10 17:05:36 -05:00
tresabhi 1bca762781 start of credits 2026-10-10 16:59:34 -05:00
tresabhi 7f7d0cc499 remove outdated docs 2026-10-10 16:41:57 -05:00
TrèsAbhi 0c91ee3600 New Crowdin updates (#389)
* New translations en.json (Ukrainian)

[ci skip]

* New translations en.json (Chinese Simplified)

[ci skip]

* New translations en.json (French)

[ci skip]

* New translations en.json (Spanish)

[ci skip]

* New translations en.json (Japanese)

[ci skip]

* New translations en.json (Polish)

[ci skip]

* New translations en.json (Portuguese)

[ci skip]

* New translations en.json (Russian)

[ci skip]
2026-10-09 23:33:06 -05:00
tresabhi 1988ecff92 smaller titles 2026-10-09 18:20:11 -05:00
tresabhi ff03f8ffb2 remove bold 2026-10-09 18:17:56 -05:00
tresabhi d050776628 format 2026-10-09 18:14:59 -05:00
tresabhi 78bff2cdd2 logs 2026-10-09 18:13:22 -05:00
tresabhi 072174ad45 promote version 2026-10-09 18:01:10 -05:00
TrèsAbhi 03f2bcdc1a Merge pull request #366 from Hitjack007/track-repair-time 2026-10-09 17:29:38 -05:00
TrèsAbhi b6ae34dafa Merge pull request #377 from Hitjack007/armor-penetration-chance 2026-10-09 17:28:05 -05:00
TrèsAbhi 2e10052732 Merge pull request #282 from Hitjack007/armor-controls-edge 2026-10-09 17:06:22 -05:00
TrèsAbhi 9a95306b37 Merge pull request #284 from Hitjack007/mixer-mobile 2026-10-09 17:03:52 -05:00
tresabhi fbc4355984 remove clamped vw 2026-10-09 17:02:54 -05:00
TrèsAbhi 24026a95ee Merge pull request #359 from Hitjack007/flag-offset 2026-10-09 16:57:27 -05:00
TrèsAbhi 8f4a43fc8a Merge pull request #357 from Hitjack007/playlist-filters-layout 2026-10-09 16:55:20 -05:00
tresabhi 646d6fa7d5 center align and max width 32rem 2026-10-09 16:54:37 -05:00
TrèsAbhi 37fae7477d Merge branch 'main' into playlist-filters-layout 2026-10-09 16:53:35 -05:00
tresabhi 12ff9a90eb update matrix 2026-10-08 11:13:12 -05:00
tresabhi 5ad5c701c9 update envs for chunk splitting 2026-10-08 11:10:47 -05:00
Mark Greene a365fa5e50 Fix: migrate Imgur images to BlitzKit hosting 2026-10-08 20:28:02 +13:00
Mark Greene 57d77bf2b4 Fix: calculate tank dimensions from collision models 2026-10-08 20:25:03 +13:00
Mark Greene 940c3c537b Feature: track repair time in Tankopedia
Adds track repair time to the Tankopedia survivability stats, matching the value the game lists.

- Added a required `repair_time` to track definitions, filled from each chassis's hysteresis health divided by its health regen per second
- Applied the toolbox, the repair crew skill and the protective kit as multiplicative repair speed bonuses
- Added a Track repair time row under fire chance; it appears once the definitions are regenerated on the next build

Fixes #308
2026-10-08 18:02:05 +13:00
Mark Greene fbdfa2c063 Feature: Penetration chance in the armor shot card
Shows the chance a shot penetrates in the dynamic armor shot card, right-aligned on the shot's result line.

- Penetration varies by ±5% (the same randomisation the armor highlighter shader uses), so the chance is the share of that range where the shot's final outcome is a penetration
- Re-runs the existing shot calculation at different penetration values, so spaced armor, HEAT gap losses and ricochets are taken into account
- For ricochets the chance is shown on the ricocheted shot's line; HE splashes don't count as penetrations
- Adds the `shot_card.stats.penetration_chance` string

Fixes #342
2026-10-08 18:00:57 +13:00
tresabhi 7234c39ad8 move credits back 2026-10-07 21:32:38 -05:00
Mark Greene 643e1dd352 Fix: crop transparent padding from fade flags
The fade flag images are 2:1 but the flag only fills the left part, with the rest transparent. That made `cover` + `center` in the tech tree node crop and offset the visible flag.

- Trim the transparent border from the fade flag in the `/flags/fade/[id].webp` route using `sharp`
- Revert the tech tree node back to `cover` + `center`, since the image is now just the flag
2026-10-05 08:10:52 +13:00
Mark Greene fbba0bf13b Fix: constrain playlist filter width
The filters on the playlist page stretched into one long strip beside the tank pool, squeezing the pool into the remaining space.

**Changes**
- Place the filters and the generate button in a fixed-width column (`22rem`) on medium screens and up so the filter buttons wrap compactly
- Stretch the generate button to the column width
- Let the tank pool take the remaining width
- Tighten the gap between the two columns
- Keep the existing stacked layout on small screens
2026-10-04 20:07:52 +13:00
Mark Greene 6907e5fb7a Fix: mixer buttons clipping at the screen edges on small phones
The mixer's hull/turret/gun row is about 440px wide at its fixed sizes and is centered with `left: 50%` and `translateX(-50%)`, so on phones narrower than that it overflowed past both edges.

Use smaller button sizes on phones and scale the tank images with the viewport (`clamp(2rem, 11vw, 4em)`), with smaller separators and gaps. From 520px up the layout is unchanged.
2026-10-04 15:17:51 +13:00
Mark Greene e5e2f2505c Fix: static armor controls peeking in at the screen edge
The static armor panel hid itself with a fixed `right: -6rem`. In languages with longer labels (e.g. Spanish) the panel is wider than that, so part of it stayed visible at the edge.

Anchor the panel at `right: 0` and slide it out with a transform based on its own width (`translateX(calc(100% + var(--space-4)))`) when static armor isn't active, so it always clears the edge regardless of label length.
2026-10-04 14:50:10 +13:00
122 changed files with 6721 additions and 6465 deletions

No files matched your search

+21 -8
View File
@@ -2,6 +2,11 @@ name: Website
on: on:
push: push:
branches:
- main
- production
pull_request:
schedule: schedule:
- cron: "0 4 * * *" - cron: "0 4 * * *"
@@ -93,7 +98,7 @@ jobs:
strategy: strategy:
fail-fast: true fail-fast: true
matrix: matrix:
chunk: [default, api] chunk: [default, api, models_tanks, models_legendary, models_maps]
steps: steps:
- name: Free disk space - name: Free disk space
@@ -102,7 +107,8 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v6 uses: actions/checkout@v6
with: with:
ref: ${{ inputs.branch || 'production' }} # the PR's ref, or the manual input, or production (selected when cron)
ref: ${{ github.event.pull_request.head.sha || inputs.branch || 'production' }}
submodules: recursive submodules: recursive
token: ${{ secrets.GH_TOKEN }} token: ${{ secrets.GH_TOKEN }}
@@ -122,9 +128,14 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: bun install run: bun install
- name: Download Client - name: Download client
run: bun run download-client run: bun run download-client
- name: Download SmartDLC
if: ${{ env.CLIENT_PROVIDER == 'steam' }}
run: bun run download-smart-dlc
- name: Build - name: Build
run: bun run --bun build run: bun run --bun build
env: env:
@@ -139,13 +150,15 @@ jobs:
- name: Trigger deployment - name: Trigger deployment
# Deploy if: # workflow should trigger if:
# 1. Running cron from main using content from production to target production # - is by cron and is on main: triggering to production
# 2. Running manually and targeting non-production # - is by push and is on production: triggering to production
# - is by manual and is on anything: triggering to anything
if: >- if: >-
${{ ${{
github.ref == 'refs/heads/production' || (github.event_name == 'schedule' && github.ref == 'refs/heads/main')
(inputs.environment != '' && inputs.environment != 'production') || (github.event_name == 'push' && github.ref == 'refs/heads/production')
|| (github.event_name == 'workflow_dispatch')
}} }}
env: env:
-47
View File
@@ -1,47 +0,0 @@
# BlitzKit Credits
BlitzKit is a one man band **TrèsAbhi** but I am far from solo. Helpers, in the order of contribution over time:
### S0AP
BlitzKit Discord bot verification, testing, advertisement, and the initial encouragement to create BlitzKit.
### Prince_NA
BlitzKit Discord bot and website testing and general advise.
### Vovko
BlitzKit Discord bot and website rendering pipeline.
### Maddox
Game file decompression.
### Pyogenics
Game 3D model parsing.
### Aeson
Game file layout, general advise, advertisement, and Tankopedia pre-release testing.
### Minitelrose, ChickenMan7777
3-caliber rule edge cases.
### HisRoyalFatness, Synx
Embed UX.
### [OPTML] clan, \_34, xkdkw, Droodles Blitz
Tankopedia pre-release testing.
### GonnaHetzMe
Redacted by request.
### Mark Greene
GitHub contributor on bug fixes and feature additions.
+3 -3
View File
@@ -1,14 +1,14 @@
# BlitzKit 1.29.10 # BlitzKit 1.29.10
Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions this update. Thank you to [HitJack](https://github.com/Hitjack007) for your contributions this update.
## Features ## Features
- Combined game mode passive and active abilities into a single dropdown - Combined game mode passive and active abilities into a single dropdown
- [Mark Greene] Added tier filters to the Guess game - Added tier filters to the Guess game [HitJack]
- Changing tiers will break your streak - Changing tiers will break your streak
## Fixes ## Fixes
- [Mark Greene] module damage is now properly shown when sorting with it in the tank search - module damage is now properly shown when sorting with it in the tank search [HitJack]
- Duplicate abilities in the tank filters are now removed - Duplicate abilities in the tank filters are now removed
+1 -1
View File
@@ -4,7 +4,7 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions
## Fixes ## Fixes
- [GonnaHetzMe] The turret for Centurion I is no longer offset from the body - The turret for Centurion I is no longer offset from the body [GonnaHetzMe]
- Please allow up to 24 hours for the model to update - Please allow up to 24 hours for the model to update
- Vertical Stabilizers now give the correct 12% buff instead of 15% - Vertical Stabilizers now give the correct 12% buff instead of 15%
- Re-ordering tanks in Compare now works once again - Re-ordering tanks in Compare now works once again
+2 -2
View File
@@ -1,6 +1,6 @@
# BlitzKit 1.29.8 # BlitzKit 1.29.8
Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions this update. Thank you to [HitJack](https://github.com/Hitjack007) for your contributions this update.
## Features ## Features
@@ -15,5 +15,5 @@ Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions
## Fixes ## Fixes
- The Tankopedia now smoothly resizes when enlarging on interaction - The Tankopedia now smoothly resizes when enlarging on interaction
- [Mark Greene] Stock turrets now correctly mount the corresponding stock gun - Stock turrets now correctly mount the corresponding stock gun [HitJack]
- The consumable and provision buttons in Compare are no longer tiny - The consumable and provision buttons in Compare are no longer tiny
+3 -3
View File
@@ -1,14 +1,14 @@
# BlitzKit 1.29.9 # BlitzKit 1.29.9
Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions this update. Thank you to [HitJack](https://github.com/Hitjack007) for your contributions this update.
## Features ## Features
- Reworked tank search filters to be far more compact to make way for new filters - Reworked tank search filters to be far more compact to make way for new filters
- [Mark Greene] Added the ability to filter tanks by consumables - Added the ability to filter tanks by consumables [HitJack]
- Added the ability to filter tanks by provisions and game-mode abilities and powers - Added the ability to filter tanks by provisions and game-mode abilities and powers
## Fixes ## Fixes
- Consumable and provision icons in Compare are now properly sized - Consumable and provision icons in Compare are now properly sized
- [Mark Greene] Provisions now properly affect terrain resistances - Provisions now properly affect terrain resistances [HitJack]
+5 -5
View File
@@ -13,11 +13,11 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions
## Technical Features ## Technical Features
- [GonnaHetzMe] Enabling dev mode now displays the tank's non-numerical id - Enabling dev mode now displays the tank's non-numerical id [GonnaHetzMe]
- [GonnaHetzMe] The dev id and the new dev name are now copyable on click - The dev id and the new dev name are now copyable on click [GonnaHetzMe]
## Fixes ## Fixes
- [GonnaHetzMe] Tech trees that start at tiers higher than tier 1 like the Blitz Nation ones now properly render their trees in Tankopedia - Tech trees that start at tiers higher than tier 1 like the Blitz Nation ones now properly render their trees in Tankopedia [GonnaHetzMe]
- [GonnaHetzMe] The tank pitch/yaw inputs in the Tank Sandbox now initialize with the correct values instead of 0 - The tank pitch/yaw inputs in the Tank Sandbox now initialize with the correct values instead of 0 [GonnaHetzMe]
- [GonnaHetzMe] Large Repair Kits once again use the correct modern icon - Large Repair Kits once again use the correct modern icon [GonnaHetzMe]
+1 -1
View File
@@ -4,5 +4,5 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions
## Fixes ## Fixes
- [GonnaHetzMe] Tank hit points in Equalizer mode is now accurate to the game - Tank hit points in Equalizer mode is now accurate to the game [GonnaHetzMe]
- Armor highlighting now reflects the actual thicknesses of tanks in Equalizer mode - Armor highlighting now reflects the actual thicknesses of tanks in Equalizer mode
+3 -3
View File
@@ -4,9 +4,9 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions
## Fixes ## Fixes
- [GonnaHetzMe] Tungsten shells are now properly cropped - Tungsten shells are now properly cropped [GonnaHetzMe]
- Equalizer no longer gives insanely high penetration values - Equalizer no longer gives insanely high penetration values
- The tank reveal animation no longer repeats when you scroll away and back to the tank sandbox - The tank reveal animation no longer repeats when you scroll away and back to the tank sandbox
- [GonnaHetzMe] The RHM. Pzw.'s turret no longer has the floating plate - The RHM. Pzw.'s turret no longer has the floating plate [GonnaHetzMe]
- Please give BlitzKit up to 1 hour to update the model - Please give BlitzKit up to 1 hour to update the model
- [GonnaHetzMe] Tanks with inclined turret rings like the Minotauro now display the correct pitch in the tank sandbox inputs - Tanks with inclined turret rings like the Minotauro now display the correct pitch in the tank sandbox inputs [GonnaHetzMe]
+5 -5
View File
@@ -4,7 +4,7 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions
## Features ## Features
- [GonnaHetzMe] Added tooltips to the module selector in Tankopedia - Added tooltips to the module selector in Tankopedia [GonnaHetzMe]
## Fixes ## Fixes
@@ -12,7 +12,7 @@ Thank you to [GonnaHetzMe](https://github.com/karelpak1) for your contributions
- Removed tank visual and collision model caching - Removed tank visual and collision model caching
- Guesser once again breaks streaks if not all tiers are selected - Guesser once again breaks streaks if not all tiers are selected
- BlitzKit now properly unloads tank models from memory when visually hidden in Guesser - BlitzKit now properly unloads tank models from memory when visually hidden in Guesser
- [GonnaHetzMe] Tanks with complex transparency like the Herdbreaker once again handle opacity correctly - Tanks with complex transparency like the Herdbreaker once again handle opacity correctly [GonnaHetzMe]
- [GonnaHetzMe] Pieces of tank models that have transparency now handle culling properly (they're visible from both sides) - Pieces of tank models that have transparency now handle culling properly (they're visible from both sides) [GonnaHetzMe]
- [GonnaHetzMe] Tanks with "cardboard" textures have been fixed, thanks to better PVR file parsing - Tanks with "cardboard" textures have been fixed, thanks to better PVR file parsing [GonnaHetzMe]
- [GonnaHetzMe] Tank icons are now scaled correctly so small tanks are now properly zoomed out in contrast to bigger ones - Tank icons are now scaled correctly so small tanks are now properly zoomed out in contrast to bigger ones [GonnaHetzMe]
+5 -5
View File
@@ -1,6 +1,6 @@
# BlitzKit 1.30.7 # BlitzKit 1.30.7
Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions this update. Thank you to [HitJack](https://github.com/Hitjack007) for your contributions this update.
## Features ## Features
@@ -8,13 +8,13 @@ Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions
## Fixes ## Fixes
- [Mark Greene] Clicking on the armor multiple times with HE no longer crashes BlitzKit - Clicking on the armor multiple times with HE no longer crashes BlitzKit [HitJack]
- [Mark Greene] Ricochets that later intersect with external modules no longer falsely claim a successful damaging penetration - Ricochets that later intersect with external modules no longer falsely claim a successful damaging penetration [HitJack]
- The lighting animation no longer stops prematurely when BlitzKit is unfocused - The lighting animation no longer stops prematurely when BlitzKit is unfocused
- The spot light angle has been increased to more evenly light up larger tanks - The spot light angle has been increased to more evenly light up larger tanks
- BlitzKit once again uses soft shadows, reducing the pixelated shadows - BlitzKit once again uses soft shadows, reducing the pixelated shadows
- Fixed the weird patterns that formed on the tracks of tanks under self-shadows - Fixed the weird patterns that formed on the tracks of tanks under self-shadows
- Increased the floor size and light decay to create the illusion that the floor is infinite - Increased the floor size and light decay to create the illusion that the floor is infinite
- [Mark Greene] Safari no longer crashes when unloading textures for unloaded tanks - Safari no longer crashes when unloading textures for unloaded tanks [HitJack]
- The gun depression transition between two constraints (like often behind tanks) now uses a gentler zoned and can never be 0 - The gun depression transition between two constraints (like often behind tanks) now uses a gentler zoned and can never be 0
- [Mark Greene] Armor plate names in Static Armor are now properly capitalized in English and translated to other languages - Armor plate names in Static Armor are now properly capitalized in English and translated to other languages [HitJack]
-41
View File
@@ -1,41 +0,0 @@
# BlitzKit 1.31.4
Thank you to [Mark Greene](https://github.com/Hitjack007) for your contributions this update.
## Features
- [Mark Greene] Added Peekaboo DPM
- Your Peekaboo DPM is lower than your normal DPM if your reload is faster than 10s as you'll have to wait for the remaining 10s for you to get unspotted before you can poke and shoot
- [Mark Greene] The test and owned tank filters are now more intuitive as clicking on them now turns the clicked option on instead of off
- [Mark Greene] Added a spall liner button to the Tankopedia beside the other equipment
## Fixes
- [Mark Greene] BlitzKit Session now properly handles tanks removed from the game
- [Mark Greene] Removed the Beta badge from the Equalizer button
- Updated the background image for the Equalizer button to the actual banner of the new game mode
- [Mark Greene] The armor no longer disappears when you turn on Dynamic Armor System
- [Mark Greene] Camouflage values in Tankopedia are now more descriptive when shooting
- [Mark Greene] The contact shadows on the ground no longer grow & darken when switching between tabs
- The "Help Translate BlitzKit" text on the home page is now properly centered vertically
- [Mark Greene] The footer now says "Branch" instead of "CDN"
- [Mark Greene] The game version in the footer now displays a shorthand version instead of the entire version number
- [Mark Greene] The reload visualizer now displays just 1 decimal place
- [Mark Greene] The search bar no longer redirects to a seemingly random tank when clicking enter when searching
- [Mark Greene] Tank search now properly handles the full names of tanks like the Super Pershing
- [Mark Greene] The loading bar below the name of the tanks in Tankopedia is now sufficiently spaced below
- [Mark Greene] The gun depression visualizer now properly handles the inherent tilt of tanks like the Minotauro
## Technical Features
- Added documentation to the README on setting up and developing BlitzKit locally
- Added bug report and feature request forms to GitHub
- Switched to the GNU AGPLv3 license
## Technical Fixes
- BlitzKit now handles the new ID system for game-modes in WoTB
- The directory which preview versions of the game are downloaded to are now created properly
- This was the last bug standing in the way of BlitzKit Previews
- Welcome back, BlitzKit Previews!
- Removed some dead code from the BlitzKit model mangler
+98
View File
@@ -0,0 +1,98 @@
# BlitzKit 1.32.0
Thank you to [HitJack](https://github.com/Hitjack007) for your contributions this update.
## Features
### Tankopedia & Armor
- Added a spall liner button to the Tankopedia beside the other equipment [HitJack]
- Listed track repair times in the Tankopedia [HitJack]
- The penetration chance is now displayed when penetration testing armor [HitJack]
- Added a new setting to disable automatically loading tanks in Tankopedia [HitJack]
### Tank Performance & Mechanics
- Added Peekaboo DPM [HitJack]
- Your Peekaboo DPM is lower than your normal DPM if your reload is faster than 10s as you'll have to wait for the remaining 10s for you to get unspotted before you can poke and shoot
### Tank Filters
- The test and owned tank filters are now more intuitive as clicking on them now turns the clicked option on instead of off [HitJack]
### Game Compatibility
- Added compatibility for tier XI tanks [HitJack]
## Fixes
### Tankopedia & Armor
- The armor no longer disappears when you turn on Dynamic Armor System [HitJack]
- Camouflage values in Tankopedia are now more descriptive when shooting [HitJack]
- The penetration chance is now displayed when penetration testing armor [HitJack]
- Listed track repair times in the Tankopedia [HitJack]
- Added a spall liner button to the Tankopedia beside the other equipment [HitJack]
- The flags in the Tankopedia tech tree are no longer offset to the top left [HitJack]
- The loading bar below the name of the tanks in Tankopedia is now sufficiently spaced below [HitJack]
- Removed the vertical sliver of pixels found to the right of the Equalizer toggle in Tankopedia
### Tank Search & Filters
- The search bar no longer redirects to a seemingly random tank when clicking enter when searching [HitJack]
- Tank search now properly handles the full names of tanks like the Super Pershing [HitJack]
- The tank search now remains consistent in order even when an added filter does not add/remove tanks from the list [HitJack]
- The test and owned tank filters are now more intuitive as clicking on them now turns the clicked option on instead of off [HitJack]
### Visuals & UI
- Removed the Beta badge from the Equalizer button [HitJack]
- Updated the background image for the Equalizer button to the actual banner of the new game mode
- The contact shadows on the ground no longer grow & darken when switching between tabs [HitJack]
- Additionally, the contact shadows stays visible at low angles [HitJack]
- The "Help Translate BlitzKit" text on the home page is now properly centered vertically
- The footer now says "Branch" instead of "CDN" [HitJack]
- The game version in the footer now displays a shorthand version instead of the entire version number [HitJack]
- The reload visualizer now displays just 1 decimal place [HitJack]
- Plot controls for the Static armor tab no longer pokes in from the right on non-Static armor tabs in some languages [HitJack]
- Mixer's controllers now scale better on smaller screens [HitJack]
- The list of available tanks in the Playlist is no longer excessively wide [HitJack]
### Tank Mechanics & Models
- The gun depression visualizer now properly handles the inherent tilt of tanks like the Minotauro [HitJack]
- When moving the tracks of tanks, the textures no longer move at different rates [HitJack]
### Localization
- Users with a preference on a language are once again redirected to the correct localized pages [HitJack]
### Session & Game Compatibility
- BlitzKit Session now properly handles tanks removed from the game [HitJack]
## Technical Fixes
- BlitzKit now handles the new ID system for game-modes in WoTB
- The directory which preview versions of the game are downloaded to are now created properly
- This was the last bug standing in the way of BlitzKit Previews
- Welcome back, BlitzKit Previews!
- Removed some dead code from the BlitzKit model mangler
- The player discovery loop now persists for longer than 1 iteration [HitJack]
- Bun is now forced to run scripts with the `--bun` flag
## Technical Features
- Added documentation to the README on setting up and developing BlitzKit locally
- Added bug report and feature request forms to GitHub
- Switched to the GNU AGPLv3 license
## Technical Fixes
- BlitzKit now handles the new ID system for game-modes in WoTB
- The directory which preview versions of the game are downloaded to are now created properly
- This was the last bug standing in the way of BlitzKit Previews
- Welcome back, BlitzKit Previews!
- Removed some dead code from the BlitzKit model mangler
- The player discovery loop now persists for longer than 1 iteration [HitJack]
- Bun is now forced to run scripts with the `--bun` flag
-9
View File
@@ -1,9 +0,0 @@
# Timezones
What is considered a "day's worth of games" is determined by the reset time. The reset time is generally at midnight everyday after which newer games are counted towards the next day. Reset times vary from region to region:
- North America: `UTC-5:00` (Central North American Time midnight)
- Europe: `UTC+1:00` (Central European Time midnight)
- Asia: `UTC+7:00` (Central Asia Standard Time midnight)
**Reset times are different from Blitz Stars** (Blitz Stars resets at 5:00 am locally relative to the user opening their website). Inconsistencies with Blitz Stars only occur with sleep-deprived players and players who play in the wrong region.
-45
View File
@@ -1,45 +0,0 @@
# Blitzkit Rating Leaderboard
A straightforward way of storing the entire World of Tanks Blitz rating leaderboard to disk.
```cpp
primary BlitzkitRatingLeaderboard {
utf8"BKRL" magic;
Header header;
primary Body<header> body;
}
Header {
uint16 version; // always 1
Format format;
uint32 count;
}
Format enum<uint8> {
Base,
Superset1,
}
Body<Header header> match<header.format> {
Base {
primary {
uint32 id;
uint16 score;
}[header.count] entries;
};
Superset1 {
primary {
uint32 id;
uint16 score;
uint32 battles;
uint32 wins;
uint32 survived;
uint32 damage;
uint32 kills;
}[header.count] entries;
};
}
```
-18
View File
@@ -1,18 +0,0 @@
# Discovered Ids
```c
primary DiscoveredIds {
utf8"DIDS" magic;
Header header;
primary Body body;
}
Header {
uint16 version; // always 1
}
Body {
uint32 count;
uint32[count] ids;
}
```
+1 -170
View File
@@ -1,172 +1,3 @@
# KitScore # KitScore
## Memo Remind me to write out the linearized model!
KitScore is a performance metric that makes sense. This metric can be applied to any game, virtual or real. Specific pieces of information relating directly to World of Tanks Blitz will be provided within parentheses and with a "WoTB:" prefix.
## Consumption of Observations
KitScore is driven solely by the behavior of other players and finding meaning of a new observation within a pool of condensed data based on previously observed data. Generally, we will be provided with a number of statistics (the $x_i$ of an observation) per player (WoTB: $x_\text{frags}$, $x_\text{xp}$, $x_\text{spots}$, etc.) including a target statistic (the $x_j$ of an observation) that all other statistics try to maximize (WoTB: "winrate" which we will defined later as $x_j$).
If the statistics are cumulative, they will have to be normalized (WoTB: statistics fetched from Wargaming are indeed cumulative even for a single player; $x_\text{frags}=\frac{\Sigma x_\text{frags}}{\Sigma x_\text{battles}}$, $x_\text{spots}=\frac{\Sigma x_\text{spots}}{\Sigma x_\text{battles}}$, $x_j=\frac{\Sigma x_\text{wins}}{\Sigma x_\text{battles}}$, etc.). Each player will have such average statistics, giving us many points of data to work with. If the statistics are not cumulative, then you will be dealing with multiple observations per player which will only help improve accuracy.
## It's Impossible to "Find What Makes the Metric Tick"
WN8, a widely adopted metric in the World of Tanks and World of Tanks Blitz communities is plagued with problems. One of them being that people often find and exploit "what makes the metric tick." In other words, people easily exploit the rudimentary nature of WN8 to score undeservedly high.
In WN8, the gains of some rewarding categories overshadow the losses of others though that may not necessarily be in the best interest in maximizing winrate. KitScore makes this nearly impossible as it punishes a player for scoring well solely high in a certain category. You will never exploit KitScore. Period.
## Generating Reasonable Values
TODO: there's like no runaway cases
## Symbol Interpretation
| Symbol | Interpretation |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ |
| $A_\text{human}$ | The human readable version of the raw score $A$. |
| $A$ | The raw KitScore. |
| $C$ | An arbitrary coefficient. |
| $I$ | The number of statistics including the target statistic. This means that there are $I-1$ entries for $x_i$ and $1$ entry for $y$ for each observation. |
| $i$ | The statistic index of where there are $I$ entries. |
| $j$ | A discriminator for the target statistic. There may never be more than $1$ entries for $j$. |
| $m$ | The degree of the polynomial regression. |
| $n$ | The number of observations. |
| $a$ | An "atomic" score which is a function of the $i$th statistic. |
| $w$ | The weight of the $i$th atomic statistic. |
## Computing the Score
The final metric $A_\text{human}$ is an arbitrarily scaled value of the raw score $A$ where $C$ is any coefficient of your liking. BlitzKit uses $C=10^3$.
$$
A_\text{human}=CA
$$
The final metric $A$ is the weighted average of individual scores $a$ which are functions of the $i$th statistic excluding the target statistic $j$ itself.
$$
A=\frac{\sum_{i \neq j} w_{i}a_{i}}{\sum_{i \neq j} w_{i}}
$$
The "atomic" score $a$ is the difference between the predicted target statistic $P_{i \leftrightarrow j}(x_i)$ acquired using a polynomial regression of degree $m$ and the actual newly observed $x_j$.
$$
a_i=x_j-P_{i \leftrightarrow j}(x_i)
$$
The polynomial regression of $m$th degree can be written as follows:
$$
P(x)=\beta_0x^0+\beta_1x^1+\beta_2x^2+\dots+\beta_mx^m
$$
Polynomial regression coefficients $\beta$ can be acquired through basic linear algebra where an $m \times m$ of constants is multiplied with $m \times 1$ of unknowns which equals another $m \times 1$ of constants.
```math
\begin{bmatrix}
\sum_{k=1}^n x_i^0 & \sum_{k=1}^n x_i^1 & \sum_{k=1}^n x_i^2 & \dots & \sum_{k=1}^n x_i^m \\
\sum_{k=1}^n x_i^1 & \sum_{k=1}^n x_i^2 & \sum_{k=1}^n x_i^3 & \dots & \sum_{k=1}^n x_i^{m+1} \\
\sum_{k=1}^n x_i^2 & \sum_{k=1}^n x_i^3 & \sum_{k=1}^n x_i^4 & \dots & \sum_{k=1}^n x_i^{m+2} \\
\vdots & \vdots & \vdots & \ddots & \vdots \\
\sum_{k=1}^n x_i^m & \sum_{k=1}^n x_i^{m+1} & \sum_{k=1}^n x_i^{m+1} & \dots & \sum_{k=1}^n x_i^{2m} \\
\end{bmatrix}
\begin{bmatrix}
\beta_0 \\
\beta_1 \\
\beta_2 \\
\vdots \\
\beta_m
\end{bmatrix}
=
\begin{bmatrix}
\sum_{k=1}^n x_jx_i^0 \\
\sum_{k=1}^n x_jx_i^1 \\
\sum_{k=1}^n x_jx_i^2 \\
\vdots \\
\sum_{k=1}^n x_jx_i^m
\end{bmatrix}
```
The weight $w$ is a slice of the Pearson corelation matrix. The numerator is the corelation between the $i$th statistic and the target statistic $j$ while the denominator the sum of the corelations between the $i$th statistic and all statistics but the target statistic $j$.
$$
w_{i}=\frac{r_{i\leftrightarrow j}^2}{\sum_{i_{k}\neq j}r_{i\leftrightarrow i_{k}}^2}
$$
## Understanding the Corelation Matrix
Forming the corelation matrix will create an $I \times I$ matrix where. This matrix is best represented as a table. The example below illustrates a matrix/table for $I=4$ which includes $3$ entries for $i$ statistics and $1$ entry for the $j$ target statistic.
| | $x_1$ | $x_2$ | $x_3$ | $x_j$ |
| ----- | --------------------------- | --------------------------- | --------------------------- | --------------------------- |
| $x_1$ | $1$ | $r_{1 \leftrightarrow 2}^2$ | $r_{1 \leftrightarrow 3}^2$ | $r_{1 \leftrightarrow j}^2$ |
| $x_2$ | $r_{1 \leftrightarrow 2}^2$ | $1$ | $r_{2 \leftrightarrow 3}^2$ | $r_{2 \leftrightarrow j}^2$ |
| $x_3$ | $r_{1 \leftrightarrow 3}^2$ | $r_{2 \leftrightarrow 3}^2$ | $1$ | $r_{3 \leftrightarrow j}^2$ |
| $x_j$ | $r_{1 \leftrightarrow j}^2$ | $r_{2 \leftrightarrow j}^2$ | $r_{3 \leftrightarrow j}^2$ | $1$ |
It should not be a surprise to find $r_{i \leftrightarrow i}^2=1$ which forms a neat diagonal across the table. Note that there are many duplicates within the $I^2$ entries. The "bottom-right triangle" can be eliminated to remove redundancies leaving us with only $\frac{I(I+1)}{2}$ fields occupied.
| | $x_1$ | $x_2$ | $x_3$ | $x_j$ |
| ----- | ----- | --------------------------- | --------------------------- | --------------------------- |
| $x_1$ | $1$ | $r_{1 \leftrightarrow 2}^2$ | $r_{1 \leftrightarrow 3}^2$ | $r_{1 \leftrightarrow j}^2$ |
| $x_2$ | | $1$ | $r_{2 \leftrightarrow 3}^2$ | $r_{2 \leftrightarrow j}^2$ |
| $x_3$ | | | $1$ | $r_{3 \leftrightarrow j}^2$ |
| $x_j$ | | | | $1$ |
When programming this matrix into an array, $r_{i \leftrightarrow i}^2=1$ will be redundant. I recommend condensing the matrix into an array of size $\frac{I(I+1)}{2}+I=\frac{I(I-1)}{2}$ to avoid all redundant entries. For $I=4$, the array will look something like the one illustrated below (here, $j=4$).
$$
[r_{1 \leftrightarrow 2}^2, r_{1 \leftrightarrow 3}^2, r_{1 \leftrightarrow 4}^2, r_{2 \leftrightarrow 3}^2, r_{2 \leftrightarrow 4}^2, r_{3 \leftrightarrow 4}^2]
$$
## Understanding the Weights
Some may find the weight equation arbitrary; it evidently isn't. The goal of $w$ is to eliminate over-rewarding the same behavior represented in multiple statistics. It makes all atomic statistics concurrent by leveraging the Pearson corelation matrix.
A simplified example will clarify the idea. First, we compute a Pearson corelation matrix for $I=3$ statistics. We have $x_1$ and $x_2$, the statistics that are trying to maximize $x_j$. Reminder: a Pearson corelation matrix finds the $r$ value not only between $x_i$ and $x_j$ but also between all combinations of $x_i$ and themselves. Here, $r^2$ is calculated using polynomial regression corelation analysis to the $m$th degree.
| | $x_1$ | $x_2$ | $x_3$ | $x_j$ |
| ----- | ----- | ----------- | ----- | ----- |
| $x_1$ | $1$ | $\boxed{0}$ | $0$ | $1$ |
| $x_2$ | | $1$ | $0$ | $1$ |
| $x_3$ | | | $1$ | $1$ |
| $x_j$ | | | | $1$ |
In the case above, $r^2_{1 \leftrightarrow 2}=0$ meaning that both statistics have absolutely nothing to do with each other. Hence, the player will be awarded for optimizing both individually. And since $r^2_{1 \leftrightarrow j}=r^2_{2 \leftrightarrow j}$, they should both be rewarded equally; in other words, they should have equal weights.
$$
w_{1}=\frac{1}{1 + 0 + 0}=1
$$
$$
w_{2}=\frac{1}{0 + 1 + 0}=1
$$
$$
w_{3}=\frac{1}{0 + 0 + 1}=1
$$
Now consider a case where $x_1$ and $x_2$ are fully correlated. It would be a bad idea to reward them equally; hence, their weights suffer.
| | $x_1$ | $x_2$ | $x_3$ | $x_j$ |
| ----- | ----- | ----------- | ----- | ----- |
| $x_1$ | $1$ | $\boxed{1}$ | $0$ | $1$ |
| $x_2$ | | $1$ | $0$ | $1$ |
| $x_3$ | | | $1$ | $1$ |
| $x_j$ | | | | $1$ |
$$
w_{1}=\frac{1}{1 + 1 + 0}=0.5
$$
$$
w_{2}=\frac{1}{1 + 1 + 0}=0.5
$$
$$
w_{3}=\frac{1}{0 + 0 + 1}=1
$$
-71
View File
@@ -1,71 +0,0 @@
# BlitzKit Regular Tank Stats
A straightforward way of storing the entire World of Tanks Blitz tank statistics for players to disk.
## Manifest `manifest.rtsm`
```cpp
primary RegularTankStatisticsManifest {
utf8"RTSM" magic;
Header header;
primary Body body;
}
Header {
uint16 version; // always 1
}
Body {
uint32 time;
uint8 base;
}
```
## Chunk `*.rtsc`
```cpp
primary RegularTankStatisticsChunk {
utf8"RTSC" magic;
Header header;
primary Body body<header.playerCount>;
}
Header {
uint16 version; // always 1
uint32 playerCount;
}
Body<uint32 playerCount> {
Player[playerCount] players;
}
Player {
uint32 id;
uint16 tankCount;
Tank[tankCount] tanks;
}
Tank {
uint32 id;
uint32 battleLifeTime;
uint32 lastBattleTime;
uint8 markOfMastery;
uint32 battles;
uint32 capturePoints;
uint32 damageDealt;
uint32 damageReceived;
uint32 droppedCapturePoints;
uint32 frags;
uint32 frags8p;
uint32 hits;
uint32 losses;
uint8 maxFrags;
uint16 maxXp;
uint32 shots;
uint32 spotted;
uint32 survivedBattles;
uint32 winAndSurvived;
uint32 wins;
uint32 xp;
}
```
+22 -3
View File
@@ -4,14 +4,33 @@
"paths": { "paths": {
"default": null, "default": null,
"api": null
"api": null,
"models_tanks": null,
"models_legendary": null,
"models_maps": null
}, },
"nodes": { "nodes": {
"default": "blitzkit/deploy-node-beta.blitzkit.app", "default": "blitzkit/deploy-node-beta.blitzkit.app",
"api": "blitzkit/deploy-node-api.beta.blitzkit.app"
"api": "blitzkit/deploy-node-api.beta.blitzkit.app",
"models_tanks": "blitzkit/deploy-node-tanks.models.beta.blitzkit.app",
"models_legendary": "blitzkit/deploy-node-legendary.models.beta.blitzkit.app",
"models_maps": "blitzkit/deploy-node-maps.models.beta.blitzkit.app"
}, },
"aliases": { "aliases": {
"default": "/",
"api": "https://api.beta.blitzkit.app", "api": "https://api.beta.blitzkit.app",
"static": "https://static.beta.blitzkit.app"
"models_tanks": "https://tanks.models.beta.blitzkit.app",
"models_legendary": "https://legendary.models.beta.blitzkit.app",
"models_maps": "https://maps.models.beta.blitzkit.app",
"static": "https://static.blitzkit.app"
} }
} }
+15 -1
View File
@@ -4,11 +4,25 @@
"paths": { "paths": {
"default": null, "default": null,
"api": "api"
"api": "api",
"models_tanks": "models/tanks",
"models_legendary": "models/legendary",
"models_maps": "models/maps"
}, },
"nodes": {}, "nodes": {},
"aliases": { "aliases": {
"default": "/",
"api": "/api", "api": "/api",
"models_tanks": "/models/tanks",
"models_legendary": "/models/legendary",
"models_maps": "/models/maps",
"static": "https://static.blitzkit.app" "static": "https://static.blitzkit.app"
} }
} }
+22 -3
View File
@@ -4,14 +4,33 @@
"paths": { "paths": {
"default": null, "default": null,
"api": null
"api": null,
"models_tanks": null,
"models_legendary": null,
"models_maps": null
}, },
"nodes": { "nodes": {
"default": "blitzkit/deploy-node-opentest.blitzkit.app", "default": "blitzkit/deploy-node-opentest.blitzkit.app",
"api": "blitzkit/deploy-node-api.opentest.blitzkit.app"
"api": "blitzkit/deploy-node-api.opentest.blitzkit.app",
"models_tanks": "blitzkit/deploy-node-tanks.models.opentest.blitzkit.app",
"models_legendary": "blitzkit/deploy-node-legendary.models.opentest.blitzkit.app",
"models_maps": "blitzkit/deploy-node-maps.models.opentest.blitzkit.app"
}, },
"aliases": { "aliases": {
"default": "/",
"api": "https://api.opentest.blitzkit.app", "api": "https://api.opentest.blitzkit.app",
"static": "https://static.opentest.blitzkit.app"
"models_tanks": "https://tanks.models.opentest.blitzkit.app",
"models_legendary": "https://legendary.models.opentest.blitzkit.app",
"models_maps": "https://maps.models.opentest.blitzkit.app",
"static": "https://static.blitzkit.app"
} }
} }
+22 -3
View File
@@ -4,14 +4,33 @@
"paths": { "paths": {
"default": null, "default": null,
"api": null
"api": null,
"models_tanks": null,
"models_legendary": null,
"models_maps": null
}, },
"nodes": { "nodes": {
"default": "blitzkit/deploy-node-preview.blitzkit.app", "default": "blitzkit/deploy-node-preview.blitzkit.app",
"api": "blitzkit/deploy-node-api.preview.blitzkit.app"
"api": "blitzkit/deploy-node-api.preview.blitzkit.app",
"models_tanks": "blitzkit/deploy-node-tanks.models.preview.blitzkit.app",
"models_legendary": "blitzkit/deploy-node-legendary.models.preview.blitzkit.app",
"models_maps": "blitzkit/deploy-node-maps.models.preview.blitzkit.app"
}, },
"aliases": { "aliases": {
"default": "/",
"api": "https://api.preview.blitzkit.app", "api": "https://api.preview.blitzkit.app",
"static": "https://static.preview.blitzkit.app"
"models_tanks": "https://tanks.models.preview.blitzkit.app",
"models_legendary": "https://legendary.models.preview.blitzkit.app",
"models_maps": "https://maps.models.preview.blitzkit.app",
"static": "https://static.blitzkit.app"
} }
} }
+21 -2
View File
@@ -4,14 +4,33 @@
"paths": { "paths": {
"default": null, "default": null,
"api": null
"api": null,
"models_tanks": null,
"models_legendary": null,
"models_maps": null
}, },
"nodes": { "nodes": {
"default": "blitzkit/deploy-node-blitzkit.app", "default": "blitzkit/deploy-node-blitzkit.app",
"api": "blitzkit/deploy-node-api.blitzkit.app"
"api": "blitzkit/deploy-node-api.blitzkit.app",
"models_tanks": "blitzkit/deploy-node-tanks.models.blitzkit.app",
"models_legendary": "blitzkit/deploy-node-legendary.models.blitzkit.app",
"models_maps": "blitzkit/deploy-node-maps.models.blitzkit.app"
}, },
"aliases": { "aliases": {
"default": "/",
"api": "https://api.blitzkit.app", "api": "https://api.blitzkit.app",
"models_tanks": "https://tanks.models.blitzkit.app",
"models_legendary": "https://legendary.models.blitzkit.app",
"models_maps": "https://maps.models.blitzkit.app",
"static": "https://static.blitzkit.app" "static": "https://static.blitzkit.app"
} }
} }
+5 -3
View File
@@ -1,16 +1,18 @@
{ {
"name": "blitzkit", "name": "blitzkit",
"version": "1.31.4", "version": "1.33.0-beta.1",
"license": "BlitzKit License", "license": "BlitzKit License",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "cd packages/website && bun --bun run dev", "dev": "cd packages/website && bun --bun run dev",
"build": "cd packages/website && bun run build", "build": "cd packages/website && bun --bun run build",
"discover-ids": "cd packages/scripts && bun run discover-ids", "discover-ids": "cd packages/scripts && bun run discover-ids",
"build-protos": "cd packages/scripts && bun run build-protos", "build-protos": "cd packages/scripts && bun run build-protos",
"record-performance": "cd packages/scripts && bun run record-performance", "record-performance": "cd packages/scripts && bun run record-performance",
"download-client": "cd packages/scripts && bun run download-client", "download-client": "cd packages/scripts && bun run download-client",
"clean-astro": "rm -rf packages/website/.astro packages/website/node_modules/.astro packages/website/node_modules/.vite" "download-smart-dlc": "cd packages/scripts && bun run download-smart-dlc",
"clean-astro": "rm -rf packages/website/.astro packages/website/node_modules/.astro packages/website/node_modules/.vite",
"vfs": "cd packages/scripts && bun run vfs"
}, },
"type": "module", "type": "module",
"workspaces": [ "workspaces": [
@@ -246,6 +246,27 @@ export abstract class ServerBlitzKitAPI0 extends BlitzKitAPI {
return this; return this;
} }
protected getTankFilterIds(
name: string,
definitionKey: string,
filter: "include" | "exclude",
) {
const keys = name.trim().split(/\s+/).filter(Boolean);
return keys.flatMap((key) => {
const id = this.tankStringIdMap[key];
if (id === undefined) {
console.warn(
`Skipping unavailable tank "${key}" in ${filter} vehicle filter for "${definitionKey}"`,
);
return [];
}
return [id];
});
}
protected getString(name: string) { protected getString(name: string) {
const collection: Record<string, string> = { const collection: Record<string, string> = {
[locales.default]: this.stringsI18n[locales.default][name], [locales.default]: this.stringsI18n[locales.default][name],
@@ -264,6 +285,8 @@ export abstract class ServerBlitzKitAPI0 extends BlitzKitAPI {
collection[locale] = localizedString; collection[locale] = localizedString;
} }
collection[locales.default] = collection[locales.default] ?? name;
return { locales: collection } satisfies I18nString; return { locales: collection } satisfies I18nString;
} }
} }
@@ -387,7 +387,7 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
: TankType.TANK_TYPE_RESEARCHABLE, : TankType.TANK_TYPE_RESEARCHABLE,
tier: tank.level, tier: tank.level,
class: tankClass, class: tankClass,
testing: tankTags.includes("testTank"), testing: tankTags.includes("testTank") || tank.level === 11,
deprecated: tankTags.includes("deprecated"), deprecated: tankTags.includes("deprecated"),
price: tankPrice, price: tankPrice,
camouflage_still: tankDefinition.root.invisibility.still, camouflage_still: tankDefinition.root.invisibility.still,
@@ -434,6 +434,7 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
resistance_hard: terrainResistances[0], resistance_hard: terrainResistances[0],
resistance_medium: terrainResistances[1], resistance_medium: terrainResistances[1],
resistance_soft: terrainResistances[2], resistance_soft: terrainResistances[2],
repair_time: track.hysteresisHealth / track.healthRegenPerSec,
tier: track.level, tier: track.level,
unlocks: resolveUnlocks( unlocks: resolveUnlocks(
this.blitzModuleTypeToBlitzkit, this.blitzModuleTypeToBlitzkit,
@@ -594,9 +595,25 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
for (const shellKey in gunListEntry.shots) { for (const shellKey in gunListEntry.shots) {
const gunShellEntry = gunListEntry.shots[shellKey]; const gunShellEntry = gunListEntry.shots[shellKey];
const shell = shellList.root[shellKey]; const shell = shellList.root[shellKey];
// Newer client data stores shot properties on the shell rather
// than repeating them under every gun's <shots> entry.
const speed =
typeof gunShellEntry === "string"
? shell.speed
: gunShellEntry.speed;
const maxDistance =
typeof gunShellEntry === "string"
? shell.maxDistance
: gunShellEntry.maxDistance;
const piercingPower =
typeof gunShellEntry === "string"
? shell.piercingPower
: gunShellEntry.piercingPower;
const shellId = toUniqueId(nation, shell.id); const shellId = toUniqueId(nation, shell.id);
const shellName = this.getString(shell.userString); const shellName = this.getString(shell.userString);
const penetrationRaw = gunShellEntry.piercingPower const penetrationRaw = piercingPower
.split(" ") .split(" ")
.filter((penetrationString) => penetrationString !== "") .filter((penetrationString) => penetrationString !== "")
.map(Number); .map(Number);
@@ -606,7 +623,7 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
].shells.push({ ].shells.push({
id: shellId, id: shellId,
name: shellName, name: shellName,
velocity: gunShellEntry.speed, velocity: speed,
armor_damage: shell.damage.armor, armor_damage: shell.damage.armor,
module_damage: shell.damage.devices, module_damage: shell.damage.devices,
caliber: shell.caliber, caliber: shell.caliber,
@@ -622,7 +639,7 @@ export abstract class ServerBlitzKitAPI1 extends ServerBlitzKitAPI0 {
near: penetrationRaw[0], near: penetrationRaw[0],
far: penetrationRaw[1], far: penetrationRaw[1],
}, },
range: gunShellEntry.maxDistance, range: maxDistance,
}); });
} }
@@ -1,15 +1,60 @@
import { CamouflageDefinitions } from "@blitzkit/core"; import {
CamouflageDefinitions,
Sc2ReadStream,
type TankParameters,
} from "@blitzkit/core";
import { isEqual, times } from "lodash-es";
import { Cache } from "./0_base"; import { Cache } from "./0_base";
import { ServerBlitzKitAPI1 } from "./1_tankDefinitions"; import { ServerBlitzKitAPI1 } from "./1_tankDefinitions";
export abstract class ServerBlitzKitAPI2 extends ServerBlitzKitAPI1 { export abstract class ServerBlitzKitAPI2 extends ServerBlitzKitAPI1 {
private async skinPresets(vehicle: string) {
const [nation, tankKey] = vehicle.split(":");
const parameters = await this.vfs.yaml<TankParameters>(
`Data/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`,
);
const sc2 = new Sc2ReadStream(
(
await this.vfs.file(
`Data/3d/${parameters.resourcesPath.blitzModelPath}`,
)
).buffer as ArrayBuffer,
).sc2();
const presets = new Set<string>();
for (const node of sc2["#dataNodes"]) {
if (typeof node.configCount !== "number") continue;
times(node.configCount, (index) => node[`configArchive_${index}`])
.filter(
(archive) =>
!isEqual(archive.textures, node.configArchive_0.textures),
)
.forEach((archive) => presets.add(archive.configName));
}
return presets;
}
@Cache() @Cache()
async camouflageDefinitions() { async camouflageDefinitions() {
const camouflageDefinitions = CamouflageDefinitions.create(); const camouflageDefinitions = CamouflageDefinitions.create();
const customization = await this.vfs.yaml<
Record<string, { Name: string; Path: string }>
>("Data/3d/Customization.yaml");
const items = new Map(
Object.values(customization).map(({ Name, Path }) => [
Name,
Path.replace("~res:/", "Data/").replace(/\.sc2$/, ""),
]),
);
const skinPresets = new Map<string, Promise<Set<string>>>();
for (const camoKey in this.camouflagesXml!.root.camouflages) { for (const camoKey in this.camouflagesXml!.root.camouflages) {
const camo = this.camouflagesXml!.root.camouflages[camoKey]; const camo = this.camouflagesXml!.root.camouflages[camoKey];
if (!(camoKey in this.camouflagesYaml!)) continue;
const yamlEntry = this.camouflagesYaml![camoKey]; const yamlEntry = this.camouflagesYaml![camoKey];
const fullName = yamlEntry.userString const fullName = yamlEntry.userString
? this.getString(yamlEntry.userString) ? this.getString(yamlEntry.userString)
@@ -20,12 +65,51 @@ export abstract class ServerBlitzKitAPI2 extends ServerBlitzKitAPI1 {
const resolvedTankName = shortName ?? fullName; const resolvedTankName = shortName ?? fullName;
const resolvedTankNameFull = const resolvedTankNameFull =
resolvedTankName === fullName ? undefined : fullName; resolvedTankName === fullName ? undefined : fullName;
const include = camo.vehicleFilter.include;
const vehicle =
include && !Array.isArray(include) && "vehicle" in include
? include.vehicle?.name
: undefined;
let tankId: number | undefined = undefined;
if (vehicle && vehicle in this.tankStringIdMap) {
const resolvedParts = await Promise.all(
Object.values(yamlEntry.customEntities ?? {}).map(
async ({ item }) => {
const path = items.get(item);
return (
path !== undefined &&
(await this.vfs.resolve(`${path}.sc2`)) &&
(await this.vfs.resolve(`${path}.scg`))
);
},
),
);
let hasPreset = false;
if (camo.group === "legendary" && yamlEntry.preset !== undefined) {
if (!skinPresets.has(vehicle)) {
skinPresets.set(vehicle, this.skinPresets(vehicle));
}
hasPreset = (await skinPresets.get(vehicle)!).has(yamlEntry.preset);
}
if (resolvedParts.some(Boolean) || hasPreset) {
tankId = this.tankStringIdMap[vehicle];
}
}
const name = this.getString(camo.userString);
camouflageDefinitions.camouflages[camo.id] = { camouflageDefinitions.camouflages[camo.id] = {
id: camo.id, id: camo.id,
name: this.getString(camo.userString), name,
tank_name: resolvedTankName, tank_name: resolvedTankName,
tank_name_full: resolvedTankNameFull, tank_name_full: resolvedTankNameFull,
tank_id: tankId,
}; };
} }
@@ -4,7 +4,13 @@ import {
ChassisDefinitionsList, ChassisDefinitionsList,
Crew, Crew,
GunDefinitionsList, GunDefinitionsList,
I_HAT,
J_HAT,
K_HAT,
ModelDefinitions, ModelDefinitions,
parseHierarchies,
Sc2ReadStream,
ScgReadStream,
TankParameters, TankParameters,
toUniqueId, toUniqueId,
TurretDefinitionsList, TurretDefinitionsList,
@@ -12,9 +18,10 @@ import {
VehicleDefinitionArmor, VehicleDefinitionArmor,
VehicleDefinitionList, VehicleDefinitionList,
VehicleDefinitions, VehicleDefinitions,
VertexAttribute,
} from "@blitzkit/core"; } from "@blitzkit/core";
import { parse as parsePath } from "path"; import { parse as parsePath } from "path";
import { Vector3Tuple } from "three"; import { MathUtils, Vector3 as THREEVector3, Vector3Tuple } from "three";
import { Cache } from "./0_base"; import { Cache } from "./0_base";
import { ServerBlitzKitAPI2 } from "./2_camouflageDefinitions"; import { ServerBlitzKitAPI2 } from "./2_camouflageDefinitions";
@@ -23,6 +30,87 @@ export abstract class ServerBlitzKitAPI3 extends ServerBlitzKitAPI2 {
return { x: tuple[0], y: tuple[1], z: tuple[2] } satisfies Vector3; return { x: tuple[0], y: tuple[1], z: tuple[2] } satisfies Vector3;
} }
private async collisionBoundingBoxes(
nation: string,
tankKey: string,
turretRotation?: { yaw: number; pitch: number; roll: number },
) {
const boundingBoxes: Record<
string,
{ min: Vector3Tuple; max: Vector3Tuple }
> = {};
const path = `Data/3d/Tanks/CollisionMeshes/${nation}-${tankKey}`;
if (!(await this.vfs.resolve(`${path}.sc2`))) {
throw new Error(`Missing collision mesh for ${nation}-${tankKey}`);
}
const sc2 = new Sc2ReadStream(
(await this.vfs.file(`${path}.sc2`)).buffer as ArrayBuffer,
).sc2();
const scg = new ScgReadStream(
(await this.vfs.file(`${path}.scg`)).buffer as ArrayBuffer,
).scg();
parseHierarchies(sc2["#hierarchy"], null, (hierarchy, components) => {
for (const component of components) {
if (component["comp.typename"] !== "RenderComponent") continue;
const polygonGroup = scg.get(
component["rc.renderObj"]["ro.batches"]["0000"]["rb.datasource"],
);
if (!polygonGroup) continue;
const min: Vector3Tuple = [Infinity, Infinity, Infinity];
const max: Vector3Tuple = [-Infinity, -Infinity, -Infinity];
const rotate =
turretRotation && hierarchy.name.toLowerCase().startsWith("turret");
polygonGroup.vertices.forEach((vertex) => {
vertex.forEach(({ attribute, value }) => {
if (attribute !== VertexAttribute.VERTEX) return;
const position = new THREEVector3(...value);
if (rotate) {
position
.applyAxisAngle(
I_HAT,
-MathUtils.degToRad(turretRotation.pitch),
)
.applyAxisAngle(
J_HAT,
-MathUtils.degToRad(turretRotation.roll),
)
.applyAxisAngle(
K_HAT,
-MathUtils.degToRad(turretRotation.yaw),
);
}
const coordinates = position.toArray();
for (let axis = 0; axis < 3; axis++) {
min[axis] = Math.min(min[axis], coordinates[axis]);
max[axis] = Math.max(max[axis], coordinates[axis]);
}
});
});
boundingBoxes[hierarchy.name.toLowerCase()] = { min, max };
}
return null;
});
if (!boundingBoxes.hull) {
throw new Error(`Missing hull collision mesh for ${nation}-${tankKey}`);
}
return boundingBoxes;
}
private assignArmor( private assignArmor(
raw: VehicleDefinitionArmor[string], raw: VehicleDefinitionArmor[string],
id: number, id: number,
@@ -67,6 +155,12 @@ export abstract class ServerBlitzKitAPI3 extends ServerBlitzKitAPI2 {
const tankParameters = await this.vfs.yaml<TankParameters>( const tankParameters = await this.vfs.yaml<TankParameters>(
`Data/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`, `Data/3d/Tanks/Parameters/${nation}/${tankKey}.yaml`,
); );
const collisionBoundingBoxes = await this.collisionBoundingBoxes(
nation,
tankKey,
tankDefinition.root.hull.turretInitialRotation,
);
const hullBoundingBox = collisionBoundingBoxes.hull;
const turretOrigin = tankDefinition.root.hull.turretPositions.turret const turretOrigin = tankDefinition.root.hull.turretPositions.turret
.split(" ") .split(" ")
.map(Number) as Vector3Tuple; .map(Number) as Vector3Tuple;
@@ -141,12 +235,8 @@ export abstract class ServerBlitzKitAPI3 extends ServerBlitzKitAPI2 {
} }
: undefined, : undefined,
bounding_box: { bounding_box: {
min: this.vector3TupleToBlitzkit( min: this.vector3TupleToBlitzkit(hullBoundingBox.min),
tankParameters.collision.hull.bbox.min, max: this.vector3TupleToBlitzkit(hullBoundingBox.max),
),
max: this.vector3TupleToBlitzkit(
tankParameters.collision.hull.bbox.max,
),
}, },
turrets: {}, turrets: {},
tracks: {}, tracks: {},
@@ -208,26 +298,35 @@ export abstract class ServerBlitzKitAPI3 extends ServerBlitzKitAPI2 {
turret.userString; turret.userString;
const turretCollisionName = parsePath(
turret.hitTester.collisionModel,
).name.toLowerCase();
const isFullYaw = -turretYaw[0] + turretYaw[1] === 360;
if (!collisionBoundingBoxes[turretCollisionName] && isFullYaw) {
throw new Error(
`Missing turret collision mesh for ${nation}-${tankKey} ${turretKey}`,
);
}
const turretBoundingBox = collisionBoundingBoxes[
turretCollisionName
] ?? {
min: [0, 0, 0] as Vector3Tuple,
max: [0, 0, 0] as Vector3Tuple,
};
modelDefinitions.models[tankId].turrets[turretId] = { modelDefinitions.models[tankId].turrets[turretId] = {
armor: turretArmor, armor: turretArmor,
gun_origin: this.vector3TupleToBlitzkit(gunOrigin), gun_origin: this.vector3TupleToBlitzkit(gunOrigin),
model_id: turretModel, model_id: turretModel,
yaw: yaw: isFullYaw
-turretYaw[0] + turretYaw[1] === 360 ? undefined
? undefined : { min: turretYaw[0], max: turretYaw[1] },
: { min: turretYaw[0], max: turretYaw[1] },
guns: {}, guns: {},
bounding_box: { bounding_box: {
min: this.vector3TupleToBlitzkit( min: this.vector3TupleToBlitzkit(turretBoundingBox.min),
tankParameters.collision[ max: this.vector3TupleToBlitzkit(turretBoundingBox.max),
parsePath(turret.hitTester.collisionModel).name.toLowerCase()
].bbox.min,
),
max: this.vector3TupleToBlitzkit(
tankParameters.collision[
parsePath(turret.hitTester.collisionModel).name.toLowerCase()
].bbox.max,
),
}, },
}; };
@@ -44,9 +44,7 @@ export abstract class ServerBlitzKitAPI6 extends ServerBlitzKitAPI5 {
filter_type: { filter_type: {
$case: "ids", $case: "ids",
value: { value: {
ids: includeRaw.name.split(/ +/).map((key) => { ids: this.getTankFilterIds(includeRaw.name, key, "include"),
return this.tankStringIdMap[key];
}),
}, },
}, },
}); });
@@ -72,9 +70,7 @@ export abstract class ServerBlitzKitAPI6 extends ServerBlitzKitAPI5 {
filter_type: { filter_type: {
$case: "ids", $case: "ids",
value: { value: {
ids: excludeRaw.name.split(/ +/).map((key) => { ids: this.getTankFilterIds(excludeRaw.name, key, "exclude"),
return this.tankStringIdMap[key];
}),
}, },
}, },
}); });
@@ -11,7 +11,7 @@ export abstract class ServerBlitzKitAPI7 extends ServerBlitzKitAPI6 {
async provisionDefinitions() { async provisionDefinitions() {
const provisionDefinitions = ProvisionDefinitions.create(); const provisionDefinitions = ProvisionDefinitions.create();
Object.entries(this.provisionsCommon).forEach(([, provision]) => { Object.entries(this.provisionsCommon).forEach(([key, provision]) => {
const entry: Provision = { const entry: Provision = {
id: provision.id, id: provision.id,
exclude: [], exclude: [],
@@ -42,9 +42,7 @@ export abstract class ServerBlitzKitAPI7 extends ServerBlitzKitAPI6 {
filter_type: { filter_type: {
$case: "ids", $case: "ids",
value: { value: {
ids: includeRaw.name.split(/ +/).map((key) => { ids: this.getTankFilterIds(includeRaw.name, key, "include"),
return this.tankStringIdMap[key];
}),
}, },
}, },
}); });
@@ -70,9 +68,7 @@ export abstract class ServerBlitzKitAPI7 extends ServerBlitzKitAPI6 {
filter_type: { filter_type: {
$case: "ids", $case: "ids",
value: { value: {
ids: excludeRaw.name ids: this.getTankFilterIds(excludeRaw.name, key, "exclude"),
.split(/ +/)
.map((key) => this.tankStringIdMap[key]),
}, },
}, },
}); });
+1
View File
@@ -25,6 +25,7 @@ export * from "./sluggify";
export * from "./staticAsset"; export * from "./staticAsset";
export * from "./sum"; export * from "./sum";
export * from "./tankDefinitions"; export * from "./tankDefinitions";
export * from "./tankBoundingBox";
export * from "./tankIcon"; export * from "./tankIcon";
export * from "./tankNames"; export * from "./tankNames";
export * from "./unionBoundingBox"; export * from "./unionBoundingBox";
@@ -0,0 +1,32 @@
import { ModelDefinition, TurretModelDefinition } from "../protos";
import { unionBoundingBox } from "./unionBoundingBox";
export function tankBoundingBox(
tankModelDefinition: ModelDefinition,
turretModelDefinition: TurretModelDefinition,
) {
const hull = tankModelDefinition.bounding_box!;
const turret = turretModelDefinition.bounding_box!;
const origin = tankModelDefinition.turret_origin!;
if (
turret.min!.x === turret.max!.x &&
turret.min!.y === turret.max!.y &&
turret.min!.z === turret.max!.z
) {
return unionBoundingBox(hull, hull);
}
return unionBoundingBox(hull, {
min: {
x: turret.min!.x + origin.x,
y: turret.min!.y + origin.z,
z: turret.min!.z + origin.y,
},
max: {
x: turret.max!.x + origin.x,
y: turret.max!.y + origin.z,
z: turret.max!.z + origin.y,
},
});
}
@@ -1,5 +1,5 @@
import { times } from "lodash-es"; import { times } from "lodash-es";
import { CrewType, ShellType, TankClass, TankType } from "../../protos"; import { CrewType, ShellType } from "../../protos";
export const SHELL_NAMES: Record<ShellType, string> = { export const SHELL_NAMES: Record<ShellType, string> = {
[ShellType.SHELL_TYPE_AP]: "AP", [ShellType.SHELL_TYPE_AP]: "AP",
@@ -15,33 +15,6 @@ export const CREW_MEMBER_NAMES = {
[CrewType.CREW_TYPE_RADIOMAN]: "radioman", [CrewType.CREW_TYPE_RADIOMAN]: "radioman",
} as const; } as const;
/**
* @deprecated use svg
*/
export const TANK_ICONS: Record<TankClass, string> = {
[TankClass.TANK_CLASS_TANK_DESTROYER]: "https://i.imgur.com/BIHSEH0.png",
[TankClass.TANK_CLASS_LIGHT]: "https://i.imgur.com/CSNha5V.png",
[TankClass.TANK_CLASS_MEDIUM]: "https://i.imgur.com/wvf3ltm.png",
[TankClass.TANK_CLASS_HEAVY]: "https://i.imgur.com/ECeqlZa.png",
};
/**
* @deprecated use svg
*/
export const TANK_ICONS_PREMIUM: Record<TankClass, string> = {
[TankClass.TANK_CLASS_TANK_DESTROYER]: "https://i.imgur.com/TCu3EdR.png",
[TankClass.TANK_CLASS_LIGHT]: "https://i.imgur.com/zdkpTRb.png",
[TankClass.TANK_CLASS_MEDIUM]: "https://i.imgur.com/3z7eHX6.png",
[TankClass.TANK_CLASS_HEAVY]: "https://i.imgur.com/P3vbmyA.png",
};
/**
* @deprecated use svg
*/
export const TANK_ICONS_COLLECTOR: Record<TankClass, string> = {
[TankClass.TANK_CLASS_TANK_DESTROYER]: "https://i.imgur.com/WTjeirB.png",
[TankClass.TANK_CLASS_LIGHT]: "https://i.imgur.com/EwhtKkU.png",
[TankClass.TANK_CLASS_MEDIUM]: "https://i.imgur.com/u8YDMBh.png",
[TankClass.TANK_CLASS_HEAVY]: "https://i.imgur.com/8xRf3nc.png",
};
export const TIERS = times(10, (index) => index + 1); export const TIERS = times(10, (index) => index + 1);
export const TIER_ROMAN_NUMERALS: Record<number, string> = { export const TIER_ROMAN_NUMERALS: Record<number, string> = {
1: "I", 1: "I",
@@ -68,8 +41,3 @@ export const flags: Record<string, string> = {
european: "🇪🇺", european: "🇪🇺",
other: "<:other:1218421572243558482>", other: "<:other:1218421572243558482>",
}; };
export const TREE_TYPE_ICONS: Record<TankType, Record<TankClass, string>> = {
[TankType.TANK_TYPE_RESEARCHABLE]: TANK_ICONS,
[TankType.TANK_TYPE_PREMIUM]: TANK_ICONS_PREMIUM,
[TankType.TANK_TYPE_COLLECTOR]: TANK_ICONS_COLLECTOR,
};
-50
View File
@@ -1,50 +0,0 @@
export enum ImgurSize {
/**
* The default size
*/
Default = '',
/**
* Unknown size but really really small
*/
UltraSmall = 'ss',
/**
* 90x90
*/
SmallSquare = 's',
/**
* 160x160
*/
BigSquare = 'b',
/**
* 160x160
*/
SmallThumbnail = 't',
/**
* 320x320
*/
MediumThumbnail = 'm',
/**
* 640x640
*/
LargeThumbnail = 'l',
/**
* 1024x1024
*/
HugeThumbnail = 'h',
}
interface ImgurOptions {
format: 'jpeg' | 'png';
size: ImgurSize;
}
const defaultImgurOptions: ImgurOptions = {
format: 'png',
size: ImgurSize.Default,
};
export function imgur(id: string, imgurOptions?: Partial<ImgurOptions>) {
const options = { ...defaultImgurOptions, ...imgurOptions };
return `https://i.imgur.com/${id}${options.size}.${options.format}`;
}
-1
View File
@@ -1 +0,0 @@
export * from './imgur';
-1
View File
@@ -1,6 +1,5 @@
export * from "./blitz"; export * from "./blitz";
export * from "./blitzkit"; export * from "./blitzkit";
export * from "./imgur";
export * from "./math"; export * from "./math";
export * from "./patreon"; export * from "./patreon";
export * from "./protobuf"; export * from "./protobuf";
@@ -13,4 +13,5 @@ message Camouflage {
required I18nString name = 2; required I18nString name = 2;
optional I18nString tank_name = 3; optional I18nString tank_name = 3;
optional I18nString tank_name_full = 4; optional I18nString tank_name_full = 4;
optional uint32 tank_id = 5;
} }
@@ -24,6 +24,7 @@ export interface Camouflage {
name: I18nString | undefined; name: I18nString | undefined;
tank_name?: I18nString | undefined; tank_name?: I18nString | undefined;
tank_name_full?: I18nString | undefined; tank_name_full?: I18nString | undefined;
tank_id?: number | undefined;
} }
function createBaseCamouflageDefinitions(): CamouflageDefinitions { function createBaseCamouflageDefinitions(): CamouflageDefinitions {
@@ -191,7 +192,7 @@ export const CamouflageDefinitions_CamouflagesEntry: MessageFns<CamouflageDefini
}; };
function createBaseCamouflage(): Camouflage { function createBaseCamouflage(): Camouflage {
return { id: 0, name: undefined, tank_name: undefined, tank_name_full: undefined }; return { id: 0, name: undefined, tank_name: undefined, tank_name_full: undefined, tank_id: 0 };
} }
export const Camouflage: MessageFns<Camouflage> = { export const Camouflage: MessageFns<Camouflage> = {
@@ -208,6 +209,9 @@ export const Camouflage: MessageFns<Camouflage> = {
if (message.tank_name_full !== undefined) { if (message.tank_name_full !== undefined) {
I18nString.encode(message.tank_name_full, writer.uint32(34).fork()).join(); I18nString.encode(message.tank_name_full, writer.uint32(34).fork()).join();
} }
if (message.tank_id !== undefined && message.tank_id !== 0) {
writer.uint32(40).uint32(message.tank_id);
}
return writer; return writer;
}, },
@@ -250,6 +254,14 @@ export const Camouflage: MessageFns<Camouflage> = {
message.tank_name_full = I18nString.decode(reader, reader.uint32()); message.tank_name_full = I18nString.decode(reader, reader.uint32());
continue; continue;
} }
case 5: {
if (tag !== 40) {
break;
}
message.tank_id = reader.uint32();
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
@@ -265,6 +277,7 @@ export const Camouflage: MessageFns<Camouflage> = {
name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined, name: isSet(object.name) ? I18nString.fromJSON(object.name) : undefined,
tank_name: isSet(object.tank_name) ? I18nString.fromJSON(object.tank_name) : undefined, tank_name: isSet(object.tank_name) ? I18nString.fromJSON(object.tank_name) : undefined,
tank_name_full: isSet(object.tank_name_full) ? I18nString.fromJSON(object.tank_name_full) : undefined, tank_name_full: isSet(object.tank_name_full) ? I18nString.fromJSON(object.tank_name_full) : undefined,
tank_id: isSet(object.tank_id) ? globalThis.Number(object.tank_id) : 0,
}; };
}, },
@@ -282,6 +295,9 @@ export const Camouflage: MessageFns<Camouflage> = {
if (message.tank_name_full !== undefined) { if (message.tank_name_full !== undefined) {
obj.tank_name_full = I18nString.toJSON(message.tank_name_full); obj.tank_name_full = I18nString.toJSON(message.tank_name_full);
} }
if (message.tank_id !== undefined && message.tank_id !== 0) {
obj.tank_id = Math.round(message.tank_id);
}
return obj; return obj;
}, },
@@ -300,6 +316,7 @@ export const Camouflage: MessageFns<Camouflage> = {
message.tank_name_full = (object.tank_name_full !== undefined && object.tank_name_full !== null) message.tank_name_full = (object.tank_name_full !== undefined && object.tank_name_full !== null)
? I18nString.fromPartial(object.tank_name_full) ? I18nString.fromPartial(object.tank_name_full)
: undefined; : undefined;
message.tank_id = object.tank_id ?? 0;
return message; return message;
}, },
}; };
@@ -87,6 +87,7 @@ message TrackDefinition {
required float resistance_medium = 10; required float resistance_medium = 10;
required float resistance_soft = 11; required float resistance_soft = 11;
repeated Unlock unlocks = 12; repeated Unlock unlocks = 12;
required float repair_time = 13;
} }
message EngineDefinition { message EngineDefinition {
@@ -338,6 +338,7 @@ export interface TrackDefinition {
resistance_medium: number; resistance_medium: number;
resistance_soft: number; resistance_soft: number;
unlocks: Unlock[]; unlocks: Unlock[];
repair_time: number;
} }
export interface EngineDefinition { export interface EngineDefinition {
@@ -1759,6 +1760,7 @@ function createBaseTrackDefinition(): TrackDefinition {
resistance_medium: 0, resistance_medium: 0,
resistance_soft: 0, resistance_soft: 0,
unlocks: [], unlocks: [],
repair_time: 0,
}; };
} }
@@ -1800,6 +1802,9 @@ export const TrackDefinition: MessageFns<TrackDefinition> = {
for (const v of message.unlocks) { for (const v of message.unlocks) {
Unlock.encode(v!, writer.uint32(98).fork()).join(); Unlock.encode(v!, writer.uint32(98).fork()).join();
} }
if (message.repair_time !== 0) {
writer.uint32(109).float(message.repair_time);
}
return writer; return writer;
}, },
@@ -1906,6 +1911,14 @@ export const TrackDefinition: MessageFns<TrackDefinition> = {
message.unlocks.push(Unlock.decode(reader, reader.uint32())); message.unlocks.push(Unlock.decode(reader, reader.uint32()));
continue; continue;
} }
case 13: {
if (tag !== 109) {
break;
}
message.repair_time = reader.float();
continue;
}
} }
if ((tag & 7) === 4 || tag === 0) { if ((tag & 7) === 4 || tag === 0) {
break; break;
@@ -1929,6 +1942,7 @@ export const TrackDefinition: MessageFns<TrackDefinition> = {
resistance_medium: isSet(object.resistance_medium) ? globalThis.Number(object.resistance_medium) : 0, resistance_medium: isSet(object.resistance_medium) ? globalThis.Number(object.resistance_medium) : 0,
resistance_soft: isSet(object.resistance_soft) ? globalThis.Number(object.resistance_soft) : 0, resistance_soft: isSet(object.resistance_soft) ? globalThis.Number(object.resistance_soft) : 0,
unlocks: globalThis.Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => Unlock.fromJSON(e)) : [], unlocks: globalThis.Array.isArray(object?.unlocks) ? object.unlocks.map((e: any) => Unlock.fromJSON(e)) : [],
repair_time: isSet(object.repair_time) ? globalThis.Number(object.repair_time) : 0,
}; };
}, },
@@ -1970,6 +1984,9 @@ export const TrackDefinition: MessageFns<TrackDefinition> = {
if (message.unlocks?.length) { if (message.unlocks?.length) {
obj.unlocks = message.unlocks.map((e) => Unlock.toJSON(e)); obj.unlocks = message.unlocks.map((e) => Unlock.toJSON(e));
} }
if (message.repair_time !== 0) {
obj.repair_time = message.repair_time;
}
return obj; return obj;
}, },
@@ -1994,6 +2011,7 @@ export const TrackDefinition: MessageFns<TrackDefinition> = {
message.resistance_medium = object.resistance_medium ?? 0; message.resistance_medium = object.resistance_medium ?? 0;
message.resistance_soft = object.resistance_soft ?? 0; message.resistance_soft = object.resistance_soft ?? 0;
message.unlocks = object.unlocks?.map((e) => Unlock.fromPartial(e)) || []; message.unlocks = object.unlocks?.map((e) => Unlock.fromPartial(e)) || [];
message.repair_time = object.repair_time ?? 0;
return message; return message;
}, },
}; };
+26 -1
View File
@@ -88,6 +88,7 @@ enum PvrChannelType {
enum ResolvedBitRatePixelFormat { enum ResolvedBitRatePixelFormat {
R4G4B4A4, R4G4B4A4,
R8G8B8A8,
R5G6B5A0, R5G6B5A0,
} }
@@ -137,6 +138,27 @@ export class PvrReadStream extends ReadStream {
}; };
} }
case ResolvedBitRatePixelFormat.R8G8B8A8: {
const data = Buffer.alloc(pixelCount * 4);
times(pixelCount, (index) => {
const buffer = this.consumeUint8Array(4);
const bufferIndex = index * 4;
data[bufferIndex] = buffer[0]; // R
data[bufferIndex + 1] = buffer[1]; // G
data[bufferIndex + 2] = buffer[2]; // B
data[bufferIndex + 3] = buffer[3]; // A
});
return {
data,
width: header.width,
height: header.height,
channels: 4 as const,
};
}
case ResolvedBitRatePixelFormat.R5G6B5A0: { case ResolvedBitRatePixelFormat.R5G6B5A0: {
const data = Buffer.alloc(pixelCount * 3); const data = Buffer.alloc(pixelCount * 3);
@@ -208,10 +230,13 @@ export class PvrReadStream extends ReadStream {
if (pixelFormat.order === "rgba") { if (pixelFormat.order === "rgba") {
if (isEqual(pixelFormat.bitRates, [4, 4, 4, 4])) { if (isEqual(pixelFormat.bitRates, [4, 4, 4, 4])) {
return ResolvedBitRatePixelFormat.R4G4B4A4; return ResolvedBitRatePixelFormat.R4G4B4A4;
} else } else if (isEqual(pixelFormat.bitRates, [8, 8, 8, 8])) {
return ResolvedBitRatePixelFormat.R8G8B8A8;
} else {
throw new TypeError( throw new TypeError(
`Unhandled rgba bit rate ${pixelFormat.bitRates.join(", ")}`, `Unhandled rgba bit rate ${pixelFormat.bitRates.join(", ")}`,
); );
}
} else if (pixelFormat.order === "rgb\0") { } else if (pixelFormat.order === "rgb\0") {
if (isEqual(pixelFormat.bitRates, [5, 6, 5, 0])) { if (isEqual(pixelFormat.bitRates, [5, 6, 5, 0])) {
return ResolvedBitRatePixelFormat.R5G6B5A0; return ResolvedBitRatePixelFormat.R5G6B5A0;
+22
View File
@@ -90,6 +90,28 @@ export interface Hierarchy {
name: string; name: string;
} }
export function parseHierarchies<Parent>(
hierarchies: Hierarchy[],
parent: Parent,
parseHierarchy: (
hierarchy: Hierarchy,
components: Component[],
parent: Parent,
) => Parent | undefined,
) {
for (const hierarchy of hierarchies) {
const components = Array.from(
{ length: hierarchy.components.count },
(_, index) => hierarchy.components[index.toString().padStart(4, "0")],
);
const child = parseHierarchy(hierarchy, components, parent);
if (child !== undefined && hierarchy["#hierarchy"]) {
parseHierarchies(hierarchy["#hierarchy"], child, parseHierarchy);
}
}
}
// 0001, 0002, 0003...: Component // 0001, 0002, 0003...: Component
type Components = { type Components = {
count: number; count: number;
@@ -3,5 +3,7 @@ export type CamouflagesYaml = Record<
{ {
userString?: string; userString?: string;
shortUserString?: string; shortUserString?: string;
preset?: string;
customEntities?: Record<string, { item: string }>;
} }
>; >;
@@ -20,11 +20,13 @@ export interface GunDefinitionsList {
burst?: { count: number; rate: number }; burst?: { count: number; rate: number };
clip?: { count: number; rate: number }; clip?: { count: number; rate: number };
shots: { shots: {
[key: string]: { [key: string]:
speed: number; | ""
piercingPower: string; | {
maxDistance: number; speed: number;
}; piercingPower: string;
maxDistance: number;
};
}; };
}; };
}; };
@@ -10,6 +10,9 @@ export type ShellDefinitionsList = Record<
normalizationAngle?: number; normalizationAngle?: number;
ricochetAngle?: number; ricochetAngle?: number;
explosionRadius?: number; explosionRadius?: number;
speed: number;
maxDistance?: number;
piercingPower: string;
} }
> & { > & {
icons: Record<string, string>; icons: Record<string, string>;
@@ -34,6 +34,8 @@ export interface VehicleDefinitions {
}; };
level: number; level: number;
hullPosition: string; hullPosition: string;
hysteresisHealth: number;
healthRegenPerSec: number;
armor: { armor: {
leftTrack: leftTrack:
| number | number
+10 -9
View File
@@ -1,10 +1,4 @@
{ {
"test": {
"default": "test",
"long": "This is a long test string. You MUST NEVER see this in the UI. My favorite fruit is {fruit} because it has the color of {color}. I like it so much that I will say its name 3 times! {fruit}! {fruit}! {fruit}! Once again, it's {color}, not {not_color}.",
"fox": "The quick brown fox jumps over the lazy dog."
},
"common": { "common": {
"name": "BlitzKit", "name": "BlitzKit",
@@ -44,7 +38,7 @@
"branches": { "branches": {
"beta": "Beta", "beta": "Beta",
"development": "Development", "development": "Post Malone Edition",
"opentest": "OpenTest", "opentest": "OpenTest",
"preview": "Preview", "preview": "Preview",
"production": "Production" "production": "Production"
@@ -338,6 +332,13 @@
}, },
"tools": { "tools": {
"credits": {
"name": "Credits",
"button": "View people",
"description": "Contributors of BlitzKit",
"seo_description": "BlitzKit is the work of many"
},
"playlist": { "playlist": {
"reset": "Reset", "reset": "Reset",
"shuffle": "Shuffle", "shuffle": "Shuffle",
@@ -683,6 +684,7 @@
"hullTraverseSoftTerrain": "Soft", "hullTraverseSoftTerrain": "Soft",
"health": "Health", "health": "Health",
"fireChance": "Fire chance", "fireChance": "Fire chance",
"trackRepairTime": "Track repair time",
"viewRange": "View range", "viewRange": "View range",
"camouflageStill": "Camouflage still", "camouflageStill": "Camouflage still",
"camouflageMoving": "Moving", "camouflageMoving": "Moving",
@@ -991,11 +993,10 @@
"footer": { "footer": {
"motto": "Everything World of Tanks Blitz", "motto": "Everything World of Tanks Blitz",
"copyright": "Unaffiliated with Wargaming or any service", "association": "An Open Collective Project",
"about": { "about": {
"title": "About", "title": "About",
"credits": "Credits",
"discord": "Discord", "discord": "Discord",
"github": "GitHub", "github": "GitHub",
"patches": "Patches" "patches": "Patches"
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+3 -1
View File
@@ -5,7 +5,9 @@
"discover-ids": "bun src/discoverIds/index.ts", "discover-ids": "bun src/discoverIds/index.ts",
"build-protos": "bun src/protos.ts", "build-protos": "bun src/protos.ts",
"record-performance": "bun src/recordPerformance/index.ts", "record-performance": "bun src/recordPerformance/index.ts",
"download-client": "bun src/downloadClient/index.ts" "download-client": "bun src/downloadClient/index.ts",
"download-smart-dlc": "bun src/downloadSmartDLC/index.ts",
"vfs": "bun src/vfs/index.ts"
}, },
"dependencies": { "dependencies": {
"@blitzkit/closed": "workspace:*", "@blitzkit/closed": "workspace:*",
+23 -5
View File
@@ -9,6 +9,8 @@ import {
} from "./constants"; } from "./constants";
import { QuickGitHubRelease } from "./types"; import { QuickGitHubRelease } from "./types";
const DEPOT_DOWNLOADER_RETRY_TIME = 30_000;
const provider = assertSecret(import.meta.env.CLIENT_PROVIDER); const provider = assertSecret(import.meta.env.CLIENT_PROVIDER);
const source = assertSecret(import.meta.env.CLIENT_SOURCE); const source = assertSecret(import.meta.env.CLIENT_SOURCE);
const dir = assertSecret(import.meta.env.CLIENT_DIR); const dir = assertSecret(import.meta.env.CLIENT_DIR);
@@ -43,11 +45,27 @@ if (provider === "steam") {
const username = assertSecret(import.meta.env.STEAM_USERNAME); const username = assertSecret(import.meta.env.STEAM_USERNAME);
const password = assertSecret(import.meta.env.STEAM_PASSWORD); const password = assertSecret(import.meta.env.STEAM_PASSWORD);
await $`${DEPOT_DOWNLOADER_EXECUTABLE} -os ${ while (true) {
platform const result = await $`${
} -app ${id} -username ${username} -password ${ DEPOT_DOWNLOADER_EXECUTABLE
password } -os ${platform} -app ${id} -username ${
} -dir ${dir} -max-downloads ${DEPOT_DOWNLOADER_MAX_DOWNLOADS}`; username
} -password ${password} -dir ${dir} -max-downloads ${
DEPOT_DOWNLOADER_MAX_DOWNLOADS
}`.nothrow();
if (result.exitCode === 0) {
console.log("Client downloaded successfully!");
break;
}
console.error(
`DepotDownloader failed (exit ${result.exitCode}). Retrying in ${DEPOT_DOWNLOADER_RETRY_TIME / 1000} seconds...`,
);
await new Promise((resolve) =>
setTimeout(resolve, DEPOT_DOWNLOADER_RETRY_TIME),
);
}
} else if (provider === "zip") { } else if (provider === "zip") {
const url = assertSecret(import.meta.env.CLIENT_SOURCE); const url = assertSecret(import.meta.env.CLIENT_SOURCE);
@@ -2,9 +2,16 @@ import { dvp } from "@blitzkit/closed";
import { assertSecret } from "@blitzkit/core"; import { assertSecret } from "@blitzkit/core";
import { mkdir, writeFile } from "fs/promises"; import { mkdir, writeFile } from "fs/promises";
import { parse as parsePath } from "path"; import { parse as parsePath } from "path";
import ProgressBar from "progress";
import { parse as parseYaml, stringify as stringifyYaml } from "yaml"; import { parse as parseYaml, stringify as stringifyYaml } from "yaml";
import { PATCHES_ROOT, vfs } from "./buildAssets/constants"; import { RegionsPublish } from "../types/regionsPublish";
import { vfs } from "../vfs/vfs";
const CLIENT_DIR = assertSecret(import.meta.env.CLIENT_DIR);
const regionsPublish = await vfs.yaml<RegionsPublish>(
"Data/regions_publish.yaml",
);
const [smartDlcUrl] = regionsPublish.Common.smartDlcUrls;
const versionTextFile = await vfs.text(`Data/version.txt`); const versionTextFile = await vfs.text(`Data/version.txt`);
const currentVersion = versionTextFile const currentVersion = versionTextFile
@@ -18,9 +25,7 @@ console.log(`Installing patches for ${currentVersion}...`);
let patchIndex = 1; let patchIndex = 1;
while (true) { while (true) {
const response = await fetch( const response = await fetch(
`${assertSecret( `${smartDlcUrl}/s${currentVersion}_${patchIndex}.yaml`,
import.meta.env.WOTB_DLC_CDN,
)}/dlc/s${currentVersion}_${patchIndex}.yaml`,
); );
console.log(patchIndex, response.status); console.log(patchIndex, response.status);
@@ -30,51 +35,34 @@ while (true) {
console.log(`Applying patch ${patchIndex}...`); console.log(`Applying patch ${patchIndex}...`);
const data = parseYaml(await response.text()); const data = parseYaml(await response.text());
const dvpm = await fetch( const dvpm = await fetch(`${smartDlcUrl}/${data.dx11}`).then((response) =>
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${data.dx11}`, response.arrayBuffer(),
).then((response) => response.arrayBuffer()); );
const dvpd = await fetch( const dvpd = await fetch(
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${data.dx11.replace( `${smartDlcUrl}/${data.dx11.replace(".dvpm", ".dvpd")}`,
".dvpm",
".dvpd",
)}`,
).then((response) => response.arrayBuffer()); ).then((response) => response.arrayBuffer());
const files = await dvp(dvpm, dvpd); const files = await dvp(dvpm, dvpd);
const bar = new ProgressBar(
`Patching ${files.length} files :bar`,
files.length,
);
for (const { path, data } of files) { for (const { path, data } of files) {
console.log(`Patching "${path}"...`); console.log(`Patching "${path}"...`);
const { dir } = parsePath(path); const { dir } = parsePath(path);
try { await mkdir(`${CLIENT_DIR}/Data/${dir}`, { recursive: true });
await mkdir(`${PATCHES_ROOT}/Data/${dir}`, { recursive: true });
} catch (error) {
console.warn(`Failed to make directory "${dir}"`);
}
const buffer = Buffer.from(data); const buffer = Buffer.from(data);
await writeFile(`${PATCHES_ROOT}/Data/${path}`, new Uint8Array(buffer)); await writeFile(`${CLIENT_DIR}/Data/${path}`, new Uint8Array(buffer));
bar.tick();
} }
console.log("patches done for patch"); console.log("patches done for patch");
if ("dynamicContentLocalizationsDir" in data) { if ("dynamicContentLocalizationsDir" in data) {
console.log( console.log(
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${ `${smartDlcUrl}/${data.dynamicContentLocalizationsDir}/en.yaml`,
data.dynamicContentLocalizationsDir
}/en.yaml`,
); );
const localizationsResponse = await fetch( const localizationsResponse = await fetch(
`${assertSecret(import.meta.env.WOTB_DLC_CDN)}/dlc/${ `${smartDlcUrl}/${data.dynamicContentLocalizationsDir}/en.yaml`,
data.dynamicContentLocalizationsDir
}/en.yaml`,
); );
console.log("fetched"); console.log("fetched");
const newStrings = parseYaml(await localizationsResponse.text()); const newStrings = parseYaml(await localizationsResponse.text());
@@ -86,10 +74,10 @@ while (true) {
const patchedContent = stringifyYaml(patchedStrings); const patchedContent = stringifyYaml(patchedStrings);
console.log("stringified"); console.log("stringified");
await mkdir(`${PATCHES_ROOT}/Data/Strings`, { recursive: true }); await mkdir(`${CLIENT_DIR}/Data/Strings`, { recursive: true });
console.log("mkdir"); console.log("mkdir");
await writeFile( await writeFile(
`${PATCHES_ROOT}/Data/Strings/en.yaml`, `${CLIENT_DIR}/Data/Strings/en.yaml`,
new Uint8Array(Buffer.from(patchedContent)), new Uint8Array(Buffer.from(patchedContent)),
); );
console.log("file"); console.log("file");
@@ -0,0 +1,7 @@
export interface RegionsPublish {
Common: Common;
}
interface Common {
smartDlcUrls: string[];
}
+23
View File
@@ -0,0 +1,23 @@
import { vfs } from "./vfs";
const command = Bun.argv[2];
const path = Bun.argv[3];
if (!path) {
console.error("Gimme a path to assess dumb ass");
process.exit(1);
}
if (command === "cat") {
const content = await vfs.file(path);
await Bun.write(Bun.stdout, content);
} else if (command === "ls") {
const files = await vfs.dir(path);
for (const file of files) {
console.log(file);
}
} else if (command === "yaml") {
const content = await vfs.yaml(path);
await Bun.write(Bun.stdout, JSON.stringify(content, null, 2));
}
+4
View File
@@ -0,0 +1,4 @@
import { assertSecret } from "@blitzkit/core";
import { LocalVFS } from "@blitzkit/core/src/blitzkit/vfs/local";
export const vfs = new LocalVFS(assertSecret(import.meta.env.CLIENT_DIR));
Binary file not shown.

After

Width:  |  Height:  |  Size: 166 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

@@ -128,19 +128,30 @@ export function ShotDisplayCard({ shot, ...props }: ShotDisplayCardProps) {
? shotStatusColors[shot.out.status] ? shotStatusColors[shot.out.status]
: undefined; : undefined;
const inTitleColor = shotStatusColors[shot.in.status]; const inTitleColor = shotStatusColors[shot.in.status];
const hasOutLayers = shot.out !== undefined && shot.out.layers.length > 0;
const penetrationChance = shot.penetrationChance !== undefined && (
<Text color="gray" weight="bold">
{literals(strings.common.units.percentage, {
value: (shot.penetrationChance * 100).toFixed(0),
})}
</Text>
);
return ( return (
<Card variant="classic" {...props}> <Card variant="classic" {...props}>
<Flex direction="column" gap="2"> <Flex direction="column" gap="2">
<Flex direction="column" gap="1"> <Flex direction="column" gap="1">
<Text color={inTitleColor} weight="bold"> <Flex justify="between" align="center" gap="4">
{literals( <Text color={inTitleColor} weight="bold">
strings.website.tools.tankopedia.sandbox.dynamic.shot_card.status[ {literals(
shot.in.status strings.website.tools.tankopedia.sandbox.dynamic.shot_card
], .status[shot.in.status],
{ damage: Math.round(shot.damage).toLocaleString(locale) } { damage: Math.round(shot.damage).toLocaleString(locale) }
)} )}
</Text> </Text>
{!hasOutLayers && penetrationChance}
</Flex>
<table <table
style={{ style={{
@@ -204,13 +215,17 @@ export function ShotDisplayCard({ shot, ...props }: ShotDisplayCardProps) {
</Flex> </Flex>
</Inset> </Inset>
<Text color={outTitleColor} weight="bold"> <Flex justify="between" align="center" gap="4">
{literals( <Text color={outTitleColor} weight="bold">
strings.website.tools.tankopedia.sandbox.dynamic.shot_card {literals(
.status[shot.out.status], strings.website.tools.tankopedia.sandbox.dynamic.shot_card
{ damage: Math.round(shot.damage).toLocaleString(locale) } .status[shot.out.status],
)} { damage: Math.round(shot.damage).toLocaleString(locale) }
</Text> )}
</Text>
{penetrationChance}
</Flex>
<Flex direction="column"> <Flex direction="column">
{shot.out.layers.map((layer, index) => { {shot.out.layers.map((layer, index) => {
@@ -63,6 +63,36 @@ export type ArmorUserData = {
} }
); );
const PENETRATION_RANDOMIZATION = 0.05;
function resolvePenetrationChance(shoot: (scale: number) => Shot | null) {
function penetrates(scale: number) {
const shot = shoot(scale);
return (shot?.out ?? shot?.in)?.status === "penetration";
}
let low = 1 - PENETRATION_RANDOMIZATION;
let high = 1 + PENETRATION_RANDOMIZATION;
if (penetrates(low)) return 1;
if (!penetrates(high)) return 0;
for (let iteration = 0; iteration < 16; iteration++) {
const middle = (low + high) / 2;
if (penetrates(middle)) {
high = middle;
} else {
low = middle;
}
}
return (
(1 + PENETRATION_RANDOMIZATION - high) / (2 * PENETRATION_RANDOMIZATION)
);
}
const omitMaterial = new MeshBasicMaterial({ const omitMaterial = new MeshBasicMaterial({
colorWrite: false, colorWrite: false,
depthWrite: true, depthWrite: true,
@@ -89,6 +119,7 @@ export function SpacedArmorSceneComponent({
intersections: Intersection[], intersections: Intersection[],
allowRicochet: boolean, allowRicochet: boolean,
remainingPenetrationInput?: number, remainingPenetrationInput?: number,
penetrationScale = 1,
) => { ) => {
const { customShell } = Tankopedia.state; const { customShell } = Tankopedia.state;
const shell = customShell ?? Duel.state.antagonist.shell; const shell = customShell ?? Duel.state.antagonist.shell;
@@ -125,6 +156,7 @@ export function SpacedArmorSceneComponent({
Duel.state.protagonist.equipmentMatrix, Duel.state.protagonist.equipmentMatrix,
); );
const penetration = const penetration =
penetrationScale *
shell.penetration!.near * shell.penetration!.near *
resolvePenetrationCoefficient( resolvePenetrationCoefficient(
hasCalibratedShells, hasCalibratedShells,
@@ -367,6 +399,7 @@ export function SpacedArmorSceneComponent({
ricochetIntersections, ricochetIntersections,
false, false,
remainingPenetration, remainingPenetration,
penetrationScale,
); );
shot.in.status = "ricochet"; shot.in.status = "ricochet";
@@ -422,6 +455,16 @@ export function SpacedArmorSceneComponent({
const shot = shoot(event.point, event.intersections, true)!; const shot = shoot(event.point, event.intersections, true)!;
shot.penetrationChance = resolvePenetrationChance((scale) =>
shoot(
event.point,
event.intersections,
true,
undefined,
scale,
),
);
Tankopedia.mutate((draft) => { Tankopedia.mutate((draft) => {
draft.shot = shot; draft.shot = shot;
}); });
@@ -1,38 +0,0 @@
---
import { tankIcon } from "@blitzkit/core";
import { Flex, Heading, Link, Strong, Text } from "@radix-ui/themes";
---
<Flex justify="center" px="4">
<Link
color="gray"
highContrast
style={{ display: "content" }}
href="/docs/guides/christmas-2025"
underline="none"
>
<Flex
mt="3"
px="5"
py="4"
style={{
borderRadius: "var(--radius-3)",
backgroundImage: "url(https://i.imgur.com/LRYmSkg.png)",
backgroundSize: "cover",
backgroundPosition: "center",
boxSizing: "border-box",
}}
align="center"
gap="5"
>
<img src={tankIcon(25169)} style={{ height: "min(15vw, 5rem)" }} />
<Flex direction="column">
<Heading size={{ initial: "4", sm: "6" }}>Christmas 2025</Heading>
<Text size={{ initial: "2", sm: "3" }}>
Win the <Strong>GSOR the TANK</Strong> and more!
</Text>
</Flex>
</Flex>
</Link>
</Flex>
@@ -0,0 +1,36 @@
.outer {
padding: 0 var(--space-4);
margin-top: var(--space-3);
img {
width: 1.25em;
height: 1.25em;
border-radius: 50%;
}
.center {
position: relative;
background: linear-gradient(var(--pink-3), var(--purple-2));
box-shadow: var(--shadow-3);
max-width: 40rem;
padding: var(--space-5);
border-radius: var(--radius-4);
.important {
position: absolute;
top: 0;
left: 50%;
transform: translate(-50%, -50%);
background-color: inherit;
padding: var(--space-3);
}
}
}
@@ -0,0 +1,48 @@
import { HeartFilledIcon } from "@radix-ui/react-icons";
import { Button, Em, Flex, Strong, Text } from "@radix-ui/themes";
import { donationTiers } from "../../config/donations";
import styles from "./index.module.css";
export function Beg() {
return (
<Flex align="center" gap="4" direction="column" className={styles.outer}>
<Text size="3" className={styles.important}>
<Flex gap="2" align="center">
<img src="https://github.com/tresabhi.png" />
<Em>We need your attention</Em>
</Flex>
</Text>
<Flex direction="column" className={styles.center} gap="4">
<Flex direction="column" gap="3">
<Text color="tomato">
We can no longer keep BlitzKit sustainable for <Strong>free</Strong>
.
</Text>
<Text>
We want to add tank modules, player statistics, rebalancing patch
notes, bring back the Discord bot, and more.
</Text>
<Text>
But paying out of pocket makes that impossible. We are an earnest
non-profit, so consider donating to make the above possible. 100% of
your money goes back into BlitzKit.
</Text>
</Flex>
<Flex gap="3">
{donationTiers.map(({ name, value, link }) => (
<a target="_blank" key={name} href={link}>
<Button size="3" color="crimson">
{value === null && <HeartFilledIcon />}
{value === null ? "Custom" : `$${value}`}
</Button>
</a>
))}
</Flex>
</Flex>
</Flex>
);
}
@@ -3,9 +3,9 @@ import { useEffect, useState, type ReactNode } from "react";
import type { MaybeSkeletonComponentProps } from "../types/maybeSkeletonComponentProps"; import type { MaybeSkeletonComponentProps } from "../types/maybeSkeletonComponentProps";
import { InlineSkeleton } from "./InlineSkeleton"; import { InlineSkeleton } from "./InlineSkeleton";
const TIME = 1764898200 * 1000; const TIME = 1792598400 * 1000;
export function Giveaway({ skeleton }: MaybeSkeletonComponentProps) { export function Countdown({ skeleton }: MaybeSkeletonComponentProps) {
const [timeLeft, setTimeLeft] = useState<number>(TIME - Date.now()); const [timeLeft, setTimeLeft] = useState<number>(TIME - Date.now());
useEffect(() => { useEffect(() => {
@@ -31,14 +31,14 @@ export function Giveaway({ skeleton }: MaybeSkeletonComponentProps) {
string = ( string = (
<> <>
in{" "} revealed in{" "}
<Code highContrast> <Code highContrast>
{hours}h {minutes}m {seconds}s {hours}h {minutes}m {seconds}s
</Code> </Code>
</> </>
); );
} else { } else {
string = "has ended. Come again later!"; string = "have been revealed.";
} }
return ( return (
@@ -47,7 +47,7 @@ export function Giveaway({ skeleton }: MaybeSkeletonComponentProps) {
color="gray" color="gray"
highContrast highContrast
style={{ display: "content" }} style={{ display: "content" }}
href="https://discord.gg/njQdBhNS?event=1446208951136813117" href="https://preview.blitzkit.app/tanks"
underline="none" underline="none"
> >
<Flex <Flex
@@ -56,17 +56,17 @@ export function Giveaway({ skeleton }: MaybeSkeletonComponentProps) {
py="4" py="4"
style={{ style={{
borderRadius: "var(--radius-3)", borderRadius: "var(--radius-3)",
backgroundImage: "url(https://i.imgur.com/LRYmSkg.png)", backgroundImage: "url(https://i.imgur.com/xgngxoy.png)",
backgroundSize: "cover", backgroundSize: "cover",
backgroundPosition: "center", backgroundPosition: "center",
boxSizing: "border-box", boxSizing: "border-box",
boxShadow: "0 0 var(--space-7) var(--blue-a5)", boxShadow: "0 0 var(--space-7) var(--white-a2)",
}} }}
align="center" align="center"
gap="5" gap="5"
> >
<img <img
src="https://i.imgur.com/mvmJQgB.png" src="https://i.imgur.com/kXV3r3P.png"
style={{ style={{
height: "min(15vw, 5rem)", height: "min(15vw, 5rem)",
filter: "drop-shadow(0.5rem 0.5rem 1rem #00000080)", filter: "drop-shadow(0.5rem 0.5rem 1rem #00000080)",
@@ -75,11 +75,11 @@ export function Giveaway({ skeleton }: MaybeSkeletonComponentProps) {
<Flex direction="column"> <Flex direction="column">
<Heading size={{ initial: "4", sm: "6" }}> <Heading size={{ initial: "4", sm: "6" }}>
Music Box giveaway {!skeleton && string}{" "} Tier XIs {!skeleton && string}{" "}
{skeleton && <InlineSkeleton width="10rem" />} {skeleton && <InlineSkeleton width="10rem" />}
</Heading> </Heading>
<Text size={{ initial: "2", sm: "3" }}> <Text size={{ initial: "2", sm: "3" }}>
Join the BlitzKit Discord server event Get ready to go to the Tankopedia!
</Text> </Text>
</Flex> </Flex>
</Flex> </Flex>
@@ -0,0 +1,135 @@
---
import { Grid, Text } from "@radix-ui/themes";
import { credits } from "../config/credits";
import { getStrings } from "../core/i18n/getStrings";
interface Props {
locale: string;
}
const { locale } = Astro.props;
const strings = getStrings(locale);
---
<style>
.credits {
display: flex;
justify-content: center;
padding: var(--space-4);
.inner {
display: flex;
flex-direction: column;
gap: var(--space-2);
width: 100%;
max-width: 80rem;
.list {
gap: var(--space-5);
.link {
display: contents;
.person {
--profile-size: 5rem;
position: relative;
display: flex;
flex-direction: column;
padding: var(--space-4);
padding-top: 0;
margin-top: calc(var(--profile-size) / 2);
gap: var(--space-1);
box-shadow: var(--shadow-3);
border-radius: var(--radius-3);
.contain {
border-radius: inherit;
position: absolute;
top: 0;
right: 0;
width: 100%;
height: 100%;
overflow: hidden;
.hint {
width: 100%;
height: 100%;
background-size: cover;
background-position: center;
filter: saturate(20) brightness(0.125) blur(4rem);
}
}
.text {
position: relative;
}
img {
border-radius: 50%;
position: relative;
margin-top: calc(var(--profile-size) / -2);
object-fit: cover;
width: var(--profile-size);
height: var(--profile-size);
margin-bottom: var(--space-2);
}
}
}
}
}
}
</style>
<div class="credits">
<div class="inner">
<Grid
className="list"
py="4"
columns="repeat(auto-fill, minmax(16rem, 1fr))"
flow="dense"
gap="4"
gapY="8"
>
{
credits.map((person) => (
<a target="_blank" href={person.url} class="link">
<div class="person">
<div class="contain">
<div
class="hint"
style={`background-image: url(${person.image})`}
/>
</div>
<img src={person.image} />
<Text weight="medium" className="text" color="gray" highContrast>
{person.name}
</Text>
<Text className="text" color="gray" wrap="pretty">
{person.description}
</Text>
</div>
</a>
))
}
</Grid>
</div>
</div>
+3 -6
View File
@@ -43,9 +43,9 @@ const strings = getStrings(locale);
}} }}
> >
<Heading>BlitzKit</Heading> <Heading>BlitzKit</Heading>
<Text color="gray">{strings.website.footer.motto}</Text> <Text size="2" color="gray">{strings.website.footer.motto}</Text>
<Text size="1" color="gray"> <Text size="2" color="gray">
{strings.website.footer.copyright} {strings.website.footer.association}
</Text> </Text>
<Box mt="2"> <Box mt="2">
@@ -84,9 +84,6 @@ const strings = getStrings(locale);
sm: "start", sm: "start",
}} }}
> >
<LinkI18n {locale} href="/docs/about/credits" color="gray">
{strings.website.footer.about.credits}
</LinkI18n>
<Link <Link
href="https://discord.gg/nDt7AjGJQH" href="https://discord.gg/nDt7AjGJQH"
target="_blank" target="_blank"
+9 -2
View File
@@ -1,13 +1,20 @@
import { Link, Table } from '@radix-ui/themes'; import { Link, Table } from '@radix-ui/themes';
import MarkdownToJSX from 'markdown-to-jsx'; import MarkdownToJSX from 'markdown-to-jsx';
import type { ComponentProps } from 'react'; import type { ComponentProps } from 'react';
import { docImageUrl, isExternalImage } from '../core/blitzkit/docImages';
interface MarkdownProps { interface MarkdownProps {
children: string; children: string;
} }
function Image(props: ComponentProps<'img'>) { function Image({ src, ...props }: ComponentProps<'img'>) {
return <img style={{ maxWidth: '100%' }} {...props} />; return (
<img
style={{ maxWidth: '100%' }}
src={src && isExternalImage(src) ? docImageUrl(src) : src}
{...props}
/>
);
} }
export function Markdown({ children }: MarkdownProps) { export function Markdown({ children }: MarkdownProps) {
+8 -44
View File
@@ -5,7 +5,7 @@ import {
GearIcon, GearIcon,
HamburgerMenuIcon, HamburgerMenuIcon,
} from "@radix-ui/react-icons"; } from "@radix-ui/react-icons";
import { Box, Code, Flex, IconButton, Link } from "@radix-ui/themes"; import { Box, Code, Flex, Grid, IconButton, Link } from "@radix-ui/themes";
import { resolveBranchName } from "../core/blitzkit/branches"; import { resolveBranchName } from "../core/blitzkit/branches";
import { getStrings } from "../core/i18n/getStrings"; import { getStrings } from "../core/i18n/getStrings";
import { Var } from "../core/radix/var"; import { Var } from "../core/radix/var";
@@ -20,7 +20,7 @@ export interface Props {
const { integrated = false } = Astro.props; const { integrated = false } = Astro.props;
const toolsFiltered = Object.values(tools).filter( const toolsFiltered = Object.values(tools).filter(
(tool) => !tool.href && !tool.disabled (tool) => !tool.href && !tool.disabled,
); );
const { locale } = Astro.props; const { locale } = Astro.props;
const branchName = resolveBranchName(locale); const branchName = resolveBranchName(locale);
@@ -105,7 +105,7 @@ const strings = getStrings(locale);
<Flex <Flex
className="content" className="content"
width="100%" width="100%"
p={{ initial: "4", sm: "3" }} p="3"
direction="column" direction="column"
align="center" align="center"
> >
@@ -133,41 +133,6 @@ const strings = getStrings(locale);
<Box flexGrow="1" /> <Box flexGrow="1" />
<Flex
align="center"
gap={{ initial: "3", md: "6" }}
display={{ initial: "none", sm: "flex" }}
justify="center"
className="tools"
>
{
toolsFiltered.map((tool) => {
const selected = Astro.url.pathname.includes(`/${tool.id}`);
const toolStrings =
strings.website.tools[
(tool.strings ??
tool.id) as keyof typeof strings.website.tools
];
return (
<LinkI18n
{locale}
weight={selected ? "medium" : "regular"}
color="gray"
highContrast={selected}
size={{ initial: "1", md: "2" }}
href={`/${tool.id}`}
underline="hover"
>
{toolStrings.name}
</LinkI18n>
);
})
}
</Flex>
<Box flexGrow="1" />
<Flex align="center" gap="4"> <Flex align="center" gap="4">
<Link <Link
style={{ display: "flex", alignContent: "center" }} style={{ display: "flex", alignContent: "center" }}
@@ -191,7 +156,7 @@ const strings = getStrings(locale);
<NavbarAccount {locale} client:idle /> <NavbarAccount {locale} client:idle />
<Flex align="center" display={{ initial: "flex", sm: "none" }}> <Flex align="center">
<IconButton variant="ghost" color="gray" className="hamburger"> <IconButton variant="ghost" color="gray" className="hamburger">
<Cross1Icon data-expanded /> <Cross1Icon data-expanded />
<HamburgerMenuIcon data-closed /> <HamburgerMenuIcon data-closed />
@@ -200,11 +165,10 @@ const strings = getStrings(locale);
</Flex> </Flex>
</Flex> </Flex>
<Flex <Grid
direction="column"
data-expanded data-expanded
columns="repeat(auto-fill, minmax(30rem, 1fr))"
gap="3" gap="3"
display={{ initial: "flex", sm: "none" }}
> >
{ {
toolsFiltered.map((tool) => { toolsFiltered.map((tool) => {
@@ -229,7 +193,7 @@ const strings = getStrings(locale);
}} }}
> >
<Flex <Flex
py="4" p="6"
justify="end" justify="end"
flexGrow="1" flexGrow="1"
style={{ style={{
@@ -243,7 +207,7 @@ const strings = getStrings(locale);
); );
}) })
} }
</Flex> </Grid>
</Flex> </Flex>
</Flex> </Flex>
@@ -25,6 +25,7 @@ import { FilterControl } from "./TankSearch/components/FilterControl";
const tankDefinitions = await api.tankDefinitions(); const tankDefinitions = await api.tankDefinitions();
const POOL_HEIGHT = "16rem"; const POOL_HEIGHT = "16rem";
const FILTERS_WIDTH = "32rem";
export function PlaylistGenerator({ skeleton }: MaybeSkeletonComponentProps) { export function PlaylistGenerator({ skeleton }: MaybeSkeletonComponentProps) {
const [largeWarningOpen, setLargeWarningOpen] = useState(false); const [largeWarningOpen, setLargeWarningOpen] = useState(false);
@@ -80,13 +81,19 @@ export function PlaylistGenerator({ skeleton }: MaybeSkeletonComponentProps) {
<Flex justify="center" width="100%" align="center" px="4"> <Flex justify="center" width="100%" align="center" px="4">
<Flex <Flex
flexGrow="1" flexGrow="1"
gap="9" gap="6"
align="center" align="center"
justify="center" justify="center"
maxWidth="80rem" maxWidth="80rem"
direction={{ initial: "column-reverse", md: "row" }} direction={{ initial: "column-reverse", md: "row" }}
> >
<Flex direction="column" gap="4" align="center"> <Flex
direction="column"
gap="4"
align="center"
flexShrink="0"
width={{ initial: "100%", md: FILTERS_WIDTH }}
>
<FilterControl /> <FilterControl />
<Button <Button
@@ -1,3 +0,0 @@
export function StupidCat() {
return <img src="https://i.imgur.com/6FBBzb9.png" />;
}
@@ -1,7 +1,7 @@
import { import {
normalizeBoundingBox, normalizeBoundingBox,
resolveDpm, resolveDpm,
unionBoundingBox, tankBoundingBox,
type TankDefinition, type TankDefinition,
} from "@blitzkit/core"; } from "@blitzkit/core";
import { useMemo } from "react"; import { useMemo } from "react";
@@ -112,10 +112,7 @@ export function TankSearchCard({ tank, onSelect }: TankSearchCardProps) {
return (tank.camouflage_still * gun.camouflage_loss * 100).toFixed(0); return (tank.camouflage_still * gun.camouflage_loss * 100).toFixed(0);
case "survivability.volume": { case "survivability.volume": {
const dimensions = normalizeBoundingBox( const dimensions = normalizeBoundingBox(
unionBoundingBox( tankBoundingBox(tankModelDefinition, turretModelDefinition),
tankModelDefinition.bounding_box!,
turretModelDefinition.bounding_box!,
),
); );
return (dimensions.x * dimensions.y * dimensions.z).toFixed(0); return (dimensions.x * dimensions.y * dimensions.z).toFixed(0);
@@ -123,10 +120,7 @@ export function TankSearchCard({ tank, onSelect }: TankSearchCardProps) {
case "survivability.length": { case "survivability.length": {
const bounds = normalizeBoundingBox( const bounds = normalizeBoundingBox(
unionBoundingBox( tankBoundingBox(tankModelDefinition, turretModelDefinition),
tankModelDefinition.bounding_box!,
turretModelDefinition.bounding_box!,
),
); );
return Math.max(bounds.x, bounds.y, bounds.z).toFixed(0); return Math.max(bounds.x, bounds.y, bounds.z).toFixed(0);
@@ -3,7 +3,7 @@ import {
normalizeBoundingBox, normalizeBoundingBox,
resolveDpm, resolveDpm,
SEARCH_KEYS, SEARCH_KEYS,
unionBoundingBox, tankBoundingBox,
type TankDefinition, type TankDefinition,
} from "@blitzkit/core"; } from "@blitzkit/core";
import { literals } from "@blitzkit/i18n/src/literals"; import { literals } from "@blitzkit/i18n/src/literals";
@@ -137,16 +137,10 @@ export const TankSearch = memo<TankSearchProps>(
const bTurretModelDefinition = const bTurretModelDefinition =
bTankModelDefinition.turrets[b.turrets.at(-1)!.id]; bTankModelDefinition.turrets[b.turrets.at(-1)!.id];
const aSize = normalizeBoundingBox( const aSize = normalizeBoundingBox(
unionBoundingBox( tankBoundingBox(aTankModelDefinition, aTurretModelDefinition),
aTankModelDefinition.bounding_box!,
aTurretModelDefinition.bounding_box!,
),
); );
const bSize = normalizeBoundingBox( const bSize = normalizeBoundingBox(
unionBoundingBox( tankBoundingBox(bTankModelDefinition, bTurretModelDefinition),
bTankModelDefinition.bounding_box!,
bTurretModelDefinition.bounding_box!,
),
); );
const aVolume = aSize.x * aSize.y * aSize.z; const aVolume = aSize.x * aSize.y * aSize.z;
const bVolume = bSize.x * bSize.y * bSize.z; const bVolume = bSize.x * bSize.y * bSize.z;
@@ -164,16 +158,10 @@ export const TankSearch = memo<TankSearchProps>(
const bTurretModelDefinition = const bTurretModelDefinition =
bTankModelDefinition.turrets[b.turrets.at(-1)!.id]; bTankModelDefinition.turrets[b.turrets.at(-1)!.id];
const aSize = normalizeBoundingBox( const aSize = normalizeBoundingBox(
unionBoundingBox( tankBoundingBox(aTankModelDefinition, aTurretModelDefinition),
aTankModelDefinition.bounding_box!,
aTurretModelDefinition.bounding_box!,
),
); );
const bSize = normalizeBoundingBox( const bSize = normalizeBoundingBox(
unionBoundingBox( tankBoundingBox(bTankModelDefinition, bTurretModelDefinition),
bTankModelDefinition.bounding_box!,
bTurretModelDefinition.bounding_box!,
),
); );
const aLength = Math.max(aSize.x, aSize.y, aSize.z); const aLength = Math.max(aSize.x, aSize.y, aSize.z);
const bLength = Math.max(bSize.x, bSize.y, bSize.z); const bLength = Math.max(bSize.x, bSize.y, bSize.z);
@@ -24,6 +24,14 @@ export function Survivability({ stats }: StatsAcceptorProps) {
decimals={0} decimals={0}
value={(stats) => stats.fireChance * 100} value={(stats) => stats.fireChance * 100}
/> />
{stats.trackRepairTime !== undefined && (
<InfoWithDelta
value="trackRepairTime"
stats={stats}
deltaType="lowerIsBetter"
decimals={2}
/>
)}
<InfoWithDelta value="viewRange" stats={stats} decimals={0} /> <InfoWithDelta value="viewRange" stats={stats} decimals={0} />
<ViewRangeVisualizer stats={stats} /> <ViewRangeVisualizer stats={stats} />
<Info <Info
@@ -0,0 +1,44 @@
import { Flex, IconButton, type FlexProps } from "@radix-ui/themes";
import type { ComponentProps, CSSProperties } from "react";
type SidebarIconButtonProps = ComponentProps<typeof IconButton> & {
selected: boolean;
src: string;
alt: string;
imageStyle?: CSSProperties;
};
export function SidebarIconGroup({ style, ...props }: FlexProps) {
return (
<Flex
direction="column"
overflow="hidden"
style={{ borderRadius: "var(--radius-full)", ...style }}
{...props}
/>
);
}
export function SidebarIconButton({
selected,
src,
alt,
imageStyle,
...props
}: SidebarIconButtonProps) {
return (
<IconButton
color={selected ? undefined : "gray"}
variant="soft"
size={{ initial: "2", sm: "3" }}
radius="none"
{...props}
>
<img
alt={alt}
src={src}
style={{ width: "50%", height: "50%", ...imageStyle }}
/>
</IconButton>
);
}
@@ -0,0 +1,83 @@
import { alias } from "@blitzkit/core";
import { Flex, Tooltip } from "@radix-ui/themes";
import { uniqBy } from "lodash-es";
import { SKIN_NUMBER } from "../../../../../../constants/skinNumber";
import { api } from "../../../../../../core/blitzkit/api";
import { useLocale } from "../../../../../../hooks/useLocale";
import { Duel } from "../../../../../../stores/duel";
import { Tankopedia } from "../../../../../../stores/tankopedia";
import { TankopediaDisplay } from "../../../../../../stores/tankopediaPersistent/constants";
import { SidebarIconButton } from "./SidebarIconButton";
const camouflageDefinitions = await api.camouflageDefinitions();
export function SkinSwitcher() {
const tank = Duel.use((state) => state.protagonist.tank);
const skin = Tankopedia.use((state) => state.requestedSkin);
const requestedDisplay = Tankopedia.use((state) => state.requestedDisplay);
const disturbed = Tankopedia.use((state) => state.disturbed);
const { unwrap } = useLocale();
const skins = uniqBy(
Object.values(camouflageDefinitions.camouflages).filter(
(camouflage) => camouflage.tank_id === tank.id,
),
(camouflage) => unwrap(camouflage.name!),
);
if (skins.length === 0) return null;
return (
<Flex
direction="column"
top="50%"
right={
disturbed && requestedDisplay === TankopediaDisplay.Model
? "3"
: "-4rem"
}
style={{
position: "absolute",
transform: "translateY(-50%)",
transitionDuration: "200ms",
pointerEvents: "auto",
}}
>
{skins.map((camouflage, index) => {
const name = unwrap(camouflage.name!).replace(
"%(camo_num)",
SKIN_NUMBER,
);
const top = index === 0 ? "var(--radius-full)" : "0";
const bottom = index === skins.length - 1 ? "var(--radius-full)" : "0";
return (
<Tooltip key={camouflage.id} content={name} side="left">
<SidebarIconButton
selected={skin === camouflage.id}
alt={name}
src={alias("api", `/icons/camouflages/${camouflage.id}.webp`)}
size={{ initial: "3", sm: "4" }}
radius="full"
style={{
borderRadius: `${top} ${top} ${bottom} ${bottom}`,
}}
imageStyle={{
width: "70%",
height: "70%",
borderRadius: "50%",
}}
onClick={() => {
Tankopedia.mutate((draft) => {
draft.requestedSkin =
draft.requestedSkin === camouflage.id
? undefined
: camouflage.id;
});
}}
/>
</Tooltip>
);
})}
</Flex>
);
}
@@ -31,11 +31,11 @@ export function Thicknesses({ thicknessRange, skeleton }: ThicknessesProps) {
return ( return (
<Flex <Flex
position="absolute" position="absolute"
right={display === TankopediaDisplay.StaticArmor ? "0" : "-6rem"} right="0"
top="50%" top="50%"
mr="4" mr="4"
style={{ style={{
transform: "translateY(-50%)", transform: `translate(${display === TankopediaDisplay.StaticArmor ? "0" : "calc(100% + var(--space-4))"}, -50%)`,
userSelect: "none", userSelect: "none",
transitionDuration: "200ms", transitionDuration: "200ms",
}} }}
@@ -46,6 +46,11 @@ import { TankSearch } from "../../../../TankSearch";
import { CustomShellButton } from "./components/CustomShellButton"; import { CustomShellButton } from "./components/CustomShellButton";
import { DynamicArmorSwitcher } from "./components/DynamicArmorSwitcher"; import { DynamicArmorSwitcher } from "./components/DynamicArmorSwitcher";
import { QuickInputs } from "./components/QuickInputs"; import { QuickInputs } from "./components/QuickInputs";
import {
SidebarIconButton,
SidebarIconGroup,
} from "./components/SidebarIconButton";
import { SkinSwitcher } from "./components/SkinSwitcher";
import { SpallLinerSwitcher } from "./components/SpallLinerSwitcher"; import { SpallLinerSwitcher } from "./components/SpallLinerSwitcher";
import { Thicknesses } from "./components/Thicknesses"; import { Thicknesses } from "./components/Thicknesses";
@@ -87,6 +92,8 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
<Thicknesses skeleton={skeleton} thicknessRange={thicknessRange} /> <Thicknesses skeleton={skeleton} thicknessRange={thicknessRange} />
<SkinSwitcher />
<Flex <Flex
gap="2" gap="2"
direction="column" direction="column"
@@ -181,24 +188,13 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
</Popover.Root> </Popover.Root>
)} )}
<Flex <SidebarIconGroup>
direction="column"
style={{
borderRadius: "var(--radius-full)",
}}
overflow="hidden"
>
{antagonistGun.shells.map((thisShell) => ( {antagonistGun.shells.map((thisShell) => (
<IconButton <SidebarIconButton
color={
thisShell.id === antagonistShell.id && !hasCustomShell
? undefined
: "gray"
}
variant="soft"
key={thisShell.id} key={thisShell.id}
size={{ initial: "2", sm: "3" }} selected={thisShell.id === antagonistShell.id && !hasCustomShell}
radius="none" alt={unwrap(thisShell.name!)}
src={alias("api", `/icons/shells/${thisShell.icon}.webp`)}
onClick={() => { onClick={() => {
Duel.mutate((draft) => { Duel.mutate((draft) => {
draft.antagonist.shell = thisShell; draft.antagonist.shell = thisShell;
@@ -208,19 +204,10 @@ export function Options({ thicknessRange, canvas, skeleton }: OptionsProps) {
draft.customShell = undefined; draft.customShell = undefined;
}); });
}} }}
> />
<img
alt={unwrap(thisShell.name!)}
src={alias("api", `/icons/shells/${thisShell.icon}.webp`)}
style={{
width: "50%",
height: "50%",
}}
/>
</IconButton>
))} ))}
<CustomShellButton /> <CustomShellButton />
</Flex> </SidebarIconGroup>
<Flex <Flex
direction="column" direction="column"
@@ -1,30 +1,46 @@
import { UpdateIcon } from "@radix-ui/react-icons"; import { UpdateIcon } from "@radix-ui/react-icons";
import { Button, Flex, Heading } from "@radix-ui/themes"; import { Button, Flex, Heading } from "@radix-ui/themes";
import { useEffect, useRef } from "react";
import { SKIN_NUMBER } from "../../../../../../constants/skinNumber";
import { api } from "../../../../../../core/blitzkit/api";
import { useLocale } from "../../../../../../hooks/useLocale"; import { useLocale } from "../../../../../../hooks/useLocale";
import { Duel } from "../../../../../../stores/duel"; import { Duel } from "../../../../../../stores/duel";
import { Tankopedia } from "../../../../../../stores/tankopedia"; import { Tankopedia } from "../../../../../../stores/tankopedia";
import type { MaybeSkeletonComponentProps } from "../../../../../../types/maybeSkeletonComponentProps"; import type { MaybeSkeletonComponentProps } from "../../../../../../types/maybeSkeletonComponentProps";
import { Tracker } from "./components/Tracker"; import { Tracker } from "./components/Tracker";
const camouflageDefinitions = await api.camouflageDefinitions();
export function Title({ skeleton }: MaybeSkeletonComponentProps) { export function Title({ skeleton }: MaybeSkeletonComponentProps) {
const { unwrap, strings } = useLocale(); const { unwrap, strings } = useLocale();
const modelRequested = Tankopedia.use((state) => state.modelRequested); const modelRequested = Tankopedia.use((state) => state.modelRequested);
const protagonist = Duel.use((state) => state.protagonist.tank); const protagonist = Duel.use((state) => state.protagonist.tank);
const revealed = Tankopedia.use((state) => state.revealed); const revealed = Tankopedia.use((state) => state.revealed);
const disturbed = Tankopedia.use((state) => state.disturbed); const disturbed = Tankopedia.use((state) => state.disturbed);
const name = unwrap(protagonist.name!); const hasRevealed = useRef(false);
const skin = Tankopedia.use((state) => state.requestedSkin);
const camouflage =
skin === undefined ? undefined : camouflageDefinitions.camouflages[skin];
const tankName = unwrap(protagonist.name!);
const name = camouflage
? `${tankName} ${unwrap(camouflage.name!).replace("%(camo_num)", SKIN_NUMBER)}`
: tankName;
const fontSize = revealed const fontSize = revealed
? disturbed ? disturbed
? "1.5rem" ? "1.5rem"
: "2rem" : "2rem"
: `min(12vh, ${75 / name.length}vw)`; : `min(12vh, ${75 / name.length}vw)`;
useEffect(() => {
if (revealed) hasRevealed.current = true;
}, [revealed]);
return ( return (
<Flex <Flex
onPointerDown={(event) => { onPointerDown={(event) => {
event.preventDefault(); event.preventDefault();
if (!modelRequested) return; if (!modelRequested || hasRevealed.current) return;
Tankopedia.mutate((draft) => { Tankopedia.mutate((draft) => {
draft.revealed = true; draft.revealed = true;
@@ -18,7 +18,7 @@ import { TankopediaDisplay } from "../../../../../../stores/tankopediaPersistent
const ANGLE = degToRad(15); const ANGLE = degToRad(15);
const REVEAL_ANIMATION_TIME = 3; const REVEAL_ANIMATION_TIME = 3;
const TRANSITION_ANIMATION_TIME = 0.5; export const TRANSITION_ANIMATION_TIME = 0.5;
const LIGHTS_COUNT = 3; const LIGHTS_COUNT = 3;
const THETA_OFFSET = degToRad(180 - 45); const THETA_OFFSET = degToRad(180 - 45);
@@ -46,11 +46,17 @@ export function Lighting({ hasPbr }: Props) {
const highGraphics = TankopediaPersistent.use((state) => state.highGraphics); const highGraphics = TankopediaPersistent.use((state) => state.highGraphics);
const requestedDisplay = Tankopedia.use((state) => state.requestedDisplay); const requestedDisplay = Tankopedia.use((state) => state.requestedDisplay);
const revealed = Tankopedia.use((state) => state.revealed);
const skinPending = Tankopedia.use(
(state) => state.loadedSkin !== state.skin,
);
const animationTime = useRef(REVEAL_ANIMATION_TIME); const animationTime = useRef(REVEAL_ANIMATION_TIME);
const t0 = useRef(performance.now() / 1e3 - animationTime.current); const t0 = useRef(performance.now() / 1e3 - animationTime.current);
const holding = useRef(false);
const isRevealing = useRef(true); const isRevealing = useRef(true);
const isFirstReveal = useRef(true);
const [animate, setAnimate] = useState(true); const [animate, setAnimate] = useState(true);
@@ -71,6 +77,37 @@ export function Lighting({ hasPbr }: Props) {
setAnimate(true); setAnimate(true);
}, [requestedDisplay]); }, [requestedDisplay]);
useEffect(() => {
if (isFirstReveal.current) {
isFirstReveal.current = false;
return;
}
if (!revealed) {
animationTime.current = TRANSITION_ANIMATION_TIME;
t0.current = performance.now() / 1e3;
holding.current = true;
} else if (holding.current) {
animationTime.current = REVEAL_ANIMATION_TIME;
t0.current = performance.now() / 1e3 - animationTime.current;
holding.current = false;
} else {
return;
}
setAnimate(true);
invalidate();
}, [revealed]);
useEffect(() => {
if (!skinPending) return;
animationTime.current = TRANSITION_ANIMATION_TIME;
t0.current = performance.now() / 1e3;
setAnimate(true);
}, [skinPending]);
return ( return (
<> <>
<ContactShadows <ContactShadows
@@ -90,6 +127,7 @@ export function Lighting({ hasPbr }: Props) {
hasPbr={hasPbr} hasPbr={hasPbr}
t0={t0} t0={t0}
animationTime={animationTime} animationTime={animationTime}
holding={holding}
wrapper={wrapper} wrapper={wrapper}
stop={() => { stop={() => {
setAnimate(false); setAnimate(false);
@@ -145,11 +183,19 @@ interface AnimatorProps {
t0: RefObject<number>; t0: RefObject<number>;
animationTime: RefObject<number>; animationTime: RefObject<number>;
holding: RefObject<boolean>;
wrapper: RefObject<Group | null>; wrapper: RefObject<Group | null>;
hasPbr: boolean; hasPbr: boolean;
} }
function Animator({ stop, t0, animationTime, wrapper, hasPbr }: AnimatorProps) { function Animator({
stop,
t0,
animationTime,
holding,
wrapper,
hasPbr,
}: AnimatorProps) {
const requestedDisplay = Tankopedia.use((state) => state.requestedDisplay); const requestedDisplay = Tankopedia.use((state) => state.requestedDisplay);
const display = Tankopedia.use((state) => state.display); const display = Tankopedia.use((state) => state.display);
@@ -176,7 +222,7 @@ function Animator({ stop, t0, animationTime, wrapper, hasPbr }: AnimatorProps) {
useFrame(({ invalidate }) => { useFrame(({ invalidate }) => {
const dt = performance.now() / 1e3 - t0.current; const dt = performance.now() / 1e3 - t0.current;
const x = clamp(dt / animationTime.current, 0, 2); const x = clamp(dt / animationTime.current, 0, holding.current ? 1 : 2);
if (x === 2) { if (x === 2) {
apply(1); apply(1);
@@ -188,6 +234,9 @@ function Animator({ stop, t0, animationTime, wrapper, hasPbr }: AnimatorProps) {
const t = (0.5 * Math.sin(Math.PI * (x + 0.5)) + 0.5) ** 2; const t = (0.5 * Math.sin(Math.PI * (x + 0.5)) + 0.5) ** 2;
apply(t); apply(t);
if (holding.current && x === 1) return;
invalidate(); invalidate();
if (x >= 1 && Tankopedia.state.display !== requestedDisplay) { if (x >= 1 && Tankopedia.state.display !== requestedDisplay) {
@@ -195,6 +244,12 @@ function Animator({ stop, t0, animationTime, wrapper, hasPbr }: AnimatorProps) {
draft.display = requestedDisplay; draft.display = requestedDisplay;
}); });
} }
if (x >= 1 && Tankopedia.state.skin !== Tankopedia.state.loadedSkin) {
Tankopedia.mutate((draft) => {
draft.skin = draft.loadedSkin;
});
}
}); });
return null; return null;
@@ -3,10 +3,11 @@ import { useRef } from "react";
import { Group, Mesh, MeshStandardMaterial, Vector2 } from "three"; import { Group, Mesh, MeshStandardMaterial, Vector2 } from "three";
import { applyPitchYawLimits } from "../../../../../../core/blitz/applyPitchYawLimits"; import { applyPitchYawLimits } from "../../../../../../core/blitz/applyPitchYawLimits";
import { hasEquipment } from "../../../../../../core/blitzkit/hasEquipment"; import { hasEquipment } from "../../../../../../core/blitzkit/hasEquipment";
import { jsxTree } from "../../../../../../core/blitzkit/jsxTree";
import { modelTransformEvent } from "../../../../../../core/blitzkit/modelTransform"; import { modelTransformEvent } from "../../../../../../core/blitzkit/modelTransform";
import { skinTree } from "../../../../../../core/blitzkit/skinTree";
import { controlsEnabledEvent } from "../../../../../../core/controlsEnabled"; import { controlsEnabledEvent } from "../../../../../../core/controlsEnabled";
import { useModel } from "../../../../../../hooks/useModel"; import { useModel } from "../../../../../../hooks/useModel";
import { useSkin } from "../../../../../../hooks/useSkin";
import { useTankModelDefinition } from "../../../../../../hooks/useTankModelDefinition"; import { useTankModelDefinition } from "../../../../../../hooks/useTankModelDefinition";
import { useTankTransform } from "../../../../../../hooks/useTankTransform"; import { useTankTransform } from "../../../../../../hooks/useTankTransform";
import { Duel } from "../../../../../../stores/duel"; import { Duel } from "../../../../../../stores/duel";
@@ -28,6 +29,7 @@ export function TankModel() {
const gunModelDefinition = turretModelDefinition.guns[protagonist.gun.id]; const gunModelDefinition = turretModelDefinition.guns[protagonist.gun.id];
const { gltf } = useModel(protagonist.tank.id); const { gltf } = useModel(protagonist.tank.id);
const nodes = Object.values(gltf.nodes); const nodes = Object.values(gltf.nodes);
const skinGltf = useSkin(protagonist.tank.id);
useTankTransform(track, turret, turretContainer, gunContainer); useTankTransform(track, turret, turretContainer, gunContainer);
@@ -92,7 +94,7 @@ export function TankModel() {
window.removeEventListener("pointerup", handlePointerUp); window.removeEventListener("pointerup", handlePointerUp);
} }
return jsxTree(node, { return skinTree(node, skinGltf, {
mesh(_, props, key) { mesh(_, props, key) {
return ( return (
<mesh <mesh
@@ -169,7 +171,7 @@ export function TankModel() {
window.removeEventListener("pointerup", handlePointerUp); window.removeEventListener("pointerup", handlePointerUp);
} }
return jsxTree(node, { return skinTree(node, skinGltf, {
mesh(_, props, key) { mesh(_, props, key) {
return ( return (
<mesh <mesh
@@ -250,7 +252,7 @@ export function TankModel() {
window.removeEventListener("pointerup", handlePointerUp); window.removeEventListener("pointerup", handlePointerUp);
} }
return jsxTree(node, { return skinTree(node, skinGltf, {
mesh(_, props, key) { mesh(_, props, key) {
return ( return (
<mesh <mesh
+102
View File
@@ -0,0 +1,102 @@
interface CreditPeople {
name: string;
description: string;
url?: string;
image: string;
}
export const credits: CreditPeople[] = [
{
name: "TrèsAbhi",
description: "Founder and lead developer",
url: "https://abhi-deep.com/",
image: "https://github.com/tresabhi.png",
},
{
name: "HitJack",
description: "Developer on website",
url: "https://marksstuff.com",
image: "https://github.com/Hitjack007.png",
},
{
name: "aeson000",
description: "Advisor on game and website",
url: "https://discord.gg/WHdER7ZPAD",
image: "/media/users/aeson000.png",
},
{
name: "GonnaHetzMe",
description: "Developer and advisor on back end",
url: "https://github.com/karelpak1",
image: "https://github.com/karelpak1.png",
},
{
name: "ChickenMan7777",
description: "Moderator and former advisor on game mechanics",
url: "https://discord.gg/rEsUbXCqD9",
image: "/media/users/chickenman7777.webp",
},
{
name: "Avenir",
description: "Moderator and elite Advanced Recon Commando",
image: "/media/users/avenir.webp",
},
{
name: "Pyogenics",
description: "Former advisor on game 3D format",
url: "https://github.com/Pyogenics",
image: "https://github.com/Pyogenics.png",
},
{
name: "Prince_NA",
description: "Former advisor on bot and website",
image: "/media/users/prince-na.webp",
},
{
name: "Vovko",
description: "Former advisor on bot",
url: "https://amth.one/",
image: "https://github.com/cufee.png",
},
{
name: "S0AP",
description: "Former advisor on and advertiser for bot",
url: "https://discord.gg/3KfH93um3Y",
image: "/media/users/s0ap.webp",
},
{
name: "Synx",
description: "Former advisor on bot and website",
url: "https://www.youtube.com/@Synx_Blitz",
image: "/media/users/synx.webp",
},
{
name: "34wotb",
description: "Former advisor on bot",
url: "https://www.twitch.tv/34wotb/",
image: "/media/users/34wotb.jpg",
},
{
name: "HisRoyalFatness",
description: "Former advisor on website",
url: "https://www.youtube.com/@hisroyalfatness",
image: "/media/users/hisroyalfatness.jpg",
},
{
name: "Minitelrose",
description: "Former advisor on game mechanics",
url: "https://wotinspector.com/",
image: "/media/users/minitelrose.webp",
},
{
name: "Maddox",
description: "Game asset decompression",
url: "https://github.com/Maddoxkkm",
image: "https://github.com/Maddoxkkm.png",
},
{
name: "TJ Duff",
description: "Chief executive cheer leader",
image: "/media/users/tj-duff.jpg",
},
];
+23
View File
@@ -0,0 +1,23 @@
// TODO: source this from the open collective api, if even possible
export const donationTiers = [
{
name: "The Backer",
value: 5,
link: "https://opencollective.com/blitzkit/contribute/backers-106312/checkout",
},
{
name: "The Engineer",
value: 10,
link: "https://opencollective.com/blitzkit/contribute/the-engineer-107057/checkout",
},
{
name: "The Patron",
value: 25,
link: "https://opencollective.com/blitzkit/contribute/the-patron-107056/checkout",
},
{
name: "The Sponsor",
value: null,
link: "https://opencollective.com/blitzkit/donate",
},
];
@@ -0,0 +1 @@
export const SKIN_NUMBER = "0417";
+4
View File
@@ -74,4 +74,8 @@ export const tools: Record<string, Tool> = {
href: "https://discord.gg/nDt7AjGJQH", href: "https://discord.gg/nDt7AjGJQH",
button: "plum", button: "plum",
}, },
credits: {
id: "credits",
button: "bronze",
},
}; };
Loaded 100 of 122 files, more files were not shown because too many files have changed in this diff. Show more