View Full Version : Anatomy of the .GTR / .GTL file container
KarlosDaJackal
14 February 07, 22:06
Hi,
I just did my first testing with the skining process and I realise that a .GTR file (or .GTL if your a legends man) is basically just a container for a few DDS files.
It occured to me that a lot of this create a car stuff could be automated/scripted to the point where all someone would have to do is paint the goddamn thing :)
So the Question
Apart from using G-Editor and manually exporting and re-importing .DDS files into the .GTR/.GTL file, is there an different tool for working with the .GTR file or can anybody give me a spec of how the .GTR file works so that I can see if it is a realistic goal to eliminate the need for G-Editor(i think its commercial software, cant find license info anywhere).
The idea would be to have a free open source stack off applications to do all the work. So you would use the G.I.M.P to paint (GPLv2) and to that you would add the DDS plugin (GPLv2) and the finally part of the puzzle that doesn't exist yet would be a nice python or mono script/gui that basically was a wizard for taking an existing car and creating all the files/directories you needed and also changing options like team name/drivers/numbers etc.
If I wrote it (big if) i would release it under GPLv2 also. But getting the DDS into and out of the GTR files without G-Editor is a stumbling block.
If needed new templates could be created and released under a creative commons license so that nobody would have to ask permission to use them.
Basically give the artists the right tools so that they just have to worry about the art and not about the technical stuff.
Grasshopper
15 February 07, 00:55
I have no idea if this can help, this is rather technical, and a bit over my head,
but there's the mas2files.exe from F1. (i think it belonged to masstudio or so? )
Maybe it's still compatible with .gtr files, they are still more or less the same
as .mas files as far as i can tell.
testdriver@belgium
15 February 07, 09:59
Hi,
I just did my first testing with the skining process and I realise that a .GTR file (or .GTL if your a legends man) is basically just a container for a few DDS files.
It occured to me that a lot of this create a car stuff could be automated/scripted to the point where all someone would have to do is paint the goddamn thing :)
So the Question
Apart from using G-Editor and manually exporting and re-importing .DDS files into the .GTR/.GTL file, is there an different tool for working with the .GTR file or can anybody give me a spec of how the .GTR file works so that I can see if it is a realistic goal to eliminate the need for G-Editor(i think its commercial software, cant find license info anywhere).
The idea would be to have a free open source stack off applications to do all the work. So you would use the G.I.M.P to paint (GPLv2) and to that you would add the DDS plugin (GPLv2) and the finally part of the puzzle that doesn't exist yet would be a nice python or mono script/gui that basically was a wizard for taking an existing car and creating all the files/directories you needed and also changing options like team name/drivers/numbers etc.
If I wrote it (big if) i would release it under GPLv2 also. But getting the DDS into and out of the GTR files without G-Editor is a stumbling block.
If needed new templates could be created and released under a creative commons license so that nobody would have to ask permission to use them.
Basically give the artists the right tools so that they just have to worry about the art and not about the technical stuff.
Infact you don't need G-editor. To paint you start from a blank template, paint whatever you want and place the DDS file into the correct folder using the correct name. GTR2 will use this new dds file, and your car will appear with the new skin. So no need in get the dds file back into the GTR file and to modify excisting files. You want the original skin back : just delete the dds file.
This way the game stays intakt and you don't modify anything.
KarlosDaJackal
15 February 07, 11:47
Infact you don't need G-editor. To paint you start from a blank template, paint whatever you want and place the DDS file into the correct folder using the correct name. GTR2 will use this new dds file, and your car will appear with the new skin. So no need in get the dds file back into the GTR file and to modify excisting files. You want the original skin back : just delete the dds file.
This way the game stays intakt and you don't modify anything.
I'll test that, that would solve a whole heap of problems if it works. Thanks for the advise.
testdriver@belgium
15 February 07, 12:59
I'll test that, that would solve a whole heap of problems if it works. Thanks for the advise.
Np, remember to use exactly the same name for the DDS as it is called in the GTR file. And place the file where the GTR file is.
I am 100% sure it works.
darock
15 February 07, 13:05
A minor detail about the separate dds file approach.
The .gtr file seems to provide GTR2 a means to compress the data.
I'm doing some cars for a future mod and just looked at the file sizes of one of them. The gtr file is 613Kb for that car. The three dds files it contain are 1,879Kb total.
darock
15 February 07, 13:13
testdriver,
I have a question.
The *_TEX.gtr file and the *_ULTRA_TEX.gtr file both contain dds files that have the same name. (for example, *_BODY1.dds) That suggests that either GTR2 has no real reason for two different gtr files containing different "sizes" of BODY1.dds files, or that GTR2 somehow will use duplicately named files.
Are some of the dds files not needed?
Is one of the TEX files not needed?
darock
15 February 07, 13:19
I'm just getting used to the data structure in GTR2. But one thing I noticed was that some car painters have the same size/resolution ddr files in both the *TEX.gtr file as are in the *ULTRA_TEX.gtr file. Looking at the date/time stamps on the individual ddr files shows that those car painters have obviously duplicated one TEX gtr and changed the duplicate's name.
It appears that GTR2 works, but is it actually causing a FPS hit to not have both resolution files?
testdriver@belgium
15 February 07, 13:49
testdriver,
I have a question.
The *_TEX.gtr file and the *_ULTRA_TEX.gtr file both contain dds files that have the same name. (for example, *_BODY1.dds) That suggests that either GTR2 has no real reason for two different gtr files containing different "sizes" of BODY1.dds files, or that GTR2 somehow will use duplicately named files.
Are some of the dds files not needed?
Is one of the TEX files not needed?
I am no expert. And you are right about the different sizes/resolution of the different dds files inside the two GTR files. But I use always the same setting to create dds files. What i havn't tried is to put the to put the dds file in the *_TEX.gtr file and then extract it back. It could be that G-Editor compresses the Files when you put it in the *_TEX.gtr.
Anyway i havn't seens a fps drop and can cleary see the difference between using the highres cars and not (You can change it somewhere in the Game)
So apparently GTR does the compression for you. when you put the seperate in the folder without putting it in the GTR file.
I havn't seen any performance drop, in our league (Flatout :www.fo.forumwise.com) we do it always like this and nobody has complained until now.
Doing it like this makes it way easier to see the result in the GAME. Just save the dds file and go into the showroom and you can see the result. After you change it and save it again just select the car again in the showroom and you will see the change you have done. You don't have to exit the game for this, just select the car again in the showroom.
darock
15 February 07, 14:13
Geditor does compress the files quite a bit.
And with every data structure I've seen so far, files with the same name wind up with the last one encountered being the one that is used.
Your suggestion is going to save me a lot of time. Thanks.
darock
15 February 07, 14:24
As for seeing the affect of the different resolution skins............
There was obviously a reason for having two different resolutions in the past. And the old design could have named the two different, but identical otherwise, files differently.
It appears that the design team back then simply solved the problem by having the acquisition code pick up the different sizes by picking up differently named gtr files and placing the data where it needed it at the time the code was handling that type/"size" data.
It's also clean to me now that GTR2 really isn't crashed by having only one size BODY1.ddr for both needs. In fact, without seeing the code, there is no guarantee that GTR2 is still even looking at the *_TEX.gtr info.
It's risky to make conclusions about the use of graphics files by what we see in a game. The smaller resolution ddr info might only be used for some special function that we don't see in the garage view. And it might be that we miss the difference in fps that changing one car at a time would cause.
But whatever..........
I know that some car painter's gtr files don't even have some dds that others do have. So it's for sure that we can leave some of them out if they're in the other gtr.
It's been good talking with you. You taught me a lot.
darock
15 February 07, 14:39
I just tried an experiment that was triggered by this discussion.
I deleted the TEX.gtr file from one of my cars. The car showed up in selection screens and garage closeups and on the track as a one-color, no-detail car.
So I restored the TEX and deleted the ULTRA_TEX.gtr. The car showed up with all details and colors everywhere that I looked in the game.
Now..... what does that tell us???
I guess it tells me that since the three ddr files that I had in the ULTRA_TEX.gtr apparently weren't missed by GTR2 weren't needed since they were also in the TEX.gtr file.
interesting..............
KarlosDaJackal
15 February 07, 14:55
I just tried an experiment that was triggered by this discussion.
I deleted the TEX.gtr file from one of my cars. The car showed up in selection screens and garage closeups and on the track as a one-color, no-detail car.
So I restored the TEX and deleted the ULTRA_TEX.gtr. The car showed up with all details and colors everywhere that I looked in the game.
Now..... what does that tell us???
I guess it tells me that since the three ddr files that I had in the ULTRA_TEX.gtr apparently weren't missed by GTR2 weren't needed since they were also in the TEX.gtr file.
interesting..............
They probably only come into effect when you go to advanced options and turn on high res car liveries and high res cockpit. I wish I could test it but i'm working for another 90mins.
testdriver@belgium
15 February 07, 15:06
They probably only come into effect when you go to advanced options and turn on high res car liveries and high res cockpit. I wish I could test it but i'm working for another 90mins.
Yep are thinking the same here, the high res versions are needed when you put on high res car liveries. Same problem about testing it :) :)
darock
18 February 07, 11:42
Good call. I forgot about the highres switches.
I feel that I have a good excuse. The bloody cars look excellent, VERY excellent without bothering with setting highres.
skridge
18 February 07, 16:31
Good call. I forgot about the highres switches.
I feel that I have a good excuse. The bloody cars look excellent, VERY excellent without bothering with setting highres.
i have tested this. ultra_tex is for high res cars. turn that off and you get blue box cars unless you have the normal tex. i've seen this many times in stand alone cars that were half ass made.
run everything in low detail mode, and you will see the need for both sizes. there are serveral mods that have this prob. one of the vertigo mods (not zmax) has this issue. setting the game to non high res gets you a field of blue cars.
vBulletin® v3.8.7, Copyright ©2000-2013, vBulletin Solutions, Inc.