Search Unity

easy roads in unity

Discussion in 'Assets and Asset Store' started by raoul, Mar 18, 2009.

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi Guats,

    I am not sure if your problem is related to this but to pull out a new road from a crossing connection you do Click + Drag, not Shift + Click + Drag.

    I do not 100% understand the last bit and in the screenshot I can only see that perhaps the UV tiling seems to use a very low value. Also looking at the white surrounding surfaces (representing the terrain deformation shape) connecting correctly to the connection it seems the road is connected well. Which settings are not inherited from the crossing connection?

    "High Segment" Default geo setting, is that actually the UV Tiling I mentioned ("UV Tiling" in the Inspector)? This is inherited from the road type assigned to the crossing connection. You can check the default UV Tiling for that road type in General Settings > Road Types. Is that indeed using a low value (0.1)? This used to be the case for some road types in previous betas but the default UV Tiling of all road types should be 1 in the latest beta 7.7.

    Thank you very much for the compliments Guats!

    Raoul

    btw, this is the very first EasyRoads thread from 2009 when I started experimenting creating roads through code and flattening the terrain according the road shape, v3 beta http://forum.unity3d.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/ .I know You are aware of this thread since you posted there as well, but just in case...
     
  2. RedWo1f

    RedWo1f

    Joined:
    Jan 10, 2013
    Posts:
    5
    Hello, I was recently using EasyRoads v3 and for the most part got everything set up (with the help of the documentation ofc). I want to make a large city, so I am wanting to use the motorway 2 lane roads (the wider, city style roads with multiple lanes).

    Creating it isnt the problem, but for some reason no matter what, my FPS characters collider seems to get stuck when attempting to walk over the middle median. I can sprint over it just fine, but it's like the collider is raised improperly on either the road or my character. I messed with my characters settings for a while but couldn't find a work around for it (still a noob, so I'm sure I'm missing something). Any help would be appreciated, and can send you a quick video if you need a more clear example :)
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi RedWo1f,

    Is this only happening for the motorway road type?

    The generated roads are ordinary unity game objects with mesh collider attached. So I am not sure what could be causing this, neither has this behaviour been reported before.

    Which character controller system are you using?

    Or, what exactly do you mean with "middle median"? English is not my native language, is this actually related to the middle barrier side object which is auto activated for the motorway road type? In that case, first thoughts are that this seems to be related to your character controller settings acting differently depending on the speed. You could test this by putting a simple cube primitive in the scene matching the height and width of the barrier. Does the same thing happen?

    Thanks,
    Raoul

    V3 thread: https://forum.unity3d.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/ :)
     
  4. RedWo1f

    RedWo1f

    Joined:
    Jan 10, 2013
    Posts:
    5
    I managed to fix the issue at hand, thanks :) Just had to make some collider adjustments on my character controller. One other thing I was wondering about (and sorry in advance if this isnt the right place to post) is my sidewalks. Is there a way to change it's textures? They are a tan color, which is completely out of theme with my city. I also noticed when I try to remove one side of a sidewalk, or both (since not all my streets need them), the street blurs out.



    76931a1a1bc0fd0a70155665b3790f71.png 16dff03fb508ade91aa7447225d93a66.png

     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi RedWo1f,

    The first section of the manual explain the main workflow, roads adapting to connection crossings also regarding sidewalks. The very first section includes a number of provisional demo videos, one of them is "crossing options"



    This video also covers adjusting sidewalks, you will see a material slot. Here you can assign your own material or you can assign your own texture to the currently used material.

    I am not sure what happened with the sidewalk? Which version are you using? What exactly did you do?

    Thanks,
    Raoul

    V3 thread: https://forum.unity3d.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/
     
    RedWo1f likes this.
  6. RedWo1f

    RedWo1f

    Joined:
    Jan 10, 2013
    Posts:
    5
    Thanks! Turns out I was on an older version :p updating fixed a lot of my minor errors. Asset is working exactly as it does in the video. A+ tool, great work.
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Good to hear that :) The sidewalk issue was indeed a known problem but fixed quite some time ago.

    Certainly because v3 is still in beta it is recommended to always update to the latest version. The latests builds should be quite stable and ready for production. Finishing work on the new demo project at the moment, when that is done it will be released..

    Thanks,
    Raoul

    V3 thread: https://forum.unity3d.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/
     
    Last edited: Nov 16, 2016
  8. PeteGartside

    PeteGartside

    Joined:
    Nov 26, 2016
    Posts:
    5
    I've just spent a week creating a very simple road editing tool and just ran across your wonderful tool that dose everything i was trying to do and more :)
    I'm just evaluating the free version before buying the full version and the first problem i've found is on unity 5.5.0f2 i don't get the EasyRead3D menu to appearing, is this a restriction of the free version or a problem with the version of unity i'm using?

    Cheers
    Pete
     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi Pete,

    Thank you! :)

    Where are you looking for the menu? It used to be at the top of the horizontal menu but that is no longer allowed by the asset store:

    For v2 you can now find the menu in: GameObject > Create Other > EasyRoads3D

    It is mentioned in the Quick Start section at the top of the manual.

    Regarding evaluating the free version before buying the full version, it is recommended to already start using the v3 betas. v3 is an entirely new road tool with different workflow like no need to select the Add / Insert markers tabs in the Inspector, much more features.

    https://forum.unity3d.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/

    Raoul
     
  10. rbm123

    rbm123

    Joined:
    May 24, 2015
    Posts:
    125
    Hi
    I'm new with this tool
    how can I make "Dirt road" or something Like "Off road" ?
    I mean road in Forest with no Asphalt!
    sorry for my bad English
     
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi rbm123,

    Which version are you using?

    Roads created with the free version use by default the "roadMaterial" material in /Assets/EasyRoads3D/Resources/. To use different materials you can duplicate this material add a dirt texture and assign the duplicated material to the road.

    In v3 you can do all this by creating road types in General Settings > Road Types, this way you can quickly reuse road types. The package includes an example dirt texture, more will follow once the new demo project is ready.

    The below screenshot was posted last week:
    IConnector2.jpg

    V3 thread: https://forum.unity3d.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/

    Thanks,
    Raoul
     
  12. Niloy

    Niloy

    Joined:
    Mar 19, 2016
    Posts:
    9
    Hi Brother....I just started using Easy Road 3D recently....It's really awesome with all these features....But I am stuck in a point....i don't know what I am doing wrong....The terrain pops up through the road texture when my Car gets closer to the slopes....I raised the slopes increasing the y value of the Road Markers screen_1920x1080_2017-05-03_17-14-29.png
     
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi Niloy,

    Hope you like all the new features! This is v3 right?

    That looks like z-fighting.

    Raising the y values of the road markers will not work because the terrain flattening will still be done relative to these new Y values. You can try increasing the road network "Raise" value in Build Mode. This will move the road network higher above the ground.

    The shape is not clearly visible because of the cam angle and the zoom level, but it seems this happens in an area with a considerable change in the road direction (from more horizontal going upwards). What are the terrain specs (terrain size and heightmap resolution) and what is the road resolution? This defines whether there are enough terrain points available to nicely conform the terrain with the road shape.

    v3 thread: https://forum.unity3d.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/ :)

    Thanks,
    Raoul
     
  14. Niloy

    Niloy

    Joined:
    Mar 19, 2016
    Posts:
    9
    This is not v3....It's v2.5.9.3....I raised the road network value in the Build Mode....But to solve it properly I had to raise the value up to 50cm....And that's really high....The edges of the road on both side looks oddly higher than the terrain lol....I am using Unity 5.5.0p4....I believe it's a stable version with no Lightmapping issues.
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    V2 indeed has a similar raise value, but this is more for the max 0.05 range. For sure 50cm will not look good.

    What are your terrain specs, size resolution and what is your road resolution? Can you show a screenshot of that critical area sideways so it is clearly visible how the road is aligned with the terrain?

    You can find the v3 beta package as a separate package in the EasyRoads3D folder. It is recommended to start using it,it will soon replace v2.

    Thanks,
    Raoul
     
  16. Niloy

    Niloy

    Joined:
    Mar 19, 2016
    Posts:
    9
    Terrain Spec:
    Capture.JPG

    When The Car is infront of the High Slope the road texture is ok:
    screen_480x270_2017-05-03_22-51-21.png

    But when it starts to get closer to the height change:
    screen_960x540_2017-05-03_22-52-36.png
    Here is the terrain Side View. You can see the higher slope in this angle screen_960x540_2017-05-03_22-55-50.png screen_960x540_2017-05-03_22-54-24.png
     
  17. Niloy

    Niloy

    Joined:
    Mar 19, 2016
    Posts:
    9
    Did you find any solution Bro? :)
     
  18. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    The heightmap resolution is 33 (quite low), the size is 500. This means that each cell covers about 15 unity units.

    There are not enough terrain points available to handle road shape height changes over a short distance. Does that make sense?

    Try increasing the heightmap resolution. Note that this will flatten the terrain so if you want to keep this particular terrain you can duplicate the terrain first in the assets folder.


    Thanks,
    Raoul
     
  19. Niloy

    Niloy

    Joined:
    Mar 19, 2016
    Posts:
    9
    Thank You for the Suggestion Raoul :)
    But I imported Easy Road v3 in my project and run the scene main.unity from the EasyRoads3D scenes folder....The Road problem still appears....The Terrain spec is same as it was in the asset....Height resolution is 513.
    screen_1920x1080_2017-05-04_02-11-08.png
    screen_1920x1080_2017-05-04_02-11-37.png

    I am using Unity Engine 5.5.0p4....But it also occured in 5.3.5....And the build platform is set to Android....Is any of these causing this problem?

    Thank You :)
    Niloy
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi Niloy,

    In the new screenshots the terrain is not conformed to the road at all, it looks like the road network is in its original state in Edit Mode. Did you click the "Build Terrain(s)" button after clicking the middle mountain tab in the Inspector?

    Thanks,
    Raoul
     
    Last edited: May 4, 2017
  21. Niloy

    Niloy

    Joined:
    Mar 19, 2016
    Posts:
    9
    Hlw Raoul
    It worked on v3 really well....The terrain doesn't pop out anymore....It didn't solve on v2 even if I click on the mountain icon tab....I believe that was the auto build terrain button....But it works like a charm on v3 when I press that build terrain button....I realized that it happens when I pull one marker very high that it's previous marker....I just have to be a little careful while making road....I am gonna use v3 from now on.

    Thanks a lot for all the help Brother :)
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Good to hear that!

    Terrain deformation does work the same for v2 and v3. Are you still using that 33 heightmap resolution?

    Anyway, it is certainly recommended to use v3 :)

    Thanks,
    Raoul
     
  23. Niloy

    Niloy

    Joined:
    Mar 19, 2016
    Posts:
    9
    Yeap....I am using 33 resolution for Terrain Height as the Game is for Android. I want to keep the surrounding elements as optimized as possible. I just keep my terrain height on the road as smooth and straight as possible. That way the Road Texture renders perfectly.

    Thank You,
    Niloy
     
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Yes, when using lower heightmap resolutions a more smooth road is required where for example height changes take place over a longer distance.

    Glad to hear you found a way to work with your terrain. Other options are to use terrain mesh overlays in critical areas using shape type of side object. That gives a little bit more freedom in the road shape on lower terrain heightmap resolutions.

    Thanks,
    Raoul
     
  25. NumT

    NumT

    Joined:
    Feb 13, 2014
    Posts:
    19
    Hi Raoul. I'm trying to create a custom crossing prefab using the latest beta available on the Asset Store. When clicking on the the "Build Connection Prefab" I'm getting the following errors:

    "missing UV data, .." etc. <--- not a problem, I'm just going to put a flat material on for now
    and

    IndexOutOfRangeException: Array index is out of range.
    EasyRoads3Dv3.OQQOCOOQOQ.OQCQQCODQC (UnityEngine.Mesh mesh)
    EasyRoads3Dv3Editor.QDOQSQDOOQDDD.OCQCCQOQDC (UnityEngine.GameObject sourceObject, Int32 connectionNum, UnityEngine.Material& mat, System.Collections.Generic.List`1& materials, Boolean recalculateNormals, Boolean recalculateTangents)
    QDDOOQOOQDDD.DoGUI ()
    QDDOOQOOQDDD.OnGUI ()

    The second one being the problem I believe... any ideas?

    EDIT:
    I've tried to get around this by creating an empty crossing prefab first and dragging it into the crossing prefab slot in the custom crossing editor but clearly there is still something wrong as shift selecting verts for connections gives me a NullReferenceException

    Cheers
     
    Last edited: May 10, 2017
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi NumT,

    The system does expect UV coordinates hence that warning message.

    Could you assign UV coordinates to your mesh in your modelling app and try again? You can also send me the mesh so I can have a look at it myself.

    In any case, I will test a mesh with no UV coordinates and make sure it gives a proper warning instead of the IndexOutOfRangeException.

    Thanks,
    Raoul
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi again,

    I think I was able to recreate the error. Did you check "Recalculate Tangents"?

    If you do this the first time when building the new prefab, the source prefab with the original mesh data is used. For calculating tangents, UV coordinates are required. If you switch off "Recalculate Tangents" all should work, or add UVs :)

    This will be handled better in the next update, thank you for reporting this!

    Thanks,
    Raoul
     
  28. jfran227

    jfran227

    Joined:
    Dec 29, 2017
    Posts:
    14
    is there a way so it does not lag the editor.
     
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi jfran227,

    Could you provide more info about your roads. How long are they, are crossings and side objects involved? And which particular action is lagging the editor?

    The scene view workflow will be further optimized but in general all should be fine. Longer roads can cause some lagging but usually they are split in sections joined by crossings which deals with this with possible lagging. If your road sections are long, I Connectors can be inserted at specific intervals, this will also give more control over LOD levels and occlusion culling.

    Regarding side objects, the guard rail example in the demo project causes lagging. This is related to calculating the normals according the "Smooth Normals" settings in the Side Object Manager editor window. Calculating these smooth normals can be switched off for Edit Mode in General Settings > Scene Settings.

    Thanks,
    Raoul

    v3: https://forum.unity.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/
     
  30. jfran227

    jfran227

    Joined:
    Dec 29, 2017
    Posts:
    14
    sorry for the late reply but I figured it out its just when I have a camera active in the game view, I think its the lighting but all is good other then that its a great asset
     
  31. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Since you mention lighting, is "Auto" switched on in the lighting window near the bottom? In that case this will continuously run in the background because of the geometry changes in the scene. It will have an impact on the performace in Scene View. I remember in the beginning when this was introduced in Unity 5 it was almost unworkable on an older computer.

    I belief we usually switch "Auto" off anyway when working on the road network. It certainly is in the development project.

    Glad to hear you like the tool.

    Thanks,
    Raoul
     
  32. jfran227

    jfran227

    Joined:
    Dec 29, 2017
    Posts:
    14
    question is there a road end or something that can blend into the terrain
     
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hi jfran227,

    Yes, that is possible. Two things are needed for that:

    1) The material on the road must use the ER Road Transparency shader.
    2) After selecting the first or last marker, look further below in the Inspector for resp. "Fade In Distance" or "Fade Out Distance" slider. These controls are locaeted near the bottom of the marker section. These sliders control the distance over which the road will blend with the terrain.

    The demo package includes various examples of this, like in the center of the scene, the dirt track towards the old farm.

    Thanks,
    Raoul

    v3: https://forum.unity.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/


    .
     
  34. Matsuguma

    Matsuguma

    Joined:
    Aug 7, 2017
    Posts:
    7
    Hey, @raoul

    Is there any way I can stop EasyRoads from modifying my terrain.asset file? Every time I press play, it modifies my asset, and it is kind of a pain for version control :/
    I'm currently using easy roads just to spawn my roads through code and then I call FinalizeObjects.

    Thanks in advance!
     
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    Hey Victor-TFG,

    Which version are you using?

    Thev play button inteferin g was a known issue with v2, not in v3. And in v3, you can set in the Build tab (middle mountain tab) how the terrain should be updated, heightmap, splatmap, vegetation etc.

    Thanks,
    Raoul

    V3 thread: https://forum.unity.com/threads/easyroads3d-v3-the-upcoming-new-road-system.229327/

    .
     
    Matsuguma likes this.
  36. Matsuguma

    Matsuguma

    Joined:
    Aug 7, 2017
    Posts:
    7
    I'm using v3, but I'm using EasyRoads through its scripting API only, not the editor.
    Is there any way to specify these update values (heightmap, splatmap, etc) through code?

    The code I'm using so far is very simple (and it basically all I need):
    Code (CSharp):
    1. var roadNetwork = new ERRoadNetwork();
    2.             var roadType = new ERRoadType
    3.             {
    4.                 roadWidth = 8,
    5.                 roadMaterial = RoadsSettings.Instance.RoadMaterial,
    6.                 layer = 1,
    7.                 tag = "Untagged"
    8.             };
    9.  
    10.             for (var i = 0; i < length; i++)
    11.             {
    12.                 // loop for creating roads
    13.                 roadNetwork.CreateRoad(name, roadType, positions);
    14.             }
    15.  
    16.             roadNetwork.BuildRoadNetwork();
    17.             roadNetwork.FinalizeObjects();
     
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,820
    roadNetwork.BuildRoadNetwork();

    Part of that is updating the terrain. Usually that is what you want, otherwise you can try the same code without this line.

    As for BuildRoadNetwork(), the heightmap will always be updated otherwise the road will float above the terrain or the terrain will break through the road. splatmap, trees, detail are optional.

    BuildRoadNetwork(bool splatmaps, bool trees, bool detail)

    Thanks,
    Raoul
     
    Matsuguma likes this.
  38. Matsuguma

    Matsuguma

    Joined:
    Aug 7, 2017
    Posts:
    7
    Oh, I see. It worked! Thank you :)
     
    raoul likes this.
unityunity