Posted: Tue Jun 23, 2020 7:58 am Post subject:
Texture system info from the new patch (and game in general)
Here is some information on how textures work in the remaster and what has changed in the remaster patch.
Ok so firstly, all texture files in the remaster are either .dds files or .tga files.
Both are standard formats so I wont go into details here.
A .tga file can have an optional .meta file. This is a JSON file containing a size value (x and y) and a crop value (top, left, bottom, right)
Here is an example of the contents of such a file:
Code:
{"size":[256,256],"crop":[71,40,187,199]}
Basically the size value specifies what size the original tga file was and the crop value shows where within that original tga file the actual tga file goes.
Its an optimization intended to reduce the size of all the assets by removing un-necessary black borders around the 4 edges. Unsure if its somehow a benefit at runtime or not since I don't know how the GlyphX engine works.
What has changed in the patch (as part of an attempt to fix stuttering issues) is that the core game .tga files (units, structures etc) are now stored in a zip file. So in the previous version of the game you would have a folder (inside the .meg file) called data\art\textures\srgb\common\vfx\fball1 containing a bunch of .tga and .meta files and now you have a file called data\art\textures\srgb\common\vfx\fball1.zip that contains the same .tga and .meta files.
If your mod contains art for a unit, structure or effect (these are things that would go in common_vfx.xml, ra_structures.xml, ra_units.xml, ra_vfx.xml, td_structures.xml, td_units.xml or td_vfx.xml) then you probably need to use a zip for the textures in your mod going forward.
Mods that have such art will have folders like Data\Art\Textures\SRGB\Tiberian_Dawn\Units\WARRIOR or Data\Art\Textures\SRGB\Tiberian_Dawn\Units\ANT1
If you have such a folder and it already contains .meta files then all you need to do is to use a zip program to zip up the contents of the folder.
So the contents of Data\Art\Textures\SRGB\Tiberian_Dawn\Units\ANT1 would go in Data\Art\Textures\SRGB\Tiberian_Dawn\Units\ANT1.zip in your mod and the Data\Art\Textures\SRGB\Tiberian_Dawn\Units\ANT1 folder would go away.
If you have such a folder and it doesn't contain .meta files then you can also do the above and make it a zip and it will probably work. Or you can run it through the tgautil.py script released by EA/Petroglyph as part of the new patch which will generate both the .meta files and the .zip for you. Exactly how you use this script I dont know, someone who knows Python more than I do will have to explain more. QUICK_EDIT
This is a JSON file containing a size value (x and y) and a crop value (top, left, bottom, right)
Here is an example of the contents of such a file:
Code:
{"size":[256,256],"crop":[71,40,187,199]}
I assume this part is wrong.
There is an art of MOEBIUS (which is luckly uncroped) with size of 266,208
And there is EINSTEIN which is basicly a reskin of MOEBIUS.
einstein-0000.meta
Code:
{"size":[266,208],"crop":[116,41,202,116]}
so nothing whrong about x,y. however adding "(top, left, bottom, right)" gave a weird results. so I've experimented a bit and here I think how it works:
(left, top, right, bottom)
first entry
left: crop everything below 116 on axis X
second entry
top: crop below 41on axis Y
third entry
right: crop above 202 on axis X
fourth entry
bottom: crop above 116 on axis Y
so to backward math is:
1. add to bottom =208-116
2. add to right =226-202
3. add to top 41
4. add to left 116
crop.png
Description:
Filesize:
26.11 KB
Viewed:
4258 Time(s)
_________________ Gangster is a Project Perfect Wuj (c)Aro Last edited by Gangster on Mon Jul 06, 2020 7:56 pm; edited 1 time in total QUICK_EDIT
Ohi Nice to see you are still around.
Petro released a python script that does the cropping, generating the meta file, and zipping up and it appears to do the reverse as well.
https://github.com/electronicarts/CnC_Remastered_Collection/blob/master/SCRIPTS/tgautil.py
I'm bad at python so no clue what its doing exactly
Edit: got it working
The coords are top left absolute and bottom right absolute pixel locations indeed.
What a bizarre offset for this render, why just why
it has a dependency
python -m pip install Pillow
then should be able to run it via python tgautil.py _________________ Tiberian Dawn, Red Alert, Tiberian Sun ,Red Alert 2,Renegade, Command & Conquer 3,Tiberium and Tiberium Wars and Westwood related image & video archive
https://picasaweb.google.com/113361105083292812413?noredirect=1
Skype live:tomsons26
Don't forget to state who are you otherwise i'll ignore the invite QUICK_EDIT
Man, I have to ask you to do a step by step tut, as I have zero experiense with py.
I tried Pyton 3.8 with inbuild pip. had bunch of syntax error, which I manage to "fix" with help of youtubers. installed Pillow. But it the end script had no effect, or maybe it was I who failed to use console right way.
Second day I tried Pyton 2.7, but it had no pip, no pilow, argparse gave error. outdated libs, manual installments everywhere.
And when I've already given up, you came and saying: "meh, got it running"
please.. _________________ Gangster is a Project Perfect Wuj (c)Aro QUICK_EDIT
Uh i have no idea how to troubleshoot this. I do have 2.7 set not 3 in my system path. Just running tgautil.py it throws
Code:
print 'Wrote ZIP archive \'{}\''.format(out_file)
^
SyntaxError: invalid syntax
but python tgautil.py works showing
Code:
usage: tgautil.py [-h] {z,u} ...
tgautil.py: error: too few arguments
z is for zip up, u is for unzip
python tgautil.py u EINSTEIN.ZIP
should just unzip the archive and uncrop the tgas _________________ Tiberian Dawn, Red Alert, Tiberian Sun ,Red Alert 2,Renegade, Command & Conquer 3,Tiberium and Tiberium Wars and Westwood related image & video archive
https://picasaweb.google.com/113361105083292812413?noredirect=1
Skype live:tomsons26
Don't forget to state who are you otherwise i'll ignore the invite QUICK_EDIT
You can post new topics in this forum You can reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum