[1.11.4][Standard RP/LWRP] Free Opensource Road Creator

After some testing I found that the Outer Extra Meshes Controlled By Roads option had a lot of flaws, so this update makes it more reliable!

1.9.1

  • Added Extra Meshes Controlled By Roads option to intersections
  • Added Reset Turn Markings button in settings
  • Fixed Extra Meshes Controlled By Roads option not working correctly when some roads were connected with their start point instead of their end point
  • Fixed Extra Meshes Controlled By Roads for roundabouts not working correctly when a road only had extra meshes on the right side
  • Fixed lane markings not being removed when the road is resetted
  • Fixed lane markings not generating the first time a road connects to a intersection/roundabout
  • Fixed error with roundabouts when no roads were connected and outer extra meshes controlled by roads was true
  • Fixed error with roundabouts when extra meshes controlled by roads was true while the extra meshes had a start width or end width of 0.

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.

1.9.3

  • Added default lanes option, set this to 0 to disable lane markings by default

  • Added undo support to splitting segments

  • You can now move roads start/end point even tho they are connected

  • Road segments are now set to straight after being split

  • Fixed error when clicking pre-1.9.0 roads caused by missing lane markings

  • Fixed lane markings not always generating

  • Fixed lane markings rotation often being incorrect

  • Fixed road start lane markings being at the last segment and not the first

1.9.4

  • Fixed creating objects with the creation gui creating childs to the first road system in the scene instead of the currently selected
  • Fixed coping prefab line settings with middle click not updating the prefab line automatically

1.9.5

  • 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

Lots of small improvements and bug fixes!

1.10.0

  • 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!

Thanks! Have any links to your project?

Not public yet :slight_smile:

Yes I’m still updating this!

1.10.1

  • 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

  • Fixed roundabout uv issues

Always nice with some bug fixes!

1.10.2

  • Added Texture Scale option to intersections/roundabouts
  • Roundabout now generate the center ring texture all around
  • Improved default connection position when connecting roads to existing intersections
  • Fixed Street lamp post prefab having the player tag

Time for some new features!


1.11.0

  • Added intersection main roads

  • Added option to rotate the road (change the y offset of: start/end left/right)

  • Added 1 lane roundabout

  • Added 4 lane road with double lines

  • Fixed automatic intersection curve placement sometimes being way off

  • Fixed intersection extra meshes texture stretching depending on intersection size instead of repeating

  • Fixed road texture not always updating when moving a point with the move handles

  • Fixed new roads segments having a reference to the last segment’s bridge settings instead of a copy

  • Fixed not all road textures having transparent background

  • Fixed street lamp post prefab not having a collider

Hi MCrafterzz, great job with this! I was using Road Architect, but it was old and limited, luckily I’ve found your asset. :slight_smile:

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! :smile:

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. :slight_smile:
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. :slight_smile:

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!

Hi, when i create a road in the last point of a segment the road is deformed like this
Screenshot by Lightshot
Can you help me ?

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
1 Like