I'm using Bresenham's line algorithm to calculate a "line" of cells between a start and end point on a 2D tile grid.
However, I'm using this during terrain generation to create a visible pathway, which means I need every cell to have at least one shared border with a neighbor.
This shows how the line algorithm is picking cells:
Yet if you imagine this as a road, there's no way to drive from one "segment" to the next.
How can I calculate a line that doesn't "jump" like this?
I've thought about using pathfinding or raycasting but they both feel like overkill because they worry about things I don't need here. I won't have obstacles to route around and I don't care about calculating ray intersections.