kotiq / wt-tools

War Thunder resource extraction tools
29 stars 3 forks source link

Would it be possible to fix the Replay unpacker #16

Open OshidaBCF opened 1 year ago

OshidaBCF commented 1 year ago

A friend wanted to make a TacView integration for the replay system, i can make one that would work off the "web map" but i'm missing informations.

So i was wondering if i could make one from a replay file, but i would need the unpacker to work for that to happen

Do you have an exemple of already "extracted" replay, i want to see if there is data that i can use or if everything i would need it missing?

kotiq commented 1 year ago
$ pwd
/home/kotiq/games/linux/WarThunder/Replays

$ python -m wt_tools.wrpl_unpacker_ng --format=strict_blk '#2023.01.12 23.45.27.wrpl'
#2023.01.12 23.45.27.wrpl => /media/games/kotiq/linux/WarThunder/Replays/#2023.01.12 23.45.27.wrpl.d

$ tree '#2023.01.12 23.45.27.wrpl.d'
#2023.01.12 23.45.27.wrpl.d
├── info.json
├── m_set.blkx
├── rez.blkx
└── wrplu.bin

File wrplu.bin is an unpacked replay stream.

OshidaBCF commented 1 year ago

image I get an error if i use either normal or _ng, is yours different than mine ?

OshidaBCF commented 1 year ago

strict_blk doesn't change the error

kotiq commented 1 year ago
* 547f246 2022-10-30 | setup: bdist_msi: downgrade setuptools (HEAD -> new-format, origin/new-format) [kotiq]
* c343b01 2022-08-18 | wrpl: session type as int (wrpl_parser, ddsx) [kotiq]
* d386d30 2022-08-18 | wrpl: update file format [kotiq]

What is the value of the byte pair at offset 0x04c4 in the replay file?

OshidaBCF commented 1 year ago

0x04C4 is 0A

I re-downloaded the vromfs files and format, but error is still here.

kotiq commented 1 year ago

Okay. I will ignore this pair as a constant.

OshidaBCF commented 1 year ago

#2023.01.07 13.57.38.wrpl.txt Here's the replay in case of

OshidaBCF commented 1 year ago

That single line fixed it.

I can extract the files correctly but now i don't know what to do with the .bin, it seems to be encoded

kotiq commented 1 year ago

The file contains a list of nodes. I can extract from it what I know partially, such as the blk sequence of the decals or decorators location. I haven't dealt with the wrpl format, I think it would require a lot of reverse engineering.

OshidaBCF commented 1 year ago

Hmmm, what i would need would be positions of planes and missiles, i can probably link each plane with a name using the blks. Thanks

kotiq commented 1 year ago

How it looked six years ago.

OshidaBCF commented 1 year ago

Jesus...

Also what does the "replay_db" folder do ?

Make a database from a replay ?

kotiq commented 1 year ago

I think at the time I was calculating the battle rating range of opponents participating in battles based on a set of replays. I'm not sure if this works in the current version.

OshidaBCF commented 1 year ago

shit, yeah it's probably to hard to make it without knowing the layout