Dismiss Notice
Hey Guest,
If you are interested in ghosting, the Ghosting Awards for January 2025 has just been announced:

Click here to check it out!

How does track code work?

Discussion in 'Support and Questions' started by TeeMee, May 4, 2015.

  1. TeeMee

    TeeMee Casual Member

    Hello, this is my first post by the way :)

    I was just wondering how the code for free rider tracks works? I have noticed a few patterns but would like to be able to make my own custom track editor/loader so could someone explain it to me?
     
    IsaiahRed and Twinkles like this.
  2. Twinkles

    Twinkles Active Member Official Author

    Well, I will try to help. Well if u want to save a track for another day to work on is this is what u do number 1. Click import track. Copy and paste it. Save it somewhere so u do not lose it. Hope this helped
     
  3. TeeMee

    TeeMee Casual Member

    I know the basics about importing and exporting it, I used to play some chrome browser extention of free rider 2 where you could only use code to play tracks, it was the only version of the game not blocked at my school :p. Thanks for the help and nice cat btw
     
  4. Twinkles

    Twinkles Active Member Official Author

    Ok lol
     
  5. Asierro

    Asierro Well-Known Member Official Author

    Hope this helps:
    "They are coordinate pairs in base 32, and lines are separated by commas.
    For example, the clear track (the single line when you open the editor):

    Code:
    -18 1i 18 1i

    This is two coordinates: -18 1i and 18 1i. This is one line, from (-18, 1i) to (18, 1i). It's base 32, that's (-40, 50) and (40, 50) in decimal. So the default 'empty-track'-line goes from x=-44 to x=44, on y=54.
    When we add a few snapped lines, their end points will be added to the current line, like so:

    Code:
    -18 1i 18 1i 1a 2b -1 29

    This line goes from (-18, 1i), via (18, 1i) and (1a, 2b) to (-1, 29). In decimal, (-40, 50) to (40, 50) to (42, 75) to (-1, 73).
    When we add non-snapped lines, they are lines on their own, so their coordinates are separated from the other lines with commas:

    Code:
    -18 1i 18 1i 1a 2b -1 29,17 10 1h -3,-t -k -1a p
    So we have the line from the last piece, the line from (17, 10) to (1h, -3), and the line from (-t, -k) to (-1a, p). In decimal, (39, 32) to (49, -3) and (-29, -20) to (-42, 25).

    However, in a full trackcode, there's also some number signs (#). An example could be:

    Code:
    -18 1i 18 1i 1a 2b -1 29,17 10 1h -3,-t -k -1a p#-e -28 23 -28#G 9 15 -b6,B b -f -5k,C 35 2n,T 36 1v,O 35 19#BMX


    The part before the first sign is the track, so the normal lines that kill you if you hit 'em head-first. The part between the first and second sign is the scenery part, it contains all the scenery lines, they work the same as the normal lines except you don't hit them.
    The part between the second and third sign holds the special objects (Checkpoints, goals, bombs, boosts, gravity things and slow-mos). This works a bit differently.
    The objects are all separated by commas. They themselves consist of at least three parts: a letter, followed by the x- and y-coordinates, and optionally a direction.
    The letter signifies which object it is. G = gravity, B = boost, C = checkpoint, T = goal, O = bomb.
    The coordinates work as with lines, it's a pair of base 32 numbers.
    The direction is only needed for boosts and gravity things, they point somewhere. This is marked with a base 32 number, in degrees.

    The last part is obviously the default bike to use, which is either 'BMX' or 'MTB'."

    Source: http://forum.canvasrider.com/topic30394.html
     
    Azgr00, CHOLO, Skeeny and 7 others like this.
  6. TeeMee

    TeeMee Casual Member

    Thanks! I had a suspicion it was using another base.
     
  7. kadinl14

    kadinl14 Active Member Official Author

    haha nice photo
     
  8. TeeMee

    TeeMee Casual Member

    Thanks. I found it on google images when I was searching for something completely different, it just appeared so I thought I would save it for later :p
     
  9. THEMONSTER

    THEMONSTER Member

    It's in base-32
     
  10. THEMONSTER

    THEMONSTER Member

    I can summarise all of your post in one sentence :
    frhd track code is base-32
    There you go, done.
     
  11. TeeMee

    TeeMee Casual Member

    I don't think his answer was too long tbh, It described the different sections for scenary and gave examples.
     
    Skeeny and Dakoziol-2nd like this.
  12. Dakoziol-2nd

    Dakoziol-2nd Well-Known Member Official Author

    Thanks! It's nice knowing how Free Rider works, I'll have to experiment now...
     
  13. THEMONSTER

    THEMONSTER Member

    You don't have to to experiment or anything. I have done that for you already! I've experimented myself, and then went on to create my own track editor, with a lot of cool features!
    You can copy and paste things, draw millions of powerups in a row automatically ( but don't do that of course ), and a lot of other things!
    I could show you the beta version if you'd like!
    EDIT : No I can't it stopped working for some reason lol
     
    Last edited: May 8, 2015
    Dakoziol-2nd likes this.
  14. TeeMee

    TeeMee Casual Member

    experimenting is different tho :3
     
  15. THEMONSTER

    THEMONSTER Member

    Not really! :D
     
  16. Dakoziol-2nd

    Dakoziol-2nd Well-Known Member Official Author

    Well, I meant my own experiments, but nice work!
     
  17. THEMONSTER

    THEMONSTER Member

    Replying to yourself? lol
     
  18. Dakoziol-2nd

    Dakoziol-2nd Well-Known Member Official Author

    Oops, meant to reply to you. :/
     
  19. TeeMee

    TeeMee Casual Member

    Guys, I did it, I made a track decoder. On scratch as well XD
    https://scratch.mit.edu/projects/66075670
     
    Dakoziol-2nd and Asierro like this.
  20. TeeMee

    TeeMee Casual Member

    It is really basic at the moment. I haven't implemented panning or zooming and it only reads black-line-only tracks (so no powerups or scenary). That is going to come soon though!
     

Share This Page