Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve RoadLaneAgent lane transition #184

Open
TheDuckCow opened this issue Sep 8, 2024 · 0 comments
Open

Improve RoadLaneAgent lane transition #184

TheDuckCow opened this issue Sep 8, 2024 · 0 comments
Labels
bug Something isn't working
Milestone

Comments

@TheDuckCow
Copy link
Owner

The RoadLaneAgent is a new node added as of v0.5.0, a helper for tracking along RoadLanes for any lane following needs. Right now, when the agent is request to move_along_curve with a distance that would push it into the next (or previous) lane, it will correctly auto assign that new lane. However, it's not yet correctly doing the remainder movement once on that lane. For instance, a player who is located 9.5m along a 10m lane who then requests to move 1m forward, then will get to 10m, change to the next lane, and presumedly have another 0.5m to move along the other lane.

Simpler said than done, we just need to content with the fact that two RoadLanes may not be facing the same direction, or even worse, might be incorrectly authorized such that they are not adjacent/overlapping. So we need to decide on the behavior:

  • Option A: Blindly assume RoadLanes are placed and connected correctly. Simplest to understand, the only thing we'd have to care for is that the reverse_direction is flagged correctly.
  • Option B: When attaching to a new curve, fetch the nearest position of the player on that curve and use that to figure out how much further to move along. The problem with this is, though, that we essentially have to ignore the intended "reverse_direction" flag and then for this initial frame the player is tracking along the wrong direction, but then the next frame most likely the agent is going to go in the oppposite direction. I ran into this infinite flickering issue while working on this demo and was annoying to troubleshoot

At this point, I'm assuming we should go with Option A, and if there's any invalid connections, the parent calling vehicle/controller should be able to contend with it

@TheDuckCow TheDuckCow added the bug Something isn't working label Sep 8, 2024
@TheDuckCow TheDuckCow added this to the v0.6.0 milestone Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant