GPL Track Creating - trk23dow - GTK

From Grand Prix Legends Wiki
Jump to: navigation, search

Authored by the GPLEA


trk23dow does not like all GTKs. This is because not all GTKs you can create with GPLTrk contain sufficient detail for trk23dow to process them correctly. Here you will find detail on the specific requirements, and the options available to control the way your GTK is processed.


trk23dow will not create any polygons before the first trace, or after the last trace. In other words, the first and last traces are clipping planes. The reason for no polygons is that trk23dow does not have any altitude data to work with.


Sections cannot be >=180degrees in curvature. I strongly suggest making 90 degrees your limit; splitting sections of greater curvature into 2. You must make sure that your sections do not have gaps between them. Although this won't stop trk23dow working, it will cause GPL to lock up when you drive *on* the 'gap' (doesn't happen every time you drive over the gap if the gap is small). The GPL Track Creating - Sections page has more detail on gaps.


Your altitudes can be anything - trk23dow will process them. If you want your track to look good, however, you should try to keep your altitudes the same across all traces, per section. Exceptions such as hills, banking, etc. should be accompanied by additional polygons for the walls that cover those altitudes. Use unk4 flags to increase the number of polygons (or even decrease them so that one polygon covers all - it often works!)


Walls cover the entire track surface. trk23dow creates polygons for every wall in your track. The number/texture/style of polygons is controlled using unk4 flags, listed below.  Note that any combination of flags can be added together, although this may cause weirdness, especially if you use flags together that do the same/opposite function.

[FWO] means First Wall Only - you should only use this on Wall #0 of a section - it will have no effect when applied to any other walls. For detail on the TEX Settings, see the TEX page.

Flag# / Explanation

1 - Inverts texture coordinates left-right.  Untested - a relic of older versions

2 - Where a wall covers/crosses more than one trace, this will stop trk23dow from splitting the wall on those crossings.

  • This also forces the texture to be mapped once left-right.
  • Do not use when...  the altitudes corresponding to the covered traces are non-planar - e.g. a cambered piece of track.
  • Do use when... you have a flat bit of track and you are saving polygons.
  • See also - flag 512

4 - Creates this wall from triangles instead of quads.  However, if a polygon is found to be non-co-planar, it will automatically be created from triangles.

8 - The texture for this wall will be mapped once, stretching to fit.  This is useful for things like track markings (e.g. the markings at the beginning of a runway).

16 - When vertical walls are created, by default they do not have polygons created for the inside-base - where the ground level would be if the wall was not vertical. This flag will create those polygons for this wall.

32 - For walls with height, this flag adds polygons to the beginning (front).

  • TEX Setting: 4.
  • See also - flag 64.

64 - For walls with height, this flag adds polygons to the end (back).

  • TEX Setting: 5.
  • See also - flag 32.

128 - Creates upside-down polygons, just under the surface of the track.  This is used when you :need to see the underside of the track - e.g. a bridge/crossover.

  • TEX Setting: 3.

256 - [FWO] This setting stops trk23dow from splitting any of the walls in this section based on the values in <trackname>.set

  • Do not use when... you have a hilly piece of track, or you have varied altitudes left-right, or you have walls that cross several traces.
  • Do use when... you have a flat piece of track, or a constant gradient piece of track.  This will save FPS.
  • See also - flags 2048, 4096.

512 - Exactly the same as flag 2, except this does not stop the wall from being split where it crosses traces.

  • Do not use when... it makes things go weird.
  • Do use when... flag 2 messes up, leaving gaps, but you still require the texture to be mapped once.  Often used for the track wall.
  • See also - flag 2

1024 - The entire track is covered with visibility boxes. In normal circumstances they are created between walls with height. E.g. one from the right extremity to the pit wall, one for the pit wall, one from the pit wall to the armco on the left, one for the armco, one from the armco to the left extremity.

However, when your track has elevations such as banking, you will likely see clipping effects due to the polygons being drawn in the wrong order. Add 1024 to the flags of the wall immediately to the right of where the problem is - e.g. add it to the wall that is the banking. The problem should go away. It will not be solved on all corners though, due to evil stuff :-|

2048 - [FWO] Increases the number of polygons for every wall in this section by 5, longitudinally.

  • Do not use when... you have bad FPS, or the section is a corner (5*4 = 20 times as many polygons = bad!)
  • Do use when... the cars appear to either drive under, or float above, the track surface. Also, you can use on corner sections when they appear too blocky, although 4096 is better for corners.
  • See also - flags 4096, 256

4096 - [FWO] Increases the number of polygons for every wall in this section by 2, longitudinally.

  • Do not use when... you have bad FPS, or the section is a corner (5*2 = 10 times as many polygons = bad!)
  • Do use when... the cars appear to either drive under, or float above, the track surface, or a corner is too blocky.
  • See also - flags 2048, 256

8192 - [FWO] This will increase the number of groove polygons in this section by performing a longer calculation on the groove data for this section.

  • Do not use when... you have bad FPS, or the groove is already ok in appearance.
  • Do use when... the racing groove is too blocky, goes all over the place.
  • See also - flag 16384.

16384 - [FWO] Creates one groove polygon for the entire track section - the complete opposite of flag 8192.

  • Do not use when... it makes the groove too blocky/weird.
  • Do use when... the racing groove is too smooth and you get bad FPS.
  • See also - flag 8192.

32768 - This stops trk23dow from creating a polygon for the back-facing side of walls with height. This is useful for when the back-facing sides of walls will never be seen because of the track layout. Back-facing is defined as: left-facing if the wall is to the left of the centre-line; right-facing if the wall is to the right of the centre-line; undefined if the wall is on the centre-line.

65536 - [FWO] By default, corner sections are created in three resolutions - high (4 pieces), medium (2 pieces) and low (1 piece). Setting this flag will create the section from high (2 pieces), medium (1 piece) and low (1 piece). This has two main effects:

  • 1) Decreases the number of polygons, thus improving FPS.
  • 2) Decreases the number of boxes covering the track (see flag 1024), thus improving FPS, but decreasing the graphical quality.
  • See also - flag 1024.

131072 - This stops trk23dow from creating top polygons for walls with height - e.g. the top of trees that you can't see.  This is a FPS saving measure.

262144 - [FWO] This will add ceiling polygons for all walls in this section. The height above the ground-level polygons is taken from the height of the first wall, which will normally be the side of a tunnel or something similar.

  • TEX Setting: 6
  • See also - flag 524288

524288 - This turns off ceiling polygons for this section - e.g. the walls that are the side of the tunnel.

  • See also - flag 262144.

Updated 27-Jan-2001

Transfered to the wiki: 19.04.2009