Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. The Criminal Enterprises
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. Announcements

    2. Support

    3. Suggestions

*DO NOT* SHARE MEDIA OR LINKS TO LEAKED COPYRIGHTED MATERIAL. Discussion is allowed.

[REL] ViceTXD Update


Spooky
 Share

Recommended Posts

 

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? tounge2.gif

 

[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 by ST.MU
Link to comment
Share on other sites

 

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 smile.gif.

 

 

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

 

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 smile.gif.
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! smile.gif

 

 

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

ViceTXD updated! - 1.5b biggrin.gif

 

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 wink.gif.

Link to comment
Share on other sites

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

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

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 wink.gif, 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

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

 

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 wink.gif, 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 sad.gif 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 by ZanderZ
Link to comment
Share on other sites

@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

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 smile.gif.

 

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 wink.gif

Link to comment
Share on other sites

The problem is, whatever was used to create the TXD set the datasize for the 3rd image to <5236> when it should be <17512> confused.gif. <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

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 wink.gif

Link to comment
Share on other sites

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 wow.gif)

Link to comment
Share on other sites

wanna know if the program was txd gold?

check the last 17 (or less) bytes of the txd file (before possible 2048 alingment trash) biggrin.gif

 

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 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

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

Suction Testicle Man

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 sad.gif

Edited 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

  • 2 weeks later...
Suction Testicle Man

Well, does anyone know if this is the case? smile.gif

If at first you don't succeed, you fail, and the test will be terminated.

Link to comment
Share on other sites

@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

@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

@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 smile.gif.

 

@Delfi: Why aren't you ever on msn anymore? tounge.gif or maybe we're just not on at the same times confused.gif

Link to comment
Share on other sites

@Delfi: Why aren't you ever on msn anymore? tounge.gif or maybe we're just not on at the same times confused.gif

@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

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

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

  • 2 weeks later...

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.