[1.6.1][SRP/LWRP] Free Opensource Road Creator

Imo there are no really good free road creators at the moment. There are some good paid alternatives like EasyRoads3D, but for people who want to create free games you can't afford to buy expensive assets. So I decided to create my own. It's open source, completely free and focuses on customizability to fit everyone's different needs, it can be used both for low poly and high resolution graphics. It all depends on which assets you use, but the tool is flexible. Low poly assets are currently included.Trailer:

Features:Road Creation
- Place, move and delete points to create a series of curves
- Generate roads with different width, texture and much more.
- Customizable shoulders, possible to have multiple on each side
- Options are changed per-segment which allows for more control like the road having a extra lane before a intersection
- Terrain deformation to make the terrain adjust to the road
- Easly make a road into a bridge with automatic pillar placement (see bridge section)

Prefab Line Tool
- Includes a prefab line tool to place prefabs along a series of curves
- Change rotation direction, scale (per-axis), adapt to terrain etc
- Option to have a different start/end prefab which is useful for example guard rails
- Options to curve the mesh and also to fill in the gap between them to get a smootly curved and connected line of prefabs
- Many more customization options

Bridges
- Generate bridges with only a few click!.
- Currently 12 bridges are included but you can easly add your own. The tool with modify the bridge mesh so that it fits the mesh perfectly
- Generate pillars automaticly with options such as: gap, scale and rotation direction
- Adapt gap to bridge option to automatically align the pillars with the custom bridge mesh.

Intersections
- Procedurally generated intersections, easly create them by connecting two roads end/start points
- Easly customize intersections by moving points and changing how sharp the connections should be (per connection)
- Move the connected road points when the intersection is selected to have full control over the intersection mesh

Other
- Includes a bunch of roads and road related assets like turn markings and road signs
- Create timed traffic lights

And at this very second I'm importing it to use for my personal game. Might let you know it goes

Edit:
So far having fun with it but I'm stuck with two things.
1. I never managed to touch the Y Offset and Smoothness Amount fields. My editor seems to lose focus. Also when editing anything it's like I'm forced not to Alt+Tab for example.
Using 2018.3.1f1 fresh project
2. Unsure how to finish the "circuit"

And at this very second I'm importing it to use for my personal game. Might let you know it goes

Edit:
So far having fun with it but I'm stuck with two things.
1. I never managed to touch the Y Offset and Smoothness Amount fields. My editor seems to lose focus. Also when editing anything it's like I'm forced not to Alt+Tab for example.
Using 2018.3.1f1 fresh project
2. Unsure how to finish the "circuit"

Click to expand...

Glad to hear that you've downloaded my project! But it's unfortunate that you have found problems with it.
1. The editor doesn't loose focus for me so this is one of these super anoying things that I can't reproduce and therefore have no way to fix. I guess you have tried reopening the project and selecting another object in the scene before selecting the road again?

I would recommend having the smoothness amount as zero as it's kinda hacky. Modify the control point to get the smoothest possible curves!
2. You have 2 options. Either you could overlap them a little bit so that they look connected but arn't or you could do it the proper way and have two roads and create intersections between them (move a start/end point from both roads to the same point to create an intersection. You can then hold s while moving the intersection points so it's so small that it isn't noticable. This way you'll have a complete circuit. Generate intersections must be enabled for both roads tho.

Glad to hear that you've downloaded my project! But it's unfortunate that you have found problems with it.
1. The editor doesn't loose focus for me so this is one of these super anoying things that I can't reproduce and therefore have no way to fix. I guess you have tried reopening the project and selecting another object in the scene before selecting the road again?

I would recommend having the smoothness amount as zero as it's kinda hacky. Modify the control point to get the smoothest possible curves!
2. You have 2 options. Either you could overlap them a little bit so that they look connected but arn't or you could do it the proper way and have two roads and create intersections between them (move a start/end point from both roads to the same point to create an intersection. You can then hold s while moving the intersection points so it's so small that it isn't noticable. This way you'll have a complete circuit. Generate intersections must be enabled for both roads tho.

Click to expand...

Hi!
Yes, I've tried selecting another gameobject and then the road system again. I understand that this is some kind of specific problem. Neither do I know why this happens and it's frustrating I can't even "touch" the variables.
Also thanks for the second info, will give it a try.

And out of curiosity it says to start with LWRP but this is kinda inconvenient for most of the/my cases. Look I don't need an ultra HD version but just for the normal projects would be better I think.

Hi!
Yes, I've tried selecting another gameobject and then the road system again. I understand that this is some kind of specific problem. Neither do I know why this happens and it's frustrating I can't even "touch" the variables.
Also thanks for the second info, will give it a try.

And out of curiosity it says to start with LWRP but this is kinda inconvenient for most of the/my cases. Look I don't need an ultra HD version but just for the normal projects would be better I think.

Click to expand...

The roads need a specific shader to stretch correctly so I needed to create a shader graph for it. So it's possible to have it for the standard rendering pipeline but you'll have to write a custom shader. Also Unity has said that LWRP and HRP is the way forward and that the SRP will be deprecated soon. So it's more of a general Unity thing than this specific package, everyone will have to move over soon… I don't like it being split into two as some features like decals only are avaliable for HRP and not for the rest of the community but we'll just have to accept it...

As for the inspector, the more information I get the higher are the chances that I can solve it. Does it only happen for roads. Do global settings work? Road segments? Prefab lines? Intersections?

EDIT: I've heard that LWRP shaders work quite well for HRP so if that's want you want then you can probably switch without problems.

I totally agree you don't have to make two separate packages. Actually I switched to my traditional road editor for now but just for you I tested it again. Global settings work fine and editing the road too (placing the road, barriers and all that sort of stuff).
The variables in the inspector of "Prefab Line" and "Road" inside "Road System" cannot be changed. When I click on it, it refuses to focus or basically won't let me enter another number. Like the smoothness amount for example.
Hopefully you can understand what I mean.

Also, don't worry I leave this road creator behind . I may use it in the future when LWRP is the going ham.
For now I wish you the best of luck

Edit: I've had trouble setting up the bridge. I assume the Y Offset First Step and Y Offset Second Step should change height but I still get a road glued on the terrain itself

I totally agree you don't have to make two separate packages. Actually I switched to my traditional road editor for now but just for you I tested it again. Global settings work fine and editing the road too (placing the road, barriers and all that sort of stuff).
The variables in the inspector of "Prefab Line" and "Road" inside "Road System" cannot be changed. When I click on it, it refuses to focus or basically won't let me enter another number. Like the smoothness amount for example.
Hopefully you can understand what I mean.

Also, don't worry I leave this road creator behind . I may use it in the future when LWRP is the going ham.
For now I wish you the best of luck

Edit: I've had trouble setting up the bridge. I assume the Y Offset First Step and Y Offset Second Step should change height but I still get a road glued on the terrain itself

Click to expand...

To not make the road glued. Set the terrain option of the segment to ignore then you change the point with + and - when selected. I'll do my best to try to fix the problem. I hope I can fix it for you!

1.0.3 has been released!:
- Fixed focus problems preventing searching when selecting objects and variables to be editable in the inspector (let me know if it works @Justice0Juic3 )
- Object creation gui is now showed when a global settings or road segment object is selected

1.0.4 has been uploaded, fixing some bugs:
- Replaced extra meshes width option with start width and end width for increased customizability
- Fixed roads treating height incorrectly causing them to sometime hang like a hanging bridge.
- Fixed extra meshes and bridges starting at the wrong position when that segment's start width is different than the last segments end width

Features, tweak and loads of bug fixes. 1.1.0 has it all!:
- Added extra meshes for intersections
- Added creation gui button to create traffic lights
- Holding CTRL when moving points up and down now snaps their position to whole values (also useful to move them faster)
- Traffic light now show the creation gui when selected
- Made pillar placement for bridges more exact
- Changed uv system for bridges to stretch the texture similar to roads or intersections depending on if it's a road or intersection
- Bridge pillars now have a rotation direction option
- Multiple traffic lights can now be modified at the same time
- Roads bridges now generate caps

- Fixed prefab lines hanging when both points are in air
- Fixed first prefab in prefab lines sometimes being bent in the wrong direction (@Justice0Juic3 this should make your road system look a bit better )
- Fixed an error when the first road segment has a bridge
- Fixed prefabs in prefab lines being placed to near eachover in slopes
- Fixed being able to have multiple global settings object
- Fixed road/prefab lines/road segments and intersection printing error when there is no global settings object
- Fixed points not being dropped when going out of scene view
- Fixed points not being dropped when holding shift
- Fixed prefab lines direction not being left by default
- Fixed intersection materials having no texture
- Fixed not being able to change intersection bridge material
- Fixed intersection bridges not generating cap on last connection
- Fixed prefab lines fill gap being able to be used when rotate alongst curve is false causing strange results
- Other small bugs fixes and tweaks

Would anyone mind if I removed the smoothness amount option for roads? It always gives pretty bad results so it's better to simply use another shorter segment. Please let me know! If noone is against it, it will be removed in the next update.

1.1.1 is a smaller update:
- Multiple segments' extra meshes can now be edited at the same time so you no longer have to edit one segment at a time
- Removed smoothness amount for roads
- Added reset curve points button to intersections
- Huge code cleanup which leads to minor performance improvements
- Other small tweaks and bug fixes

Yeah of course But what I mean is that sometimes you need something different than a X cross or a T cross. Example:

Does the system works for such angles?

Last question : I understand that it's only working for LWRP or HDRP?

Click to expand...

Yes. The intersection system is dynamic so they can be in every shape. Yes the tool requires Lwrp/hdrp for the shader graph to work. The tool itself does still work without it but you'll have to write a custom shader that divides uv2.x with uv.x.

Also just so you know. The blue mouse position laggs behind the actual position making it look buggy. The is because of the sceneview not updating, this is fixed in the upcoming version. Just so you don't leave this tool because it looks buggy.

I present the biggest update yet, 1.2. As well as fixing month-old bugs it also adds many handy features.

Full changelog:
- Added option to road segments to generate custom bridges. Currently two types of suspension bridges are included but you can easly add your own. Many options can be customized such as scale, amount of repetions etc.
- Added suspension bridge pillar
- Road guideline system revamped:
- Cursor now snapps to closes point on line instead of only a few point alongt it
- Changed the visuals to be less cluttered, a circle is now displayed at the point's position and lines are displayed to mark the end of it
- Road guidelines length is now set instead of amount giving much more control over size
- Road guidelines display distance is now configurable, to prevent them from taking up big parts of the screen
- Road guidelines snap distance can now be changed
- Distance calculations to determine if the guideline should be shown is now from the nearest point on line instead of center position
- Made center road guidelines more accurate

- Prefab lines "bend objects" now follows the curve much more exactly
- Prefab lines scale has been replaced with xScale, yScale and zScale
- The position of road's and prefab line's points can now be edited in the inspector for easier modification. When selected the selected point will be rendered. Moving them automaticly updates the road/prefab line.
- Connected road points can now be moved when intersection is selected

- Fixed mouse position cylinder lagging behind actual position
- Fixed intersection vertices not being pararell causing extra meshes to sometimes generate in weird self-overlapping shapes
- Fixed extra meshes generating on the wrong side of the road
- Fixed prefab lines having the wrong spacing by default
- Fixed uvs for bridge caps being incorrect
- Fixed top of bridges generating mirrored compared to roads causing the bridge to sometime go through the road in steep curved slopes.
- Fixed cursor cylinder being on top of curve points when a intersection is selcted
- Fixed intersection extra meshes not preventing null material
- Fixed bridge mesh not being removed when removing a road's en point
- Fixed bridge pillars at start and end point having wrong rotation
- Fixed bridge pillar scale not being relative to the mesh height causing all pillar meshes to have to be the same size
- Many more changes and fixes

1.2.1:
- Settings are now edited in the Road Creator tab in project settings instead of in a Global Settings game object
- Added shader to support the standard render pipeline (Materials are still for LWRP)
- Added button to duplicate extra mesh for quicker editing
- Selecting a point now automaticly selects the move tool
- Placed prefabs in prefab lines are now hidden in the inspector
- Fixed roads and intersections generating pillar(s) even tho place pillar(s) is false
- Fixed roads and intersection normals being flipped and their shader having to flip them back
- Decreased the file size to 1/5 of the previous release
- Other small changes and fixes

I feel like this tool is nearing completion so development will slow down (I will still fix bugs and do tweaks). My focus atm will be on including some more types of bridges. Let me know if you feel like something is missing!

1.3.0:
- Added new settings, hide non-editable objects. When true which it is by default, it hides objects such as road segment meshes from the inspector. As they arn't editable in any way they just take space in the hierarchy.
- Added new settings to change the default materials and prefabs used by roads, intersections and prefab lines
- Removed background from road and intersections. As they now use the same base material their colours will always match
- Pillars can now be placed even tho generate simple mesh is false as long as generate custom mesh is true
- Added overlay material option to extra meshes
- Split roads xz pillar scale to x scale and z scale
- Added option to road segments to adapt pillar gap to custom mesh to quickly place the pillars at the correct positions
- Other changes and fixes

1.3.1:
- Added settings to change default start/end prefab line prefabs as well as bridge pillar

1.5.0 focuses on finalizing the bridge system to also support arch bridges:
- Added 6 new bridges: arch bridge, simple arch bridge, small truss bridge, circular arch bridge, curved truss bridge and simple beam bridge
- Adapt to custom bridge now changes the x scale of pillars to match the extra mesh. The z scale still has to be changed manually as it's impossible to calculate (is different for every bridge mesh)
- Added adapt bridge to terrain which displaces the mesh's lowest vertices so that it goes down all the way to the ground. Enable this when using the new arch bridges.
- Added X pillar scale multiplier as some pillars base are wider than the top part and therefore the pillar doesn't match the custom bridge mesh by default
- Pillars are now moved so that they always are in the center of the road even when one side has extra meshes
- Removed some old pillars
- Fixed pillars going through custom bridge meshes when they have parts under the road
- More smaller stuff

1.6.0
This tool´s biggest flaw imo is the inability to insert points in the middle of a segment. This resulted in situations when you had to redo the whole road which can be time consuming. I'm happy to announce that it's finally fixed! You can now spilt a segment into to two by holding down A and left clicking on a segment.

- You can now split a segment (Left click + A)
- Added undo support for intersections
- Divided up the prefab line editor into sections
- Fixed error with center guidelines when a road segment is too short (they are now only generated when possible)
- Code clean up, it should now be easier to read

1.6.1 is a small bug fix update:
- New segments now use the last segments end width as start width to prevents strange transitions, previously it used it's start width. This includes intersections.
- Fixed pillar gap options not being shown when generate custom bridge is false

Oops...

"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.