Page 1 of 1

Build 22/32 pids

Posted: Thu Feb 14, 2019 10:51 pm
by Rebel
This is mostly to machf since I think he's familiar with the file's structure. Do you know the
differences involved?

I can force tresed to load those builds, but without textures. My swap_viewer goes through
the files, but I'm guessing that it's displaying only half the amount of textures.

Any thoughts?

Re: Build 22/32 pids

Posted: Fri Feb 15, 2019 12:06 am
by machf
Ask tatu, I think he went through them. Right now I don't remember if I looked at them or not...

Re: Build 22/32 pids

Posted: Fri Feb 15, 2019 6:03 am
by tatu
I usd SWPExt to extract all textures and then used GeomAdd's verify function to get the names, and then I renamed all by hand (or most anyway) as GeomAdd appear to list them in the correct order, most of the part.

As for the file structure, I have no idea :D

Re: Build 22/32 pids

Posted: Fri Feb 15, 2019 6:34 am
by machf
OK, I'll take a look at them, then...

(BTW, there are a few whose names you didn't get properly, I think...)

Re: Build 22/32 pids

Posted: Fri Feb 15, 2019 7:03 am
by tatu
machf wrote:(BTW, there are a few whose names you didn't get properly, I think...)
In the end I think I only fully renamed Build 22 IJ and PV and then used those for Build 32. I did a lot of compare between the retail ones when I was unsure so texture issues seen in the level is probably due to issues in the GRF or something rather than the textures themselves.

Re: Build 22/32 pids

Posted: Fri Feb 15, 2019 4:14 pm
by machf
Well, there's a road texture in PV which definitely has the wrong name for some reason... and PH is missing some textures here and there.

Going back to the subject at hand: my first analysis of the files (checking the source, too) seems to indicate that the only differences between PID files version 1.2.0 (early builds) and 1.3.0 (later builds, including the retail) aside from the version number itself (first 4 bytes, 0x120 or 0x130, respectively) seems to be the way the hash values for the texture names are calculated... but forget about calculating a new hash from an old one for an easy conversion, I don't think that's possible.

In the end, the way tatu did the conversion IS the way to go; extract all the textures from the version 120 files (which can be read just like the version 130 files) and store them in a new version 130 file, finding out their names first. If you find a way to automate the process, well...

EDIT: The other possibility would be to find out how the old hash was calculated, then go through all the texture names for each level in order to build a reference table containing both the old-style hash values and the new-style ones for each texture name, and use that to do a global replace in the version 120 .PID files (also updating the version number in the header from 0x120 to 0x130).

Re: Build 22/32 pids

Posted: Fri Feb 15, 2019 6:39 pm
by tatu
It is really only a few hours of hard work to rename the textures so I think that is quicker.

Yeah, I never fully finished them as 99% of the stuff in the level was foliage and renaming all the $ texture was just tons of work.

And I don't know about the PV Road. I guess I could've named some wrong, it's been too long. I think I stopped cause not that many people seemed interested in them anyway :P

Re: Build 22/32 pids

Posted: Fri Feb 15, 2019 11:43 pm
by Rebel
Yeah, had a feeling it was the hash values when the textures were mia since both file versions seem
to have identical structures. I thought about tatu's method myself and figured it would take quite a
bit of time to rebuild a new pid/swp pack.

Re: Build 22/32 pids

Posted: Sat Feb 16, 2019 8:36 am
by tatu
Rebel wrote:Yeah, had a feeling it was the hash values when the textures were mia since both file versions seem
to have identical structures. I thought about tatu's method myself and figured it would take quite a
bit of time to rebuild a new pid/swp pack.
But you would only need to do it once :D
I might take another shoot at it soon again, just to finally do it.

Re: Build 22/32 pids

Posted: Sat Feb 16, 2019 3:03 pm
by machf
I'm searching for the description of the hash function. I don't think it's the same CRC-32 as the sound names inthe .TPA files, although Andres (or maybe it was TSOrd, I don't know who wrote that part) says that it's combined with the bumpmap's filename too... so far, I haven't been able to calculate valid hashes for neither the v120 nor the v130 versions.

Re: Build 22/32 pids

Posted: Sat Feb 16, 2019 4:21 pm
by tatu
The source is of no help either with information? Not even for v130?

Re: Build 22/32 pids

Posted: Sat Feb 16, 2019 4:33 pm
by machf
I haven't found whichever section deals with it yet...

Re: Build 22/32 pids

Posted: Tue Feb 19, 2019 5:29 pm
by machf
Hey, Rebel, tatu and I were further discussing this via PM and I made some progress, I've just CCd you my latest answer...