Search Unity

  1. Unity 2019.2 is now released.
    Dismiss Notice

EasyRoads3D v3 - the upcoming new road system

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

  1. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    805
    kloogens likes this.
  2. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    68
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Yes, when doing this in a new scene I indeed get the same error! This is fixed, I will prepare a new beta in the next couple of days.

    Many thanks!
    Raoul
     
    Last edited: Aug 24, 2015
    hopeful likes this.
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Kloogens,

    Yes, for now you can use one of the .obj exporter scripts available on the unify wiki.

    Exporting a single object is actually implemented, we use it a lot for debugging. I will add Inspector options for the relevant game objects.

    I will also add side objects to the main export option.

    Thanks,
    Raoul
     
  5. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    68
    Thanks Raoul , I'm using the objexporter as suggested and everything is working fine.
     
    raoul likes this.
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi guys,

    Beta 6.8.1 is available from the same download link.

    It includes a fix for the issues posted by Carpe Denius and further optimizations to the new custom prefab system.

    Upon request API options have been added to snap the road to the terrain instead of having the terrain flattened according the road shape.

    Thanks,
    Raoul
     
    ksam2 and hopeful like this.
  7. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Hey Raoul,

    Just updated to 6.8.1 and found that the Roundabout prefab crossing seems bugged to always enter prefab editor mode. I place on in the scene and it immediately throws the following error:

    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3.ERModularBase.OCOQOCDDOQ (UnityEngine.GameObject prefab, Vector3 hitPos, UnityEngine.GameObject& newPrefab, EasyRoads3Dv3.ERCrossingPrefabs& prefabScript, EasyRoads3Dv3.ERCrossings& crossingsScript)
    EasyRoads3Dv3Editor.OQCQCOODCQ.OnSceneGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.SceneView.CallOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1987)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1352)
    UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1188)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)


    So I select the connection in the hierarchy and it enters prefab editing mode. So I go ahead and "Exit Prefab Editor", saving the changes and the object immediately destroys itself, resulting in the following:

    MissingReferenceException: The object of type 'ERCrossingPrefabs' has been destroyed but you are still trying to access it.
    Your script should either check if it is null or you should not destroy the object.
    UnityEditor.Editor.IsEnabled () (at C:/buildslave/unity/build/Editor/Mono/Inspector/Editor.cs:554)
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean forceDirty, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect, Boolean eyeDropperDirty) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1082)
    UnityEditor.InspectorWindow.DrawEditors (UnityEditor.Editor[] editors) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:969)
    UnityEditor.InspectorWindow.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:350)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)


    I even tried making a copy of the Roundabout (dynamic) object and placing it as a Custom Prefab and the same still occurs. :(
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Besus,

    I will double check the Roundabout prefab in 6.8.1

    Just to be sure, how are you adding the prefab to the scene? It sounds like you are doing this from the project panel, is that right? You can do this for dynamic prefabs to modify the base prefab but not for custom prefabs, it indeed will be added. If you want to edit a custom prefab you can drag it from /Assets/EasyRoads3D/Resources/custom prefabs/ on the stage of the Custom Prefab Editor window.

    To add a prefab to the scene please always use the 3rd tab from the left in the Inspector.

    Otherwise does this error only occur with the Custom Roundabout prefab?

    Thanks,
    Raoul
     
  9. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Only with the roundabout prefab. And I always add a crossing via the third tab and shift+click in the scene. This is the only prefab doing this (regardless of adding it the proper way or just dragging out the prefab from the project folder) and always reverts to the prefab editor in the inspector.
     
  10. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    Yes, that is correct. I played some more with the asset today and (re)watched some videos. Each time I understand things a bit better.

    The question I have at this time is how to grab a particular road marker when more that one is at the exact same location. I am seeing this with my OSM created road network. Roads end on top of each other. I want to split them apart, but I can't seem to differentiate which marker, from which road, I grab. As it is now I just grab one and move it around, which shows which road it is connected to, but it moves the road from the exact position that it should be based on the OSM data.

    If there currently isn't a way to select a particular marker, then consider this a feature request. Maybe when several markers are close (or exactly on top of) to each other, if you lasso select them, a popup comes with all them listed. As you hover over each marker in the list, it highlights the road segment it is associated with. Then you click on the one in the list that you wish to select.
     
  11. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
  12. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    I too had that happening in the last beta that I was using (I want to say that it was 6.6.1?) but upgrading to 6.8.1 seemed to have solved it for me.
     
  13. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I am running 6.8.0. I will update to 6.8.1 and see if that helps. Thanks.

    ==UPDATE==
    I updated to 6.8.1, however the issue still remains.
     
    Last edited: Aug 29, 2015
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Besus,

    I just tested the Roundabput prefab, both in the main demo scene as in a new scene. Instantiating the prefab from the third tab on the left works fine and roads can be pulled out without issues.

    Could you try the package 6.8.1 in a new project? Does that work well? In that case, could you try removing this prefab from the assets folder and reimport the package?

    Thanks,
    Raoul
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Tinjaw,

    Yes, when you extract OSM data, the four roads connecting to for example an X crossing will most likely be at the same position. But I do not exactly understand what the problem is? The X crossing prefab should be at that position and all 4 roads should be attached to the respective crossing connections. So you you just have to select a marker, move it a little bit so you see to which road it belongs and then move it slightly backwards in the direction of the previous/next marker to create space for the X crossing prefab.

    In which way doesn't this work well for you?

    Thanks,
    Raoul
     
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Don't worry about these specfic red markers located at crossing prefab surroundings. These red handles show areas that can be critical regarding terrain flattening, but they should appear near the road edges. I will check why they are also displayed near crossings on the white surface vertices. In any case, it shouldn't result in issues in Build Mode, does it?

    In the video the second blue marker can be an issue, it is located very close to the marker connected to the crossing. I assume it is positioned based on the OSM data. This can affect the spline shape as you see in the video, the way it initially connects to the crossing.

    Thanks,
    Raoul
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    I just replied to the initial post, just in case there is a real issue, apart from these red handles being displayed, what exactly is the issue regarding the generated road network?

    Thanks,
    Raoul
     
  18. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    That was the issue. You have answered my question. Thanks
     
  19. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    No, I doesn't appear to cause problems.
     
  20. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    The more I thought about it, it doesn't matter. I was just paranoid about deviating from the actual road data by moving markers around, but in reality, it doesn't matter.
     
  21. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I believe I may have found a bug in 3.8.1. If you click/choose a connection and shift-click to place it all is well. If the next thing you do is hold down ctrl and move the connection it will duplicate and and you will be moving one while the other remains.

    http://screencast.com/t/hK3dcTWp08
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Tinjaw,

    Since you mention shift-click to place it, I think this is more related to functionality.

    To position a prefab there is no need to press the Shift key. In fact, after selecting a prefab in the Inspector and use Shift+click to instantiate it in the scene, another Shift+click will add additional prefabs to the scene. This functionality remains active until you for example pull out a road or do something else. It is done to avoid having to select the same prefab over and over in the Inspector.

    Isn't this what is actually happening?

    Regarding the Ctrl key, when I press Ctrl and click, it will by itself not instantiate a new prefab. Or do you mean holding both Shift + Ctrl. In that case, what I mentioned above will happen but that is related to the Shift key, not the Ctrl key.

    Thanks,
    Raoul
     
    Last edited: Aug 31, 2015
  23. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    193
    Is there a way of setting spline points to be smooth or straight before placing new splines in the scene?
     
  24. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    It sounds like user error. I'm glad. It's a lot easier to correct a user than debug code. ;-)
     
    hopeful and raoul like this.
  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Jeff,

    Do you mean the marker Controller Type? By default the spline controller is used as generally you will not want to use "Straight" on two consecutive markers.

    Thanks,
    Raoul
     
  26. jeffmorris1956

    jeffmorris1956

    Joined:
    Jul 3, 2012
    Posts:
    193
    I meant the marker Controller Type. Sometimes, I need the "Straight" on two consecutive markers.
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    "Straight" on two consecutive markers is tricky especially when for lower road resolutions and sharper angles (vertices may overlap). I will see if I can optimize this further. In theory some key combination can be added to create new markers with a specific Controller Type or to force the same Controller Type as the previous marker.

    Thanks,
    Raoul
     
  28. BUDU_KRATOK

    BUDU_KRATOK

    Joined:
    Jan 3, 2011
    Posts:
    30
    Hi, Raoul!

    You are doing a really excellent job! After GSDRoads (Road Architect), EasyRoads3d (especially v3) looks more than impressive.

    There are any good ways to create navigation waypoints by generated roads? Or something just for getting actual coords for roads. Looks like all sources are obfuscated and I can't find any information about API.

    Something like this (screenshot from GSDRoads with own-written waypoint system):
    gsd.jpg

    Thank you!
     
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi BUDU_KRATOK,

    Thank you very much!

    Do you already have access to the v3 beta?

    The API is not yet documented well in the manual but the package includes a runtime scene with a script that is not obfuscated (/Assets/EasyRoad3D/scripts/). You will find various ways to get access to the road spline data both available at runtime as in the Unity editor.

    And you can always ask here if you have further questions.

    Thanks,
    Raoul
     
  30. BUDU_KRATOK

    BUDU_KRATOK

    Joined:
    Jan 3, 2011
    Posts:
    30
    Oh, really, I found this script. Thank you again :)
     
    HeadClot88 and raoul like this.
  31. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    Thanks Raoul.

    For some reason, my road network had become screwed-up (which was causing the roundabout prefab to work the way it was). Deleting the road network and starting a new one resolved the issue.
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    HI Besus,

    A road network consists of road objects and crossing prefabs with scripts attached that affect each other. What other issues did you have making the road network appear to be not working anymore? I am asking this because it is unlikely the full road network gets screwed-up unless all crossing prefabs and roads are corrupted and in your initial post you mentioned you only had this issue with the Custom Roundabout prefab.

    Do you have a backup of the old road network? If not, please never delete a road network if you feel it is corrupted, chances are it is just a small issue that can be fixed. I would appreciate it a lot if I could have a look at such a scene / road network.

    Thanks,
    Raoul
     
  33. Besus

    Besus

    Joined:
    Mar 9, 2014
    Posts:
    226
    That's just it, everything else appeared to be working fine. All other crossing prefabs worked but they all created as their own game object (and not as a child of the road network). It wasn't until I manually added them under the road network that they worked as expected though.

    Before deleting the road network I did remove all other crossing prefabs in hopes of fixing the roundabout but had no luck. If I encounter it again in the future, I can dig a bit further and see if there is a simpler solution. Luckily the road network wasn't too complicated yet so it wasn't a complete waste of time to redo it.
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Besus,

    What exactly do you mean with this? Do you mean that when you add a crossing prefab to the scene through the 3rd tab from the left in the Inspector, the prefab was not addad as a child to the game object Road Network > Connection Objects? In that case, did you get error messages?

    What exactly do you mean with "I did remove all other crossing prefabs"? Remove them from the scene or from the assets folder? Removing them from the scene will not make the Custom Roundabout prefab work differently. What about my initial suggestion, removing the Custom Roundabout prefab from the asset folder and reimprot the package? Did you try that?

    Yes, this sort of situations are very useful regarding debugging and eliminating possible glitches, more information now or in case this happens again is very helpful and much appreciated.

    Thanks,
    Raoul
     
  35. Locky

    Locky

    Joined:
    May 14, 2015
    Posts:
    86
    I recently purchased Easy Roads 3D and am interested in the Version 3 beta. Whom do I contact to get involved with that? Thanks.
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Locky,

    I will send you the beta info. Could you send me a PM (Start Conversation) or contact us through our website, http://unityterraintools.com/, and include your email address?

    Thanks,
    Raoul
     
  37. Dweebster

    Dweebster

    Joined:
    Aug 30, 2012
    Posts:
    73
    Hi Raoul

    I'm a great fan of Easy Road and have been using it for years.

    However my biggest challenge with using Easy Road is to get the road aligned with the landscape. Often I need to raise with the road with about 0.4 m which creates to large gaps. I know that I can export the road as a model and fix it but it just takes too long time.

    I think it would be great if you could allow an option to extend the road with down slanting sides like this:

    ____
    / \
    / \
    --------------
    Then there wouldn't be an issue with gaps and we could use a gravel texture on the slanting part.
    This is might even possible with side objects but I haven't tried yet.

    Or do you have any other recommendation how to over come this problem?
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Dweebster,

    Thank you for the kind words!

    In general only a small Raise value < 0.05 should work but this depends on the terrain settings and the nature of the terrain. The bigger the heighmapscale (terrain heightmap resolution vs size) the less terrain points are available to flatten the terrain according the road shape. On relatively flat surfaces this situation should not be too problematic but indeed this does need attention on hilly terrains with abrupt height changes, especially with the road also bending.

    0.4 does sound like a lot though, what are your terrain settings and do these issues indeed occur in hilly areas?

    What you suggest can be done in v3 by using custom road types, see the below video at 2:40


    If you do not really need crossings you can still use this approach. Create a model in your modelling app with the desired roads shape, create a temporary custom prefab like done in the above video. After assigning the connection info you can store this info as a new Road Type. You will now be able to create new roads with this shape from the New Road Object tab (second from the left).

    Indeed you can also use side objects for this. In v3 the side object system is further expanded with options to snap specific vertices to the terrain. You can have the outer vertices snap to the terrain. When using a shader package like RTP you could even blend this object entirely with the terrain as if it is part of it.

    It is also on the list to have this type of road shapes work together with the dynamic crossings system, but that will probably be v3.x

    Let me know if you have further questions regarding this.

    Thanks,
    Raoul
     
  39. Miggy

    Miggy

    Joined:
    Feb 9, 2010
    Posts:
    74
    Hi Raoul,

    I'm having some trouble with terrain intersecting the road like here:

    easyroad.jpg

    This is with the latest v3 beta. I used to use Road Architect which was pretty good at modifying the terrain so the road lay nicely on the terrain without intersecting. The problem with Road Architect is it has some major bugs with intersections and seems to be abandoned.

    Thanks.
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Miggy,

    The white surfaces surrounding the road are visible, this means the road is in Edit Mode. In Edit Mode the terrain is not flattened according the road shape.

    Matching the terrain with the road is done through the middle mountain tab in the Inspector > Build Terrain button. You can switch back and forth between Edit and Build Mode.

    The beta email includes links to various movies (also avaialble in this thread) showing the main v3 features, you will see this Edit Mode to Build Mode process in most of these videos.

    Thanks,
    Raoul
     
  41. MartinLyne

    MartinLyne

    Joined:
    Apr 25, 2013
    Posts:
    30
    Can I get put on the beta list please? Just bought pro license. (Might want to update first post with beta signup process too, thanks!)

    Cheers,
    Martin
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Martin,

    Could you send me a PM (Start Conversation) or contact us through our website, http://unityterraintools.com/, and include your email address?

    This does come up regularly in the review section on the asset store. I will add a note to the first post of this thread.

    In general, it won't be long before the beta will be part of the asset store package. Currently some small requests and other bits and pieces are being implemented . When that is done, the beta will be added to the asset store package. After that it will be a matter of preparing additional resources. Once that is done and you guys are happy with how things work 3.0 will be released.

    Thanks,
    Raoul
     
  43. Locky

    Locky

    Joined:
    May 14, 2015
    Posts:
    86
    Hi Raoul,
    My email is
    auburnanimator@yahoo.com
     
  44. Miggy

    Miggy

    Joined:
    Feb 9, 2010
    Posts:
    74
    Thanks Raoul. Now I have a better understanding of how the new system works. A couple of questions:

    1) There is an option "Build LOD Groups". Is that something coming in the future?

    2) Were you planning to add any traffic flow information to the system? The custom editors look like they would be perfect for adding some kind of line placement to define traffic flow which would be automatically connected for each road segment.
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Miggy,

    1) "Build LOD Groups" is indeed currently disabled. It is implemented, the Unity LODGroup component is used. I had a look on the To Do list a while ago, but there are no notes related to this. I have to check why it is disabled, if I remember well there are some glitches on road objects with more complex geometry, or near the connection when roads are attached to a crossing.

    2) A traffic system is currently not on the list. Several users are or have been looking into this. There are several videos/Unity webplayers related to this in this thread. In theory it is all doable, the API gives you access to road data and to which crossings a road is connected. The crossing is an ordinary unity prefab which can be expanded with more info, specifically lane info. This indeed could also be added to the Custom Prefab editor window. All this is currently not on our priority list since we do not need it but if you like to see additional functionality implemented you can always give further details and we can look at it.

    Thanks,
    Raoul
     
  46. BUDU_KRATOK

    BUDU_KRATOK

    Joined:
    Jan 3, 2011
    Posts:
    30
    Talking about traffic system - current EasyRoads3D v3 API is ready for creating your own system with features that you need.
    For example, there are some screenshots from our traffic system. All waypoints generated by using EasyRoads3D v3 API.




    But of course, get waypoints directly from EasyRoads will be great feature :)
     
    emergki and raoul like this.
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    That looks very good BUDU_KRATOK!

    As mentioned integrating all this is currently not on our priority list but providing all the tools/implementing additional API functions or other functionality to make all this easier, is. Just contact us if you have a request.

    For example, the Road Types section could be expanded with additional options to define lane info. This can be used to make the creation of waypoints per lane easier.

    Also, if any of you would consider to provide a publicly available traffic solution (free or commercial), by all means feel free to do so.

    Thanks,
    Raoul
     
  48. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    On the subject of traffic systems...

    I have purchased this asset. I have not attempted yet to integrate it with Easy Roads 3D, but it would be wonderful if the two developers could work together to build a seamless integration.

    Just saying. ;-)
     
    rhodnius, hakankaraduman and Meceka like this.
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    4,681
    Hi Tinjaw,

    Yes, I am in touch with Jose Garrido the author of iTS.

    Thanks,
    Raoul
     
    Tinjaw likes this.
  50. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    329
    We also are using ITS and it would earn us lot's of time if they integrate with each other.
     
    rhodnius likes this.