TheDuckCow / godot-road-generator

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

Create button for add/select new road before/after roadpoint #36

Closed TheDuckCow closed 1 year ago

TheDuckCow commented 1 year ago

As a part of this macro-scopic issue, we want to be able to easily add add new RoadPoints for easy creation of road networks. Right now, we have to fiddle with updating pre/post roadpoints in a chain, and manually retrigger refreshing of the layouts as roadpoints are duplicated

Requirements for this task:

Out of scope:

Long term reference mockups

Again, per scope above, we're not making a 3D widget right now, and we're only affecting one roadpoint at a time. However this end still is still helpful as a reference:

Mockup for before/after buttons (part of this PR):

Screen Shot 2023-01-15 at 8 36 37 PM
bdog2112 commented 1 year ago
  • Give the new roadpoint a name which starts off equal to the current roadpoint, and then increments any number found (or adds "001" if none)

RoadPoints should exist in an array where its length, more or less, represents the total number of RoadPoints. Do names matter to the user other than for the purpose of troubleshooting?

What if we simply use the array index number as the name and pad it with zeroes? That would do away with the need to figure out how to extend the number on the current name and it would be really efficient. (e.g. RP00001, RP00002, RP99999)

Using four or five digit padding would give the user between 10K and 100K RoadPoints.

If points are being added/deleted, then a one to one relationship with points and indexes will cease to exist. Still, if we assume that the last RoadPoint in the array is also the last one added, then we can just increment its number to use as the name for the next point without requiring greater complexity.

Is padding even necessary? (e.g. 1, 2, 3... 99999)

bdog2112 commented 1 year ago
  • The newly added RoadPoint should placed directly in front of the current roadpoint by 4x the current lane width

New segments occasionally display "blank" textures due to their short length resulting from "4 x current lane width". If the segment is, then, stretched slightly longer, the lane texture will show up. This limitation is due to how textures are currently tiled.

A simple tweak that would help to avoid the above problem would be to go with a larger default lane width multiplier such as "5".

There was also some recent discussion about cutting the road texture vertical resolution in half, which might also yield some benefits in texture tiling.

bdog2112 commented 1 year ago

There has been some discussion about the node naming algorithm See this post.