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!

Improved track format/editor

Discussion in 'Anything and everything Free Rider' started by phi16, Aug 3, 2021.

  1. phi16

    phi16 Member

    Hello! I am phi16, and I have been playing this game for years (under a different username). I have created a couple of tools, most of them private, to help out with creating tracks. Most of them have been really generic, such as image to track generators, more advanced (and nice looking) track generators, etc.etc.

    I have for a long time wanted something like a cross between Photoshop and the FRHD editor. Not nearly as advanced, but it should at least have features such as "fat" brushes, shading(more than just using another color, something more like dithering or cross-hatching), images, and stuff like drag/resize and fill.

    I have several years' experience in coding with just about every language you can name, but I am most familiar with Rust, Python, and C/C++. I would love to create something like this on my own, but the truth is I cannot. I have little to no experience in creating GUIs, though I can make most if not all of the backend of such an app.

    I already have a file format (almost) ready, as well as a tool that converts that format into a format that FRHD can understand.

    I really need people who can make GUIs in just about any language. If anyone has experience programming and wants to help, let me know! If you are interested, please leave your support below! I will put public updates on this thread.
     
  2. phi16

    phi16 Member

    I have a GitHub repository/organization up! All it contains right now is a simple track format and a python script that generates FRHD track code.
    https://github.com/FRHD-Improvements/FTFI-Python

    Here is a basic rundown of the new format (might be changed in the future):

    Each new line is a new "command", or thing to be done.
    To create a line, use either p or s, followed by the starting x/y and the ending x/y coordinates. Here is an example (A longer version of the starting line):
    Code:
    p -40 50 100 50
    Boosts are started by a b. The next three numbers are the x/y, as well as the rotation. b 90 -10 90
    Bombs are started by a k. The next two numbers are the x/y. k 10 10
    Gravity modifiers are started by a g. The next thee numbers are the x/y, as well as the rotation. g 90 10 10
    Checkpoints are started by a c. The next two numbers are the x/y. c 100 100
    SlowMos are started by an m. The next two numbers are the x/y. m -43 12
    Stars are started by a t. The next two numbers are the x/y. s 887 322

    In the repository, there is some extra stuff about image gen but I am not releasing that to the public so it is not in the public code.
     
  3. phi16

    phi16 Member

    Hello all! I know it has been a while but I have not forgotten or given up on this! I have been working hard on creating a new version of the track format, this time in a much faster programming language called Rust. For the community, this can either be great or not great. If you are a programmer, then you can probably download my code and get it working on your computer! If not, however, you are likely not going to be able to use the tool just yet. I will likely not create any sort of build for other platforms (macOS intel, linux, windows 10/11, etc.) until I get an early version of the editor done. Until then, you can find my code over on github at https://github.com/FRHD-Improvements/FRTF-Generator

    I am going to add Vehicles and the teleport powerup, and then I am going to start work on the editor. Happy riding!
     
  4. Fluoride

    Fluoride Well-Known Member Official Author

    Neato work dude! Keep up the good stuff B)
     
    pawflix and phi16 like this.
  5. phi16

    phi16 Member

    UPDATE:

    I know it has been a long time (almost a month!) since my last post, so I figured that I would give some updates here.

    Number one: I added vehicles and the teleport powerup! I am still looking into how to implement the FRHD curves and possibly some other types of curves (non-bezier or cubic bezier).
    Number two: I have started back to school again. I am taking several university courses and they have severely impacted the amount of time I can spend on this project.
    Number three: I really really really really suck at GUI programming. Basically what this means is that I have a fully functioning track code generator but I am still stuck on creating something that an everyday person would find useful. I have started at least 10 different versions using different libraries or systems, but I can't seem to get the hang of any of them. This is really the only limiting factor in why I have not released anything in a while.

    So in summary, I have made some progress, I do not have that much time to spend on this due to school, and I am really bad at the only big step that I have left.

    I am hoping to take some classes on GUI programming that will be able to help out, but until then, Happy Riding!
     
    Logeton, Fluffysmack, pawflix and 2 others like this.
  6. phi16

    phi16 Member

    I will likely be posting random and inconsistent updates such as this for the next few months.

    Here is a sneak peak of the curve editor:
    Screen Shot 2021-09-19 at 7.25.10 PM.png

    Right now it has the ability to add/remove points, and turn on/off the "smooth curves" function which allows a lot of variation.

    Here are some images of the tracks it has produced (including the failures):
    Screen Shot 2021-09-19 at 5.56.00 PM.png
    Screen Shot 2021-09-19 at 7.07.01 PM.png
    Screen Shot 2021-09-19 at 7.14.08 PM.png

    Here is where the tool is at currently:
    Screen Shot 2021-09-19 at 7.27.18 PM.png
    As you can see, it has some nice curves but it also has some really random glitches. I am not sure where those are coming from but I am on an ongoing hunt.

    I am hoping (hoping) to release a very early release sometime in october/november. Right now my only planned features for that version is a line/curve editor and powerups. No riding for now as I will probably have to completely rewrite the bike physics.
     
  7. Fluoride

    Fluoride Well-Known Member Official Author

    Yoooo nice!
     
  8. Calculus

    Calculus Community Developer Staff Member Administrator Ghost Moderator

    Awarded Medals
    I love that idea. If you need any help, let me know.
     
  9. Foxler2010

    Foxler2010 Member Team Blob Official Author

    Suggestion: make a local web server (doesn’t have to be part of the backend, just running on the same machine. This web server could be packaged with the build, or it could be a dependency of the package) and create the GUI using html and css, show the things you are drawing using some sort of canvas, and everything is manipulated in JS. Every time you click a tool, the JS sets it as selected. Every pixel on the canvas is mapped to an x/y co-ord. Clicking around on the canvas tells the JS where the mouse is on the grid and whether a tool is being used or if the mouse is just moving around. The info the JS is gathering can be translated into commands which are sent to the backend to be recorded as a file and saved somewhere (client or server, could be either). I am not sure how to implement this (I don’t know Rust), but I think it is a good concept. This also opens the door for people hosting their own instances of the software for others to use.
     
    Fluoride and biirch like this.
  10. Calculus

    Calculus Community Developer Staff Member Administrator Ghost Moderator

    Awarded Medals
    That seems like a walk through of the entire project as opposed to a suggestion. Nevertheless, I've introduced him to my SVG Drawpad and he's familiar with the Canvas API. Suggestions should be something like a tool type or general improvements from what you've seen in the code. You're suggesting a whole rewrite.
     
    Fluoride likes this.
  11. DuBzY

    DuBzY Active Member

    Very cool stuff! I wish I could help, but don't have the coding experience.
     
    Fluoride likes this.
  12. Foxler2010

    Foxler2010 Member Team Blob Official Author

    Okay, I had seen the pictures of the current editor in progress, and I’m not saying there should be a whole rewrite, just that this would be a cool way to do it. Personally I am opposed to downloading applications to do things because I’m constantly on the move with my iPad and apps aren’t usually an option due to Apple’s way of doing things. Usually for any sort of graphics I’m doing the web is a good option since everyone has a browser and you don’t need to worry about native system requirements, just that they have the supported interface (Chrome, Firefox, etc.).
     
    Fluoride likes this.
  13. Foxler2010

    Foxler2010 Member Team Blob Official Author

    …and also HTML is so simple and CSS isn’t too hard either, with a little practice you can do some cool stuff. Other languages don’t have as simple ways of putting pixels on a screen in a readable/understandable format.
     
    Fluoride likes this.
  14. Calculus

    Calculus Community Developer Staff Member Administrator Ghost Moderator

    Awarded Medals
    I get that. That was the main inspiration for my SVG Drawpad.
    I get that; however, as far as I know, the person behind this isn't a huge fan of JavaScript. Either way, I'm there to help if he's willing to make that change. I've made tons of similar projects.
     
    Fluoride likes this.
  15. Foxler2010

    Foxler2010 Member Team Blob Official Author

    Great, I will be taking a look at the current code soon and seeing what I can do with it. This seems cool, keep up the good work! If I make something interesting I will post it here.
     
    Fluoride and gun like this.
  16. phi16

    phi16 Member

    Hey guys! I know its been a while but I'm here to reply to some questions that I saw:

    The best answer I can give to this is maybe. For the first few releases it will certainly not have first-class support, but I think that most browsers will give at least a small amount of support. If there is a large demand for it once I release the app, I will probably try to add some better support.

    This is basically what I am doing. I am also contributing to a rather large open-source code editor right now that uses this same format. I really like it.

    Definitely. I have actually ditched the Drawpad version because I was losing my mind trying to refactor the code in JS. I am certainly taking inspiration from it as well as a couple of code chunks.

    Sounds great! If you have any ideas for it or want to contribute, feel completely free to open a PR or issue and I will try to respond ASAP.


    Here is what I have done since I last posted (end of September!!!):
    1. Started using drawpad as a base for the editor
    2. Spent three weeks on the new codebase (drawpad) before deciding to switch
    3. Took an extended break to refresh and contribute to some other projects
    4. Wasted about a week on trying to convert other file formats (like pure svg) to FRHD code. This might be a useful path to follow in the future.
    5. Started work on a very simple HTML/CSS/JS version (screenshots in the near future, don't get your hopes up it is spartan)
     
    Fluoride and pawflix like this.
  17. phi16

    phi16 Member

    Another update!

    I have given up on creating the editor itself for now since I am driving myself crazy with things that I am not comfortable with/knowledgable about. In theory it should be a good learning experience and I should be able to power through this, but for whatever reason I just can't get it to work. I will come back to this later.

    That being said, I have continued work on the backend for the editor. I have added diagonal lines (of several different sizes)
    Screen Shot 2021-11-23 at 4.01.29 PM.png

    As well as filled-in boxes:
    Screen Shot 2021-11-23 at 4.03.53 PM.png

    As you might notice from the first picture, there is a weird issue with lines not being a consistent distance apart. This comes from the way that I came up with to determine the coordinates of spaced-apart lines. It isn't *that* big of an issue normally, but it becomes really noticeable when I try to shade on a gradient (though to be honest, I rather like this look aside from the weird stray lines):
    Screen Shot 2021-11-23 at 4.52.54 PM.png

    Once I fix those visual bugs, my next nemesis to work on will be curves. I had been doing them in the frontend (editor) before, but I think it makes more sense to do them with the Rust library in the long run.

    Happy riding!
     
    G-raffe, Fluoride, Volund and 2 others like this.
  18. Foxler2010

    Foxler2010 Member Team Blob Official Author

    you should keep the bugs as extra features!
     
    Fluoride likes this.
  19. phi16

    phi16 Member

    I might release "crap edition" haha.
     
    pawflix, Fluoride and RadiumRC like this.
  20. phi16

    phi16 Member

    Oh hi there!

    I guess its been a while and I doubt that anyone is watching this thread or even cares anymore, but I'm back! I tried tons of stuff and I branched out it tons of directions before eventually giving up on the project, but recently I have been restarting in a really minimal editor (though I have the same eventual goals as before).

    This is really great, and I think that I have discovered some bugs in my FRHD rust package (and probably all of my other FRHD libraries) that I will have to fix. The screenshot below shows what I got working in an afternoon of work. Here are it's current (non)features:
    • One kind of line (changed in the source)
    • Only the brush
    [​IMG]

    If you can't see the image let me know. I can see it in the editor but for whatever reason I can't see it in the actual post.

    As you can see there are some serious issues with encoding that I will have to take a little while to hunt down, but overall I am happy with the progress! (And look at how much smoother the non-ruined lines are compared to the ones created by the FRHD brush).

    If you have any ideas or are interested in contributing, please let me know below!
     
    Last edited: Jun 21, 2022
    G-raffe, pawflix and Fluoride like this.

Share This Page