Hires GPI and the GPH fileAdditional posts
* GPHUpdater - first versions
* Hires gridcar examples
* Implementing the new "Hi_GP2001.gph" file into a CSM mod - step-by-step instruction
* GPH record: horizontal and vertical stretch values
* More GPH file details
* GPHUpdater v.0912
* Hires GPI Tips
* GPI files with subareas and the meaning of the GPH extra bytesIn this thread I will share with you my experience with high resolution GPI files and modifying a GPH file to get a correct display of them.
The first time I took notice of the possibility (and problematic) of hires GPI files was with the
IndyCar Series 2017 mod by rracunis. Driver images, gridcars, teamlogos and weather images seemed to be corrupt as I got only garbage display. But rracunis explained to me that the files are not corrupt but high resolution. As I was not the only one with display problems, I added standard resolution GPIs. For the
NTT Indycar mod 2020 I made an update including a "Teamart file resolution" selection in the CSM menu to choose between the high and the standard GPIs.
But only recently I got aware of the fact that the high resolution GPI display problem had already been solved. While I checked some downloaded files from the 2019 F1 season I discovered the
2019 Grid Cars Final by gap177 (Glenn). He provided a GP2001.gph file and remarked "
If anyone has display issues in game, just copy and paste the file in the folder named 'misc' into >menudata\pc\gp2001" in the thread. I checked it and it worked! This encouraged me to examine how to create a GPH file fitting some hires GPI for the 2019 mod resp. the Indycar 2020 mod. This is described in detail below.
I have read about the GPH file some time ago in the thread
Menu editing questions, where Lo2k explained
"
All files describing menus are in GP4folder/MenuData/PC/GP2001 folder.
...
gpi files are stored in the images folder and are 32bit pictures (containing an alpha channel).
All menus drawings and pictures are stored in gpi files.
But not all gpis are used by the game, in fact gpis from 388 to 401 are not used cause they are already there in previous gpis.
The tool i talked about on my forum is not a gpm browser but a gpi browser, allowing preview only of all gpi files.
gph file is storing descriptions about gpi files stored in the images folder.
As madman said, you can got there Number of gpis used, gpis ID, width and height and other datas that Madman might be right about even if i never test them personnaly.
..."
The tool he is talking about is his
GPI Browser 1.2 that is a great help while creating specific GPH files.
GPH fileThe structure of the GPH file was not hard to understand. The following extract shows four records (you need a hexeditor to reproduce it):
84 01 00 00 00 00 00 00; starting sequence: 00000-00006, offset to record 1 = 9
01 00 00 00 00 00 f0 00 00 00 b4 00 00 00 00 00 00 00 00 00 70 3f 00 00 34 3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 34 3f 00 00 70 3f
8d 00 00 00 1e 00 00 01 00 00 d5 00 00 00 00 00 00 00 00 00 80 3f 00 00 55 3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 3f 00 00 80 3f
... 480 bytes area 01afe-01cdd
8e 00 00 00 00 00 80 00 00 00 60 00 00 00 00 00 00 00 00 00 80 3f 00 00 40 3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 3f 00 00 80 3f
83 01 00 00 00 00 c8 00 00 00 96 00 00 00 00 00 00 00 00 00 48 3f 00 00 16 3f 00 00 00 00 00 00 00 00 00 00 00 00 00 00 16 3f 00 00 48 3f
There are some other extra areas besides the one in front of ID 142 with 480 bytes: 32 bytes each in front of 9,10 and 35 , 64 bytes in front of 11 and 256 in front of 43.
You can see a full description in the
GPH Offsets Widths Heights text file.
The format is double byte with lowbyte, highbyte order. A hexadecimal value 0200 (=512) is given as "00 02".
387 GPI records are included, each with a length of 46 bytes and offsets for id=0, width=6 and height=10.
Thus I get from the four records:
ID=001 (01 00), width=240 (00 f0), height=132 (b4 00)
ID=141 (8d 00), width=256 (00 01), height=213 (d5 00)
ID=142 (8e 00), width=128 (80 00), height= 56 (60 00)
ID=387 (83 01), width=200 (c8 00), height=150 (96 00)
Now I could edit the values of the GPH file with the hexeditor, but I was more comfortable with using the GPI Browser instead. To get a modified GPH file in a testing environment, I copied my complete GP4 backup folder into a GP4-test folder and directed GPI Browser to it by "Change GP4 path". Now I loaded TGA files with the desired size into the GPIs of the browser window and finished it by pressing the button "Apply all changes", to update the GPH file. As I was only interested into the new width and height of the GPI, the display of the image in the browser didn't matter. Finally I copied the new file GP4_test\MenuData\PC\GP2001\GP2001.gph to the place I wanted it to use.
Creating hires GPI for the 2019 F1 modFor the
2019 mod V2.2 compiled by MSchumi24 I wanted to test the following hires GPI files:
1)
2019 Grid Cars Final by gap177 (Glenn Perk). Glenn had also provided the standard grid car files of the mod.
2)
files 2019 by augustogibim, Grid Cars + Pitcrew&Engineers + Driver Art+ Garages 2019
3)
Visors + driver arts + logos + gridcars 2019] by rracunis. He has also provided the standard driver and teamlogo files of the mod.
First I made some changes in the 2019 CSM mod structure to support hires and standard GPI. I did this using the %texres% variable that is defined in the Settings\GlobalVars.ini file for texture resolution selection to support GPI file resolution also. %texres% can have the values "Hi" and "Std". In the "Teamart" subfolders "Drivers", "Gridcars", and "Logos" I created new subfolders "Hi" to contain the new hires GPI files.
In the "2019.csm" file I changed the following line of section [Files]:
TeamArt =Teamart\teamart-%texres%.ini
and in the folder "Teamart" I created two new INI files: "teamart-std.ini" with the same content as "teamart.ini" and "teamart-hi.ini". In "teamart-hi.ini" I replaced "Drivers\" with "Drivers\%texres%\", "Logos\" with "Logos\%texres%\" and "Gridcars\" with "Gridcars\%texres%\". In the 2019 F1 mod the teamart helmets were disabled by using empty GPI files.
In the Settings\swap.ini files section [Swapfiles] I added the line
File20 =Menu\%texres%_GP2001.gph,MenuData\PC\GP2001\GP2001.gph
Now, if texture resolution is set to "Hi" in the CSM menu, the GPH file was swapped.
1) 2019 Grid Cars Final][/url] by gap177 (Glenn Perk).
This release had GPI files for gridcars in two versions: drivernames.gpi for CSM, gpi-number.gpi for Non-CSM. TGA files were not included, but a GPH file. I did a hexeditor compare with the original GPH file to see what was changed.
Logos (default 80 00, 60 00 = 128x96px)
with new width 00 02 = 512px, height 80 01 = 384px for GPI ID numbers
31 00 = 49
32 00 = 50
33 00 = 51
8e 00 = 142
8f 00 = 143
90 00 = 144
91 00 = 145
92 00 = 146
93 00 = 147
94 00 = 148
95 00 = 149
Gridcars (default: C8 00, 31 00 = 200x49px)
with new width 90 01 = 400px, height 77 00 = 119px for GPI ID numbers
b2 00 = 178
b3 00 = 179
b6 00 = 182
b7 00 = 183
b8 00 = 184
b9 00 = 185
ba 00 = 186
bb 00 = 187
(bc 00 = 188 for team11 is intentionally not changed)
bd 00 = 189
be 00 = 190
This GPH was not only designed for hires gridcars, but for hires teamlogos also, though GPI files for logos were not included. The gridcar height of 119 was unexpected but worked. The usual value would have been 99.
I copied the GPH file into folder Menu and renamed it to "Hi_GP2001.gph".
Then I copied the new hires gridcar GPI files from Glenn into the "Gridcars" subfolder "Hi". Here I had to be careful and check if the team names fit in the mod. Three names had to be adjusted: "Alfa Romeo" to "AlfaRomeo", "Racing Point" to "RacingPoint" and "Red Bull" to "RedBull". Finally I copied the file "team11.gpi" from folder "Std" to folder "Hi".
Now I started the mod with "Texture resolution" set to "Hi" and "Race Type" set to "Non Championship Race" to get the grid displayed. After starting a race, I admired the beautiful hires gridcars. Back to the main menu I selected a driver. The teamlogo was not shown in the background because of the wrong size in the GPH, but that was no big deal. After I quit GP4 and started the mod again with "Texture resolution" set to "Standard", the teamlogo - in standard size - was shown correctly.
2) "files 2019" by augustogibim, Grid Cars + Pitcrew&Engineers + Driver Art+ Garages 2019From this archive I used "Drivers 2019.rar" and "Gridcars 2019.rar". Included were only TGA files, no GPI or GPH. The files were provided in two versions: one for 4:3 and one for widescreen. I took the 4:3 images, but the process is the same with the widescreen part. Driver images had a size of 512x512px while the gridcars were special: they had a view from above and a size of 1200x300px. From TGA I created GPI using Slimtex. The names of the drivers were only 3 characters long, so the drivers GPI files had to be renamed to fit the mod. The gridcar names were almost perfect, only "racingp" had to be changed to "racingpoint".
Now I created the GPH file. First I copied the default GP2001.gph file from my backup folder into my GP4-test folder MenuData\PC\GP2001\ to have a clean start. Then I loaded a driver TGA file in GPI Browser over all driver GPI (33, 55-56, 60-64, 66, 68, 70, 72, 74-75, 193, 268-273, 304) and a gridcar file over all gridcar GPI (178-179,182-190). Finally I pressed "Apply all changes", copied the modified GPH to the 2019 mods Menu folder and renamed it to "Hi_GP2001.gph". A look into the GPH file showed that the driver GPI width and height were both set to 00 02 (=512) while the gridcar GPI width and height are b0 04 (=1200) resp. 2c 01 (=300).
I replaced the files in Teamart\Drivers\Hi and Teamart\Gridcar\Hi with the new GPI. Now I started the mod with "Texture resolution" set to "Hi" and and "Race Type" set to "Non Championship Race" and tested the resulting displays.
3) "Visors + driver arts + logos + gridcars 2019" by rracunis.
I used the "Gridcars 1.0" (HD and Normal, GPI and TGA files) and the "Teamart 2019" (GPI only) with hires "Drivers" and "Logos" providing two hires versions, one in the subfolder HD. The normal gridcars had a size of 200x49px as usual, while the HD gridcars had the size 400x99px. Drivers were sized 512x512px, which was also true for the HD logos. The latter surprised me a bit. Because the standard size for teamlogos is 128x96px I expected something like 512x384px (4x).
In "Drivers" and "Logos" I created one TGA file using Slimtex. Then I generated the GPH file using GPI Browser and the TGA files. Now I made a backup of the original gridcars "Std" folder and copied the GPI files into their mod folder. Finally I started the mod and tested the result.
Six driver images and eight gridcars were corrupt and the logos were not shown. The research showed: I had not updated the drivers GPI 268-273 with GPI Browser, I had forgotten to rename the gridcar names of the double word teams and I had forgotten to edit the [logos] section in the teamart.ini file. Second try after correction: drivers and gridcars ok, but logos were not shown. Something was wrong with the GPH size I suggested. I created TGA files of other sizes (400x300, 512x384), imported them with GPI Browser into the logos GPI, but it didn't work either.
Finally I gave up and used the other GPI logos from the main folder "Logos" of rracunis files that were correct displayed in Slimtex - in contrast to the HD logos. These 512x512px logos worked with a GPH size of 512x512px as well as 512x384px and I could at last enjoy the enhanced display.
2019 F1 mod teamart hires updateIn the original mod the authors of the standard files are:
Teamart
-Drivers rracunis
-Helmets (nohelmets)
-Gridcars Glenn Perk
-Logos rracunis
It is therefore reasonable to take the hires files from the same authors and update the mod with them in the way I explained above. As the rracunis files are already loaded, all I had to do was to take the backup "Std" folder for gridcars and put Glenn's hires gridcars into the "Hi" folder. I could use the same GPH as above because the GPH size 400x99px worked with Glenns hires gridcars also.
Download:
2019 F1 mod teamart hires updateCreating hires GPI for the Indycar2020 modThe
NTT Indycar mod 2020 compiled by rracunis had already got hires and lowres teamart GPI files (Drivers, Gridcars and Logos) and a "Teamart resolution" selection in the CSM menu. On my computer the hires GPI was displayed disturbed so I always had to play with low resolution ('Med'
teamart. With the implementation of the GPH file I hoped to make all the hires files visible to me.
The driver images with a hires format of 512x512px made no problem. This was different with the gridcars, logos and weather (in folder 'Data\Files\Weather\Hi'
hires GPI:
type standard hires gpi gph size result
drivers 256x256 512x512 512x512 okay
gridcars 200x49 512x512 512x512 ? no
512x125 ? no
400x99 okay
logos 128x96 512x512 512x384 ? no
weather:
124-139 160x128 512x512 480x384 ? no
320x356 ? no
131 244x128 512x512 488x256 ? no
132 256x32 512x512 512x64 ? no
400x50 ? no
While I was successful with the gridcars GPH size 400x99 (90 01, 63 00) over a 512x512 GPI file, all my effort to get the logos and/or weather hires files displayed properly was in vain. Finally I decided to replace those GPIs. Fortunately I had got weather files from rracunis for a previous Indycar mod. The hires logos I made myself. This worked:
type standard hires gpi gph size result
logos 128x96 512x384 512x384 okay
weather:
134-139 160x128 640x512 640x512 okay
131 244x128 488x256 488x256 okay
132 256x32 256x512 256x512 okay
Downlaod:
Indycar 2020 mod teamart and weather hires updateSummaryAs a conclusion of this experience I can say that it feels good to be able to see the hires GPI now.
The size of hires GPI files should in general have the same aspect ratio than the corresponding original GPIs to avoid problems.
It is good for the user if TGA files are provided in a hires GPI release.
Several questions are remaining:
a) Why have some users hires GPI display problems on their computer but others do not?
b) Does a correct GPH file solve all problems or are there still users that cannot see all hires GPIs.
c) Why is it sometimes possible to display a GPI that has a size (i.e. 512x512) different from the GPH size (i.e. 400x99) and sometimes not?
GPH InformationInformation for GPH file creation. The hires sizes are just examples.
Drivers
driver images are shown in driver selection and driver gpaedia.
gpi 33, 55-56, 60-64, 66, 68, 70, 72, 74-75, 193, 268-273, 304
Default: 256x256 px 00 01, 00 01
Hires: 512x512 px 00 02, 00 02
GPI ID Offset Driver
033 = 21 00 00648 01
055 = 37 00 00B62 09
056 = 38 00 10
060 = 3C 00 11
061 = 3D 00 02
062 = 3E 00 08
063 = 3F 00 04
064 = 40 00 18
066 = 42 00 00D56 07
068 = 44 00 00DB2 15
070 = 46 00 00E0E 17
072 = 48 00 00E6A 05
074 = 4A 00 00EC6 12
075 = 4B 00 13
193 = C1 00 02608 03
268 = 0C 01 03382 20
269 = 0D 01 19
270 = 0E 01 14
271 = 0F 01 22
272 = 10 01 06
273 = 11 01 16
304 = 30 01 039FA 21
-------------------------------------
Helmets
A teamart helmet is shown in the background of the driver gpaedia.
gpi 195,199-218,336
Default: 64x64 px 40 00, 40 00
Hires: 256x256 00 01, 00 01
GPI ID Offset Driver
195 = C3 00 02664 04
199 = C7 00 0271C 14
200 = C8 00 17
201 = C9 00 01
202 = CA 00 19
203 = CB 00 07
204 = CC 00 21
205 = CD 00 11
206 = CE 00 08
207 = CF 00 06
208 = D0 00 12
209 = D1 00 13
210 = D2 00 09
211 = D3 00 16
212 = D4 00 22
213 = D5 00 03
214 = D6 00 15
215 = D7 00 10
216 = D8 00 18
217 = D9 00 02
218 = DA 00 05
336 = 50 01 03FBA 20
-------------------------------------
Logos
A teamlogo is shown in the background of the selected driver.
gpi 49-51, 142-149
Default: 128x96 px 80 00, 60 00
Hires: 512x384 px 00 02, 80 01
GPI ID Offset Team
049 = 31 00 00A4E 05
050 = 32 00 04
051 = 33 00 01
142 = 8E 00 01CE4 09
143 = 8F 00 06
144 = 90 00 02
145 = 91 00 10
146 = 92 00 11
147 = 93 00 08
148 = 94 00 03
149 = 95 00 07
-------------------------------------
Gridcars
Gridcars are shown at the start of a championship or non championship race.
gpi 178-179,182-190
Default: 200x49px C8 00, 31 00
Hires examples:
* 400x119 90 01, 77 00
* 400x99 90 01, 63 00
* 1200x300 B0 04, 2C 01 (view from above)
GPI ID Offset Team
178 = B2 00 02356 01
179 = B3 00 02
182 = B6 00 03
183 = B7 00 05
184 = B8 00 04
185 = B9 00 09
186 = BA 00 06
187 = BB 00 10
188 = BC 00 11
189 = BD 00 08
190 = BE 00 07
-------------------------------------
Weather
Weather images are shown at the start of a (championship or non championship) race.
gpi-num default hires
gpi 124-130,133-139 160x128 px 00 A0, 00 80 640x512
gpi 131 244x128 px 00 F4, 00 80 488x256
gpi 132 128x64 px 00 40, 00 80 256x512
Nr. ID Offset
124 = 7C 00 017C2
125 = 7D 00
126 = 7E 00
127 = 7F 00
128 = 80 00
129 = 81 00
130 = 82 00
131 = 83 00
132 = 84 00
133 = 85 00
134 = 86 00
135 = 87 00
136 = 88 00
137 = 89 00
138 = 8A 00
139 = 8B 00
petrus' gpaedia filesEdited 20 time(s). Last edit at 10/13/2021 03:32PM by petrus.