is-consulting / moddingSuite

Wargame modding suite
MIT License
55 stars 23 forks source link

WARNO TGV format cannot be exported #52

Open tagaziel opened 1 year ago

tagaziel commented 1 year ago

Trying to extract the TGV files in WARNO's archives throws the following exception:

moddingSuite.exe Error: 0 : Unhandeled exception in Thread occoured: System.NotSupportedException: Unknown Pixelformat BC3_SRGB w moddingSuite.BL.TGV.TgvReader.TranslatePixelFormat(String pixelFormat) w moddingSuite.BL.TGV.TgvReader.Read(Stream ms) w moddingSuite.BL.TGV.TgvReader.Read(Byte[] data) w moddingSuite.ViewModel.Edata.EdataManagerViewModel.<>c__DisplayClass124_0.b__1(

I'll look through the forks to see if it's been updated, but it's a huge blocker for the wiki :(

is-consulting commented 1 year ago

Can you provide me with more information about what exactly you are trying to export (DAT File name, Path inside the file) so I can test my fix?

tagaziel commented 1 year ago

Gladly! These are the TGV files inside CommonInterface.ppk (extracted from \steamapps\common\WARNO\Data\PC\82436\84771\ZZ_4.dat), but let's use this one:

PC\Texture\Assets\2D\Interface\Common\UnitsIcons\Allemagne\KdA_CMD_DDR.tgv

In Steel Division 2, the suite would export to a DDS with inverted colors, which would be fixed once converted to .png with ImageMagick (mogrify -format png with default settings), and then on to the wiki.

In WARNO, you get the above error. I've managed to rip the DDS files using NinjaRipper and dumping them, but these are not given their original filenames, but a hexadecimal name that's been impossible to correlate with the filenames. I've uploaded how the file should look after exporting and conversion to PNG (Ninja rips to DDS with the correct color palette from the start):

https://warno.fandom.com/wiki/File:KdA_CMD_DDR.png

Hope this helps, if you need anything, I'll gladly upload whatever's needed. And thank you in advance!

is-consulting commented 1 year ago

I tried some fix, can you open and verify wether this file is working?

KdA_CMD_DDR.tgv.zip

tagaziel commented 1 year ago

It does! I've compared the DDS ripped from the game and one output by the New and Improved TGV converter and the histogram is nearly identical. There's some minor variation, as expected, but the results are pretty much not visible to the naked eye.

Attaching screenshot below (left is your file, the right is one ripped by me)

image

I think it works!

tagaziel commented 1 year ago

Sorry to ping you, but what was the fix? I might learn coding specifically to fork the suite and apply it :)