Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    509
    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:
      739
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  3. JamesWjRose

    JamesWjRose

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

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    276
    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?
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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
     
  6. Noa3

    Noa3

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

    raoul

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

    Thanks,
    Raoul
     
  8. 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:

  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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
     
  10. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    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.
     
  11. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,686
    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.
  12. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    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.
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  15. Darthlatte

    Darthlatte

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

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  17. Darthlatte

    Darthlatte

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

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    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.
  19. Baldinoboy

    Baldinoboy

    Joined:
    Apr 14, 2012
    Posts:
    1,526
    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?
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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
     
  22. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    Thats a really clever solution - thank you:)
     
  23. protopop

    protopop

    Joined:
    May 19, 2009
    Posts:
    1,561
    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.
     
  24. protopop

    protopop

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

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    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).
     
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  27. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    20
    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.
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  29. Baldinoboy

    Baldinoboy

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

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    20
    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
     
  31. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    20
    @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
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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
     
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  34. xkinginthecastlecastlex

    xkinginthecastlecastlex

    Joined:
    Nov 7, 2018
    Posts:
    93
    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
     
  35. ceebeee

    ceebeee

    Joined:
    Mar 7, 2017
    Posts:
    395
    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.
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  38. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    20
    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 ?
     
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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
     
  40. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    20
    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).
     
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    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
     
  42. 05cordie

    05cordie

    Joined:
    Sep 30, 2015
    Posts:
    8
    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:

  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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
     
  44. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    20
    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 ?
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  46. 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
     
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    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.
  48. raoul

    raoul

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

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

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,295
    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
  50. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    20
    Hi Raoul,
    Thanks for the fix, any idea when it comes live ? On the same subject, it is possible to keep the layer settings of the original gameobject ?

    An other improvement that we thought, it is to let the possibility to organize the connection prefab in folder (or juste create spoiler to hide/show some of them), because we got something like 50 different junction prefab, so it is a bit hard to organize them actually :)