TheDuckCow / godot-road-generator

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

End point lanes change, unexpectedly, when start point lanes are changed #80

Closed bdog2112 closed 1 year ago

bdog2112 commented 1 year ago

Observed an intermittent issue that we've seen many times in the past. However, I thought it was attributed to the IDE being unstable after plugin edits, which is to be expected But, now I think it's something else and I found some steps that help to re-create it for further troubleshooting.

ISSUE: Sometimes the "end point" number of lanes changes when the user changes number of lanes on the "start point".

In the image below, one lane was added to the top RoadPoint and the middle RoadPoint unexpectedly also added a lane. The expected behavior is for lanes to be added only to the selected RoadPoint.

lanes_issue_1

Steps to re-create the problem:

Not all RoadPoints exhibit the problem. But, if you limit the test case to the simple road network described, above, you should be able to observe the issue.

bdog2112 commented 1 year ago

It's worth noting that, if you save the file pictured above, the file will show that lanes on all three RoadPoints have been changed. The third RoadPoint simply isn't redrawn to show the change. Although, if you click the third point, it will redraw and the change will become visible.

TheDuckCow commented 1 year ago

Thanks for logging the bug - I presumed it somehow had to do with there being two pointers to the same array index somehow. This also happens in our wheel steal demo figure 8 scene.

Let's leave it alone for now, we can bring it to another release after the launch (which I might have you prioritize working on for the couple weeks while I'm traveling, we'll set expectations in our Sunday team meeting).

bdog2112 commented 1 year ago

When troubleshooting, earlier, I noticed that you can leave export variables null in the declaration and populate them in _init or _ready. Then, they will be considered changed from their default and their values stored in Scene files no matter what. I believe that is a solution that could work right now.

TheDuckCow commented 1 year ago

As far as I understand now, @bdog2112 we actually already resolved this bug right?

Closing the issue as I can't reproduce this now (and I recall we came to a solution to linked arrays), but please comment if you recall otherwise and think this is still open.

bdog2112 commented 1 year ago

Yes. This was fixed when array initialization was moved to the _init routine.