Corner data

Posted by petrus 
Corner data
Date: October 02, 2019 02:56PM
Posted by: petrus
In this thread I'll talk about my latest experience with corner data that I've been testing extensively lately. At the end you will find a short quiz (two questions).

Corner data are displayed in the circuit selection menu under track information / track data.
In the left part of the screen for every corner a name (optional) and the recommended gear and speed is displayed. In the right part you see a trackmap. Eventually it has corner number tooltip graphics that will display the corner name, if you hover the mouse cursor over them.



How to change corner data
To change corner data, two methods exist.

1) Using GPaedia files. Providing GPS files with new data is the method used by most mods.
Example of GPaedia corner data:
972 [NAK]monza corner data

1: Variante del Rettifilo
    1st Gear
    55mph/86kmh
...
The advantage is, that the number of corners is not restricted so much, that an actual track with 23 corners like Singapore doesn't fit into the display. But is has the disadvantage, that the tooltips are not available anymore.

2) Using the GPxTrack part of GPxPatch. This is described in the GPxTrack file of the GPxPatch help. The information is put into the tracks INI file. Example for corner 1:
[Corner1]
Name=Coin Senna
Desc1=Gear 2
Desc2=70mph/112km/h
X=0.845
Y=0.601667
The method does support the corner data info with the Name and Desc specificatons as well as the tooltips with the X and Y specifications. Unfortunately this is only possible in a restricted way. GPxTrack can display a maximum of 20 corner data infos. The number of tooltips is even more limited, because they are hardcoded in GP4 and their maximum is slot dependend, i.e. a new track can only have as many tooltip graphics as the original track in the same slot. A comparison between the original 2001 tracks and the 2019 tracks shows the problem:
Slot 2001              2019
Num. Tracks      Corners  Tracks
---------------------------------------
 1  Melbourne	 16   16  Melbourne		
 2  Sepang	 15   15  Sakhir
 3  Interlagos	 15   16  Shanghai
 4  Imola	  9   20  Baku
 5  Barcelona	 15   16  Barcelona
 6  A1-Ring	 10   19  Monaco
 7  Monaco	 14   13  Montreal
 8  Montreal 	 12   15  Paul Ricard
 9  Nürburgring	 13    8  Red Bull Ring
10  Magny-Cours	 12   18  Silverstone
11  Silverstone	 17   13  Hockenheim
12  Hockenheim	 13   14  Hungaroring
13  Hungaroring	 14   19  Spa-Francorchamps
14  Spa-Francor. 13   11  Monza
15  Monza	 12   23  Singapore
16  Indianapolis 13   19  Sochi
17  Suzuka	 12   18  Suzuka
 1		 16   17  Mexico City 
 2		 15   20  Austin
 3		 15   15  Interlagos
 4		  9   21  Abu Dhabi

Monza 2019 with tooltips
Because I thought it would be very time consuming to figure out the coordinates, I never tried to make corner data using GPxTrack before. But now I found that it can be done quite easily and made a Monza 2019 corner data display with tooltips. The trick is to use a 1000x1000px resolution in GP4 with GPxPatch. To do this, I edited the GP4 file "f1graphics.cfg":
1	; f1graphics.cfg controls all settings (default 0)
1000	; [RELEASE] Game 3D Horizontal Resolution
1000	; [RELEASE] Game 3D Vertical Resolution
...
1	; [RELEASE] Run in a window
First I started the original GP4, got the Monza2001 corner data display and made a 1000x1000px screenshot of it.
Second I run the 2019mod and did the same with Monza2019. The trackmap is different, so the tooltip coordinates have to be explored.
To do this, I opened both images in PAINT.NET. Then I selected a tooltip graphic from the zoomed in first image and copied and pasted it into a new layer of the second. I moved the copied tooltip into the areas of the new trackmap, where I wanted the tooltip numbers to be. If I found such a position, I zoomed in until the pixels could be seen clearly. Then I moved the cursor to the upper left of the tooltip area and read the pixel coordinates from the bottom status line. For corner1 this was 597 and 410, so I got X=0.597 and Y=0.410. It's easy, isn't it?

If you want to try it in a mod (the 2018mod by kedy89 and the 2019mod by MSchumi are using the fitting Monza trackmap), copy the following data into your Monza track INI file:
;Monza 2019 corner data 
[Corner1]
Name=Rettifilo Tribune
Desc1=Gear 1
Desc2=55mph/86km/h
X=0.781
Y=0.390
[Corner2]
Name=Variante del Rettifilo
Desc1=Gear 1
Desc2=45mph/74km/h
X=0.767
Y=0.443
[Corner3]
Name=Curve Biassono
Desc1=Gear 6
Desc2=190mph/305km/h
X=0.874
Y=0.457
[Corner4]
Name=Variante della Roggia
Desc1=Gear 2
Desc2=75mph/120km/h
X=0.814
Y=0.619
[Corner5]
Name=Variante della Roggia
Desc1=Gear 2
Desc2=85mph/133km/h
x=0.811
Y=0.669
[Corner6]
Name=Curve di Lesmos
Desc1=Gear 4
Desc2=120mph/193km/h
X=0.740
Y=0.678
[Corner7]
Name=Curve di Lesmos
Desc1=Gear 3
Desc2=110mph/178km/h
X=0.734
Y=0.614
[Corner8]
Name=Variante Ascari
Desc1=Gear 3
Desc2=105mph/169km/h
X=0.694
Y=0.477
[Corner9]
Name=Variante Ascari
Desc1=Gear 4
Desc2=130mph/212kmh
X=0.706
Y=0.431
[Corner10]
Name=Variante Ascari
Desc1=Gear 4
Desc2=145mph/235km/h 
X=0.667
Y=0.449
[Corner11]
Name=Curva Parabolica
Desc1=Gear 4
Desc2=135mph/215km/h
X=0.507
Y=0.283

The tooltips do not show up? Well, in a mod with more than 17 tracks it is normal to deactivate them, because else in the track selection menu in tracklist b (2019: 18-21 = 1-4), where some tracks (5 to 17) are not used, those will display the tooltips of the original tracks. To avoid this the 20 tooltip number images 155.gpi to 174.gpi are cleared by the mod. You will normally find them in the Data/Teamart folder, from where they are swapped into GP4s image folder even without an entry in the swap.ini of the mod.
If you put them from Teamart into another folder like Teamart/Numbers, they will now not be swapped and the tooltips are shown.

With TSM you can also use all GPxTrack specification in the settings.ini files. Because the TSM GUI does not support this, you have to edit the INI file manually. While TSM is able to use multiple INI files in one folder, GPxTrack does not, so it is best to have only one settings.ini file in a folder, if GPxTrack specifications are used.

How to get corner data infos
Intense internet research is unavoidable.
I prefer videos like
* youtube - 2009/2010 F1 track simulator (Red Bull)
* youtube - 2016/2017 F1 bird's eye view
* youtube - F1 Circuit Guide & Qualifying Pole Lap 2019
Images do not always have infos of all corners, e.g. f1mix/circuits .

Corner data limits
Corner data entries have limits. If you go behind one, GP4 will just display until the limit and cut of the rest.
Try to guess (or even check out) the following:

1) Using GPaedia, how many corners can be put into the corner data information?
- a) 20
- b) 25
- c) it depends on the total number of lines that the display is using
- d) it only depends on the available text memory

2) Using GPaedia or GPxTrack: if in the first corner data line the name of the corner is given, what is the maximum length of this entry?
- a) 20 characters
- b) 32 characters
- c) 295 characters
- d) 500 characters

Solutions will be given after 1 week.


petrus' gpaedia files



Edited 8 time(s). Last edit at 02/04/2020 04:49PM by petrus.
Re: Corner data
Date: October 04, 2019 12:50AM
Posted by: SDI
My guesses:

1: c
2: b

René Smit, Independent Software Developer.
Download my GPx tools here.
Re: Corner data
Date: October 07, 2019 08:56PM
Posted by: Turbo Lover
Very nice tutorial again petrus. :)



My Grand Prix 4 Files

I'm a total dick. How many people can say that?
Re: Corner data
Date: October 09, 2019 01:38PM
Posted by: petrus
Answers:

1: c)
2: d) for GPxTrack, none of them (sorry) for GPaedia

@SDI: Didn't you put a limit of 500 characters for corner data into GPxTrack?

Explanations:

1: If you use two lines for the title and a blank line below, a maximum of 84 lines is left for the corner data.
Modern tracks like Singapore, Abu Dhabi or Hanoi have got more than 20 corners. It would not be possible to display a full fledged 22 corner data list. With every corner using name, gear, speed and a blank line below this would need 22*4=88 lines, but only 84 would be displayed. Fortunately many corners are without names, e.g. 15 of 23 in Singapore/Marina Bay, so 15*3 + 8*4 = 45+32 = 77 fit into the display area.

2: For testing I put a fairly unreasonable (but famous) text into the corner data "Name" area which I took from Lorem ipsum.
GP4 uses line wrap to display corner data that does not fit into one line. A lot of text could be displayed in this way.
Using GPxTrack I encountered a fix limit of 500 characters, which means, that for the 2nd question d) is half the answer.
With GPaedia it was different. The text was displayed until the available 84 lines were filled. The number of characters depends on there widths. From the "Lorem ipsum" text ca. 2400 charactes could be displayed.
This knowledge is probably not of much practical use. But the question "how many characters can be written into the (first) Name line before a line wrap occurs" certainly is, because it affects the numbers of lines used and so the limit from question 1.
In GP4 the display of the test text will look like
1: Lorem ipsum dolor sit amet, 
consetetur sadipscing elitr, sed
diam nonumy eirmod tempor 
invidunt ut labore et dolore 
magna aliquyam erat, sed diam 
voluptua. At vero eos et 
accusam et justo duo dolores 
et ea rebum. Stet clita kasd 
gubergren, no sea takimata 
sanctus est Lorem ipsum dolor sit 
amet. Lorem ipsum dolor sit
amet, consetetur sadipscing 
elitr, sed diam nonumy eirmod 
tempor invidunt ut labore et 
dolore magna aliquyam erat,
sed diam voluptua. At vero eos
et accusam et justo duo
... 
and it seems that the limit of characters for one line is 33. 32 is a good guess in this case.
Actually this depends on the width of the used characters and has to be measured in pixels.
I found out that the limit is 274 pixels. My maximum test line contains 67 characters "." or "i" with width=4 and one character ';)' with width=6.
You can see the widths of the font characters in the table of GP4_Font.zip.


petrus' gpaedia files



Edited 1 time(s). Last edit at 10/09/2019 07:15PM by petrus.
Re: Corner data
Date: October 09, 2019 03:14PM
Posted by: SDI
Yes, I forgot I had a buffer size of 500 :) It's probably around 494, as I append a newline with 4 spaces to the text, and terminate it with a zero. All of that needs to fit in the buffer.

My guess of 32 was really a guess, but good to see it was close to the actual line width for average font character width before it start to wrap :)

René Smit, Independent Software Developer.
Download my GPx tools here.
Sorry, only registered users may post in this forum.

Click here to login

Maintainer: mortal, stephan | Design: stephan, Lo2k | Moderatoren: mortal, TomMK, Noog, stephan | Downloads: Lo2k | Supported by: Atlassian Experts Berlin | Forum Rules | Policy