1. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice
  2. We're looking for feedback on Unity Starter Kits! Let us know what you’d like.
    Dismiss Notice
  3. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  4. Unity 2017.1 is now released.
    Dismiss Notice
  5. Check out all the fixes for 5.6 on the patch releases page.
    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:
    2,764
    In the latest betas auto updating crossings after road type changes was added. It seems the code changes are at the moment interfering with crossings that do not use road types, I will check that

    Anyway, for a better/easier workflow, it is recommended to work with road types and assign road types to crossings. This allows auto adjusting crossing connections, auto adjust scene crossings after road type changes, auto create for example lampposts next to the roads when pulling a new road from a connection.

    Thanks,
    Raoul
     
  2. kaptured

    kaptured

    Joined:
    Jun 20, 2017
    Posts:
    3
    Hello,

    I am trying to generate roads at runtime and was wondering what I have to do to create connections/intersections between roads with a script?

    Thanks!
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    Have you checked the ERConnection options in Scripting API section of the manual?

    Get availalable connections
    ERRoadNetwork.LoadConnections() : ERConnection[]

    or

    ERRoadNetwork.GetSourceConnectionByName(string name) : ERConnection

    Attach to the start of a road:

    ERRoad.AttachToStart(ERConnection connectionObject, int connectionIndex)

    Attach to the end of a road:

    ERRoad.AttachToEnd(ERConnection connectionObject, int connectionIndex)

    Instantiate a crossing:

    ERRoadNetwork.InstantiateConnection(ERConnection sourceConnection, string name, Vector3 position, Vector3 euler) : ERConnection

    Please try this and check the manual for more related to this.

    Thanks,
    Raoul
     
    Last edited: Jul 6, 2017
  4. Cyfieithydd

    Cyfieithydd

    Joined:
    Nov 18, 2016
    Posts:
    12
    Hi, i have some problems with ERRoadNetwork - is there a way to delete the grass properly? After using BuildRoadNetwork() terrain heights are changed, but the grass is still there, right on the road. Thanks in advance!
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    Hi Cyfieithydd,

    Are you indeed using

    BuildRoadNetwork()

    or

    BuildRoadNetwork(bool splatmaps, bool trees, bool detail)

    Thanks,
    Raoul
     
  6. Cyfieithydd

    Cyfieithydd

    Joined:
    Nov 18, 2016
    Posts:
    12
    I used BuildRoadNetwork() - i've tried BuildRoadNetwork(true, true, true) - but it changed nothing.
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    Can you tell more about how you are using the scripting API, what exactly is your workflow / code?

    You have more terrain control when working with an existing Road Network object in the scene, but I just tested this in the runtime example scene which builds a road network from scratch. I added some trees and grass. Both are removed near the road. Could you test all this in runtime scene example?

    Thanks,
    Raoul
     
  8. Cyfieithydd

    Cyfieithydd

    Joined:
    Nov 18, 2016
    Posts:
    12
    I've just tried BuildRoadNetwork(true, true, true) again - and everything is working by some reason (nothing was changed exept BuildRoadNetwork line in code), thanks for help anyway!
     
    raoul likes this.
  9. Cyfieithydd

    Cyfieithydd

    Joined:
    Nov 18, 2016
    Posts:
    12
    Sorry for bothering, but one more question - is it possible to use "Selected Roads Only" at runtime? The reason i'm asking - i have 16 terrains, 16x16 km and multiple roads - be adding new road, old ones are also calculated - is there a way to avoid it somehow and calculate only fresh added road?
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    "Selected Roads Only" inside the editor is mainly intended for quick testing while working on a specific road in Scene View. But this option can be added to the scripting API as well, I will make a note of that.

    Thanks,
    Raoul
     
  11. Cyfieithydd

    Cyfieithydd

    Joined:
    Nov 18, 2016
    Posts:
    12
    Thanks a lot, i'll look forward to it.
     
  12. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    5
    i want ask for a feature:
    to make it possibile to change the width(with sidewalks) from the street segments like thie picture here.

    or is it allready possibile to change the width multiple times with one street?
     

    Attached Files:

  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    Hi Noa3,

    Do you mean change the width of the sidewalk gradually? There is no built-in direct solution for that, but it is possible to change the road shape. Th N key toggles this feature on/off, you will see handles near each node for the selected marker. You can change the position in Scene View and in the Inspector. Holding the shift key will also move all nodes outside the selected node. This way you can change the width.

    For instant width changes you could use the I Connector That way you can connect two roads with different widths. This will work well in city type of environments where the sidewalks connect with buildings.

    Thanks,
    Raoul
     
    Noa3 likes this.
  14. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    5
    wow, this help me allready a lot! but its normal i can only change the height from the sidewalk?

    what i want, is to change is the road width on the same way. my way now was to create 2 identical streets , one with width 10 and one with width 15, select marker on begin and end and press Shift+J, but this works most time one time between 2 ConectionPrefabs.

    Looking forward for the next realese!
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    Do you mean the road shape option, the N key? You can change both the X and the Y position for each node.

    Yes, joining two roads with diferent sidewalk widhts is also an option. That results in a smooth transition, the same result as when changing node positions.

    Thanks,
    Raoul
     
  16. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    5
    Jeah, N Key work well on the beginning on a connectior and on roads without sidewalks. but if i have a sidewalk and want to change the width of the road it stuck on the same position. :/ but the N key work most times well
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    With regard to the second line, if you change the road width afterwards, all data is reset. Is that what you mean? Previously changed side walk widths being reset after road width changes? That is indeed what will happen when you change the "Road Width" setting afterwards.

    As mentioned in my earlier post, the implementation of changing nodes is not really related to "side walks", it is just a way to change the shape of the object you are generating. In your case, a road and sidewalks. But for the system they are one.

    So, the N key should work well in any case, for any road shape. Just avoind changing the road width through the inspector option "Road Width" if you already made manually changes to the road shape for specific markers. In that case, you can change the road width by moving the two nodes that represent the road part of the "shape" just like how you changed the side walk width. Hope that makes sense.

    Thanks,
    Raoul
     
    Noa3 likes this.
  18. claydamron

    claydamron

    Joined:
    Jan 31, 2017
    Posts:
    10
    Is it possible to switch from one material (or texture) to another in the same road system for different areas?
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    Hi claydamron,

    You can use the I Connector to connect two road objects with different materials and optionally blending textures at the transition. The main demo scene includes an example of an asphalt / dirt track transition next to the dirt track part of the small custom road network.

    There are various other ways to do this on a single road object using custom shaders and either vertex color info or, for example, splatmap type of blending.

    Thanks,
    Raoul
     
    claydamron likes this.
  20. LeGiangAnh

    LeGiangAnh

    Joined:
    Nov 10, 2013
    Posts:
    34
    I receive many errors when upgrade to Unity 2017.1f3
    Assets/EasyRoads3D/Editor/ERTextureWindow.js(63,12): BCE0005: Unknown identifier: 'i'.
    Assets/EasyRoads3D/Editor/ERTextureWindow.js(63,19): BCE0005: Unknown identifier: 'i'.
    Assets/EasyRoads3D/Editor/ERTextureWindow.js(165,19): BCE0019: 'ToUpper' is not a member of 'Object'.
    Assets/EasyRoads3D/Editor/ERTextureWindow.js(184,1): BCE0005: Unknown identifier: 'matEdit'.
    Assets/EasyRoads3D/Editor/MarkerEditorScript.js(14,40): BCE0019: 'SetObjectScript' is not a member of 'UnityEngine.Object'.
     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    Hi LeGiangAnh,

    That is a v2 script. V3 will soon replace v2 on the asset store. But when do these errors happen? There are no known issues with v2.

    In any case, it is recommended to start using v3. As mentioned it will soon replace v2. V3 is part of the asset store download as a separate unity package. For a clean install you can deselect all files in the Import window, only select the v3 beta package near the top. It will import in /EasyRoads3D/. Double click this file to import v3.

    In your situation (v2 already being imported), you can rename the folder /EasyRoads3D/ in /EasyRoads3D v2/ double click that same v3 beta package in this renamed folder. V3 will import in /EasyRoads3D/. Afterwards you can remove the /EasyRoads3D v2/ folder.

    Thanks,
    Raoul
     
  22. jailbar

    jailbar

    Joined:
    Nov 21, 2012
    Posts:
    47
    Does EasyRoads come with any side objects? Such as guard rails, fences, rumble strips, poles, lights?

    Thanks.
     
  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    Hi jailbar,

    The beta package includes several provisional side objects, have a look at the main demo scene.

    The new demo project is about ready, it includes new side objects (fences, walls, road markers, barriers, guard rails, power lines, etc.). I will be away for a week on a short holiday. After that I will prepare the final packages, finish promotional material and release v3 including the new side object assets.

    Thanks,
    Raoul
     
    John3D and hopeful like this.
  24. LeGiangAnh

    LeGiangAnh

    Joined:
    Nov 10, 2013
    Posts:
    34
    I'm using v3. Do I need to delete all v2 files before installing V3?
     
  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    Hi LeGiangAnh,

    V2 and v3 should work fine together in the same project but it is recommended to start using v3 it will soon replace v2. And when using v3 we would prefer a clean assets folder and remove v2. And in your situation with those errors, I would indeed remove v2 as well.

    Thanks,
    Raoul
     
  26. sadicus

    sadicus

    Joined:
    Jan 28, 2012
    Posts:
    119
    Unity 5.6 V3 Beta 6 is importing but there is no EasyRoads menu. or GameObject> Create Other> ?
    Also is there a PDF manual?
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,764
    Hi sadicus,

    It looks like I just replied to your email with the same question also asking for the manual, is that right?

    The "Create Other" path is v2. For v3, please look in GameObject > 3D Objects

    But you mention Unity5.6 v3 Beta 6? The current beta is 8.5.1

    Thanks,
    Raoul