Track as a graph


So far the track has been modeled a series of points with a spline constructed between them. That approach has no way to support junctions/forks.

So this evening I quickly swapped over to modelling the track as a graph - surprisingly painless. In the screenshot the red squares show track points and the green lines are showing where we've correctly detected a meaningful junction/decision point in the track (i.e. where it's vital we model it as a graph and not a line).

Next up will be to overlay a spline on the graph - probably by doing e.g. A* pathfinding to a destination and then adding the points to a 'spline' which we do our u-value movement over.

I don't think I will have to do any correction for speed vs. spline length because all the points are guaranteed uniformly distributed, but we'll see..

Leave a comment

Log in with itch.io to leave a comment.