Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. Want more efficiency in your development work? Sign up to receive weekly tech and creative know-how from Unity experts.
    Dismiss Notice
  4. Build games and experiences that can load instantly and without install. Explore the Project Tiny Preview today!
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

EasyRoads3D v3 - the upcoming new road system

Discussion in 'Works In Progress' started by raoul, Feb 19, 2014.

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    That script is not using the scripting API or any prefab. It will simply reset sidewalk settings and activate all sidewalks.

    I would think you are using custom sidewalk settings, active on one side of the road, inactive on the other side. And that somehow is not longer in sync between some prefabs connected by the same road. That is why I mentioned checking the sidewalk corner handles of these connections and make sure they are either both white (inactive) or green (active).

    That is what I would check first on a crossing prefab that raises that specific warning message.

    Thanks,
    Raoul
     
    JamesWjRose likes this.
  2. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    341
    Why this surrender area of road it too wide? I need to make it a lot more thinner! almost near the road surface. But I can't find a parameter to make it thinner :confused:
     

    Attached Files:

    • ER.png
      ER.png
      File size:
      2.1 MB
      Views:
      34
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi Crossway,

    That is related to my reply to your previous post.

    The Surrounding area can be made smaller. What is wide in your screenshot is the Indent area. This is the terrain area that needs to be aligned with the road height. It is based on the heightmapscale of your terrain, heightmap resolution vs terrain size. There will not be enough terrain points available to level your terrain with road if these surfaces would be smaller. The terrain will either break through the road or the road will float above the terrain.

    To make these surfaces smaller, either the terrain size should be smaller or the heightmap resolution higher. That way more terrain points will be available near the road.

    These temporary surfaces do look wide, or is the road narrow? What is your terrain heightmap resolution and terrain size?

    Thanks,
    Raoul
     
    Last edited: Nov 17, 2018
    Crossway likes this.
  4. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    189
    Thanks for the detail response. I'll look into it.
     
  5. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    151
    I tried to run the Windridge City demo but I got compiler errors due to missing type or namespace name..

    PostProcessing
    PostProcessVolume
    postProcessProfile

    How can I fix the problem?
     
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi Jeff,

    We did not make the Windridge Scity scene, it is published by Unity itself and the errors are not EasyRoads3D related :)

    I will see if I can find out more info.

    Thanks,
    Raoul
     
  7. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    57
    Did you have allready ímported the latest version from the Unity PackageManager?
     
    raoul likes this.
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    That is indeed mentioned in the asset description.

    Thanks,
    Raoul
     
  9. jamqdlaty

    jamqdlaty

    Joined:
    May 31, 2015
    Posts:
    8
    Yes, this error pops up when I drop my object into source object slot. I'm attaching obj packed (can't attach obj). I also tried with simplified start/end elements of the mesh (one edge loop removed), but same thing happens.
     

    Attached Files:

  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi jamqdlaty,

    I had a look at the .obj. Which version of EasyRoads3D do you use?

    After importing the .obj in the project I noticed in the import settings that it has no UVs assigned. When dropping the object in the Source Object slot this is confirmed, EasyRoads3D will throw a warning message mentioning that the mesh has no UV assigned. But this should not break the functionality. See the below image.

    In previous versions however this situation where no UVs are assigned to the message, did throw an error.

    Also, it appears that that pivot point is not near the center of the bounding box of the object. This results in the barrier being generated away from the road. It is recommended to have the pivot point near the center of the bounding box and use the side object X Position to position it relative to the edge of the roads. That way the same side object can be used instantly on road types with different widths.

    soUVs.jpg


    Thanks,
    Raoul
     
  11. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    876
    I want to make my AI walk down roads by following a list of transforms.

    Is there a way to export or extract the road points as a bunch of gameobjects?

    Kind of like if the road points you can select in road editing were extracted to seperate gameobjects that exist in the scene, and we could use that for a variety of rod effects.
     
  12. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    4,458
    Not an official answer, but the first thing I think of is "side objects." Maybe you can do side objects that are offset into the road as waypoints?
     
    protopop and raoul like this.
  13. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    57
    pls look a search here for a Easy Roads traffic plugin, or look at https://forum.unity.com/threads/eas...-new-road-system.229327/page-119#post-3869110

    this both will help you to create transforms based on road shape.

    i writing in my free time a Traffic Plugin too but wait for the new version of Easyroads becuase it will make some things a lot more easy.
     
    Mark_01, protopop and raoul like this.
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi protopop,

    It depends on what you need. hopeful suggested side objects in his post. That way you have full control over positioning. This approach could currently also be used for lane specific waypoints.

    Previously there was an option that generated waypoints in the center of the road. Currently this info is available through the scripting API.

    Below is a script that simulates the previous waypoint system (empty gameobjects every X distance in the center of the road) using the scripting API. The distance can be defined in the script.

    Thanks,
    Raoul
     

    Attached Files:

    Last edited: Nov 19, 2018
    Mark_01, protopop and hopeful like this.
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi Noa3,

    Lane info can be defined for road types in the first v3.2 beta. Support on crossings is implemented for the new Flex Connector.

    LaneConnectors.jpg

    By default connections will be auto generated between right /left lanes for all involved connectors but this can be customized.

    Thanks,
    Raoul
     
    Last edited: Nov 19, 2018
    JamesWjRose and Noa3 like this.
  16. Darthlatte

    Darthlatte

    Joined:
    Jan 28, 2017
    Posts:
    19
    Hi, does this asset work in Unity 2018.3 (with HDRP)? And will it work with Vegetation Studio Pro? Thanks
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi Darthlatte,

    Unity 2018.3 is supported.

    The provided road types / materials are not yet HDRP optimized. But you can create your own road types in General Settings > Road Types and assign your own materials.

    Vegetation Studio Pro is fully supported in the current v3.1.2. This can be activated in General Settings > terrain Management where global perimeter values per vegetation type can be set. This can then be further customized per road type.

    Thanks,
    Raoul
     
    Last edited: Nov 19, 2018
    Mark_01 and Darthlatte like this.
  18. Darthlatte

    Darthlatte

    Joined:
    Jan 28, 2017
    Posts:
    19
    Great thank you :)
     
  19. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    57
    it looks promissing and awsome!
    i hope this will work like i imagine and maybe i can post some source later here
     
    Mark_01 likes this.
  20. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,224
    Hi Raoul,

    Want to get your asset but just wondering if after placing all the roads, rivers can I then just have those as geometry. With a custom shader and texture, and then include that road in an asset store project, or do the roads need the EasyRoads3D folder to work, even after placement?
     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    All raw data will be accessible through the scripting API. A simple traffic example will probably also be available. This might be expanded over time.

    Thanks,
    Raoul
     
    Noa3 likes this.
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi Baldinoboy,

    This is using ordinary Unity game objects with a mesh renderer / material attached. You can create your own road types with materials. You can chose to store the mesh assets in the project folder. And there is a .obj export option.

    Once all work is done the road network can be finalized. This is an optional process in general but that is probably what you want in your case. EasyRoads3D is no longer involved from that point.

    Thanks,
    Raoul
     
  23. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    876
    Thats a really clever solution - thank you:)
     
  24. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    876
    Thank you:) Yes empty gameobjects are what i need - just to use as transforms in a list of a path. I was thinking of getting the actual road points we place ourselves, but off the top of my head i think equidistant markers is the same functionally. Thats a good point too about the lane specific waypoints using offest side objects if we need to have two way traffic. But i think one lane will work for me since its just medieval roads with travelers who have ai navmesh agent components so they can move around each other.
     
  25. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    876
    Neat - the whole GetSplinePointsCenter() function is good to know about too - thanks for sharing:)
     
  26. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    233
    I also got this pink problem with the HD Pack, I noticed when importing the HD pack on top of EasyRoads3d (with the free additional demo scene installed as well), There was this conflict:



    It seems the HD pack has a copy of the same shader (that already exists) with a different GUID. This is likely why everything goes pink.


    I manually fixed the problem by dropping the shader onto all the pink materials. However, there's a different but possibly related issue with this HD pack afterward, when I tried the Demo scene in the HD Package. I can't put it into words, so I've made a video.



    Initially I wasn't happy about how the decals pop in and out at such short distances, but I stumbled on the "Terrain Z Fighting Offset" settings on the shader, so I think that will correct it (They probably should have been tuned better for the demo). But this thing where the terrain just suddenly pops into the road at close distance, I have no idea why that is happening or how to correct it. I read through the "known issues" and "Troubleshooting" but don't see anything about this in either. (nor mention of the decal z fighting issue either coincidentally).
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi ceebeee,

    That is correct. The HD Roads package does include a slightly different version version of the ER Road Transparency shader. They are conflicting. Some changes were made in the latest version but that doesn't seem to have fully solved it. For the next update we will rename the shader path name so there is no conflict anymore.

    The fix for the pink material is indeed simple (this is related to decal prefabs). The shader on the material should point to /EasyRoads3D/ER Road Transparency.

    Regarding the video, The terrain does almost match the road network in Edit Mode, but not entirely. is this video made with the road network in Edit Mode or in Build Mode (0.54 in the video)? In Build Mode the terrain is fully flattened according the road shape.

    Then I see an issue with the crosswalk and a line marking. I had a look in the package (we did not make this package / scene ourrselves). Indeed I see the same thing. These two objects are added manually in the scene, they are parented to "manually Placed Decals". These objects will not adjust to the road shape. The problem here is that the road surface underneath these object is not flat. I will fix that in the demo scene.

    The "Terrain Z Fighting Offset" options in the material are available in the latest ER Road Transparency shader in the Pro and demo package itself. So it seems currently this shader is assigned instead of the HD Roads version. Could you try opening "/Assets/NatureManufacture Assets/Shaders/ER Road Transparency" and change the shader path a little bit like "EasyRoads3D/ER Road Transparency - HD Roads" so it doesn't point to the same "EasyRoads3D/ER Road Transparency" and then select this shader on all HD Roads decal prefabs?

    Thanks,
    Raoul
     
    Last edited: Nov 20, 2018
    ceebeee and Mark_01 like this.
  28. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    7
    Hello protopop,

    I'm actually working on a IA system from the Roads Network of EasyRoads.
    To Generate path on the roads my approach was to define for each road type the number of lane on it (one way, 1x1, 2x1, 2x2..ect..). And then use GetSplinePointsCenter() and GetSplinePointsRightSide()/GetSplinePointsLeftSide() to find the waypoints of my path.


    Code (CSharp):
    1. private static Vector3[] GeneratePath(Vector3[] center, Vector3[] side)
    2. {
    3.             Vector3[] waypoints = new Vector3[center.Length];
    4.             for (int i = 0; i < waypoints.Length; i++)
    5.             {
    6.                 Vector3 delta = center[i] - side[i];
    7.                 waypoints[i] = center[i] - delta / 2;
    8. // here if you got a 2x2 lane, divide by 3, if 3x3 divide by 4..ect..
    9.             }
    10. return waypoints;
    11. }
     
    Mark_01, JamesWjRose and raoul like this.
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi fmarianacci,

    For a pure coded solution, that is indeed the currently recommended approach. The side object option does not require coding.

    As mentioned above, in v3.2 all this data will be directly available through the scripting API, both for roads and crossings provided that you work with road types (also on crossings) which is highly recommended.

    Thanks,
    Raoul
     
    JamesWjRose and fmarianacci like this.
  30. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,224
    Great! Exactly what I need. Thank you @raoul!
     
    raoul likes this.
  31. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    7
    Thanks for your feedback Raoul,

    Any ETA for this 3.2 ? :)

    Because I built a large system on top on easy roads to include path on custom prefab (for any kind of junction, crossing, circle, exit/entry of Highway..ect..), and to connect those paths to the paths of the roads. More a bunch of settings like define the priority of each road, the speed on them ect...

    So if you tell me you release a new version to improve some of these feature in few weeks... it will be awesome
     
  32. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    7
    @raoul I got a question about the "Refresh instance" button on the inspector of custom prefab, how to use it ? It seems to be disable. And how it works.

    See the screenshot there:
    https://prnt.sc/lkqdev

    I don't find any things about it in the documentation, but I guess it update the instance of the prefab
     
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    No ETA yet, but a first beta will probably be available within a few weeks. You mention custom prefabs, auto generation for lane splines on crossings is currently added for the new Flex Connector. As you say, custom prefabs can be of any kind. It will probably be hard to accurately generate these splines automatically. More options will be required to control the shape. This will be added. but perhaps not yet in the first beta.

    Thanks,
    Raoul
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    That "Refresh Scene Instances" button is related to built-in dynamic crossing prefabs. This is indeed disabled for custom prefabs.

    What exactly is your situation? If the source model of a custom prefab has changed the prefab can be updated through the Custom Prefab Editor window. After pressing "Apply" you will be asked if scene instances should be updated. This is also the case after changing the assigned connections for custom prefabs.

    Thanks,
    Raoul
     
    fmarianacci likes this.
  35. xkinginthecastlecastlex

    xkinginthecastlecastlex

    Joined:
    Nov 7, 2018
    Posts:
    45
    hi there,
    I saw in your product description EasyRoads3D Pro v3 supports the ability to build roads in runtime.
    Unfortunately I wasn´t able to find any tutorials or documentation how to achieve that. Could you please describe how this could be done?

    Many thanks in advance
     
  36. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    233
    This could be the case, It was in whatever mode I found it to be in when I opened the demo. I tried "Build Terrain" and then "Finalize" and it did improve the situation quite a bit. (though there was still some pokethrough. I guess it just needs some further TLC to fix on my end.

    The tricky part is the HD overwrite so there is no other shader. but in the second case, I unchecked that shader so the materials wouldn't break. It's was pretty confusing because I didn't understand why there would be a different shader, or which it should be using. But if I understand correctly, the HD shader has the Z Fighting options removed because they are supposed to auto-conform to the road.I'll make a copy of the original shader, then import the HD shader and name it HD and try that way.

    EDIT: Indeed the HD version of the removes the need to manually adjust the z fighting parameters.
     
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi xkinginthecastlecastlex,

    The main EasyRoads3D Pro package includes a runtime scene example using the script /Assets/EasyRoads3D/scripts/runtimeScript. A road will be created and afterwards an objects follows the road. It is done using the scripting API documented here:

    http://unityterraintools.com/EasyRoads3D/v3/html/scriptingAPI.html

    A quick example based on 4 marker control points:
    Code (csharp):
    1. ERRoadNetwork roadNetwork = new ERRoadNetwork();
    2. ERRoadType roadType = roadNetwork.GetRoadTypeByName("Default Road");
    3. Vector3[] markers = new Vector3[4] { new Vector3(0, 0, 0), new Vector3(0, 0, 100), new Vector3(50, 0, 150), new Vector3(0, 0, 200) };
    4. ERRoad road = roadNetwork.CreateRoad("road 1", roadType, markers);
    5. roadNetwork.BuildRoadNetwork();
    Thanks,
    Raoul
     
    JamesWjRose and Mark_01 like this.
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi ceebeee,

    The scene comes in Edit mode. "Finalize" will only remove all EasyRoads3D script components so it will have no affect in this case.

    The HD Roads version has the Offset hard coded in the shader with a value of -2. The other main difference is that it has occlusion added matching the other HD Roads shaders.

    Thanks,
    Raoul
     
    Last edited: Nov 20, 2018
    ceebeee likes this.
  39. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    7
    Hi Raoul, thanks for your answer,

    We try this process to update the prefab instance, it works but that break all the connections of the instance prefab, anyway to hold the connections of a custom prefab when we update his mesh ?
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi fmarianacci,

    In what way is your custom prefab updated?

    Both for dynamic built-in and for custom prefabs, connecting roads works by snapping vertices. If the connection shapes of a custom prefab change, indeed roads will be disconnected from updated scene instances.

    Thanks,
    Raoul
     
  41. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    7
    Hi Raoul,

    The way you describe it. When we press Apply and ask to refresh the scene instances of our custom prefab.

    We have a large map (about 400km²). So we will have a very huge numbers of junction on the map. So an option to easily update all instance (and keep road connected), it we'll be good. On what I understand of EasyRoad, if you disconnect the road after an update, you know witch road is connected to the junction. So what about add option to try to reconnect the roads to the junctions we update ?
    In few case this will broke some things and/or create some graphics bugs, but in the most case it will work fine (for small junction/vertices update).
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957

    Hi fmarianacci,

    Compared to the built-in crossing types, custom prefabs can be more complicated because they are based on imported meshes. In what way is the custom prefab itself updated? Which situation should I check?

    Prefab updates can include mesh changes, mesh changes not involving road connections and changes that do involve road connection changes. Multiple custom prefabs can be involved with similar road connection shapes. Changing the connection shape of one of them will cause a conflict, a shape mismatch. Which of the two should the road in between use and how can it still connect to the other custom prefab?

    The same applies when the same mesh is used but the connection shape has changed (more or less selected vertices for a connection).

    But when a custom prefab update simply involves a new connection being added in the Custom prefab editor itself, the scene instances should always update just fine with the roads still connected.

    For a large scene and when multiple custom prefab updates are involved it might be more efficient to add a prefab refresh to the "Refresh Road Network" option. In that case "No" should be selected when asked to update scene instances. That way roads do not get disconnected.

    Thanks,
    Raoul
     
  43. 05cordie

    05cordie

    Joined:
    Sep 30, 2015
    Posts:
    5
    Hi everybody,

    I am using EasyRoads for my project and I am facing a strange issue. Everything works well in Editor but once built (Windows standalone) there are road texture degradations... Not right at start but when you get for example 1000 away from starting point.

    I cannot figure out where it comes from... Any idea ?
     

    Attached Files:

  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi 05cordie,

    That is related to UV floating point inaccuracies indeed further away on longer roads. It can be resolved by inserting I Connectors which can also be useful regarding LOD Groups. Crossings also break roads in shorter sections

    Or you can switch of compression for UV0 in Player Settings > Vertex Compression.

    Thanks,
    Raoul
     
  45. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    7
    Hi everyone,

    I create some sideobjects on my road, the mesh of the sideobject are combine. On my the MeshRenderer of the Source Object I disable the shadow, but on the combined Mesh the shadow are still "On". Anyway to keep this settings on the Combined MeshRenderer ?
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi fmarianacci,

    I just tested this. I get the same results. This will be updated so combined sideobjects will only cast shadows if the source prefab does. Thank you for reporting this!

    Raoul
     
    hopeful likes this.
  47. CrIxX91

    CrIxX91

    Joined:
    Sep 9, 2015
    Posts:
    9
    Hello, I have a problem since I bought the add-on hd, I can not get everything to work, now I need the T and X crosses but I get this line and I can not fix it.

    Unity_2018-11-28_13-03-17.jpg
     
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    Hi CrIxX91,

    The material values of the HD Roads package were set with Color Space Rendering set to Linear in the Player settings. If this is set to Gamma there are some materials that look like those in your screenshot.

    So please try Linear for Color Space rendering or look for the "Main Road Detail Albedo Power" slider in the material and lower the value.

    Thanks,
    Raoul
     
    CrIxX91 likes this.
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    3,957
    @fmarianacci, this is fixed in the next update

    Thanks again for reporting this,
    Raoul
     
    JamesWjRose likes this.
  50. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    535
    Apologies for cross-posting, but this is a very powerful must-have combination imo :D

    Using EasyRoads3D with Vegetation Studio Pro and Meadow Environment. It's really awesome to have your biomes and drag the road through it and everything gets masked automatically. Super quick & easy workflow :)

    easy roads 07.jpg
    easy roads 08.jpg
    easy roads 09.jpg
     
    Last edited: Nov 29, 2018