Continuing to work on speeding up the creation process, I made it so that you can now copy settings from roads and prefab lines so that you donāt have to manually write all values again.
1.9.2
Added option to flip roads to easly continue adding points on both ends.
Added option to flip prefab lines to easly continue adding points on both ends.
Middle clicking on another prefab line when a prefab line is selected now copied itās settings.
Middle clicking on another road segment when a road object is selected will now copy that road segmentās options. The first segment created will now use those values instead of the default ones as long as no preset is used.
Fixed prefab linesā bend objects not working when rotation direction is right
Fixed moving road points with the transform tool still ignoring if a road segment is curved or not
Fixed new road segmentās extra meshes being references to the last segmentās and not copies
Fixed being able to use prefab linesā fill gap and bend obects when rotation direction was forward or backward which created strange results
Fixed a bunch of settings not being copied over to the next road segment on creation.
Lane markers options are now only showed if (start/end)lanes are more than 0
Start and end marker offsets are now zero by default
Fixed lane markings not properly adapting to road height
Fixed build failing, resulting in no games that include this tool being able to be exported
Fixed road and prefab line road previews when the last segment has two points, acting weird to terrain
IMPORTANT! You have to add these two new layers for the tool to work. You have to manually assign the Intersection material to intersections and click the place prefab button for all prefab lines. Iām sorry for these breaking changes but it does make the tool better going forward.
1.9.6
Added two more layers: Intersection and Prefab Line
You can now select intersection connection points through intersections and roads
Fixed many strange interactions between roads and prefab lines
Fixed road lane markers being in the incorrect position when a prefab line is on top of it
You can now hold P down when connecting to an existing intersection/roundabout to keep the segmentās position before the move
You can now change the visual shape of points. The options are: Cylinder (default), Cube, Sphere and Cone
Added option to flip extra mesh uvs
All colours are now by default partially transparent to not fully block the view of whatās under. Your existing colours wonāt change so click the reset colours button in the settings window to change to these new ones
Made bridge pillar placement more exact for longer segments
Convert to mesh now supports non-road related objects
Fixed convert to mesh being broken
Fixed roadās extra meshes facing the wrong direction by default
Fixed some roundabout extra meshes facing the wrong direction by default
Fixed intersection extra mesh uvs being broken
Fixed bridge pillars being places on roads and intersections
Fixed bridge pillars interacting incorrectly with custom bridge meshes
Fixed an error when generating a road, intersection or roundabout that had a extra mesh that had both itās start and end width as 0
Fixed roundabout center extra meshes being wider than zero even tho the width was zero
Fixed extra meshes controlled by roads options for intersections and roundabout not working correctly when a extra mesh had a width of 0 but a y offset of more than 0
Fixed error when extra meshes controlled by roads was enabled for a roundabout with only one connection
How is the runtime creation support? Is each road one big mesh or smaller segments? Given any thoughts to handle the bending of the roads in a shader to allow for batching/instancing?
Every segment is its own mesh but you can convert a whole road system into one mesh to increase performance but this will take away the possibility to edit it so do that when youāre finished.
We do something similar, we bend a straight mesh segment to follow a spline. What we are looking into is doing the bending in a vertex shader to allow us to render all roads with one draw call. Will look at your intersection solution as it looks really good!
You can now divide roads with D plus left click on a point (not control point, or first/last points). Comes with undo support
Exposed traffic lightsā time since last transition so that you have more control (so now they are accually usual as different traffic lights can be in different parts of the red perioud)
Fixed being able to remove points from the first road segment when being connected to an intersection
Fixed only selected road automatically retrieving lane markings when creating an intersection
Fixed traffic lights not being movable
Fixed prefabs being placed in the wrong location when bend objects is false and gaps are large
Hi MCrafterzz, great job with this! I was using Road Architect, but it was old and limited, luckily Iāve found your asset.
For my project, I need to move a bunch of car along the road. Iāve tried the classic quadratic bezier interpolation using the point of the segments, but the resulted path is slightly offset in y when the terrain goes uphill or downhill.
I guess you adjust the mesh to stick it to the terrain. Is there a function I can use to get the real road curve?
It adapts to the terrain depending on which options you use for the segment you can change it to ignore and in that case you can use the Calculatepoints method in the roadcreator class.
If you want to use the terrain adapt mode then I believe the best way to get the points is to loop through the segmentās vertices adding 2 at a time and getting the center between the current and next vertex (0 and 1, 2 and 3, 4 and 5 etc). It would take some performance but if you do it once and then cache that information then it shouldnāt be a performance problem. Let me know how it goes and donāt hesitate to ask more questions! Also btw thanks for using my tool!
Edit: another important thing is that it uses cubic better curves (three points) and not quadratic better curves (four points)
Thank you for the quick response.
Iāve managed to use CalculatePoints to get the position at t with interpolation and the rotation with the derivative. It works well.
About intersections, for every path Iāve created a quadratic curve with the center of the intersection as control point. When the car enter the intersection, the rotation is not smooth, but I think I could manage it by using the tangent point or something.
For performance sake, Iāve stored the points of every road and all the possibile intersections paths, the only script occuring in runtime is Dijkstra algorithm to calculate the path, that is really quick with so few nodes to take in account (one per segment plus the intersections once).
Now I have another question: is there a way to create an intersection at the middle of a road, maybe by split the segments? It would be useful.
Yes Iāve got you covered, you can use CTRL + D while clicking on a non-control point on the road to split it into two roads at that position. Psst check out https://github.com/MCrafterzz/roadcreator/wiki/Instructions! It shows you all controls and shortcuts. Glad you worked it out!
The surface is probably a bit uneven and the road tries to adopt to it. In this case I recommend changing the terrain adapation mode for all segments from adapt to ignore.
Iām delighted to see that this tool is starting to gain momentum and catching peopleās eyes. I am constantly updating this tool and today itās time for another update.
1.11.1
Intersection extra meshes are now smarter and try to prevent overlapping themselves on tight corners
Fixed intersection connection point occasionally not being removed causing issues when playing the game
Prefabs with other layers than default now keep their layer in prefab lines
Oops there were a few irritating bugs in the previous version that have now been fixed:
1.11.2
Fixed intersection main roads not being visable when intersection y offset is more than 0.02
Fixed error when using the tool with Standard Render Pipeline materials
1.11.3
Fixed intersections not working correctly when using both extra meshes and main roads
Removed the right line of the 2L 1 side main road material