[Game]Pokitto Grand Prix

I gave it a try:
track3.txt (1.0 KB)

Small Remark: The name of the track can be 13 characters but only 12 are displayed.

Bigger Remark: The track I provided might be a bit too hard…

3 Likes

I will try it tonight :slight_smile: Lets see what is the lap time.

I you have time, please add the preview screenshot of the track.

How do yo do this?
It looks a bit like this: :slight_smile:

1 Like

After I add support for a diagonal road blocks, it would be easier.

The first user made track ever in PGP :slight_smile:

My record time is currently 28’0 s. I think there are still more shortcuts to make and corners to cut without missing the halfway point…

At first I did not realise that I have to turn around to get to the starting line. Currently, the initial position of the ship is always the same, so it is good to have the starting line near the place where it is in the original track, if possible.

Great track! Thanks @sbmrgd

6 Likes

Well I made the starting line like in the real circuit. So normally you should not have to turn around but there is no way to change the direction of the starting line nor the starting position…

Edit: as I already mentioned, the name is not entirely displayed, A p is missing

1 Like

Yes, I have to move the beginning of the text a couple of pixels to the left.

Btw. Did you face any problems when creating or importing the track? I have coded quite many validity checks which should help finding the problems in importing.

Can the track intersect itself? (I need a Top Gear track)

1 Like

I would also like to create custom background and tile graphics

EDIT: I know Tampere Finland and Spa in Belgium are geographically very similar and the landscape is flat and yellow, but I would like to do some alien track complete with background graphics

4 Likes

That is not in the list as long as ships are billboard objects. For now it is advisable to create tracks where you see other near cars only from behind :wink: Otherwise, it would look very funny!

1 Like

Everybody knows there are a lot of hot deserts in Finland :wink:

I am certainly planning to make textures also customisable. For that, I can utilise the bmp reader I have made long ago for PokittoLib.

But, I want to see how many people is using this feature first. So, if you want to make sure textures are implemented, so…:wink:

2 Likes

… so fork the code and make your own textures :wink: ?

1 Like

@Hanski … it seems the source is not anywhere accessible?

@Hanski has been developing it on a branch of a fork of the PokittoLib:

If you want to go to that route, how about: fork the code, implement the texture importer and other cool stuff, merge back :wink:

It does not have the latest sources. If someone needs it now I can update it.

To be honest I think it would be better to move it into a different repo.
Having to download the entire PokittoLib to get at one game is a bit excessive.
(It’s like going to get a drink and coming back with the whole fridge.)

I usually only upload the actual .h and .cpp files because for PlatformIO you can just dump those files in the src folder of a blank project and everything works,
but when I was using EmBitz I would also include the .ebp and I think a few other minor bits.

1 Like

Importing the track went very smooth, at first I had used 14 characters and I got a warning.
The creating itself was ok I guess, at first it was difficult to know what the meaning was of the different characters. A more visual tool to make tracks on a pc would of course come in handy.

2 Likes

Hi. I found that the track can actually intersect itself. Alternative routes are possible as well. Here is Hackenheimring (can’t import files yet as a new user):

Hackenheim
jpfli
................................
................................
................................
................................
/----------------------`........
|r====================,!........
|!....................|!........
|!....................|!........
|!................/---j!........
|!................|r===%........
|!................|!............
|!................|!............
|!................|!............
|!................|!............
#*../---------`...|!............
|!..|r===,r==,!...|!............
|!..|!...|!..|!...|!............
|!..|!...|!..|!...|!............
|!..|!...|!..|!...|!............
|!..|+`..|!..|!...|!............
|!..\,!..|!..|!...|!............
|!...|!..|!..|!...|!............
|!...|!..|!..|!...|!............
|+---j!..|+--j+---j+-----------`
\=====%..\========,r==========,!
..................|!..........Xx
..................|+----------j!
..................\============%
................................
................................
................................
................................

I agree with sbmrgd that all the different tile characters are difficult to remember. So I made a short script in python that let’s you make tracks with only 4 chars for corners and straight lines: “|”, “=”, “\” and “/”.

# PokittoGP track converter. Usage:
#
# python trackconv.py track.txt
#
# Track example:
# /=====\
# |/===\|
# ||...||
# ##...xx
# ||...||
# |\===/|
# \=====/

import sys


def parse_line(line):
  result = ['.']*len(line)
  ontrack = 0   # 0:ground tile, 1:track tile
  side = 0      # 0:vertical segment, -1:north edge, 1:south edge
  for x in range(len(line)):
    tile = line[x]
    if "|!".find(tile) > -1:
      result[x] = '!' if ontrack else '|'
      ontrack ^= 1
    elif "#*".find(tile) > -1:
      result[x] = '*' if ontrack else '#'
      ontrack ^= 1
    elif "Xx".find(tile) > -1:
      result[x] = 'x' if ontrack else 'X'
      ontrack ^= 1

    elif "-=".find(tile) > -1:
      result[x] = '=' if side > 0 else '-'

    elif "/rj%".find(tile) > -1:
      if ontrack:
        result[x] = 'j' if side == -1 else '%' if side == 1 else 'r'
      else:
        result[x] = '/'
      ontrack_next = 0 if ontrack and side == 1 else 1
      side = 0 if side != 0 else 1 if ontrack else -1
      ontrack = ontrack_next

    elif "\\+,`".find(tile) > -1:
      if ontrack:
        result[x] = '`' if side == -1 else ',' if side == 1 else '+'
      else:
        result[x] = '\\'
      ontrack_next = 0 if ontrack and side == -1 else 1
      side = 0 if side != 0 else -1 if ontrack else 1
      ontrack = ontrack_next
    else:
      result[x] = tile

  return "".join(result)


if len(sys.argv) != 2:
  print("Usage: "+sys.argv[0]+" track.txt")
  exit(0)

file = open(sys.argv[1])

track = {}
track['trackname'] = file.readline()[:-1]
track['author'] = file.readline()[:-1]

# Read track data lines from file, removing '\n' at the end of each line
track['data'] = [line.strip() for line in file]

result = [parse_line(line) for line in track['data'] if 0 < len(line)]

print(track['trackname'])
print(track['author'])
# Use stdout.write and not print, because we don't want newline at the end
sys.stdout.write("\n".join(result))
4 Likes