NFSAddons Forums

Main Menu

unvivtool - portable VIV decoder/encoder (NFS3-5)

Started by bfut, Dec 01, 2020, 3:59 PM

bfut

Quote from: pete9516 on Sep 06, 2022,  5:43 AM
I was just trying to use example 2:
EXAMPLE 2
   unvivtool d car.viv .

      decodes and extracts all files from archive 'car.viv' to current working
      directory

But this doesn't work at all. All it does is this:

Your command is missing the path/to/existing_folder

Notice the dot at the end, which is a common shortcut for "current working directory" (cwd). :)

unvivtool d car.viv .

bfut

Re-posted from another topic because the request clearly pertains to unvivtool.

Quote from: pete9516 on Sep 05, 2022,  1:53 AM
Quote from: bfut on Sep 02, 2022,  5:05 AM
Quote from: pete9516 on Aug 28, 2022,  2:47 AM
Quote from: bfut on Aug 27, 2022,  1:15 AM
News:
* improved stability: robust handling of manipulated / invalid FCE data
Just that you mentioned manipulated/invalid .fce data. There are quite many car.viv's that were hex edited back in the day. Can your unvivtool handle those kind of viv's? I couldn't try it out yet since the use of this program is very complicated to usual users.

1) Complicated in which sense? Are you on Windows? I'm constantly testing on Windows10, but Linux is recommended, because Python module installation is so much easier. Give WSL a try, if on a Windows machine.

2) Yes, that type of manipulation is one target. I specifically remember CPD manipulating his VIV archives (see unvivtool for that), and possibly even the FCEs. My go-to test file is CPD's Porsche 962. I'd be interested in any VIV or FCE that cannot be opened and/or fully parsed by either, unvivtool or fcecodec.

fcecodec is required to fully handle all valid FCE data. fcecodec (and unvivtool, for that matter) is designed in a way to recover as much information as possible until encountering faulty information within an invalid file. Nomenclatura: invalid = Need For Speed cannot handle it, valid = Need For Speed does handle the file. Those manipulated files of old were in fact valid in this sense, because they could be played in the games; but some tools of the day crashed. Contrary to that, crashes are not supposed to happen with my tools either way.

I have yet to encounter either FCE or VIV that cannot be opened by my tools, but would work in the games.

What information do you believe is missing from [...] documentation?
Do you have examples of manipulated files?
Well i think that those tools would be very simple in a way that where you drag'n'drop the car.viv onto the .exe file, it will get exported in the same folder. Maybe this kind of feature is too hard to code, but i know it's possible. For usual people like me it's a pain in the ass to open cmd.exe and type the whole stuff. And i know how to copy'n'paste paths in cmd.exe. But still it would be way more pleaserable to just drag & drop the car.viv onto the .exe. And yes there is one car.viv i have which i don't know any tool that can export the inner data out of it. And it's drivable in the game. Here's the link to it:
https://drive.google.com/file/d/1opmNuVo4sXjrs-pn8xdRh6bA0ifkSQhJ/view?usp=sharing

Quote from: pete9516 on Sep 06, 2022,  5:48 AM
And this is the error message when i do it the more complicated way, which finally works, but the car.viv is just too screwed.

Thanks! Fixing for next unvivtool update.

Both, VIV and FCE are indeed manipulated. fcecodec opens car.fce anyway. ;) Who is the author, if you don't mind me asking?

pete9516

Quote from: bfut on Sep 10, 2022,  5:00 AM
Quote from: pete9516 on Sep 06, 2022,  5:43 AM
I was just trying to use example 2:
EXAMPLE 2
   unvivtool d car.viv .

      decodes and extracts all files from archive 'car.viv' to current working
      directory

But this doesn't work at all. All it does is this:

Your command is missing the path/to/existing_folder

Notice the dot at the end, which is a common shortcut for "current working directory" (cwd). :)

unvivtool d car.viv .
Oh i'm sorry about this. I never knew this shortcut function. Thanks for the information

pete9516

Quote from: bfut on Sep 10, 2022,  5:11 AM
Re-posted from another topic because the request clearly pertains to unvivtool.

Quote from: pete9516 on Sep 05, 2022,  1:53 AM
Quote from: bfut on Sep 02, 2022,  5:05 AM
Quote from: pete9516 on Aug 28, 2022,  2:47 AM
Quote from: bfut on Aug 27, 2022,  1:15 AM
News:
* improved stability: robust handling of manipulated / invalid FCE data
Just that you mentioned manipulated/invalid .fce data. There are quite many car.viv's that were hex edited back in the day. Can your unvivtool handle those kind of viv's? I couldn't try it out yet since the use of this program is very complicated to usual users.

1) Complicated in which sense? Are you on Windows? I'm constantly testing on Windows10, but Linux is recommended, because Python module installation is so much easier. Give WSL a try, if on a Windows machine.

2) Yes, that type of manipulation is one target. I specifically remember CPD manipulating his VIV archives (see unvivtool for that), and possibly even the FCEs. My go-to test file is CPD's Porsche 962. I'd be interested in any VIV or FCE that cannot be opened and/or fully parsed by either, unvivtool or fcecodec.

fcecodec is required to fully handle all valid FCE data. fcecodec (and unvivtool, for that matter) is designed in a way to recover as much information as possible until encountering faulty information within an invalid file. Nomenclatura: invalid = Need For Speed cannot handle it, valid = Need For Speed does handle the file. Those manipulated files of old were in fact valid in this sense, because they could be played in the games; but some tools of the day crashed. Contrary to that, crashes are not supposed to happen with my tools either way.

I have yet to encounter either FCE or VIV that cannot be opened by my tools, but would work in the games.

What information do you believe is missing from [...] documentation?
Do you have examples of manipulated files?
Well i think that those tools would be very simple in a way that where you drag'n'drop the car.viv onto the .exe file, it will get exported in the same folder. Maybe this kind of feature is too hard to code, but i know it's possible. For usual people like me it's a pain in the ass to open cmd.exe and type the whole stuff. And i know how to copy'n'paste paths in cmd.exe. But still it would be way more pleaserable to just drag & drop the car.viv onto the .exe. And yes there is one car.viv i have which i don't know any tool that can export the inner data out of it. And it's drivable in the game. Here's the link to it:
https://drive.google.com/file/d/1opmNuVo4sXjrs-pn8xdRh6bA0ifkSQhJ/view?usp=sharing

Quote from: pete9516 on Sep 06, 2022,  5:48 AM
And this is the error message when i do it the more complicated way, which finally works, but the car.viv is just too screwed.

Thanks! Fixing for next unvivtool update.

Both, VIV and FCE are indeed manipulated. fcecodec opens car.fce anyway. ;) Who is the author, if you don't mind me asking?
Well, that's the big problem. I once saved this single car.viv in the tool folder for experimenting with it. I somewhere have it probably with a readme though in my car archive, but i'll need to search for it.
But how can your fcecodec handle car.fce's inside a locked car.viv? Were you able to extract the contents of the car.viv? If yes, please let me know! :d I want to change the class xD It should be in class B, not AA lol.
btw you can clearly see how selfish the author is when you drive the car with interior camera.. ^^ But i have to say the author has made a really good job on the model and the car performance

bfut

unvivtool.exe version 1.11 is now available from https://github.com/bfut/unvivtool

Changes:
+    support UTF8-filenames in VIV archives (e.g., CJK)
+    improved decoder (better support for manipulated or "locked" archives)
+    improved usability: on Windows, drag-and-drop archives on executable for easy decoding
+    improved stability



edit: a disclaimer on the drag-and-drop feature. if it fails, you won't get statistics or possible error messages. in these instances, it's still worth to investigate using a terminal. the same holds true for every oldschool command-line tool ofc :)

pete9516

Quote from: bfut on Sep 11, 2022,  8:52 AM
unvivtool.exe version 1.11 is now available from https://github.com/bfut/unvivtool

Changes:
+    support UTF8-filenames in VIV archives (e.g., CJK)
+    improved decoder (better support for manipulated or "locked" archives)
+    improved usability: on Windows, drag-and-drop archives on executable for easy decoding
+    improved stability



edit: a disclaimer on the drag-and-drop feature. if it fails, you won't get statistics or possible error messages. in these instances, it's still worth to investigate using a terminal. the same holds true for every oldschool command-line tool ofc :)
OMG :D This is now my number 1 tool for unpacking car.viv's. I'm glad you could find out how to debug that Civic's car.viv. I'm still searching for the author

Paul Spain

So will this allow us to extract the models from NFS HotPursuit 2 and up? So many of Robin's stuff I'd like to see if I can convert to HighStakes and give Veg's Patch a good work out.
NFS HighStakes is the best

pete9516

Quote from: Paul Spain on Sep 15, 2022,  6:59 AM
So will this allow us to extract the models from NFS HotPursuit 2 and up? So many of Robin's stuff I'd like to see if I can convert to HighStakes and give Veg's Patch a good work out.
I just tried out to export a HP2 car.viv (standard one) and it seems to work. Put me out 8 files:
car.fsh
car.o
carM.o
carRigid.o
carRigidM.o
damage.fsh
shadow.o
skeleton.o

But besides of that there's vivmagic for HP2 right?

bfut

The VIV format, internally BIGF, is the same over a wide range of EA games: NFS2 and later, C&C games, some NBA games, etc. File extensions vary, usually .viv or .big
All of these games were modded and each scene created their own BIGF decoders/encoders, respectively. Unfortunately, most of them are closed-source, i.e., not portable and bugs unfixable, or have heavy dependencies on GUI frameworks.

Hence unvivtool as a lightweight, FOSS, portable option.

Thanks for the feedback.

Quote from: pete9516 on Sep 10, 2022,  8:36 AMBut how can your fcecodec handle car.fce's inside a locked car.viv?

unvivtool extracts and creates VIV archives. fcecodec decodes, encodes, and operates on FCE data, for NFS3, NFS4 and MCO, respectively. The tools work independently of each other. Frankly, it's all I use these days.

Meredich

#24
Quote from: bfut on Sep 16, 2022, 11:37 AM
The VIV format, internally BIGF, is the same over a wide range of EA games: NFS2 and later, C&C games, some NBA games, etc. File extensions vary, usually .viv or .big
All of these games were modded and each scene created their own BIGF decoders/encoders, respectively. Unfortunately, most of them are closed-source, i.e., not portable and bugs unfixable, or have heavy dependencies on GUI frameworks.

Hence unvivtool as a lightweight, FOSS, portable option.

Thanks for the feedback.

Quote from: pete9516 on Sep 10, 2022,  8:36 AMBut how can your fcecodec handle car.fce's inside a locked car.viv?

unvivtool extracts and creates VIV archives. fcecodec decodes, encodes, and operates on FCE data, for NFS3, NFS4 and MCO, respectively. The tools work independently of each other. Frankly, it's all I use these days.
Hey! Help open the game archive from NHL2004 PS2 FE_LOGOS.viv. Please!
Quote from: bfut on Feb 23, 2021,  8:55 AM

bfut

I've taken a look at the file. I can't promise a time, but I'll try to get back to you. In the meantime, are there any online ressources on NHL 2004, website, modded files, etc.? I have zero modding knowledge outside of early NFS. ta

bfut

Quote from: Meredich on Jan 06, 2023,  4:28 AMHey! Help open the game archive from NHL2004 PS2 FE_LOGOS.viv. Please!
The good news The posted file is an uncompressed BIGF (alias .big / .viv) file. At least the first couple contained files have format SHPS (i.e., FSH) but each file seems to have a prefix of 6 bytes in length.

The bad news The FE_LOGOS.VIV directory has a quirk: each listed filename has a prefix of 4 bytes in length. The prefix as a whole is in general not made up of printable characters.

The way my tool is designed, it looks for printable characters where the filename is expected in the VIV directory. If unprintable stuff is detected, parsing stops. Because the very first directory entry has unprintable bytes where unvivtool expects the filename, you get the output from above that 0 files are listed in the directory.

This quirk does not occurs in PC-versions of Need For Speed 3-5. I can amend unvivtool to handle this situation, but you would have to convince me that it's worth my time. :)

Specifically, I'd want answers to these: How many games/files have this BIGF-quirk? What type of information iscontained in this 4 byte prefix? Do you want to extract only or also modify/create this file?

Hope this helps. :)

Meredich

#27
Quote from: bfut on Jan 12, 2023,  3:49 PM
Quote from: Meredich on Jan 06, 2023,  4:28 AMHey! Help open the game archive from NHL2004 PS2 FE_LOGOS.viv. Please!
The good news The posted file is an uncompressed BIGF (alias .big / .viv) file. At least the first couple contained files have format SHPS (i.e., FSH) but each file seems to have a prefix of 6 bytes in length.

The bad news The FE_LOGOS.VIV directory has a quirk: each listed filename has a prefix of 4 bytes in length. The prefix as a whole is in general not made up of printable characters.

The way my tool is designed, it looks for printable characters where the filename is expected in the VIV directory. If unprintable stuff is detected, parsing stops. Because the very first directory entry has unprintable bytes where unvivtool expects the filename, you get the output from above that 0 files are listed in the directory.

This quirk does not occurs in PC-versions of Need For Speed 3-5. I can amend unvivtool to handle this situation, but you would have to convince me that it's worth my time. :)

Specifically, I'd want answers to these: How many games/files have this BIGF-quirk? What type of information iscontained in this 4 byte prefix? Do you want to extract only or also modify/create this file?

Hope this helps. :)
Good afternoon! This archive contains the icons of the NHL teams in the main menu of the game. At the moment, I have replaced all teams with new uniforms and icons in the match, since there are no such problems with them as with this archive.

Meredich

#28
Quote from: bfut on Jan 12, 2023,  3:49 PM
Specifically, I'd want answers to these: How many games/files have this BIGF-quirk? What type of information iscontained in this 4 byte prefix? Do you want to extract only or also modify/create this file?

Hope this helps. :)
This archive contains 170 team logos, because there are only 170 of them in the game in other places. I would like to not just unpack it, but then pack the changed files back. I select the palette in SSH through the HEX editor and Console Texture Explorer. Here is an example on a player photo.
A total of 7 game archives are collected in this way and cannot be opened. Here they are:
FE/BG.VIV
FE/BOOT_ART.VIV
FE/CT_ART.VIV
FE/FE_ART.VIV
FE/FE_LOGOS.VIV
FE/GM_PORT.VIV
FE/OV_ART.VIV
All the rest are opened with standard tools, such as BigGUI.