Spooky Posted September 14, 2003 Author Share Posted September 14, 2003 I've updated it and it's available at the same url... Download: Setup.exe (491kb) Link to comment Share on other sites More sharing options...
steve-m Posted September 14, 2003 Share Posted September 14, 2003 (edited) I think you're refering to the 3rd dword, which Delfi informed me is the "gametype"... with "268697599" being ViceCity. No, first dword is section type, second section size and third the version id of the renderware file. TXD files have the same basic format as DFF files and consist of sections with different purpose. See KCows dff documentation for more infos. Every section has a 12 byte section header, containing type, size and ver id. The version id is 0x0800FFFF for GTA3, 0x0C02FFFF for VC PS2 and 0x1003FFFF for VC PC (in the most cases). The (usual) txd format looks like this: (22) Texture Dictionary|+-+ (1) Data| |--> Number of Textures (dword)|+-+ (21) Texture No. 1| |-+ (1) Data| | |--> (all the texture information and the image itself)| || +-- (3) Extension (always empty - size=0) --> MISSING|+-+ (21) Texture No. 2| |-- ... (same as above)|+-+ (21) Texture No. 3 |-- ... (The number in brackets stands for the section type - dword) - The flags are in the dword right after the alpha name. These are just the alpha flags and (hopefully) depend on the image type: 8bit without alpha: 97288bit with alpha: 947232bit without alpha: 153632bit with alpha: 1280DXT1 without alpha: 512DXT1 with alpha: 256DXT3 with alpha: 768(Just the second byte of the dword changes, that's why all values are divisible by 256) So does anyone know, what the dword flag between constant dword 8 and texture name means? Although it could be different for every single texture, it is always the same within the whole TXD AFAIK. Both flag and ver id can be changed in my TXD Builder (see options), if anyone likes to test. Anything unclear? [EDIT] Spooky, although leaving out the empty extension section isn't wrong and using the wrong section size doesn't seem to cause an error, most of the old TXD editors, viewers and installers only know the "standard" format and won't get along with other formats, even if they are theoretically correct. [EDIT 2] Sorry for filling your topic with this crap, haven't seen Delfi started a new one. Steve Edited September 14, 2003 by ST.MU Link to comment Share on other sites More sharing options...
Spooky Posted September 14, 2003 Author Share Posted September 14, 2003 I think you're refering to the 3rd dword, which Delfi informed me is the "gametype"... with "268697599" being ViceCity. No, first dword is section type, second section size and third the version id of the renderware file.I know, but you said when adding new textures/creating a new txd it had a high number where the size should be, but because of the bug, it was never high, it was always 4... which is why I thought you were mistaken . The (usual) txd format looks like this: (22) Texture Dictionary+-+ (1) Data| |-- Number of Textures (dword)|+-+ (21) Texture No. 1| |-+ (1) Data| | |-- (all the texture information and the image itself)| || +-- (3) Extension (always empty - size=0) --> MISSING|+-+ (21) Texture No. 2| |-- ... (same as above)|+-+ (21) Texture No. 3 |-- ... If the extension section is empty/missing in every texture, how do you know it exists? - The flags are in the dword right after the alpha name. These are just the alpha flags and (hopefully) depend on the image type: 8bit without alpha: 97288bit with alpha: 947232bit without alpha: 153632bit with alpha: 1280DXT1 without alpha: 512DXT1 with alpha: 256DXT3 with alpha: 768(Just the second byte of the dword changes, that's why all values are divisible by 256) I thought the same but some textures stray from this key... for example some player/npc skins are DXT1 without alpha and the flags are 33280... which led me to believe it's 16 individual 1-bit flags. So does anyone know, what the dword flag between constant dword 8 and texture name means?I didn't know this, but Delfi told me it's todo with the texture pixel format...special: Longword; // 4354= 16bit // 4358= 8bpp // 4354= 32bpp Link to comment Share on other sites More sharing options...
steve-m Posted September 14, 2003 Share Posted September 14, 2003 I know, but you said when adding new textures/creating a new txd it had a high number where the size should be, but because of the bug, it was never high, it was always 4... which is why I thought you were mistaken .It's like that: The number was very high (4294967288), when you look at it as dword/cardinal/whatever (+). But when you look at it as integer (+/-) it is -8, that means you took the 4 and subtracted the 12 byte headersize, so it became negative! Both of us are right! If the extension section is empty/missing in every texture, how do you know it exists?The extension section is empty because the 12 byte section header is there, saying the section has a size of 0 byte, so it contains no data/other sections. And the missing was related to YOUR txd file, because there isn't even this section header.This is a section header: type TSectionHeader = record sectype, // A number defining the type of section size, // The size of the section, the 12 byte of this header not included verID: cardinal; // The file format version ID, the same for every header in one fileend; So when I write "(22) Texture Dictionary", it means "This is a 12 byte header with sectype=22". In txd files only data sections contain data, the others contain other sections again, as you can see in my graph. I didn't know this, but Delfi told me it's todo with the texture pixel format...special: Longword; // 4354= 16bit // 4358= 8bpp // 4354= 32bpp This can't be right, because this flag is usually the same for every texture in one txd archive, and these can be different formats of course. We still need to find out the sense of this. Steve Link to comment Share on other sites More sharing options...
Spooky Posted September 15, 2003 Author Share Posted September 15, 2003 ViceTXD updated! - 1.5b I've re-wrote alot of the code as well as general fixes/additions, expect a few bugs :s. Download: Setup.exe (491kb) --- Steve, I've sorted the extension section . Link to comment Share on other sites More sharing options...
JernejL Posted September 15, 2003 Share Posted September 15, 2003 come on you two! go to the new txd format discussions topic about this sh*t! and spooky - moderator, move these last tech posts there ok? Currently working on Top Down City Game, a classics top down game similar to GTA1 & GTA2: Thread Info: https://gtaforums.com/topic/911312-new-game-top-down-city/ Youtube channel: https://www.youtube.com/channel/UCxGfOh3ld7Xm-ic3KEMB6iA Discord: https://discord.gg/UXmDPzS - join #bridge channel Link to comment Share on other sites More sharing options...
Spooky Posted September 15, 2003 Author Share Posted September 15, 2003 I can only move whole threads, not posts :s. I'll just order everyone to move there! Link to comment Share on other sites More sharing options...
ZanderZ Posted September 16, 2003 Share Posted September 16, 2003 I just downloaded the Citroën 2CV at www.philsfiles.de and I opened the huge txd file in ViceTXD. There were only 3 8bit textures, of max. size 128x128. Yet the txd file was over 1 mb! Then I opened the txd in TXD Workshop and I could see there were 8 more 512x512 textures! How come ViceTXD doesn't show these? Link to comment Share on other sites More sharing options...
Spooky Posted September 16, 2003 Author Share Posted September 16, 2003 The texture count in the main file header must be screwed... ViceTXD scans through the file for textures untill it reaches <texture count>, then it exits the function. I've updated ViceTXD just for you , it'll now read all textures and let you know about the error, and also let you fix it if you want to. Download: Setup.exe (491kb) Link to comment Share on other sites More sharing options...
steve-m Posted September 16, 2003 Share Posted September 16, 2003 The txd could have been made with TXD Gold, because I guess there was a bug that doesn't "physically" delete textures, just changes the number in the header. Link to comment Share on other sites More sharing options...
ZanderZ Posted September 16, 2003 Share Posted September 16, 2003 (edited) The texture count in the main file header must be screwed... ViceTXD scans through the file for textures untill it reaches <texture count>, then it exits the function. Ah, okay, sounds logical I've updated ViceTXD just for you , it'll now read all textures and let you know about the error, and also let you fix it if you want to. Thanks for updating, but it doesn't work I still only see 3 textures. I did a dff check with TXD Builder, and the car does use the textures, so it's probably not a 'forgotten' deleted texture. Edited September 16, 2003 by ZanderZ Link to comment Share on other sites More sharing options...
steve-m Posted September 16, 2003 Share Posted September 16, 2003 @ZanderZ: Did you try other txd viewers? Spooky, a few ideas for new features: - open the edit header dialog on double-clicking a texture name, center it on the screen/main form - allow the user to convert the formats of already existing textures (e.g. 32bit => 16bit DXT3) - mipmap support (both viewing and editing/adding) Here is some sample (pseudo) code how to calculate the dimensions of lower mipmap levels (based on the dimensions of level 0 and the given size): // this comes after the texture information datafor i:=0 to MipMapCount-1 do begin txd.Read(c, 4); // Read the size of mipmap image data, also for level 0 (full size) MipMaps[i].size:=c; // Save the size for the actual mipmap MipMaps[i].offset:=txd.Position; // Store the offset for later use (painting) txd.Position:=txd.Position+c; // Skip to the next mipmap if not tex.DXT1 then c:=c*2; // because for DXT3 there is additional alpha data, just used for the calculation below // This is the height/width calculation code, also works for non-quadratic textures! MipMaps[i].height:=round(sqrt(c/(tex.width/tex.height))); MipMaps[j].width:=round((tex.width/tex.height)*sqrt(c/(tex.width/tex.height)));end; Link to comment Share on other sites More sharing options...
Spooky Posted September 16, 2003 Author Share Posted September 16, 2003 ZanderZ: The only other thing I can think of, is the program that created the TXD didn't do the data sizing correctly... upload/email me this TXD, and i'll let you know what the problem is . Steve: - Good idea... added. - I will add this soon, I was just waiting to see if anyone had problems with the new features. - It will be added, thanks for the code Link to comment Share on other sites More sharing options...
ZanderZ Posted September 16, 2003 Share Posted September 16, 2003 Here's a direct link to the car, it included the txd file: http://www.philsfiles.de/files/vc/citroen2cv.zip I could upload just the txd file, but it wouldn't be a lot smaller... Steve: no, I only tried it in those two programs, and I did the dff check with your TXD Builder. I'll try some other txd viewers. Link to comment Share on other sites More sharing options...
Spooky Posted September 16, 2003 Author Share Posted September 16, 2003 The problem is, whatever was used to create the TXD set the datasize for the 3rd image to <5236> when it should be <17512> . <5236> would be the correct size for a 64x64 texture (such as the first texture in this archive), but it was somehow applied to this 128x128 texture. Link to comment Share on other sites More sharing options...
ZanderZ Posted September 16, 2003 Share Posted September 16, 2003 That's weird... But the only reason I pointed it out was because at first I thought it might be a ViceTXD bug. It seams to work in VC, so it's just an error of the creator, not yours Link to comment Share on other sites More sharing options...
DiCanio Posted September 17, 2003 Share Posted September 17, 2003 if you download the Mitsubishi Evo VII WRC Beta by Griff you only see 7 textures in the 8mb txd file There are actually 14 in there TXD Builder only sees 3 in a DFF Check http://www.3d-graffiti.com/ http://www.3d-graffiti.com/sub/downloads/3..._7_wrc_beta.zip --------------- Thanx for all the updates I'm sure the three of you will suss out all there is to know about TXD's - a confusing topic ) Link to comment Share on other sites More sharing options...
JernejL Posted September 17, 2003 Share Posted September 17, 2003 (edited) wanna know if the program was txd gold? check the last 17 (or less) bytes of the txd file (before possible 2048 alingment trash) basicly, all duplicated images of image 0 in txd gold have copied whole header data - and so the OLD texture_count before duplicating is in all copies... Edited September 17, 2003 by Delfi Currently working on Top Down City Game, a classics top down game similar to GTA1 & GTA2: Thread Info: https://gtaforums.com/topic/911312-new-game-top-down-city/ Youtube channel: https://www.youtube.com/channel/UCxGfOh3ld7Xm-ic3KEMB6iA Discord: https://discord.gg/UXmDPzS - join #bridge channel Link to comment Share on other sites More sharing options...
Spooky Posted September 17, 2003 Author Share Posted September 17, 2003 It must've been txd gold then, because the header for the 4th texture is really the header from the first with a few changes. Link to comment Share on other sites More sharing options...
Suction Testicle Man Posted September 19, 2003 Share Posted September 19, 2003 (edited) I have a problem... I extracted wshsprayshp.txd and exported and edited a file with a picture of a garage door on paint. When I tried to import it back into the .txd it said all sorts of jargon (I'm using the latest version of ViceTXD). The file in question was a 16bit one. I tried creating a new 32bit one with the same name and renamed the old one, then imported the edited file over my newly created one but the game just crashed when I drove to where the texture is supposed to be in the game. Later I then tried simply exporting the 16bit file and then importing it back without even touching it and it did not work - it displayed the same jargon. So my conclusion is you have problems with 16bit files. Any reason for this? If I'm asking a stupid question you can shoot me if you want. ::EDIT:: You posted this a few seconds ago: This is actually todo with your graphics card not supporting DXT compresed textures... basicly you can't add or replace textures that are using DXT compression. I'm working on getting around this with a software compresser but untill then you can just add the texture as new with the same name, using 32bit uncomressed then renaming the old texture to something else. I have a feeling the same applies to me Edited September 19, 2003 by Suction Testicle Man If at first you don't succeed, you fail, and the test will be terminated. Link to comment Share on other sites More sharing options...
Suction Testicle Man Posted September 28, 2003 Share Posted September 28, 2003 Well, does anyone know if this is the case? If at first you don't succeed, you fail, and the test will be terminated. Link to comment Share on other sites More sharing options...
steve-m Posted September 28, 2003 Share Posted September 28, 2003 @STM: I don't know, but when ViceTXD does work with compressed textures (able to show them), your graphics card must support it... @Spooky: Any progress implementing the mipmap function? Some new stuff you can add: - deleting textures from archive - a checkbox in the replace dialog, asking wether to resize the new texture (if different size) or not (strech) - several hotkeys, like pressing del deletes the texture (if implemented) Link to comment Share on other sites More sharing options...
JernejL Posted September 28, 2003 Share Posted September 28, 2003 @STM: I don't know, but when ViceTXD does work with compressed textures (able to show them), your graphics card must support it... @Spooky: Any progress implementing the mipmap function? Some new stuff you can add: - deleting textures from archive - a checkbox in the replace dialog, asking wether to resize the new texture (if different size) or not (strech) - several hotkeys, like pressing del deletes the texture (if implemented) @ST.MU: spooky wrote his own dxt decompression code and it is built into the program and graphic card independant. spooky's compressor uses dxt compression offered by your graphical card. and your card sometimes doesn't want to compress the right way... Currently working on Top Down City Game, a classics top down game similar to GTA1 & GTA2: Thread Info: https://gtaforums.com/topic/911312-new-game-top-down-city/ Youtube channel: https://www.youtube.com/channel/UCxGfOh3ld7Xm-ic3KEMB6iA Discord: https://discord.gg/UXmDPzS - join #bridge channel Link to comment Share on other sites More sharing options...
Spooky Posted September 29, 2003 Author Share Posted September 29, 2003 @ST.MU: I've been rather busy recently with work, but I will get to it, and i'll try to add what you've suggested . @Delfi: Why aren't you ever on msn anymore? or maybe we're just not on at the same times Link to comment Share on other sites More sharing options...
JernejL Posted September 29, 2003 Share Posted September 29, 2003 @Delfi: Why aren't you ever on msn anymore? or maybe we're just not on at the same times @Spooky: i was on msn friday and sunday from around 20:00 - 23:00 GMT +1, you weren't online, just in friday your sister accidently logged in, she said you went out... Currently working on Top Down City Game, a classics top down game similar to GTA1 & GTA2: Thread Info: https://gtaforums.com/topic/911312-new-game-top-down-city/ Youtube channel: https://www.youtube.com/channel/UCxGfOh3ld7Xm-ic3KEMB6iA Discord: https://discord.gg/UXmDPzS - join #bridge channel Link to comment Share on other sites More sharing options...
OffRoader23 Posted October 5, 2003 Share Posted October 5, 2003 have you made it so you can delete textures from it yet? just wondering i havent read the full 3 pages yet, but i do know that that would be helpful to be able to delete a texture from the .txd cuz i have like 5 extra textures in my wheels.txd and they are just wasting space Link to comment Share on other sites More sharing options...
JernejL Posted October 9, 2003 Share Posted October 9, 2003 have you made it so you can delete textures from it yet? just wondering i havent read the full 3 pages yet, but i do know that that would be helpful to be able to delete a texture from the .txd cuz i have like 5 extra textures in my wheels.txd and they are just wasting space i'll answer on your next question even before you ask: nobody would reply on this question because youre just wasting time (like i am right now) because why not go and download it and check it out BY YOURSELF? Currently working on Top Down City Game, a classics top down game similar to GTA1 & GTA2: Thread Info: https://gtaforums.com/topic/911312-new-game-top-down-city/ Youtube channel: https://www.youtube.com/channel/UCxGfOh3ld7Xm-ic3KEMB6iA Discord: https://discord.gg/UXmDPzS - join #bridge channel Link to comment Share on other sites More sharing options...
MasterW3 Posted October 23, 2003 Share Posted October 23, 2003 what file is d3d9.dll? I've screwed my computer up 4 times in a row installing DirectCrud9... so I will stay well away from it... anything I can do to edit TXD files in my case? Link to comment Share on other sites More sharing options...
Demarest Posted October 23, 2003 Share Posted October 23, 2003 what file is d3d9.dll?I've screwed my computer up 4 times in a row installing DirectCrud9... so I will stay well away from it... anything I can do to edit TXD files in my case? Isn't it a file placed on the machine by DirectX 9? VC auto-installs DX9. Link to comment Share on other sites More sharing options...
ZanderZ Posted October 23, 2003 Share Posted October 23, 2003 Isn't it a file placed on the machine by DirectX 9? VC auto-installs DX9. Yes, it's Direct3D version 9 (probably, given the name), so it's used for 3D stuff. Why ViceTXD uses it, I don't know. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now