Easy Roads Mesh Gen FAQ by Kris Development

Hello,
My name is Hristo Ivanov and I’m writing this post as a general help/guide to using Easy Roads Mesh Gen v0.3.x and to refer to if needed. I get lots of frequently asked similar questions and I decided to make this thread to help new users get started with the tool.
Before I continue any further let me mention that there’s a Instructions.pdf file in the package which also explains some of the basics.
With that out of the way let’s begin with the first one:

I don’t understand how to add the sidewalk on the roads.
One of the more important features of the tool is being able to add border meshes to better blend your road/river/etc. with the environment around it.
This feature is toggled by the Border Mesh option.
Once you switch Border Mesh on you’ll see more options show-up such as Border Shape and Border UVs.
Border Shape serves as a drawing board and controls the number of vertices and the shape of the borders.
It reperesents a vertical cut of the right border (looking forward from the first NavPoint ) and you can right click to add new “Key” and then move that key to the desired position. If you have Update Mode set to Realtime you can see the changes being applied instantly.
Border UVs option determines how the generated borders are unwrapped, or simply put, how the texture on them looks.

What is Update Mode?
When you’re working with the tool you’ll probably need to instantly visualise the changes you make, but once done you’d probably want to reduce the impact of the tool on the performance in the scene view.
This is where Update Mode comes in.
It controls how often the tool updates it’s mesh and vertices.
‘Manual Update’ has little to no impact on the performance since the tool is updated only when you hit ‘Apply Changes’.
‘Vertices Only’ visualises the position of the vertices but still requires to manually apply the changes.
‘Realtime’ is constantly updating the generated Mesh which makes it easier to work with, but it’s good to leave it off when you are done.
EDIT (29.08.2017): As of version 0.5 there is an ‘Automatic’ Option which aims to optimize the scene performance by preventing non-selected roads from being updated. That ultimately leads to big performance boost and smoother user experience.

Does Easy Roads Mesh Gen support terrain morphing?
EDIT (22.7.2020): As of update v0.3.x the tool did not support terrain morphing, meaning it couldn’t modify the underlying terrain to fit the shape of the road. However with the latest release (v2020 +) that feature has been added to aid level designers get the terrain shape close to what they would need, manual tweaks may still be required after that.
You can also “Ground” the points with a given offset. Grounding snaps each point to the underlying collider which makes the road mesh follow roughly the curves of the terrain. Once grounded, the points might need some manual tweaking (for that make sure the Point Control option is set to “Full Manual”).

Converting from v0.2.x to v0.3.x
When updating from an older version you may get complier errors.
This could be due to a change in the script names which failed to update on import.
What I recommend is deleting the scripts associated with the error and re-importing from the asset store.
That way the scripts will be downloaded with their proper names.
Most frequent error is:
Assets/Add-ons/EasyRoadsMeshGen/MeshGen.js(126,37): BCE0005: Unknown identifier: ‘NavPoint’.
and you can either follow the aforementionend method (Delete NavPointGizmos.js and the Gizmos folder and re-importing)
or renaming the NavPointGizmos script to NavPoint and moving it to the root folder - EasyRoadsMeshGen (However keep in mind that this method, although safer for any scene/prefab references, may be prone to errors).

Converting to v2018 C#
As of version v2018 the tool is completely ported to C#. The new C# scripts are put in a differently named folder “EasyRoadsMeshGen_CS” to avoid problems with the old package.

There are two ways to convert from the old JavaScript tool to the C# version.

The first way of converting is to completely remove the “EasyRoadsMeshGen” folder from your project, which will make all the objects that have previously had the MeshGen.JS script show up a “Missing” warning. After that you reimport the package from the Asset Store. Then you simply drag the ERMeshGen.CS script on top of the script slot of the message.

The second way is to delete the old MeshGen.JS script on your GameObject and add the ERHelper.CS script to it alongside ERMeshGen.CS. Then you will need to setup the road’s width, subdivision, UV scale, etc. and after that go to the ERHelper.CS component and click “Fix Nav Points” which will assign all the existing child Nav Points to the navPoint array (as long as they haven’t been renamed manually). The downside of doing things this way is that you will have to manually set the road parameters, however unlike the first way, you won’t be forced update all of the Game Objects that use the old scripts, which allows you to gradually switch to the new package as you use it.

Does the tool have crossroads
As of writing this edit (v2020.1 - 22.7.2020) there are ways to achieve crossroads, and have been for a long time, via the “Snap point” functionality, using a pre-made crossroad prefab to which you can snap the road’s nav points. More intuitive solutions may become available with future versions.

Official video introduction to the tool

For support:
e-mail: hropenmail01@abv.bg
Twitter: @KrisDevelopment

Can I generate the road at runtime? In my app, user is allowed to touch the screen and draw a curve with finger, then a road is generated follow the curve. Can I get this function done by your plugin?

Well, it’s on the to-do list, but it’s going to be a while before I get to implement run-time compatibility, which will also need a in-depth documentation of the different public functions.
It’s important to mention that the tool is currently being ported to C#.
As of version 0.5.x I don’t think you’ll get what you need with the Easy Roads Mesh Gen package (real-time roads) unless you personally tweak the code to work in real time for your game (which I’d appreciate if you share your solution with the rest of the community).

Hi, Nice asset. Easy to use. I am having one issue with LOD. The road texture degrades very quickly with distance and I can’t find a way to alter this.

The problem is from the texture and here’s how to fix it.
There’s an option in the texture importer called Aniso Level, turn that up above 1 until you’re happy with the result (Like in the picture). Another option that might help in addition to that is the Filter Mode, set that to Trilinear.
Cheers! :slight_smile:

3264035--251814--fix2.png

1 Like

Awesome. That did the job. :slight_smile:

hi there, just checking this for the first time. I have a question about optimization. Does it automatically reduce vertices when not necessary?
For instance, if I make a long road straight, no curves, will it generate thousands of triangles or realize that it’s flat and just generate a small quantity and adjust the UV for the texture?

The tool doesn’t have an optimization algorithm as it doesn’t really need one. If you make a road that is just a straight line, you’d generally use only 2-4 nav points, which makes for around 2-6 triangles top.

Hi Hristo,

The problem is as follows: we want to have crossings which can all be updated as the project goes along but all the 100s of previously placed ones need to update as well and dynamic crossing doesn’t seem to do this. (?)

I created a dynamic crossing and placed a few but it won’t update across the scene after I edit the prefab by adding a model to it, does this only work for custom crossings?
I figured it was b/c it’s a dynamic crossing so I tried turning it into a custom one through the custom prefab editor window. But that also doesn’t work (custom crossings only work with mesh input?)
Do I create a dynamic intersection (T junction between 2 road types) and then export as a mesh and turn that into a custom one?

Is that a limitation of dynamic crossings then?

Which also leads me to a workflow question:

If I decide I want my roads to be 6m wide and that works for dynamic crossings and associated roads but I have to make custom crossings to get proper updating prefabs and later it’s decided the roads have to be 6.2m wide and you made all the custom crossings b/c dynamic won’t update etc. so you’ll have to pretty much decide all of that in advance?

Thanks!

-edit- In the tutorial video too, where you edit the railroad, you delete the original and then place a new one where the changes take effect, this is normal, there’s no way to have it update on all previously placed instances?

can someone point me to a tutorial as i bought this but the usage is very un clear i am getting a pink road also it is not seem to follow the terrain etc.

Hi,
On the topic of dynamic junctions, it has been in the development pipeline for a while now and I will be adding that in the next few updates, however for now you have to use only static meshes. Each mesh should have child objects with the SnapPoint script so the road recognizes it as an object to snap to.
As for the road width/workflow problem, I hope that will be fixed with the dynamic junctions update in the future, but for now I will push an update this week that allows you to lock the width of the snapped points.

Sorry Kris! Your introduction video is more like a selling video. Would love to see a tutorial video.

Hello there,
You are somewhat right about that. As making videos takes a lot of time from other important activities, such as developing new assets and improving old ones, I had to take out two birds with one stone - make a tutorial which at the same time also act as marketing material.
If you describe what type of tutorial you want to see, I could definitely consider it, or at the very least help you solve a problem you’re facing.
PS: you can also write me an e-mail if you don’t feel like your issue should be shared here: hropenmail01@abv.bg OR krisdevmail@gmail.com

Hello! Is there a way to close a loop once you’ve finished dragging the points close enough for the loop to be auto completed?

P.S. Found a bug that happens when you turn Parent Points ON then OFF. It changes how the road looks and makes it irreversible.

Yes, there is a way to close the loop by using the Snap Points (just snap the end point of the road to the starting one).
About that parent points bug, you can choose not to save the scene and just reload it. It fixes it, however the parent points bug only happens if you have scaled the points. It’s something I never really had time to fix as I didn’t see it as a big enough issue. If, however, you need it fixed and presents an obstacle to your workflow I will take a deeper look into it.

1 Like

Thank you for replying. It’s not that urgent for me fortunately though it’s still worth checking, for future versions. :slight_smile:

@KrisDevelopment You got +1 customer :stuck_out_tongue:
I sent you a mail, please check

Hey!

I’m trying to figure out how to create road crossings. It looks like I need to model crossings separately, which is fine. I’m getting hung up on the border meshes though. From some older screenshots it looked like you could define a border mesh object, but I can only find the border shape curve editor now - is it no longer possible to define the border shape with a mesh? Is there at trick to matching up the shapes of the border mesh with a crossing that was modeled separately?

Thanks!

[Physics.PhysX] cleaning the mesh failed
UnityEngine.MeshCollider:set_sharedMesh(Mesh)
ERMeshGen:UpdateCollider(Mesh) (at Assets/KrisDevelopment/EasyRoadsMeshGen_CS/Scripts/ERMeshGen.cs:1247)
ERMeshGen:GenerateMesh() (at Assets/KrisDevelopment/EasyRoadsMeshGen_CS/Scripts/ERMeshGen.cs:307)
ERMeshGen:UpdateData() (at Assets/KrisDevelopment/EasyRoadsMeshGen_CS/Scripts/ERMeshGen.cs:209)
ERMeshGen:Update() (at Assets/KrisDevelopment/EasyRoadsMeshGen_CS/Scripts/ERMeshGen.cs:161)

how do you manipulate it… so that you can curve it? Is that just lots of NavPoints. I hope you reply. This tool is not bad, once you get used to it. I like the way, so far, that you can add any material you want.