Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. Walton

    Walton

    Joined:
    May 2, 2015
    Posts:
    78
    @raoul yes you are correct im trying to create a sidewalk that follows a road.... if these are ment to be used as side objects please can you explain how i can use them to follow a road..

    Thanks
     
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, in that case, for built-in road types and crossings, sidewalks can be added through the sidewalk system part of EasyRoads3D. This system will be further upgraded in v3.2

    Because sidewalks are currently not supported on custom connection prefabs like the crossings in the HD Roads package, they are added as side objects in this package.

    Please check the below video starting at 1.35



    Side objects can also be auto activated on road types in General Settings > Road Types.

    Thanks,
    Raoul
     
    Last edited: Mar 2, 2019
  3. Walton

    Walton

    Joined:
    May 2, 2015
    Posts:
    78
    Sidewalk error 4.jpg
    Ok ive watched the video and tried as you can see from the picture... ive just used the default road and selected the curbstone from the side objects and it does not show like in the video... many other side objects do no show either
     
    Last edited: Mar 2, 2019
  4. Walton

    Walton

    Joined:
    May 2, 2015
    Posts:
    78
    Sidewalk error 5.jpg @raoul also i have noticed that i don't Sidewalk error 5.jpg have as many side objects in props as you do... (see picture)
     
  5. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    I'll prepare a simple project for you to fiddle with, give me some time though to prepare a proper test scene. I'll contact you through mail when and where it will be available.

    Thanks,
    Wim
     
  6. Walton

    Walton

    Joined:
    May 2, 2015
    Posts:
    78
    @raoul

    A quick update i have some of the side objects working although some don't show

    Thank you for your help
    I said i would get there in the end, but i think some step Sidewalk error 6.jpg by step tutorials work be great for noobs like me....:)
    The only thing i can see wrong and you can see in the picture is the lines fade out in the distance... any idea

    Fixed the fading lines.... "Aniso Level"
     
    Last edited: Mar 2, 2019
  7. cygnusprojects

    cygnusprojects

    Joined:
    Mar 13, 2011
    Posts:
    767
    Hi @raoul, send you a mail (in Dutch) with the location of the sample project and how to reproduce the issue.
     
  8. raoul

    raoul

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

    We are mixing assets now.

    The side object in your last screenshots is an HD Roads sid eobject, which was the topic. The side objects in the other posts are EasyRoads3D fdemo package related.

    Which of these side objects do not show when toggled on.

    Whether side objects will instantly show depends on the "default active state for each marker" status in the Side Object Manager. Some times side objects will only be active on a small number of markers. In that case it is more efficient to not auto activate these side objects by default on all markers. Instead activate it on the desired markers. This is the case for example for bridges.

    The demo package is primarily intended for learning purposes. It includes zones with red lights pointing to tutorials on our website, also side object related, where the above is covered too.

    Regarding fading out lines, indeed this does sound texture import Aniso level related.

    Thanks,
    Raoul
     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Thank you! I will look at it.
    Raoul
     
  10. burnabao

    burnabao

    Joined:
    Jun 14, 2018
    Posts:
    1
    Hi - I'm using Unity 5.2.3. I had no problems using a previous release of EasyRoads3D Pro in this Unity version but I tried to import the latest EasyRoads to my project from the asset store but it says I need to upgrade my Unity version in order to do so (which I can't because of other packages I need to use). Is there any way to download previous EasyRoads version which will work with Unity 5.2.3? Thanks
     
  11. raoul

    raoul

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

    Which version did work for you? I belief indeed that early v3 betas did work on Unity 5.2.3

    Unity 5.2.3 is quite a while ago, at some point we have to move forward. At the moment Unity 5.6 and up are supported.

    The current versions are not tested in Unity 5.2.3 but the limitation mentioned on the asset store is more referring to the version of Unity that was used to upload the package to the asset store. Although there are no guarantees it will work, you could use Unity 5.6 to download the package and then import it in 5.2.3. The problem here might be the prefabs not importing well.

    Something else you could try, the free demo package also includes the legacy v3 beta package with beta assets. You could try importing this package first, then import the v3 dll's only from the current 3.1.5 package.

    Thanks,
    Raoul
     
  12. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    Hi there. I just upgraded to V3 from a 5 year old Easy roads version... I am primarily using easy roads to place fences down. The new version is great but I am running into an issue.

    In previous versions, I used the procedural mesh object to generate my fence lines. This would properly align all fences and I would still have seperate fence objects I can access later.

    In the new version, procedural mesh objects automatically get combined into a huge mesh which is not what we need. We have desctructible fences in the game, and we need each object to be seperate.

    Using the "Mesh Object" side object type does only help a little bit, because using it, fences are not properly aligned and anything curvy looks awful. I have to manually rotate these fences back to fit, which takes me hours to do, as we have literally several thousand fence objects in our scenes.

    Here is a screenshot comparing it.








    Is it possible to somehow make it so that fences properly align using the mesh object type or to have access to the indivudal fence prefabs using the procedural mesh object type?


    Thanks
    Nico
     
  13. raoul

    raoul

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

    The concept of the mesh type and the procedural side object type is the same between v2 and v3. Indeed the procedural side object type results in one single mesh.

    For the Mesh Object type, did you try the "Mesh Bounds Alignment" checkbox below the X Y Position / Rotation options? It is currently toggled off in your screenshot. When toggled on each instance will align with the previous instance. This also displays a button "Match Bounds" next the float field "Distance between objects". This is useful for side objects like fences. To get the desired effect like in your screenshot the distance after pressing this button needs to increase a little bit to get the small gap between instances.

    I belief the bootcamp fence in the v3 demo package is set up in a similar way.

    Thanks,
    Raoul
     
  14. Olafson

    Olafson

    Joined:
    Aug 7, 2012
    Posts:
    255
    Hi. Thanks for the quick reply.

    I tried that earlier, but it actually makes the issue worse...
     
  15. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    **EDIT, it's ok, I found them in the demo package.**

    Hi,
    I haven't used easy roads in a while,imported it into an empty project today along with the HD add on.
    I've got the HD roads and side objects working OK but I can't find the normal side objects. Fences, barriers, bridges etc.
    Are they still part of the package?
    How do I get them to show in my project?

    Many thanks.
     
    Last edited: Mar 6, 2019
  16. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    OK, so as above, I found the demo package.
    How do I import the side objects, bridges etc into a new road network?
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    What is the setup of the source prefab? Where is the pivot point located, at the start?

    Please have a look at the bootcamp fence example in the demo package.

    Thanks,
    Raoul
     
  18. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hello sheffieldlad,

    The demo package is intended for learning purposes. if you want to use specific side objects in the packages they can be exported and imported in your project. http://unityterraintools.com/tutorials/so_import_export.php

    If the full package is imported in your project then first open the demo scene and select and deselect the road network object. This will update the project log file with all the road types and side objects in this package. Afterwards they will be available for your road networks, the "Add Project Side Objects" button in the Side Object Manager.

    Thanks,
    Raoul
     
  19. sheffieldlad

    sheffieldlad

    Joined:
    Oct 9, 2013
    Posts:
    154
    Awesome, Many thanks.
     
  20. STang7

    STang7

    Joined:
    Jan 10, 2015
    Posts:
    1
    Hi, I'm trying to rebuild a track in our project using easyroads, but I've come across an issue when the road branches off. I was wondering if Raoul or anyone here knew of a method or idea to execute it.

    Attached is an image of what I'm trying to do. The orange highlighted gameobjects are easyroad road objects that I'm trying to connect in a sort of "Y Crossing" way? I've tried using the T crossing, which sort of works, but at this angle, it gets deformed too much. I also tried using I connectors to connect up the 2 branching roads to the main road, but it only works between 2 roads and not 3 it seems.

    Any help/ideas would be greatly appreciated. Thank you.

    Y Crossing.jpg
     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hello STang7,

    That is not possible using the current built-in crossings. It can be done by importing the Y connection model in your image in the system. The Customized road network videos on the Quick Start section in the manual show this process.

    V3.2 will include a new built-in crossing type, the Flex Connector, it supports Y connections. It is available in betas on our website.

    http://unityterraintools.com/v3betas.php

    Thanks,
    Raoul
     
  22. badotter

    badotter

    Joined:
    Mar 29, 2013
    Posts:
    19
    Hello Raoul,

    Thanks for the great tool! I've purchased your full version, running in Unity 2018.3.0, and I have a question about the API. I'm building a terrain paging system with OSM roads imported into a database, and I'm building roads on the fly as terrain tiles are created. This has been working relatively well with simple roads, but this weekend I decided to take on the problem of creating Connections. So far I am having a very difficult time figuring out how to add connection prefabs and connect roads to them using the API. I see the addIntersection function, but have not figured out how to use it yet.

    What I'd like to do is find nodes that are shared between two or more different roads, add an X or T intersection automatically, and connect the relevant roads to it. Does the API have this capability, and if so is there any sample code or tutorial that you could point me toward?

    Thanks again,
    Chris
     
  23. raoul

    raoul

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

    We have the same "problem" with the built-in OSM importer. We are working on this and general situations are handled well. But roads / crossing situations in osm data can be quite complex. The new Flex Connector will help a lot here, recreating real world crossing angles etc. But still, there are so many different situations in the real world...

    This is also implemented in the OSM importer although not active at the moment because it slows down the process. Very often indeed node positions between roads are shared at crossings. You will have to search for exacly that when parsing the road data, matching nod positions. The optimization we use at this moment is first comparing the bounds of each road object and only search for matches when these bounds overlap. All this is not available in the scripting API.

    Additionally, in the case a matching node is not the first or last node, the road must be split. Currently there is no function for that but a way to achieve this is to insert an I Connector at that node, this will return the newly created road, the I Connector can be destroyed afterwards.

    Are you also asking how to insert X and T Crossings? This is a matter of loading the crossing you want to use. This connection object can then either be instantly attached to a road so it already aligns with that road or it can be instantiated in the scene. Afterwards roads can be attached to the connections.

    // ERRoadNetwork class
    public ERConnection GetSourceConnectionByName(string name);

    // create a new connection in the scene
    public ERConnection InstantiateConnection(ERConnection sourceConnection, string name, Vector3 position, Vector3 euler)

    // ERRoad class
    // create a new connection in the scene and attach to the road
    public ERConnection AttachToStart(ERConnection connection);
    public ERConnection AttachToEnd(ERConnection connection);

    // connect the road an already existing crossing in the scene
    public bool ConnectToStart(ERConnection connectionObject, int connectionIndex)
    public bool ConnectToEnd(ERConnection connectionObject, int connectionIndex)

    // split road
    public ERRoad InsertIConnector(int index, string connectionName, out ERConnection connection)

    Hope this helps

    Thanks,
    Raoul
     
    Last edited: Mar 17, 2019
    badotter likes this.
  24. badotter

    badotter

    Joined:
    Mar 29, 2013
    Posts:
    19
    Ah, thanks Raoul, I think that will help a lot!

    I'm not worried about finding the nodes that intersect two features, since step one of my process is importing all the OSM data into my SQLite database, after that I can just do the following query:

    I'm sure it will get me some false positives and weird outcomes, but I'm okay manually cleaning some stuff up if I can get the bulk of the simple crossings to work. I think the main thing I was lacking was the functions you named there.

    Wish me luck! I'm sure I'll be back here with more questions later. :)

    Cheers,
    Chris
     
  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, I wasn't sure if you were asking how to find these nodes or the next step.

    Anyway good luck with this part ;) and let me know if you have further questions.

    Thanks,
    Raoul
     
  26. pahctek

    pahctek

    Joined:
    Feb 11, 2019
    Posts:
    13
    Hello, Raoul!

    I have a question. :)
    Where is the backed up terrain data stored? I found suspicious directory at '[PROJECTNAME]\EasyRoads3Dv3'. The road network automatically backs up, then the scene is getting bigger size weirdly. Is this what you intended?

    :)
    pahctek
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hello pahctek,

    The optional full terrain backup data (for extra safety) is indeed stored outside the Assets folder in [PROJECTNAME]\EasyRoads3Dv3.

    Original terrain data in Build Mode affected by the road network is stored in the scene file. This is used when moving back to Edit mode and restoring the terrain to the original state. The "Finalize" option in Build Mode, which should only be used when the road network is ready will remove all EasyRoads3D script component including this data.

    Thanks,
    Raoul
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    V3.1.6 is now available on our website

    This is a small update with improvements and fixes primarily Unity 2018.3, like potentially assets being reimported every time when the scene is saved.

    As always, please backup your project first before importing the update.

    The asset store update has been submitted and is pending approval by the asset store team.

    Later today or tomorrow a v3.2 beta update will follow.

    Thanks,
    Raoul
     
    kusi2017 likes this.
  29. pahctek

    pahctek

    Joined:
    Feb 11, 2019
    Posts:
    13
    Ah, it might be helpful for me!

    Actually, the reason I asked is that the backup data is so large that the editor becomes too slow when working on the terrain. I'm so frustrated that I delete the components every time after I work on the road network. Could you suggest a better way for me?

    Thanks :D
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I don't think that is related to the backup data stored outside the assets folder. What terrain heightmap resolution do you use? A high heightmap resolution, 4097 can result in that. Generally it is recommended to use a lower heightmap resolution and multiple terrain tiles in that case. But indeed, if you keep the additional manual backup up to date, removing the ERTerrain component will remove the data stored in the scene file.

    Thanks,
    Raoul
     
  31. pahctek

    pahctek

    Joined:
    Feb 11, 2019
    Posts:
    13
    Hi, raoul!
    Oh, I should split up the terrains more pieces. When I select Road Network after getting rid of ER Terrain component, ER asked me about new terrain detection. Then, It always add ER Terrain component to terrains. Can I turn off this feature that adding ER Terrain component to terrain automatically?

    Thanks again.
     
  32. raoul

    raoul

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

    Indeed the tool does expect to find this component and will otherwise treat a terrain as a "new" terrain in the scene. The suggestion to remove the component was more for situations that no work is done on the road network.

    Adding the component can be made optional, but it is a crucial part of the tool making it possible to restore the terrain to the original terrain state before switching to Build mode. I can already hear the complaints coming when this functionality is switched off by accident :), perhaps this option can be added as not part of the interface.

    Thanks,
    Raoul
     
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    v3.2 beta 3 is now available on our website

    This update includes further Flex Connector improvements primarily custom road shape related, supporting roads with thickness on crossings including support for both hard and soft edges.

    The quick video below shows a more complex road shape. Important in this setup are the settings for node 4 and node 6 at 0.46 and 0.59 in the video. These two nodes define the outer edges of the road for which the shape should always stay the same on crossings.

    1.23 shows the new beta 2 feature, starting new roads from an existing road automatically inserting a Flex Connector. This has changed in beta 3 to Shift + Click + Drag.



    http://unityterraintools.com/v3beta.php

    Thanks,
    Raoul
     
    ksam2, imDanOush and JamesWjRose like this.
  34. pahctek

    pahctek

    Joined:
    Feb 11, 2019
    Posts:
    13
    Yah, I understand.
    So, I attached this component when I work with roadnetwork without backing up :D

    Code (CSharp):
    1. #if UNITY_EDITOR
    2. using EasyRoads3Dv3;
    3. using UnityEditor;
    4. using UnityEngine;
    5.  
    6. [DisallowMultipleComponent]
    7. public class ERTerrainRemover : MonoBehaviour
    8. {
    9.     public bool Remove;
    10. }
    11.  
    12. [CustomEditor(typeof(ERTerrainRemover))]
    13. public class ERTerrainRemoverInspector : Editor
    14. {
    15.     private ERTerrainRemover er = null;
    16.  
    17.     private void OnEnable()
    18.     {
    19.         er = (ERTerrainRemover) target;
    20.         if (!er.Remove) return;
    21.        
    22.         var erc = er.GetComponent<ERTerrain>();
    23.         if (erc == null) return;
    24.        
    25.         DestroyImmediate(erc);
    26.     }
    27. }
    28. #endif
    Thanks!
     
    raoul likes this.
  35. FidTeam

    FidTeam

    Joined:
    Feb 27, 2019
    Posts:
    2
    Hello,

    I just bought the Pro version of EasyRoads3D v3.
    I'm trying to use the scripting API, to create a 90-degree turn between two straight lines.
    Currently this is the best turn i was able to make (as you can see the lines aren't lined up properly).
    Is there a way to make the turn better, a code example would be much appreciated.

    Thanks in advance
     

    Attached Files:

    • Turn.PNG
      Turn.PNG
      File size:
      627.9 KB
      Views:
      644
  36. raoul

    raoul

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

    A 90 degree turn with a 100% straight 90 degree angle on the road edges on a single road object is currently not possible.

    The recommended way for a 90 degree turn is using the Circular Controller type for the respective marker section. This section covers a marker at the start of the turn using the Circular Control type and a marker at the end of the turn. Please try experimenting with this manually in the Unity editor to get a feel how this works.

    To assign the circular control type through the scripting API please try:

    ERRoad.SetMarkerControlType(int markerIndex, ERMarkerControlType type)

    using ERMarkerControlType.Circular

    Thanks,
    Raoul
     
  37. badotter

    badotter

    Joined:
    Mar 29, 2013
    Posts:
    19
    Hey Raoul! Thanks for your help before, just wanted to check back in and let you know I got my OSM import w/ connections working, at least partially:

    I've got a long way to go, of course, but so far I can detect and handle the most common cases of a road crossing another road, and a road Teeing into another road, and my node connections usually work except when they explode into infinite polygons. :)

    One of my next immediate needs, however, is going to be saving a tile's worth of roads and connections to a file, so I can page through them efficiently. You wouldn't happen to have addressed that already would you? Or have any relevant advice? My most likely plan of attack is to create a binary file and just save all the positions and salient details there, but would this maybe be a smart place to take advantage of Unity's serialization functions? Curious how you would handle this.
     
  38. FidTeam

    FidTeam

    Joined:
    Feb 27, 2019
    Posts:
    2
    Result:


    This is the code we wrote based on your answer:
    Code (CSharp):
    1. public static void MakeTurn(ERRoadNetwork network, Vector3 firstRoadStart, Vector3 roadsCrossPoint, Vector3 secondRoadEnd, float turnSize, string firstRoadName, string secondRoadName)
    2.     {
    3.         Vector3 firstRoad = (roadsCrossPoint - firstRoadStart) * (1 - turnSize);
    4.         ERRoad road1 = network.CreateRoad(firstRoadName, new Vector3[] {
    5.             firstRoadStart,
    6.             firstRoadStart+firstRoad
    7.  
    8.         });
    9.         Vector3 secondRoad = (secondRoadEnd - roadsCrossPoint) * (1 - turnSize);
    10.         ERRoad road2 = network.CreateRoad(secondRoadName, new Vector3[]
    11.         {
    12.             secondRoadEnd-secondRoad,
    13.             secondRoadEnd
    14.  
    15.         });
    16.  
    17.         ERRoad roadTurn= network.CreateRoad("roadTurn", new Vector3[]
    18.         {
    19.             road1.GetMarkerPosition(1),
    20.             road1.GetMarkerPosition(1)+((roadsCrossPoint-road1.GetMarkerPosition(1))/2),
    21.             roadsCrossPoint+((road2.GetMarkerPosition(0)-roadsCrossPoint)/2),
    22.             road2.GetMarkerPosition(0)
    23.         });
    24.         for (int i = 0; i < 2; i++)
    25.         {
    26.             road1.SetMarkerControlType(i, ERMarkerControlType.StraightXZ);
    27.             road2.SetMarkerControlType(i, ERMarkerControlType.StraightXZ);
    28.         }
    29.  
    30.         for (int i = 0; i < 4; i++)
    31.         {
    32.             roadTurn.SetMarkerControlType(i, ERMarkerControlType.StraightXZ);          
    33.         }
    34.         roadTurn.SetMarkerControlType(1, ERMarkerControlType.Circular);
    35.     }
    Thanks for the fast reply :)
     

    Attached Files:

    badotter likes this.
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hey badotter,

    Good to hear you are making progress!

    This is indeed something that is on the to do list as a road network backup / restore option but it hasn't been thought out yet. So at this moment I can't really point you in a direction that will work for this and in a fast way.

    Thanks,
    Raoul
     
    badotter likes this.
  40. raoul

    raoul

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

    That generates three road objects?

    But glad to hear you got that working with the circular control type :)

    Thanks,
    Raoul
     
  41. nmbileg

    nmbileg

    Joined:
    Sep 29, 2017
    Posts:
    22
    Hello! I just bought this asset and its amazing! One question though, currently I can set the road indent, but can I change some part of the road's indent value? From the picture you can see that I want to widen the indent at some part of the road. Is it possible to do that in runtime? Thanks! Screen Shot 2019-03-22 at 12.33.08 PM.png
     
    JBR-games likes this.
  42. raoul

    raoul

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

    Glad to hear you like the tool! To achieve that the indent values can be adjusted for the involved marker settings. Indent sliders are available in the Inspector in the Marker section. The scripting API equivalents when creating roads at runtime are:

    ERRoad.SetRightIndent(float value, int markerIndex)
    ERRoad.SetLeftIndent(float value, int markerIndex)

    In a next update this will change:
    ERRoad.SetIndent(float value, int markerIndex) ; // will update both the left and right side
    ERRoad.SetIndent(float value, int markerIndex, ERRoadSide type); // ERRoadSide .Left, ERRoadSide .Right, ERRoadSide .Both


    Thanks,
    Raoul
     
    Last edited: Mar 22, 2019
  43. nmbileg

    nmbileg

    Joined:
    Sep 29, 2017
    Posts:
    22
    Thanks! I'll try that.
     
  44. Walton

    Walton

    Joined:
    May 2, 2015
    Posts:
    78
    Hi raoul

    please can you help

    all been going good till i tried to follow your youtube tutorial
    Unity - EasyRoads3D v3 Customizing Intersections

    I have no option to save the prefab like you have in the vid thankyou crossing error2.jpg crossing error 1.jpg
     
  45. raoul

    raoul

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

    Are you using Unity 2018.3.x? In Unity 2018.3 this is done in the new prefab system which does not require the highlighted buttons in your screenshot. Exiting the prefab editor will automatically save the changes.

    Additionally, not part of the older video either, since it is very much recommended to work with road types and assign road types to crossing connections, road type specific connection prefabs can be created automatically in General Settings > Road Types. In the Main Settings there is a "Create new Connection Prefab" button near the bottom below the Material options. A new connection prefab will be created based on the selected road type. It will be instantly available in the connection prefabs tab.

    Thanks,
    Raoul
     
  46. Walton

    Walton

    Joined:
    May 2, 2015
    Posts:
    78
    ok thank you raoul
     
  47. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,273
    I'd like to try different terrains with the same road structure. Is it possible that the road adjusts itself to the terrain heights?

    I've tried "Preserve Terrain Contours" on the terrain building, but the road is still below the terrain:

    t.jpg
    And Follow Terrain Contours is greyed out, so I can't select that:

    n.png

    But I'd rather have an option that all road nodes are set to the height of the terrain anyway.
     
    Last edited: Mar 23, 2019
  48. raoul

    raoul

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

    "Preserve Terrain Contours" is related to the surrounding area next to the road, the area over which the terrain will adjust from the original height to the road height.

    Is the global "Follow Terrain Contours" checkbox in the main road settings toggled on for this road? I guess this actually is not really a necessary requirement, I will make a note to change this.

    Do you mean the road markers? There is no dedicated option for that, but the global "Follow Terrain Contours" checkbox does result in markers snapping to the terrain height at that position. Afterwards the checkbox can be toggled off, the markers will remain at the same position.

    Or do you mean mesh vertices? There is not editor option for that but it can be done through the scripting API, ERRoad.SnapToTerrain(bool value) or ERRoad.SnapToTerrain(bool value, float offset)

    Thanks,
    Raoul
     
    Last edited: Mar 23, 2019
  49. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,273
    That's what I was missing, the global toggle. Now when I drag nodes around, they stick to the terrain shape. Awesome, thank you! :)
     
    raoul likes this.
  50. nmbileg

    nmbileg

    Joined:
    Sep 29, 2017
    Posts:
    22
    Hello Raoul, sorry I'm very new to this software and I don't seem to find my issue from this forum. My roads are 100% randomly created by a script at runtime. And I want to add sidewalks on my generated road. I don't have any crossings. How do I do that?

    Thanks!
    Billy
     
    JBR-games likes this.