jelster / space-truckers

A game of getting stuff from Point A to Point B... IN SPAAAACCE!
https://space-truckers.com
BSD 3-Clause "New" or "Revised" License
54 stars 21 forks source link

Route generation doesn't always result in traversable path mesh #97

Closed jelster closed 2 years ago

jelster commented 2 years ago

Describe the bug When the route is launched from certain coordinate quadrants at certain rotations, the resulting driving phase path mesh is too narrow to traverse with the truck

To Reproduce Steps to reproduce the behavior:

  1. Start with this Playground as a test harness
  2. Line 2 of the PG specifies the sample route to load - sample-route5.json by default. Change number in filename to change route (1-5)
  3. Click inside the render canvas and/or press Return to begin driving. Proceed along route
  4. Observe narrowing of tube at lower velocity areas beyond traversable limits

Expected behavior The generated mesh should have a minimum radius sufficient for the truck to traverse along with obstacle avoidance. Important sample-route1 through sample-route5 demonstrate starting positions and rotations spread around most quadrants of the coordinate space (except for vertical ones). The path generated should be equally viable for all sample routes

Screenshots

image

Additional context I think the issue stems from not correctly taking rotation into account. The rotationQuaternion is captured for every route point, but current attempts to incorporate it into path generation haven't been successful in all test cases.