Thanks! I’m definitely interested in hearing what techniques you used. Mine uses an a* algorithm and it’s far from perfect.
Hey!
Apologies for the late reaction, hope I can still be of some use. The technique that worked very well for me is as follows.
I used a guiding shape to define the base shape of the track (e.g. circle, 8-figure, etc.). This shape was divided into multiple points (e.g. at every 20% of the shape, a point).
The track itself is made up out of small pre-defined segments. These can be as simple as a 5m long straight, or a 5m long 90deg turn. Note that I did not use a grid system.
I then let an algorithm place random virtual segments and finally choose the segment that has the highest score. This score is determined by some conditions, and how close it is to the next point in the guiding shape. This works similarly to A*, but contains a more complex scoring system. To make the track a closing circuit, I cheat with the last segment. If it is close to the start, it clamps to it.
Probably the most complex part was procedurally generating the mesh, and an efficient backtracking algorithm.
In the end, by altering the guiding shape, and defining unique scoring conditions, almost any unique track can be generated procedurally. This is all possible without following any grid, meaning it is highly versatile.