Instructions how to make custom tracks and textures for Pokitto Grand Prix

Introduction

Pokitto GP supports importing custom tracks and textures from a SD card. There can be any number of custom tracks in the SD card, and they can be previewed and selected in the track browser screen.

Making a custom track

image

An example track.txt file (click to open)

This text will be hidden

Lahti Circ 
Hanski
....../------------------------`
......|r======================,!
......|!............R.........|!
.....C|!......................|!
......|!......................|!
......|!......................|!
......|+---`.................C|!
......\===,!R.................|!
/---------j!..................|!
|r=========%..................|!
|!............................|!
|!............................|!
|!R...........................|!
|!............................|!
|+-------`...................R|!
\=======,!............/-------j!
....C...|!............|r=======%
........|!............|!........
.....R..|!...........C|!........
/-------j!............|+-------`
|r=======%............\=======,!
|!C.........................R.|!
#*............................|!
|!............................|!
|!............................|!
|!R............./------`......|!
|+--------`.....|r====,!......|!
\========,!.....|!...R|!......|!
........C|!.....|!....|!.....C|!
.........|!...R.|!....|!......|!
.........|+-----j!....|+------j!
.........\=======%....\========%

There are following rules for the text file:

  • The file, “track.txt”, should be located in the following place in the SD card: \pgpdata\tracks\mytrack\track.txt . The name of the folder “mytrack” can be changed (it is not visible in the game UI), other names should be as in the example.

  • The track.txt file must be a plain ascii-text file (8-bit chars).

  • The track and author name can have max 12 chars each.

  • The track must have exactly 32x32 chars.

  • The starting point, “#*” in the track, must always be at the same position.

Each char in the map corresponds 64x64 pixels, so the map of 32x32 chars covers 2048x2048 pixels of the track.

All the map items explained (click to open)

Here are the corner and straight line items for a rectangular (6x6) track:

/----`
|r==,!
|!..|!
|!..|!
|+--j!
\====%

There are also a couple of special items:
“.” - The terrain texture
“#*” - The starting line, the left and the right item
“Xx” - The halfway point, the left and the right item. If this has not been passed, the track time is not registered at the finishing line.
“C” - A billboard object (Cactus in the original track)
“R” - A billboard object (Rock in the original track)
Note that " " (a space char) is not allowed on the track.

Making custom textures and sprites

All the textures in the 3D plane, and the billboard sprite objects can, and must, be customized. You cannot define only part of the textures. The texture and the billboard images are as follows:

  • “tex01.bmp”: the road edge, 16x24 pixels including mipmaps.
  • “tex02.bmp”: the road texture, 8x12 pixels including mipmaps.
  • “tex03.bmp”: the other road texture, 8x12 pixels including mipmaps.
  • “tex04.bmp”: terrain, 16x24 pixels including mipmaps.
  • “tex05.bmp”: starting line, 16x24 pixels including mipmaps.
  • “sprite01.bmp”: a billboard sprite.
  • “sprite02.bmp”: a billboard sprite.

The image files should be the same folder in the SD card as the track.txt file, i.e. \pgpdata\tracks\mytrack\tex01.bmp.

Palette

All the images must use the same palette. The palette is read from the first texture, “tex01.txt”. When the palette is read from the tex01.bmp file, the colors are added to end of the existing game palette, which contains 42 colors (for the ui, ships, etc). So you can use total 214 colors in your images, the rest are ignored.

Because all the images must use the same palette, it is convenient to create first a big texture atlas using 24-bit rgb colors.
image

When the all images are final in the texture atlas, it can be converted to 256-color paletted image. Then each image should be exported to a separate 256-color bmp file, like “tex01.bmp”, “tex02.bmp”, etc.

Textures

The texture files have to mipmap files, e.g. the “text05” is a 16x16 pixel texture with 8x8 and 4x4 pixel mipmap images. So the total size of the “tex05.bmp” image is 16x24 pixels. The layout of the texture file is as follows:
image

The mipmap images should be scaled down versions of the original image. To reduce flickering and the moire effect, the mipmaps should be lower contrast and smoothed version of the original image.

Note: the textures are drawn upside down in the game ( if you are going towards north). Take that into account when drawing images.

Billboard sprites

The billboard sprite size can be anything, but the width must be divisible by 4. The sprites do not have mipmap images. The pink color (rgb: 255,255,0) indicates a transparent area.

image

How to make textures using GIMP (click to open)

This is one way to do texture files with GIMP.

  • First make a new full color work image, big enough to contain all the textures (you can expand it later also). Make sure the alpha (transparent) layer is not included (“Layer / Transparency / Remove Alpha Channel”).

  • Draw the textures. At first copy each texture of the “Techno” track and paste it to the work image. Then modify/replace each texture to your taste.

  • When everything is ready, convert the full color work image to 256 color image (“Image / Mode / Indexed…” ). Do not use dithering as it looks bad when zooming.

  • Then export each texture to a separate file like this:

    • Select the area of the image that contains the texture (and mipmaps if applicable)
    • Crop the image (“Image / Crop to Selection”)
    • Export the image as e.g. “tex01.bmp” (" File / Export As …")
    • Undo cropping (ctrl-z)
    • Select the next area, etc…

Example

Unzip the packet below to the root of the SD card:
Techno_track.zip (5.2 KB)

image

7 Likes