Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Kingdom Under Fire II - dds inside .vap files

Featured Replies

  • Author
  • Localization

Amagakuro, posted Wed Nov 10, 2021 3:26 pm (67457)


Hello guys.
Zaramot on xentax is kindly making a model importer for the game. He discovered that inside some of the .vap files containing the models there're also .dds textures of the mentioned.
Could someone take a look at these files and eventually make a bms script to extract them?
Thanks~

http://www.mediafire.com/file/0pibil913lvzdwn/Hero2.rar
  • Author
  • Localization

Allen, posted Thu Nov 11, 2021 3:49 pm (67470)


Here is a Noesis script. Supports viewing and exporting textures.

.vap is a texture mesh package format.
I have took a look at the mesh structure , but lacked bone files. So no support was added.
The mesh store vertices, normals, and tangents? binormal? UV, bone weight, face and other information.

*EDIT*: update added support format 133.

tex_KingdomUnderFire2_vap.zip

  • Author
  • Localization

Amagakuro, posted Thu Nov 11, 2021 9:09 pm (67472)


Allen wrote:
Here is a Noesis script. Supports viewing and exporting textures.

.vap is a texture mesh package format.
I have took a look at the mesh structure , but lacked bone files. So no support was added.
The mesh store vertices, normals, and tangents? binormal? UV, bone weight, face and other information.


Bones are in separated files, havok format, since the main interest was texture support i didn't bother adding them. I can attach some of them if you want to give a look.
Thank you nonetheless!

Edit: quick question, some files are getting errors like
"Traceback (most recent call last):
File "C:\Users\LoremIpsum\Downloads\noesisv4459\plugins\python\tex_KingdomUnderFire2_vap.py", line 42, in noepyLoadRGBA
texture = NoeTexture(str(fileIndex), width, height, texData, texFormat)
UnboundLocalError: local variable 'texFormat' referenced before assignment"
or
"Traceback (most recent call last):
File "C:\Users\LoremIpsum\Downloads\noesisv4459\plugins\python\tex_KingdomUnderFire2_vap.py", line 33, in noepyLoadRGBA
texData = bs.readBytes(pixelDataSize)
File "C:\Users\LoremIpsum\Downloads\noesisv4459\plugins\python\inc_noesis.py", line 141, in readBytes
return noesis.bsReadBytes(self.h, numBytes)
MemoryError
WARNING: Not enough texture data for specified image type! (0 vs 0)"
Is it because some of the files doesn't contain textures?
  • Author
  • Localization

Allen, posted Thu Nov 11, 2021 10:40 pm (67473)


Upload sample(failed one). It should be a new pixel format or as you said dons't have textures file.
Yes. You can upload bone file. I want to take a look. :D
  • Author
  • Localization

Amagakuro, posted Fri Nov 12, 2021 12:30 am (67474)


Here
I uploaded the Unit1 folder,already extracted, also containing a few .vap files from hero folder that aren't working, .vap of unit1 are all not working but that may be 'cause there's no texture inside them.
Files are nameless unfortunately...
havok files are those with some comments from my side there're skeletons and animations, which can also be loaded with
https://forum.xentax.com/viewtopic.php?t=19691 the plugin here or Havok tool 2014.1
  • Author
  • Localization

LinkOFF, posted Sun Nov 14, 2021 3:17 am (67498)


Made a tool for extract textures (based on noesis script). Textures with type 133 (from vap's with error) may be extracted incorrectly. There is 2-channel (red alpha i suppose) pixel data converted to RGBA32 .

kuf2_vap.zip

  • Author
  • Localization

Allen, posted Sat Nov 20, 2021 9:27 am (67601)


Yes, 133 is a 16BPP image. It seems to be used for the Alpha channel, which should be in R8A8 format, but there are no more samples, so it is not completely certain.
I updated the script to support 133. These days I have been looking at the format of the player model and the NPC model, and I have already figured it out.
hkx file I am trying to understand the XML binary part of the file header, it is not very easy, but the skeleton part of the file is not too complicated, just need to find a way to skip the file header part.
Image
  • Author
  • Localization

Amagakuro, posted Sun Nov 21, 2021 1:13 pm (67630)


LinkOFF wrote:
Made a tool for extract textures (based on noesis script). Textures with type 133 (from vap's with error) may be extracted incorrectly. There is 2-channel (red alpha i suppose) pixel data converted to RGBA32 .


Allen wrote:
Yes, 133 is a 16BPP image. It seems to be used for the Alpha channel, which should be in R8A8 format, but there are no more samples, so it is not completely certain.
I updated the script to support 133. These days I have been looking at the format of the player model and the NPC model, and I have already figured it out.
hkx file I am trying to understand the XML binary part of the file header, it is not very easy, but the skeleton part of the file is not too complicated, just need to find a way to skip the file header part.
Image


Thank you both, i'll test them scripts when i'll have some free time! :D
  • Author
  • Localization

Amagakuro, posted Wed Nov 24, 2021 2:13 pm (67668)


Upping this as i had a big doubt (a tad late... sorry~)
The skeletons and animations container were "changed" to make them rougly compatible with Havok tool.
In case of the animations container only the header was simply changed. The skeleton had a "bigger" change in the files to make it readable.
The Unit1 files i upped have the original files too (.bak), also the hero skeleton weren't fixed so you most likely noticed that something was different mr Allen.
Well... "that's it" wanted to point it out as i dunno if this may change how the script read things or not.
Apologize again as i didn't think it sooner ><
  • Author
  • Localization

Allen, posted Sun Feb 06, 2022 12:19 pm (69689)


Finally, I finished the importer for the .vap model and .hkx skeleton.

Regarding the previous HkClass data part of the hkx skeleton file, I did not do in-depth research. I used a method of matching string characters to locate the skeleton data.

Image
Image
Image
Image

here is a noesis python script support import: model, textures, skeletons.

*Edit*:
Update , fix a small npc mesh skin/weight bug.

fmt_KingdomUnderFire2_vap.zip

  • Author
  • Localization

Allen, posted Sat Feb 19, 2022 7:30 am (70003)


Update , fix a small npc mesh skin/weight bug.
  • Author
  • Localization

xr79, posted Sun Feb 20, 2022 8:33 pm (70036)


Mr Allen, I used the old BMS script to extract the pkg files but was only able to get unnamed vap and dds files, the script for noesis can't pair those two together it seems, would you mind sharing how you extracted the PKG files to get working vap models?
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.