Just revisiting this as I’ve found a solution I think works quite nicely. Not pixel perfect, but similar to a simpler version of StarCrunch’s suggestion about assigning offsets to each tile.
Using Tiled, I created my map.
I’ve then added some extra properties to each tile type as follows:
{ id = 1, image = "tile-1.png", width = 50, height = 50, hitTest = { t="Off", topLeft={0,0}, topRight={0.5,0}, bottomRight={0.5,0.5}, bottomLeft={0,0.5}}, tileType = 1, },
The key part is the hitTest part. This describes a smaller area of the tile that behaves differently from the rest of the tile.
The issue was that the majority of tiles contained either mostly track with a smaller section not track (like a corner piece) or the opposite (like an inverse corner piece).
So each tile has a default of either track (t=“On”) or not track (t=“Off”)
The coordinates (topLeft, topRight etc.) then describe a section of the tile that is the opposite of the rest of the tile, so if our vehicle is over that, the speed needs adjusting accordingly.
With one set of coordinates you can handle any shape that has a smaller rectangular section cut out of it, so a corner, edge piece, straight piece.
Next is to look at handling diagonals effectively and more complex shapes where it isn’t just one rectangular section cut out of a square tile - ie t-shapes… I may not need that level of accuracy for what I’m doing though.
It works quickly, is pretty accurate and allows for easy editing of tracks using Tiled but goes beyond tiles just being “track” and “not track”.
Thank you again for all the replies.