Search Unity

  1. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  2. Unity 2017.1 is now released.
    Dismiss Notice
  3. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  4. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    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,820
    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:
    8
    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,820
    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:
    13
    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,820
    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:
    13
    I used BuildRoadNetwork() - i've tried BuildRoadNetwork(true, true, true) - but it changed nothing.
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    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:
    13
    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:
    13
    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,820
    "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:
    13
    Thanks a lot, i'll look forward to it.
     
  12. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    7
    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,820
    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:
    7
    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,820
    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:
    7
    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,820
    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:
    18
    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,820
    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:
    42
    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,820
    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,820
    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:
    42
    I'm using v3. Do I need to delete all v2 files before installing V3?
     
  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    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:
    151
    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,820
    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
     
  28. TriCoachSim

    TriCoachSim

    Joined:
    Mar 1, 2017
    Posts:
    20
    Hi Raoul,

    Is it possible to Finalize the RoadNetwork via the API? I didn't see it in the manual.
    I have several scenes using EasyRoads3D and i would like to automate the export (Scene copy + Finalize RoadNetwork).
     
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Hi TriCoachSim,

    This was also recently asked for by email. It will be available in the next update. If you need this urgently I can send you an alpha build.

    Thanks,
    Raoul
     
  30. TriCoachSim

    TriCoachSim

    Joined:
    Mar 1, 2017
    Posts:
    20
    Thanks for your prompt reply. I will wait for the next update
     
  31. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    313
    hi there. is it possible to make radius setting in corner/sidewalk settings more than 5 meters? we need to make it 12 at leasl, but 5 is maximum now.
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Hi zelmund,

    Adjusting the Min Max corner radius values is not integrated in the tool itself yet but can be done with an editor script:

    ERModularBase.minCornerRadius
    ERModularBase.maxCornerRadius

    ERModularBase is attached to the main road network object.

    For example:

    Code (csharp):
    1.  
    2. using UnityEngine;
    3. using UnityEditor;
    4. using System.Collections;
    5.  
    6. public class APITestsEditor : ScriptableObject {
    7.     [MenuItem( "EasyRoads3D/Set Corner Radius" )]
    8.     public static void SetCornerRadius()
    9.     {
    10.         ERModularBase scr = FindObjectOfType(typeof(ERModularBase)) as ERModularBase;
    11.         scr.maxCornerRadius = 12;
    12.     }
    13. }
    14.  
    Create a new c# script in /Assets/EasyRoads3D/Editor/ and paste the above code. Will this work for you?

    Thanks,
    Raoul
     
  33. Mohsen-janbarari

    Mohsen-janbarari

    Joined:
    Jan 25, 2016
    Posts:
    3
    how to change white surface size ?
    [​IMG]
     
  34. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    313
    weill, this is the solution, but i think it will not work for us =(
    there is to much different variations and options we need to handle. on this stage we cant reproduce real street and Xroads in our simulator project.
    anyway, thanks for solution =)
     
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Hi Mohsen-janbarari,

    Apologies for the late reply somehow I was not notified that there were new posts!

    The white surface size is controlled through the Left/Right Indent and Surrounding values in the Inspector after selecting a road marker.

    The default size for the full road network can be changed in General Settings > Scene Settings

    For the Indent values there is a Minimum value which depends on your terrains heightmapscale (size versus heightmap resolution). This minimum value ensures the best possible terrain deformation results based on the road shape.

    Thanks,
    Raoul
     
    Last edited: Aug 3, 2017
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Hi Zelmund,

    I thought you simply wanted to be able to create a wider corner radius. Is there anything you would like to see added here? Or is this more related to crossing layouts matching specific real world situations? The crossing layouts will be expanded but there are so many different situations in the real world. You can use the custom crossing prefab system based on your own meshes, many people do.

    Thanks,
    Raoul
     
  37. dheera1996

    dheera1996

    Joined:
    Aug 3, 2017
    Posts:
    4
    Hello raoul,
    I am facing a small problem... The GetSpline functions are not giving points for roundabouts .... is there any way to access the boundary points of the round about....
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Hi dheera1996,

    Indeed that is not part of the scripting API yet. Is this indeed related to the inner boundaries and the outer boundaries between and including the connections? That will be added, also for crossings.

    Thanks,
    Raoul
     
  39. dheera1996

    dheera1996

    Joined:
    Aug 3, 2017
    Posts:
    4
    Yes the inner and outer boundaries with connections ... enough points to get a 2d visualization of the roundabout .... Will you include them in the get spline points or a separate function .... Anything is fine btw... Thank You... can you suggest any work around for now to get the boundaries? I tried to get the mesh from mesh filter but thats not giving the boundaries its giving a lot of points inside the roundabout too...
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Yes, that will probably be separate functions, optionally functions can be added so these points are included in the spline info for the connected road. The inner boundaries cannot be added anyway to the road spline data. How would you like to see this integrated, a single list of all inner points or split by connection or both?

    There is not really a workaround at the moment. The inner and outer boundaries of the roundabout itself is no problem but getting the connection points is more complicated.

    Do you need this urgently? At the moment I am focussing on getting v3.0 released. People start complaining in the review section about the lack of resources and the current asset store download with the beta added as a separate package. Over time I have tried to find a balance between adding new features, improving the tool and already making it available in beta, but it really should get released now. It is a matter of weeks. If that is too long I will add this and send you an alpha build as by itself this type of thing is not too much work.

    Thanks,
    Raoul
     
  41. dheera1996

    dheera1996

    Joined:
    Aug 3, 2017
    Posts:
    4
    A List of inner points and the outer points included in the getspline function should suffice ... No not urgently please do focus on your work... but if you find any free time and can send an alpha build it would surely be helpful... just to be sure I currently am in beta version from unity(pro license bought in unity) i can get the v3.0 update right ?
     
    Last edited: Aug 3, 2017
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Ok that will be implemented. Can you PM your email or send me an email so I can send an update in case this is added before the release?

    Yes, that is right, v3 will simply fully replace v2 on the asset, no need to upgrade.

    Thanks,
    Raoul
     
  43. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    2
    Hello!
    I read on your website that one of the planned features of v3 is "Runtime API", but I did not find any details about it. Am I correct in thinking that it means we will be able to generate roads on the fly -procedurally- from, for example, external data or an algorithm? Without someone having to build or modify the roads by hand?

    That would be precisely what we need. The data available to us comes in the form of a number of nodes connected into lines with some meta data and we would like to make road generation an automated process.

    Our current system is a simple on that I wrote myself. It just generates a flat mesh that consists of four faces between each node and the height of the terrain is only considered at the nodes. Neither the terrain nor the roads take any consideration to each other which means that they cut through each other or don't even touch. Hardly an eye pleaser, but it at least does the job of showing where there are roads.

    Would we be able to use EasyRoads3D v3 to automatically generate roads from data, without any manual interference, on the fly in the engine (not the editor)?
     
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Hi NordstroemSaab,

    Contrary to v2, v3 indeed includes a scripting API that can also be used to create roads from code. It is currently not heavily promoted because it is not fully integrated yet supporting all the features when building roads manually inside the Unity editor. And resources are limited, http://unityterraintools.com/EasyRoads3D/v3/html/scriptingAPI.html . Creating roads (also from defined road types) and crossings is functional. The API is currently expanded upon user requests like dheera1996's post above. The current beta package includes a simple runtime example, a new road is created by passing an array of Vector3 (your nodes), the terrain is flattened accordingly and afterwards an object follows the road.

    Important to know is that these nodes will act as markers. Within the system the actual road shape will be generated based on the Spline controller used on each marker. That is perhaps not what you want if your current implementation is four faces between each node. In that case you could filter the data first. Alternatively we can also include a method to use the passed data as the final road spline data.

    Just in case, v3 also includes support for OSM and KML, auto creation of crossings not added yet. Although it seems this is not what you are using.

    I assume the engine is build using Unity and this is all Unity runtime related? In that case, this is possible. Whether this will work for you depends on the required functionality. Roads are created with the road network in Edit Mode, Build Mode updates the terrain according the road shape. You can switch back and forth between Edit and Build Mode, but updating the terrain after each change is expensive regarding fps.

    Let me know if you have further questions.

    Thanks,
    Raoul
     
  45. AliKhalifa

    AliKhalifa

    Joined:
    Mar 23, 2015
    Posts:
    1
    Hello Everybody!
    first things first, sorry for my poor english skills

    If you use the EasyRoads3D Free package (V2) and after the 2017 Unity update you got a lack of errors in console, then i have good news.

    I've made a fix for this issue, you can download the fixed FREE package from here: https://drive.google.com/open?id=0B2LU0ECWsTxGb3JhamQ4dm9pOFk

    Hope it works for you guys! Keep up the good work! Have a nice day ;)
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Hi Alekinjo,

    I think this is related to a review submitted yesterday for the free version, and I see you also submitted a review.

    Yesterday I tried the free package again in 2017.1.0f3 windows. Unity will ask to upgrade. After doing that it worked fine.

    In your review you give the example "For(i=0" instead of "for(var i=0)". After allowing Unity to do the upgrade during the import it should look like "for(var i=0)". It does on our end.

    In any case, the free version will soon update to v3 as well, no j

    Obviously we cannot take any responsibility for your google drive upload :)

    There is a more serious issue related to Mesh.Clear() with the 2017.2 betas at least up to b5, also for v3. In the 2017 beta forum, Unity has posted an estimated fix for this in b7.

    Thanks,
    Raoul
     
    Last edited: Aug 4, 2017
  47. zelmund

    zelmund

    Joined:
    Mar 2, 2012
    Posts:
    313
    i think custom Xroads is real solution.
    but 1 major thing we need - stability. sorry to tell this, but after 10-15 mins we suffering with unstable roads. they start to disconect, dublicate and simple disapearing. i dont talk about tons of errors spam in log.
    we already did project with ER in unity4 and our customer was satisfyed. but at that moment we simply cant do city because of stability.

    sorry for english =)
     
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Hi Zelmund,

    What exactly do you mean with custom X roads? The custom prerfab system based on mesh import?

    Road disconnecting and disappearing? Can you expand on that? When does that happen, after which action?

    I am asking this because I have spend many, many hours over the passed weeks using the tool creating the new demo scene. Roads have not disappeared, disconnected once. How can this be replicated? Does that happen with the latest 8.5.1 build? Are more people experiencing this?

    Thanks,
    Raoul
     
  49. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    2
    EasyRoads3D v3 seems to do what we need it to do then. My superior has approved the purchase of a license for evaluation. I'll be trying it out to see what I can do with it. I'll be in touch if I have further questions or would like to request some functionality.

    Thank you.
     
  50. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    2,820
    Once v3 is released more resources for the scripting API will be prepared. So yes, meanwhile please let us know if you have questions. It seems there is a growing number of people using it which is good to know.

    Thanks,
    Raoul