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!

Track Generation Script

Discussion in 'Anything and everything Free Rider' started by pylondude, Jan 2, 2018.

  1. pylondude

    pylondude Active Member Official Author

    This thread is for support and feedback on the script I have written for generating tracks. This is not the place for comments on track generation in general. For that, check out this thread: http://community.freeriderhd.com/threads/auto-generation.8740/

    Notes on using this script:
    • This script runs in Matlab and cannot be compiled to be standalone. Matlab is free for most university students or they provide a 30-day trial https://www.mathworks.com/programs/trials/trial_request.html?procode=ML GNU Octave might be an alternative? I haven't tried it.
    • "Auto-generated" tracks are not popular and will receive down votes regardless of quality. My suggestion would be to use the script for sick scenery and draw a great track manually to accompany it.
    • Building on the last point - this script uses brute-force and messes up line physics. Tracing objects manually can help mitigate this issue. For example, the black lines in the following track were all manually drawn: https://www.freeriderhd.com/t/514816-nitrocircus (I am working on a script which handles this issue better but it may take awhile to complete).
    • Complex images (especially ones that start in full color) may generate a code too large to be uploaded - I often have to delete large portions of tracks to fit upload limitations (hopefully this will also be fixed in my new script).
    I am not much help for issues with installing Matlab - sorry!
    The forums won't let me upload a script file so copy the contents of the attached .txt file into a new Matlab script.

    Notes for execution:
    • The settings are at the top and described by comments - these should be the only lines that require modification.
    • Some grayscale .jpg images will cause an error on line 26. If this occurs, comment out line 26 and uncomment line 27.
    Depending on your computer's hardware and the size of the image, it can take several minutes to complete.

    Let me know if you find any bugs or if you have any questions - I'm happy to help! If anyone else is interested in the code, please have them contact me rather than sharing it directly. I would also appreciate a mention in track descriptions so that people know where to go for help auto-generating.
     
    Last edited: Jan 2, 2018
  2. lone_wolf137

    lone_wolf137 Member

    are you giving this away?
     
  3. pylondude

    pylondude Active Member Official Author

    Yeah, I don't have enough track making skill to put it to good use. I'm hoping it's difficult enough to use to discourage misuse lol. Hopefully some skilled track creators can use it to complement some awesome tracks and decrease the stigma around generation :thumbsup:
     
  4. lone_wolf137

    lone_wolf137 Member

    oh, as long it does not become like that last autogen with m1.c1
     
  5. pylondude

    pylondude Active Member Official Author

    I haven't been actively playing for long enough to know about that one... Do you know where I can find more info?
     
  6. lone_wolf137

    lone_wolf137 Member

    m1.c3* was known for his coding skills, so he made a autogen link to where he makes them: codepen. but sadly lots of players started to misuse it so he had to take it down Screenshot 2018-01-01 at 10.53.32 PM.png here's a example of his beautiful work
     
    pylondude likes this.
  7. DeathBob1

    DeathBob1 Active Member Official Author

    how can i use it with octave
     
  8. pylondude

    pylondude Active Member Official Author

    I haven't tried it with Octave yet so not sure if all of the functions are supported? With any luck it will be plug-and-play?
     
  9. ItsColinGuys

    ItsColinGuys Well-Known Member Official Author

    I wish I could script HTML 5 to make generators for small images as detail.

    I only know HTML (1), Some JavaScript, CSS (a little bit), Python, and some Lua.

    I might try this.
     
    pylondude likes this.
  10. pylondude

    pylondude Active Member Official Author

    Tried a massive render lol... Waaay too big to upload (and a really long time to process)
    upload_2018-1-14_23-40-29.png
     
    AidantheNarwhal and SlashDash like this.
  11. SayStar

    SayStar Active Member Official Author

    Does anyone know exactly how to generate tracks?
     
  12. pylondude

    pylondude Active Member Official Author

    ... I mean ... I do to some extent :thumbsup:
     
  13. SayStar

    SayStar Active Member Official Author

    Ok can you teach me how?
     
  14. pylondude

    pylondude Active Member Official Author

    The code at the top is a good place to start - it's a lot easier to understand if you have a programming background? The trickiest part is that the coordinates are base-32 and case-sensitive. After that it's just a matter of how you parse the file. Checkout the first post in this thread and see if you can get the original code working :thumbsup:
     
  15. pylondude

    pylondude Active Member Official Author

    Pretty psyched - getting close to finishing my new script. Still some bugs though...
    upload_2018-1-16_21-51-31.png
     
  16. AidantheNarwhal

    AidantheNarwhal Member Official Author

    Oh, working on coloring?! Wow!
     
  17. pylondude

    pylondude Active Member Official Author

    Yeah, and working physics. The color part was surprisingly simple but getting the physics to work nicely has been painful so far... And people say that no effort goes into track generating :rofl:
     
  18. pssst

    pssst Forum Legend Elite Author Team Blob Official Author

    Awarded Medals
    There was a time when this kind of thing was frowned upon. However Ive always found it cool.
     
    45ones, AidantheNarwhal and pylondude like this.
  19. pylondude

    pylondude Active Member Official Author

    I've removed the script from my initial post for now... The lack of a dislike button is causing generated tracks to go trending and they don't perform well on mobile (and lots of people don't like them). Also no longer generating tracks for others - sorry! :thumbsup:
     
  20. pylondude

    pylondude Active Member Official Author

    Getting some pretty trippy bugs...
    upload_2018-1-21_16-23-41.png
     
    Leumas89 and lone_wolf137 like this.

Share This Page