Creating GPaedia for a CSM mod with team- and track-selection

The most complicated case is a season with more than 11 teams and more than 17 tracks.
We will now learn how to create gpaedia with GPaediaMaker (version 1.36 or higher needed) for such a mod.
The F1 2011 CSM mod by kedy89 will be our example.

This mod has already got gpaedia files - english/español made by jcaranti, others by kedy89 - supporting team- and track-selection as well as trackspecific display. One really has to admire the authors for their efforts to accomplish this. All the same it's still worth to make an update using the GPaediaMaker tool. One reason is, that the original gpaedia is kind of uncomplete, e.g. tracks gpaedia data and the non-trackspecific english and espanol files for hrt are missing. Another is, that correcting data can be done much easier once you have the CSV files to create all the necessary gps files from.

1) Preparation

As usual lets examine the mods structure first.
The globalvars.ini file shows how special features like team selection, track selection and/or driver replace are implemented and which variable to use for this.

Tracks and tracklists

[trackname]
...
Var1			=Melbourne
Var2			=Sepang
Var3			=Shanghai
Var4			=Istanbul
Var5			=Barcelona
Var6			=MonteCarlo
Var7			=Montreal
Var8			=Valencia
Var9			=Silverstone
Var10			=Nurburgring
Var11			=Hungaroring
Var12			=Spa
Var13			=Monza
Var14			=Singapore
Var15			=Suzuka
Var16			=Yeongam
Var17			=Buddh
Var18			=YasMarina
Var19			=Interlagos
Var20			=Generic
...
Modify			=tracknum,tracklist,racenum,physics,driver09,driver16,driver20,hrtdrivera,hrtdriverb,virgindrivera,virgindriverb
...
[tracklist]
AllowChange		=0
Name			=Tracklist
VarCount		=20
Var1			=2011a
Var2			=2011a
Var3			=2011a
Var4			=2011a
Var5			=2011a
Var6			=2011a
Var7			=2011a
Var8			=2011a
Var9			=2011a
Var10			=2011a
Var11			=2011a
Var12			=2011a
Var13			=2011a
Var14			=2011a
Var15			=2011a
Var16			=2011a
Var17			=2011a
Var18			=2011b
Var19			=2011b
Var20			=2011b
The track order is the same as in the real season. Var20 is reserved for a "Test Session" track.

Teams and drivers

 1 - Red Bull Racing
     01 = Sebastian Vettel
     02 = Mark Webber
 2 - Vodafone McLaren Mercedes
     03 = Lewis Hamilton
     04 = Jenson Button
 3 - Scuderia Ferrari
     05 = Fernando Alonso
     06 = Felipe Massa
 4 - Mercedes GP Petronas F1 Team
     07 = Michael Schumacher
     08 = Nico Rosberg
 5 - Lotus Renault GP
     09 = Nick Heidfeld 1-11 / Bruno Senna 12-19
     10 = Vitaly Petrov
 6 - AT&T Williams
     11 = Rubens Barrichello
     12 = Pastor Maldonado
 7 - Force India F1 Team
     13 = Adrian Sutil	(#14)
     14 = Paul di Resta (#15)
 8 - Sauber F1 Team
     15 = Kamui Kobayashi (#16)
     16 = Sergio Pérez (#17) 1-6, 8-19 / Pedro de la Rosa 7
 9 - Scuderia Toro Rosso
     17 = Sébastien Buemi (#18)
     18 = Jaime Alguersuari (#19)
10 - Team Lotus
     19 = Heikki Kovalainen (#20)
     20 = Jarno Trulli (#21) 1-9, 11-19 / Karun Chandhok 10
11a- Hispania Racing F1 Team
     21 = Narain Karthikeyan (#22) 1-8, 17 / Daniel Ricciardo 9-16, 18-19
     22 = Vitantonio Liuzzi (#23) 1-16, 18-19 / Daniel Ricciardo 17
11b- Marussia Virgin Racing
     21 = Timo Glock (#24)
     22 = Jérôme d'Ambrosio (#25)

(#nn = real driver number)
In the globalvars.ini the team11 selection is defined as
[team11]
Allowchange		=1
Name			=Team 11
Name Icon		=Files\Icons\minnow.ico
VarCount		=2
Var1			=HRT
Var2			=Virgin
...

2) Creating the CSV tables

We will now create the driver-, team- and track-tables with the seasons data.
While team and track csv files are in standard format, the driver csv gets a user format driverformat.csv related to the original english gpaedia made by jcaranti, but with some more data using the following (new) driver gpaedia structure:

 old                     new
 ---                     ---
 Team:                   Team:
 Date of Birth:          Date of Birth:
 Nationality:            Nationality:
 Championships:          Grand Prix Starts:            additional
 Wins:                   Championships:
 Podium:                 Best Result:	               like "Wins", but includes 2nd, 3rd etc. places
 Poles:                  Best Qualifying:              like "Poles", but includes 2nd, 3rd etc. places
 Fastest laps:           Podiums:
 Best Result:            Fastest Laps:
 First GP:               First Win:                    same as "Best Result" of old version
                         First GP:                     additional
                         2010 Championship Position:   additional
We need not yet care about the team- or track-selection, but will input all necessary data at once, including the driver replace data. The team.csv gets 12 columns, the driver.csv 28 (22 + 6 replacing drivers), the track.csv 20 (19 + 1 test) columns.

Example: drivertable .

3) Structuring the output with ini files

Now we generate the ini files that control the output. We have two tracklists "2011a" and "2011b" and two team selection values "HRT" and "Virgin".
Two INI files are made for each team11 and for the menu files, one for each tracklist, thus requiring 4 gpaedia plus 2 menu INI files.

INI file names

As the original mod does not include 2011 str files, you may also omit them here. The only disadvantage of this will be, that track names and attributes in the race menus are not displayed in all five languages, but only as given in the settings.ini file of the track - usually english - from witch the GpxPatch tool reads them.

Folders structure for output

%program_path%
+ 2011_mod_kedy89 => CSV files, INI files
  + gpaedia       => gps files into corresponding subfolder
    + hrt
      - 2011a
      - 2011b
    + virgin
      - 2011a
      - 2011b
  + ldata         => str files into corresponding subfolder
    - 2011a
    - 2011b

INI files content

Let's have a look into the INI files:
;--- gpaedia_2011_hrt_a.ini ---
;--- GP4 GPaedia Maker configuration file ---

; language variables (0 to 4):
; %ln% ==> en, de, es, fr, it
; %language% ==> English, Deutsch, español, Français, italiano

; gps: language files to create
;     create: yes=1, no=0 (optional, default is 1,0,0,0,0)
gps = 1,1,1,1,1

; define season variable %season%
season=2011
; last_year (default: %Season% - 1)
;last_year = 2001

; define program path variable %program_path%
; default is txt2gps_ff.exe path

; input path for constant txt files
in_path	= %program_path%\data\

; input path for edited csv and txt files
var_path = %program_path%\%season%mod_kedy89

; output path for created gps files
out_path = %program_path%\%season%mod_kedy89\gpaedia\hrt\2011a

; gps file names (normal)
ln_gps = GP%season%_%language%.gps

; gps file names trackspecific
track_gps = GP%season%_%language%-%tracknum%.gps

; Process cornerdata 1=yes, 0=no (default: 1)
corner_data = 0

; English teamlink names as capitals
;teamlink_caps = 1

; multiple entry delimiter output replace; character "_" will be replaced by a space; default: " | "
tag = ,_

; Use user defined format files (default = 0)
user_format = 1

; switches (teams, drivers, tracks)
; handle GP4 driver 9/10 bug (use for 9.6 patched GP4 version)
sw_driver 9=10
sw_driver 10=9
; tracks 1-17
The "ln_gps" spec sets the names of the non-trackspecific gps files to "GP2011_English.gps", ..., "GP2011_italiano.gps".
The "track_gps" spec sets the names of trackspecific gps files, e.g. for track 9 to "GP2011_english-9", ... "GP2011_italiano-9.gps".
Corner data are omitted, because the mods trackmaps are without corner markers.
Multiple entries are used in the team.csv for the "Technical Director" row of some teams, where this name changed during the season.
Userformat has to be used, because the driverformat is not standard.

;--- gpaedia_2011_virgin_a.ini ---
;--- GP4 GPaedia Maker configuration file ---
...
; output path for created gps files
out_path = %program_path%\%season%mod_kedy89\gpaedia\virgin\2011a
...
; team11=virgin:
sw_team 11=12
sw_driver 21=23
sw_driver 22=24
Omitted entries: same as hrt_a INI file.

;--- gpaedia_2011_hrt_b.ini ---
;--- GP4 GPaedia Maker configuration file ---
...
; output path for created gps files
out_path = %program_path%\%season%mod_kedy89\gpaedia\hrt\2011b
...
; tracks 18-19:
sw_track 1=18
sw_track 2=19
sw_track 3=20
sw_track 4to17=21
; first track of driver tables replace lines (default = 1); only used with second tracklist 2011b
track_1=18

;--- gpaedia_2011_virgin_b.ini ---
;--- GP4 GPaedia Maker configuration file ---
...
; output path for created gps files
out_path = %program_path%\%season%mod_kedy89\gpaedia\virgin\2011b
...
; team11=virgin:
sw_team 11=12
sw_driver 21=23
sw_driver 22=24
; tracks 18-19:
sw_track 1=18
sw_track 2=19
sw_track 3=20
sw_track 4to17=21
; first track of driver tables replace lines (default = 1); only used with second tracklist 2011b
track_1=18

Use the following two INI files if you want to have menu str files.
;--- gpaedia_2011_menu_a.ini ---
;--- GP4 GPaedia Maker configuration file ---

; language variables (0 to 4):
; %ln% ==> en, de, es, fr, it
; %language% ==> English, Deutsch, español, Français, italiano

; gps: language files to create
;     create: yes=1, no=0 (optional, default is 1,0,0,0,0)
gps = 1,1,1,1,1

; define season variable %season%
season=2011
; last_year (default: %Season% - 1)
;last_year = 2001

; define program path variable %program_path%
; program_path default: path of txt2gps.exe

; input path for constant txt files
in_path	= %program_path%\data\

; input path for edited csv and txt files
var_path = %program_path%\%season%mod_kedy89

; output path for created gps files
out_path = %program_path%\%season%mod_kedy89\ldata\2011a

; switches (teams, drivers, tracks)
; handle GP4 driver 9/10 bug (use for 9.6 patched GP4 version)
sw_driver 9=10
sw_driver 10=9
; tracks 1-17

; Generate str menu files (default: 0)
make_str = 2

As the Australian GP is the first race normally make_str=1 would be the choice here, but the circuit name in the track table is given as "Melbourne" instead of "Albert Park".

;--- gpaedia_2011_menu_b.ini ---
;--- GP4 GPaedia Maker configuration file ---
...
; output path for created gps files
out_path = %program_path%\%season%mod_kedy89\ldata\2011b
...
; tracks 18-19:
sw_track 1=18
sw_track 2=19
sw_track 3=20
sw_track 4to17=21
; first track of driver tables replace lines (default = 1); only used with second tracklist 2011b
track_1=18

; Generate str menu files (default: 0)
make_str = 2
As the first race here is "Abu Dhabi" and not "Albert Park", make_str=2 is needed to do the "Albert Park Trick" that avoids an tsmcore.exe error message. The GpxPatch tool reads the circuits name from the settings.ini file of the track. For track18 (Abu Dhabi) with
[Settings]
Name=Yas Marina
Year=2011
Country=Abu Dhabi
...
"Albert Park" will be replaced by "Yas Marina".

4) Checking the result

After running txt2gps_ff.exe with the INI files as parameter, we should look into each subfolders gpaedia.log file to see if they contain warnings and if the processing has generated the correct gps resp. str files.

The log file haeders also contain useful information about the trackspecific circuit numbers.
=== gpaedia.log ===
logfile for txt2gps_ff version 1.37
processing "...\2011mod_kedy89\gpaedia_2011_hrt_a.ini"
...
Trackspecific gpaedia for swap.ini
gptrack7      =  7
gptrack9      =  9
gptrack10     =  10
gptrack11     =  9
gptrack12     =  12
gptrack13     =  12
gptrack14     =  12
gptrack15     =  12
gptrack16     =  12
gptrack17     =  17
...

=== gpaedia.log ===
logfile for txt2gps_ff version 1.37
processing "...\2011mod_kedy89\gpaedia_2011_hrt_b.ini"
...
Trackspecific gpaedia for swap.ini
gptrack1      =  1
gptrack2      =  1
...

=== gpaedia.log ===
logfile for txt2gps_ff version 1.37
processing "...\2011mod_kedy89\gpaedia_2011_virgin_a.ini"
...
Trackspecific gpaedia for swap.ini
gptrack7      =  7
gptrack10     =  10
gptrack12     =  12
gptrack13     =  12
gptrack14     =  12
gptrack15     =  12
gptrack16     =  12
gptrack17     =  12
...

=== gpaedia.log ===
logfile for txt2gps_ff version 1.37
processing "...\2011mod_kedy89\gpaedia_2011_virgin_b.ini"
...
Trackspecific gpaedia for swap.ini
gptrack1      =  1
gptrack2      =  1
...

In the following chapter you will see, how these gptrackxx values are used to manage the trackspecific gpaedia output in the globalvars.ini file of the mod.

5) Installing the gpaedia and menu files

Copy the content of the generated folders with the gps (and str) files - but without the log file - into the mods corresponding folders:
gpaedia => Data\GPaedia
Menu    => Data\ldata
Edit the swap.ini in folder Data\Settings:
[Vars]
;GPaedia: all entries here have to be deleted
...
[Swapfiles]
...
File4		=GPaedia\%team11%\%tracklist%\GP2011_English.gps,MenuData\PC\GP2001\GP2001_English.gps
File5		=GPaedia\%team11%\%tracklist%\GP2011_Deutsch.gps,MenuData\PC\GP2001\GP2001_Deutsch.gps
File6		=GPaedia\%team11%\%tracklist%\GP2011_español.gps,MenuData\PC\GP2001\GP2001_español.gps
File7		=GPaedia\%team11%\%tracklist%\GP2011_Français.gps,MenuData\PC\GP2001\GP2001_Français.gps
File8		=GPaedia\%team11%\%tracklist%\GP2011_italiano.gps,MenuData\PC\GP2001\GP2001_italiano.gps
File9		=GPaedia\%team11%\%tracklist%\GP2011_English-%gptrack%.gps,MenuData\PC\GP2001\GP2001_English.gps
File10		=GPaedia\%team11%\%tracklist%\GP2011_Deutsch-%gptrack%.gps,MenuData\PC\GP2001\GP2001_Deutsch.gps
File11		=GPaedia\%team11%\%tracklist%\GP2011_español-%gptrack%.gps,MenuData\PC\GP2001\GP2001_español.gps
File12		=GPaedia\%team11%\%tracklist%\GP2011_Français-%gptrack%.gps,MenuData\PC\GP2001\GP2001_Français.gps
File13		=GPaedia\%team11%\%tracklist%\GP2011_italiano-%gptrack%.gps,MenuData\PC\GP2001\GP2001_italiano.gps
File14		=ldata\%tracklist%\english.str,ldata\english.str
File15		=ldata\%tracklist%\deutsch.str,ldata\deutsch.str
File16		=ldata\%tracklist%\español.str,ldata\español.str
File17		=ldata\%tracklist%\français.str,ldata\français.str
File18		=ldata\%tracklist%\italiano.str,ldata\italiano.str
...

Instead of using [Vars] specifications in the swap.ini the variable %gptrack% is defined in the globalvars.ini.
As you see from chapter 4) %gptrack% should get the values
                 hrt or virgin
gptrack7      =  7
gptrack9      =  9   or (empty)
gptrack10     =  10
gptrack11     =  9   or (empty)
gptrack12     =  12
gptrack13     =  12
gptrack14     =  12
gptrack15     =  12
gptrack16     =  12
gptrack17     =  17  or 12
Because of this we define %gptrack% in the globalvars.ini as follows:
...
[trackname]
...
Modify			= ... ,gptrack

[team11]
Allowchange		=1
...
VarCount		=2
Var1			=HRT
Var2			=Virgin
...
Modify			= ... ,gptrack9,gptrack11,gptrack17

[gptrack9]
AllowChange		=0
Name			=gpaedia number for tracks 9+11
VarCount		=2
Var1			=9
Var2			=

[gptrack17]
AllowChange		=0
Name			=gpaedia number for track 17
VarCount		=2
Var1			=17
Var2			=12

[gptrack]
Allowchange		=0
Name			=track gpaedia number
VarCount		=20
Var7			=7
Var9			=%gptrack9%
Var10			=10
Var11			=%gptrack9%
Var12			=12
Var13			=12
Var14			=12
Var15			=12
Var16			=12
Var17			=%gptrack17%
Var18			=1
Var19			=1


Download: 2011_mod_kedy89 gpaedia