Practical sessions
Here are some additions you could make to the code:
- Smooth the path even with large ground triangles.
By looking up the next couple of path segments, it may be possible to create an average of the segments. For sharper turns, the transitions between the triangles could be smoothed by using splines.
- Clean up the generated triangle neighbor list.
Right now, the list of adjacent triangles is quite large. This fact can be seen when the neighbor mesh debug drawing for a level is activated. Try to find a solution to include only triangles sharing parts of an edge.
- Add a minimum distance between walls and path lines.
For the generated ground triangles, some of the center positions may be so close to a wall that the instance will collide when following the path. In some cases, the paths even go through edges of level geometry when the triangles are seen as adjacent. When creating the ground triangles, try to find...