Click the Stage to select the track. Click the red ball to start the search. NOTE: It's advised to use Turbo Mode for a quicker presentation! (i.e: Press Shift + Click the Green Flag or See Inside, then in the header menu, press Edit > Turn on Turbo Mode)
TurboWarp: https://turbowarp.org/167912019?turbo Raceline Finder v2.0 is out there, check it out: https://scratch.mit.edu/projects/418920660/ Hello there! Recently I've found about Vector Racer, an online, turn-based paper racing game, where you can compete against an A.I. or other people's records, feel free to try it out: https://harmmade.com/vectorracer/ This project is the development of a 2D race path finder, to try to find an optimal race line for any given 2D track, so it can be useful for future racing projects on scratch! The script is still a draft, it first splits the selected track into a grid, then uses two breath-first searching algorithms to acomplish its goal: - The first one focus on mapping the track's orientation, it basically starts in the blue point of the selected track and goes throught all of it, attributing a distance value (the number of grid steps/points in-between the current point and the starting, blue point) to every grid point in the track. - The second one goes throught all the track again, and tries to find an optimal raceline, applying the same movement rules as in the Vector Racer game, using the results of the first search to check whenever the current branch/line is delayed or near the furthest branch, ignoring every branch that gets >= 12% of delay. Noticing that there are still some unwanted behaviors that I need to fix. For example, sometimes, depending on the grid's resolution, it can cut some corners in the track. Hope you like it! ========================================= UPDATES: [ Mar 10th, 2020 ]: - Shared the project as a [DRAFT]. [ Mar 11th, 2020 ]: - Converted the Vector Racer 'oval' track into the project. https://harmmade.com/vectorracer/#oval - Got 2nd place world wide on 'oval' track! I believe the only reason why it hasn't found the fastest route yet was because of my imperfect track conversion / detection. - One more track converted from Vector Racer, this time it was 'u-turn' track https://harmmade.com/vectorracer/ - After some adjustments, the algorithm took 'u-turn' track by storm, by scoring a 1st place world wide in the game! I believe it is the first of many to come! [ Mar 26th, 2020 ] - Three weeks have been passed since I started working remotely from home because of COVID-19. - Today I decided to convert yet another track from Vector Racer, no other than the 2nd official track, it's called 'street'. https://harmmade.com/vectorracer/ - Initially, the searching algorithm wasn't getting good results on this new track, finishing just globally. This was the case because this track firmly introduced corner borders, and that kind of surface wasn't yet supported by the algorithm. - I decided to fine-tune the search script, also making it support corner borders as well, after finished improving, it was able to get 3rd place on the new 'street' track, and smashed the 'oval' track as well, getting 1st place! [ Mar 27th, 2020 ] - For a reason I don't know, the search algorithm started to perform incredibly well this morning, I haven't changed the code since, so I'm assuming that perhaps the scratch team has been making improvements in the touching color blocks, or touching blocks in general. That allowed the script to get 1st place on 'street' track! [ Mar 29th, 2020 ] - Created a representation of Autodromo Enzo e Dino Ferrari, also recognized as Imola or San Marino GP Track, hope you enjoy it. Also added a way to define the percentage of maximum speed allowed in a specific search/track, for better raceline results. [ Apr 22nd, 2020 ] - Added four more tracks from my other project 'AI Race Contest', the idea is to refine and use this algorithm to implement a bot on that project. Go check it out if you're interested: [ Sep 2nd, 2020 ] Developed and finished Raceline Finder v2.0 (alpha), and tried it on my contest project that I've described in the previous update, the results were very satisfactory, making its bot getting 1st place on all tracks! [ Sep 22nd, 2020 ] Finished retouching Raceline Finder v2.0 and launched it: