TheDuckCow / godot-road-generator

A godot plugin for creating 3D highways and streets.
MIT License
328 stars 17 forks source link

Create the LaneSegment class #17

Closed TheDuckCow closed 1 year ago

TheDuckCow commented 1 year ago

In order to support AI cars on the road, there needs to be the concept of a LaneSegment, which cars can track to as the centerpoint of a lane.

Requirements

Visual reference

The blue lines represent how I expect lanes to be placed, showing the transition from number of lanes.

Screen Shot 2022-11-01 at 10 07 25 AM

In general, this sequence of videos is a good reference for how we expect to use lanes.

TheDuckCow commented 1 year ago

FYI @bdog2112 - I created this task, though need to flush it out further. Might be a good one to work on after we have the basics of lane transitions geo working, but not right away.

TheDuckCow commented 1 year ago

In terms of scenarios for how lane segments will be created, see the PDF linked in this comment. While the PDF shows "forward" and "reverse" LaneSegments, it should be noted that this concept won't really exist in practice; lane segments simply will have direction indicating the flow of traffic, and thus will be oriented however needed. If we have a "reverse" flag, it will be purely for editor / generation convenience.

TheDuckCow commented 1 year ago

Created the base lane segment class. It itself has no logic, really just a wrapper on top of the curve object with some UI drawing. Next step will be to auto generate these and place them properly to fit the lanes in the scene based on the roadpoints already existing.

Screen Shot 2023-01-04 at 11 00 33 PM
TheDuckCow commented 1 year ago

Still open (huh, was hoping that having two PRs assigned to it would keep it open if one was still pending). Core class is there, just need to create the auto generate part now too for roads that are placed.

TheDuckCow commented 1 year ago

Basic steps have been implemented. The class exists, and lanes are generated when road segments are created (if the tick box is enabled). They are not being properly generated for very curvy roads (e.g. a 90º turn) or between RoadPoints with different lane counts (ie where there are transition lanes). Nonetheless, marking this done for now, new issue created as: