Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Cheers, i'm eager to see the feature ( it was on of the things that stopped me from using ER3D ) but anyway whenever you implement it will be welcome !

    Another request... is it possible to spawn all side objects ( when not stretched mesh is created ) to be spawned as prefabs !? Will be much easier to make changes to prefabs and have them automatically updated in scene instead of open all scene and refresh roads etc... !?
     
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi hauwing,

    What type of script is this, where is it located? I was assuming you will be using this in an editor script stored in a /Editor folder.

    Another way to do this would be by selecting the road object in the hierarchy:

    Code (csharp):
    1. GameObject go = Selection.activeGameObject
    2.  
    3. // Get are reference to the road network in the scene
    4. ERRoadNetwork roadNetwork = new ERRoadNetwork();
    5.  
    6. ERRoad road = roadNetwork.GetRoadByGameObject(go);
    7.  
    8. // Other options
    9. ERRoad road = roadNetwork.GetRoadByName("The road object name");
    10. ERRoad[] roads = roadNetwork.GetRoads();
    Thanks,
    Raoul
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi @zKici,

    We have several experimental projects, also procedural road network related. It will be released at some point. Scripting API options for this will also be added. The interface for this would probably be indeed a lot easier to create compared to full runtime road creation options.

    The focus at the moment is on expanding the road building options of the tool itself.

    Thanks,
    Raoul
     
    Last edited: Nov 27, 2021
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Vagabond_,

    This will only work for instantiated prefabs. So it depends on the side object type.

    The Mesh type of side object does instantiate the selected prefab. In v3.2 this is using the PrefabUtility class, so when this is done inside the unity editor this already works as what you are asking for. Just make sure to switch of the "Combine" option near the bottom of the Side Object Manager.

    Thanks,
    Raoul
     
  5. humanfactorsvr

    humanfactorsvr

    Joined:
    Mar 31, 2020
    Posts:
    1
    Hi. I'm Tina and am completely new to Unity and to ER3D. I have been struggling but I think I finally have all my new road types created. What I need now are crosswalks and stop lines.

    Is there a way to add crosswalks? The only connection with crosswalks is the X Crossing RA Prefab.

    I was thinking I could make a new road type (but based on an existing one) and add the crosswalk and the stop line in the texture file. I would then add that to the between the road and the connection.

    Thoughts?
     
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Tina,

    Welcome :), the current version does not include a crosswalk specific feature. I am not sure how to add this texture between the road and the connection. And since the texture may repeat on the intersection, having the crosswalk part of this may not work well.

    But two ways to do this in v3.2 is by creating a decal prefab of this crosswalk / stop line and:

    1. Add this prefab as a child to the generated connection prefab in the project folder for that road type.

    2. Add this prefab to the Start / End decal options for the specific road types. Start / End decal prefabs can be added further below in the road type section.

    V3.3, available in betas, will have new sidewalk options also including support for crosswalks, both for the road itself as on intersections. This will be part of the next beta update that will soon be available.

    Thanks,
    Raoul
     
    humanfactorsvr likes this.
  7. zh99998

    zh99998

    Joined:
    Mar 2, 2020
    Posts:
    18
    I'm using v3.2.1f1 and still has this problem.
    to reproduce:
    create a new project using unity 2021.2.4f1, import 3.2.1f1 all files, open the main scene, click road network gameobject.
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi zh99998,

    Two versions of v3.2.1f1 have been uploaded to the Unity Asset Store. One for Unity versions before 2021.2 and one for Unity 2021.2. The version for 2021.2 works well, also in Unity 2021.2.4f1.

    Did you download v3.2.1f1 from an older version of Unity 2021.2? In that case, please clear the asset store cache folder and reimport for Unity 2021.2 from the Asset Store.

    Also, the best way to test the package is by importing it in a new project. Can you try that as well?

    Or did you also import the additional demo package? This package is not yet updated for Unity 2021.2.x. It will be updated later this week. This demo uses the v3.3 beta, a version for Unity 2021.2 can be downloaded from our website. Importing the Pro version after importing demo package is also an option but the v3.3 Flex Connector used in the demo scene will not work.

    Otherwise, what is the exact error?

    Thanks,
    Raoul
     
  9. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi, is there any hint to use ER3D with World Streamer 2? I asked to WS2 developer that told me that in ER3D there's an API script ERRoadNetwork class, CenterPivotPoints() that can be used to manage the position of the network parts (roads and intersections) that otherwise are all set at 0,0,0 but I'm not vert confident with scripting so I don't know how should do it correctly.
    Thanks.
     
  10. atsakir

    atsakir

    Joined:
    Sep 28, 2012
    Posts:
    8
    Hi,

    I just purchased the pro version of ER3D and I am trying to import a real road network from OSM and have either the terrain conform to the road or the road conform to the terrain, however the indent is huge at 209.34 metres and non-editable and as a result I can't get the road to not intersect the terrain. Is there any way to edit the Indent on imported roads? The terrain is extracted from real DEM data.

    upload_2021-12-2_15-25-56.png

    upload_2021-12-2_15-26-54.png
     

    Attached Files:

    Last edited: Dec 2, 2021
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi tomobiki,

    Yes, the road network is better manageable with the objects at (0,0,0). What you want can indeed be done through the scripting API, for example:

    Code (csharp):
    1. using UnityEngine;
    2. using UnityEditor;
    3. using EasyRoads3Dv3;
    4.  
    5. public class ERAPIEditor : Editor {
    6.  
    7.     [MenuItem("GameObject/3D Object/EasyRoads3D/Center Pivot Points")]
    8.     public static void CenterPivotPoints()
    9.     {
    10.         ERRoadNetwork roadNetwork = new ERRoadNetwork();
    11.         roadNetwork.CenterPivotPoints();
    12.  
    13.         Debug.Log("Process completed");
    14.     }
    15.  
    16. }
    Can you create a new C# script in /Assets/EasyRoads3D/Editor/. And copy the above code to that script. It will create a new menu item in "GameObject/3D Objects/EasyRoads3D/"

    This can be used once the road network is completed. Note that editing road objects afterwards will reset the positions back to (0,0,0).

    Thanks,
    Raoul
     
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi atsakir,

    The default Indent values are low. Since it is impossible to add detail points to the Unity terrain object, this Indent value is adjusted according the terrain object settings in the scene when necessary, specifically the terrain size and heightmap resolution which define the density of terrain points.

    So this Indent value is necessary to guarantee the best possible terrain deformation. It seems your terrain size is either quite large or the heightmap resolution is low.

    Thanks,
    Raoul
     
  13. atsakir

    atsakir

    Joined:
    Sep 28, 2012
    Posts:
    8
    Hi Raul,

    indeed the heightmap resolution is low and the terrain quite large but... those are the requirements of the application which is for Android and WebGL. Is there any way to override the default minimum indent through the API? Or is the only way to get around the problem to split the terrain in multi-terrain tiles?

    upload_2021-12-2_15-58-12.png

     
  14. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Just wondering when the update will be for the Roundabout option that we talked about?

    Thank you
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hi atsakir,

    What is the terrain size and heightmap resolution? When turning on one of the wireframe shading modes and zooming in to the terrain it gives a clear idea of the terrain point density. These are the points available to adjust the terrain to the road network.

    The terrain is quite large and the heightmap resolution is actually rather low. The calculated 209.34 Indent value is correct, so this terrain setup is not really suitable for a road network unless when it is flat.

    The only alternative for this terrain is to switch of terrain deformation and have the roads snap to the terrain but since your map shows intersections and multiple roads I am not sure if that is what you want.

    Multi terrain tiles is indeed an option.

    Thanks.
    Raoul
     
    Last edited: Dec 2, 2021
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi @zKici,

    This is done, tomorrow the version update will be available.

    Thanks,
    Raoul
     
    zKici likes this.
  17. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Thanks!!!! I'll try with it
     
    raoul likes this.
  18. jason0663

    jason0663

    Joined:
    Dec 4, 2020
    Posts:
    36
    Hi, Ive made a road and connection network for my terrain. I have set indent and surrounding smoothness the same for all roads. When I I build only some of the roads correctly display the surrounding smoothness, the indent is fine, just the surrounding smoothness is not correct on all. What am I doing wrong? Unity 2019.4 and EasyRoads v3
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi jason0663,

    Do you mean the terrain is not adjusted according the surrounding settings? In that case, there are no known issues with this, so it is hard to give feedback at this moment. Can you show images with the highlighted surfaces on, and the result in Build Mode?

    Or does the smoothness button in Build Mode does not change the shape? In that case, what is the surrounding value? Because the area will smoothen over this area. So the more terrain points in this area, the better the smoothen option will work.

    Thanks,
    Raoul
     
  20. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Raoul,

    I'm having a couple of small sidewalk issues. This is in ref to the current v3.3beta.

    https://imgur.com/a/eM2I6Fc

    In the first image, with the arrows, you can see that there is a space between the road and the curb of the sidewalk (highlighted by a white cube)

    The second issue is the outer curb, I would like to be able to change the height so that the curb is lower than the road's height. I am using CScape for street Blocks and Buildings, I need to place the Streets a little higher than the CScape Blocks so they don't intersect. But when I do that, there is this gap between the bottom of the outer curb and the CScape Block.

    Have a great weekend
     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi James,

    Looking at the image, do you mean space vertically? Sidewalks in the v3.3 beta start at the same height as the road default height. I assume the road shape height is at least 0 or higher?

    How much is a "little higher"? Is raising the default street height an option? The sidewalk will be created relative to the default y = 0 so it will be lower than the roads's height on the outside.

    Thanks,
    Raoul
     
  22. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Yes

    The CScape Blocks (the area that the buildings are placed) are all at position.y = 0

    The ER3D road markers are all set position.y = 0.115

    This is to insure that the Blocks do not appear through the Road. I can't really move the Blocks to the sides of the Roads, I mean I could... but it could be another issue... that's why I am asking if the height of the curb can be a tiny bit lower than the ER3D Road. To insure that there is not a gap.

    Which brings me back to the first question. The first image shows only the ER3D Road and sidewalk, and yet there is a small gap between the road and sidewalk (see arrows)

    So it's not really the "height", it's being lower than the road so that there is no gap. (I HOPE that clarifies)
     
  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I assume you arereporting this gap as an issue? In that case, please have a look at the sidewalks in the demo scene. There is no vertical gap between the road and the sidewalk. So the question is, what is causing this in your scene? What are the road shape settings for example?

    Of course there is always an option to add additional options for the outer curb height. But at the same time I am trying to keep control options as limited as possible to avoid the interface becoming overwelming with many options that may not really be necessary. That is why I was asking if the suggestion in my previous post was an option. That is something that is already doable with the current options. I will make a note of this.

    Thanks,
    Raoul
     
  24. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    I'll look into these, thanks for the quick response.
     
  25. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    oh FFS! I'm a complete idiot. The sidewalk issues I spoke of yesterday, at least the outer edge, where SHADOWS. (kids: don't code under the influence of stupidity)

    Raoul, I am very sorry for wasting your time.
     
  26. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    I'm getting a weird error which stops Easy Roads from working when I import the demo project. I think it's an issue with the DLL.

    Any idea
     
  27. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    It'll be of help to Raoul if you can post the exact error, please.
     
    raoul likes this.
  28. numbers1234

    numbers1234

    Joined:
    Jan 5, 2019
    Posts:
    31
    How do I properly adjust the scale of easyroads3d? My world is at a 3:1 scale, increasing the width of the roads leads to distorted textures on connector pieces.
     

    Attached Files:

  29. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126


    My mistake, here

    MissingFieldException: Field not found: EasyRoads3Dv3.ERModularRoad EasyRoads3Dv3.ERModularBase.OCODDOCCDO Due to: Could not find field in class

    This stops Easy Roads from working, the game itself is still playable.

    Edit: So the fix to this is to just import Easy Road Pro again after importing the demo package.
     
    Last edited: Dec 4, 2021
    JamesWjRose likes this.
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi James,

    Is that related to the outer edge request you had? Is that resolved or would you still like to be able to set the height of the outer curb so it can reach to lower below the road?

    Thanks,
    Raoul
     
  31. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi keithsoulasa,

    Which version of Unity is this?

    Unity 2021.2 requires an update of the demo package. This update was uploaded to the Asset Store on Friday, but it is not submitted yet. This will be done tomorrow on Monday so we can also test right after the package is improved. The update includes the v3.2.1f2 changes and HDRP 12.1.1 support.

    The demo package should work just fine for Unity 2021.1 and older.

    Thanks,
    Raoul
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi numbers1234,

    First of all it is recommended to use a scale of 1 Unity unit is 1 meter.

    But regarding your situation, looking at the image, the size of the crossing is adjusted to the road width. So I assume the road with was updated in the road type settings? That is indeed the way to do this, that way connections on crossings that use this road type will auto adjust.

    What is visible is that the line marking in the corners do no longer follow the corner. This can be adjusted by selecting the actual crossing object in the hierarchy and in the Inspector look for the ER Crossings component that also shows the EasyRoads3D toolbar.

    Corner / Sidewalk Settings > Inner Segment Distance

    Adjust this value so it covers the area with the outer line marking. The white line will follow the corner.

    You want to actually do this on the specific prefab in: /Assets/EasyRoads3D/Resources/dynamic prefabs/

    Thanks,
    Raoul
     
  33. numbers1234

    numbers1234

    Joined:
    Jan 5, 2019
    Posts:
    31
    Thank you for the reply. Loving the program and the beautiful meshes it produces.
     
    raoul likes this.
  34. tatien

    tatien

    Joined:
    Jun 24, 2014
    Posts:
    5
    Hi Raoul,
    I'm having this error when working (editing/refreshing/ etc) with side object, it put unity scene tab in a lock state.
    Using Unity 2021.2.5f1 and ER v3.2.1f2

    Edit:
    I think it's mainly occurs when using retaining wall with shape object and one node with a terrain snap weight of 1.
    My terrains are in different scenes (one scene per terrain) and the road network is in it own scene.


     
    Last edited: Dec 5, 2021
  35. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi, my project is made with a terrain that is 20 x 20 km, sliced in 1 x 1 km tiles. On this terrain I'm going to add a road network made with Easy Roads 3D. Can I add a single road network that crosses the different tiles of terrain or it won't work because it needs a only one terrain? Thanks!
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi tatien,

    It is hard to give feedback with the current info. What does the road network look like? Can this indeed be isolated to the retaining wall side object and is this the exact same walle xample as in the demo package? Is it possible to send the scene to us by email?

    Thanks,
    Raoul
     
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi tomobiki,

    Multiple terrain objects is supported and the road network can be in a separate scene. That way it can be used for all terrain tiles / scenes.

    Thanks,
    Raoul
     
  38. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Thanks to you!!!
     
  39. keithsoulasa

    keithsoulasa

    Joined:
    Feb 15, 2012
    Posts:
    2,126
    2021.2

    Thank you for the quick update!
     
  40. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Hey @raoul ,

    I have (accidentally) found out that cathegorys are a feature now ^^´ however I seem to have a bug. I renamed my already existing road types and tried to change thier names to "In_Town/4L_A_SW" and "In_Town/2L_A_SW". So they should both be in the "In_Town" tab when selecting a roadtype. But instead the tab "In_Town" exists twice. One for each roadtype.

    https://imgur.com/gxTxQEw

    Or did I something wrong? Still using unity 2019.4.14f1 and ER v3.2.1f1.

    Thanks
     
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Marcell,

    Road type categories is not a feature yet. The sub menu layout is something that Unity will automatically do when using / in the name. It cannot be used to create road type sub menus.

    Thanks,
    Raoul
     
  42. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    275
    Oh :D do you think you could use this as a base? This seems like a perfect chance.
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Probably for the interface to show road type categories and select road types in categories. But as you saw with the two added road types, more is required on the backend so categories are stored separately.
     
    marcell123455 likes this.
  44. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    hi raoul, just trying out the new update, and i am still unsure how to do the roundabout with the 4 exits equally positioned on the 45 degree angle around it.

    Is there mathematical numbers I should use for the Radius, width, position etc to achieve this

    Can you give me any pointers?


    upload_2021-12-6_10-16-6.png
     

    Attached Files:

  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi zKici,

    The number of required points will be calculated based on the radius, the resolution and the number of connections. When adding connections, the new connection will be positioned at similar angles based on the previous connection. So at the moment, all next connections are positioned relative to the first connection. That is the only thing to take into account.

    Also new is the option "Distribute Connections Evenly" in the General Settings at the top. This too takes the position of the first connection as the starting point.

    Thanks,
    Raoul
     
  46. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Perhaps I am blind I cannot see the Distribute Connections Evenly option. Can you share a screenshot?
     
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    roundabouts.jpg

    Thanks,
    Raoul
     
  48. zKici

    zKici

    Joined:
    Feb 12, 2014
    Posts:
    438
    Oh, I may not have that then?

    upload_2021-12-6_14-34-16.png
    upload_2021-12-6_14-34-31.png
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Strange, I took the screenshot from the build we use internally. I will check tomorrow, perhaps it was added to the v3.3 beta but I don't think that is the case.
     
    zKici likes this.
  50. slamon

    slamon

    Joined:
    Oct 11, 2014
    Posts:
    13
    Hello, Raoul! Thanks for your update of DemoProject, it's very usefull.
    I have question (sorry, if some has already asked you about it).
    Can I use FlexConnector to unite 2 single motorways and 1 double motorway2x2 ?
    Another question: how can I make exit (or entrance) from a motorway2x2 ?