Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    The free version does not support intersections at the moment. The Pro version supports X and T intersections, more is coming in v3.3, https://easyroads3d.com/v3alpha.php , including motorway on / off ramps. It is also possible to import your own intersection models in the system.

    Thanks,
    Raoul
     
  2. JBR-games

    JBR-games

    Joined:
    Sep 26, 2012
    Posts:
    708
    hi i recently have been looking into finally using easyroads 3d pro.. im looking to find either already made or build an off ramp for the motorway. is there a good tutorial or premade asset you can point me at for making this type of intersection.
    thank you

    edit-just noticed your last post... i guess ill wait for those new motorway pieces, but any info on making intersections would still be appriciated..
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi JBR-games,

    Yes, on off ramps will be built-in in v3.3 but that still requires some work.

    Regarding making making them yourselves and importing them into the system, have you made intersection prefabs before and imported them into the system? If not, then it is recommended to start with some simple intersections to get a feel of how this works.

    Unless the road objects connected to these motorway and exit prefabs are always flat and at the same height, what is important is the direction of the ramp connection and the position relative to the motorway. When they are parallel pointing in the same direction then the connection position must be far enough away of the motorway (sideways) so at least one terrain point is between the two. The minimum indent values in General Settings > Scene Settings can be used as a reference. When that is not the case then the terrain will probably break through part of the motorway or the exit lane when they are not at the same height and right next to each other.

    Thanks,
    Raoul
     
    JBR-games likes this.
  4. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    Hi Raoul!

    I tried using Easy Roads in unity 2019.3 and I keep getting the terrain selected when i mean to click to add a new node. I used a fresh new project and it only has Easy Roads directly from the asset store, with the version published as of today, February 7th. I tried adding the terrain to the "scene objects control" just to see if that would fix it but the behavior remained.

    Is there something I'm missing or is Easy Roads not tested yet on this new Unity version?
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi Alberto,

    We have been working over the past months with Unity 2019.3 to integrate tunnel support using the new terrain holes system in v3.2. Beta versions are available. The current v3.1.9f3 released earlier this week also works with Unity 2019.3.

    Do you mean none of the events are fired? Can you select existing markers?

    A while ago we came across a situation where a user had similar issues, non of the Unity events were triggered. It turned out to be related to the Unity editor. Resetting the editor for example back to the factory settings in Window > Layouts resolved it. Afterwards the editor can be customized again.

    Have you tried that? Does everything work well in a new project with default editor setup?

    The "Scene Objects Control" is a new feature for objects like water. They will be handled in a similar way as the Unity terrain object, selectable by double click when the road network is selected. Single click will keep the road network selected. It is not necessary to add the Unity terrain object here.

    Thanks,
    Raoul
     
  6. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    Fantastic, that did the trick! Thank you so much for the quick reply :)
     
    raoul likes this.
  7. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,199
    I wanted to create a transition from sunny day to stormy day. I used MicroSplat for the terrain wetness. However the only thing that was lacking wetness was the wetness of the road. So I asked @Vondox and he quickly coded an adapter, so that the road wetness is influenced by the Enviro weather. I thought it might be of use for others, so in case anyone else wants it, the script is attached.

    Looks like this in action:



    e. g. for Dirty Road you can configure it like this:

    usage.jpg

    Another screenshot:

    wetness.jpg
     

    Attached Files:

    Last edited: Feb 8, 2020
    hopeful and raoul like this.
  8. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    Hi Raoul!

    Back with another question.

    I'm trying to make an Armco barrier that can have smooth normals like my original mesh, but i keep getting this result of hard normals on the start/end pieces, and then an odd orientation on the lofted section. What could I be doing wrong? My original mesh has smooth normals all across the object.

    upload_2020-2-8_11-0-51.png upload_2020-2-8_11-1-13.png
     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi Alberto,

    The mesh is cut in pieces and rebuild / repeated along the spline,smooth normals on the original prefab between the start mid and end sections need to be recreated.

    Could you send the prefab so we can test it?

    Thanks,
    Raoul
     
  10. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    Absolutely, here it is!
     

    Attached Files:

  11. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    Hi Raoul,

    I ran into another scenario where i'm not sure if i'm encountering a bug or i'm doing something wrong. It's worth mentioning that my tests have been in the latest alpha for 3.3, so maybe these behaviours are different from the asset store version?

    I'm trying to make a "shape object" for the left, and one for the right. The left one is created on the left side of the road and it works as intended, however, the right one, with the exact same settings but mirrored, creates a an object on both the left side and the right side. I'm puzzled, here is my setup, and the result.

    upload_2020-2-8_14-11-46.png
    upload_2020-2-8_14-12-0.png

    upload_2020-2-8_14-13-50.png

    upload_2020-2-8_14-13-57.png
     
    Last edited: Feb 8, 2020
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi Alberto,

    The v3.3 alpha also includes the v3.2 beta updates.

    v3.2 is side object related, mainly auto generating side objects based on rules. This takes one side object as the input, it will be used on both the left and right side of the road. This does work well for auto generated side objects. But indeed, for manually placed side objects it will also generate a mirrored version on the other side. This is a bug that is fixed in the next update.

    The next 3.2 beta update also supports one side object for both the left and right side for manually placed side objects. When a side object is aligned to either the left or right side of the road, the Inspector will automatically also display side object options for the other side of the road for the same side object.

    Thank you for posting the zip, I will look at your model today.

    Raoul
     
    AlbertoMastretta likes this.
  13. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    Hey, I've come back to this and I'm unfortunately I'm still struggling with this. I seem have all the settings in place. In this screen shot you can see an individual road's settings, but still you can see I have trees on the road. What step am I missing?
     

    Attached Files:

  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hello donkey0t,

    Last week I have looked into Vegetation Studio trying out the road module posted by Rowlan on the previous page. This also involves Vegetation Studio. There were no issues with Vegetation removal. So in general everything Vegetation Studio related works well in the current version.

    From an EasyRoads3D point of view, the mask Line component is clearly created. From then on it is Vegetation Studio. It is hard to comment further on this, can you email a link to the project so we can look at it?

    Thanks,
    Raoul
     
  15. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,199
    These are my settings:

    settings.png

    Try presseting the "Reset All Road Types And Objects".

    And what's in the mask:

    mask.png
     
    donkey0t likes this.
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    @AlbertoMastretta,

    Mesh.RecalculateNormals() is used on the generated side object mesh along the spline. RecalculateNormals() directly on the armco2 fbx has the same results, non smooth normals. This mesh counts 476 vertices, visible in the Inspector. Looking at the fbx there are only176 vertices. It is not unusual that the final Unity mesh after import has more vertices but it appears this is what is causing the problem.

    An option "Weld Vertices" for vertices at the same position can be added to the Side Object options to force smooth normals in situations like this.

    Thanks,
    Raoul
     
  17. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    Thanks for the replies Raoul,

    I investigated my mesh and attempted to clean it up, unsuccessfully. So I decided to try again with another shape, this time a sphere to which I extruded a middle section to it. All normals are merged, uv maps were generated using planar projection so even the UVs are welded. No vertex colors, smooth normals all across the object. Here are my results, it still has the same problem.

    I tested this on v3.1.9.f3 and v3.3a1

    upload_2020-2-9_11-30-4.png
    upload_2020-2-9_11-30-39.png
     
  18. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi Alberto,

    The pics show different vertex counts, 146 and 168. So RecalculateNormals() can have different result. The same applies here I would say.

    Thanks,
    Raoul
     
  19. AlbertoMastretta

    AlbertoMastretta

    Joined:
    Jan 1, 2015
    Posts:
    71
    I checked the guard rail that comes with Easy Roads. The vertex count is also different between the FBX and the mesh inside of unity, however, those guard rails don't have this problem. The vertex count disparity on that guard rail is even bigger than the extruded circle.

    My guess is that that the vertex count disparity is not the cause of the problem with the normals.

    upload_2020-2-9_13-9-31.png
    upload_2020-2-9_13-9-39.png
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    It depends on which vertices are duplicated. If the dupliated vertices of your armco2 fbx are welded so the total is also 176 vertices, the normals will most likely be smooth. This option will be added.

    Thanks,
    Raoul
     
  21. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    Thanks, I have exactly the same settings and pressed the 'Reset All...' but still the vegetation persists on the road. Is this because the there is another Veg Mask overlapping the road? Do you have to 'Bake' the road for this to work?
     
  22. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    As you can see here, I've got an overlapping grass mask. If I adjust the mask to not cover the road it all works, but move the mask back to the road and it breaks. It's appear like the road's mask is been ignored.??
     

    Attached Files:

  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    The setti
    The perimeter settings of 0 means that vegetation will only be removed that is exactly on the road.

    Your previous screenshot showed that the vegetation mask Line component is added to the road, this is what EasyRoads3D does also passing the perimeter values. It shows different perimeter values per vegetation type which is not a problem. All this is Vegetation Studio related, the circle shaped lines are drawn by Vegetation Studio, not by EasyRoads3D.

    Looking at these pics this appears to be setup correctly, it is hard to give further feedback with the current info. It would help being able to look at it.

    Do manually placed Vegetation Mask Line components work well?

    Do you mean the other grass mask is interfering? How is that mask generated?

    Thanks,
    Raoul
     
    Last edited: Feb 10, 2020
  24. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Hi.

    A simple question

    Why does the ROAD WIDTH value deactivated appear on some occasions?

    Thanks
     
  25. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    FYI I got to the bottom of this, the problem is that the roads and veg are generated by another 3rd party tool. That tool creates Veg' Studio Masks. Unfortunately, as suspected, they don't play well with Veg Mask Lines. Anything in a Veg Mask Include section will always take precedence over whatever is in being excluded in the Mask Line.
     
    raoul likes this.
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi Barritico,

    That is the case when a road type is assigned to the road object, which is recommended. In that case the road width can be changed in General Settings > Road Types. "Update Scene Instances" near the bottom in the road type settings will update all roads in the scene using that road type.

    "Road Width" is also disabled when the road is attached to a crossing. But when crossings are involved it is even more recommended to work with road types. The road network will be better manageable in exactly this type of situations when for example a road width is changed.

    Thanks,
    Raoul
     
    Barritico likes this.
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi donkey0t,

    Does the same happen with the Biome Mask component?

    Thanks,
    Raoul
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    @AlbertoMastretta,

    The reason why the vertex count increases from 176 to 476 is related to the way it is unwrapped.

    Attached is a mesh asset with all vertices (except those with different vertex colors) at the same position merged. This will have smooth normals like the original prefab.

    Thanks,
    Raoul
     

    Attached Files:

  29. joe_ftg

    joe_ftg

    Joined:
    Nov 9, 2015
    Posts:
    50
    Hi Raoul

    Sometimes we get the following exceptions. It seems it occurs if we load some scenes containing terrains additively, and then load the scene containing the road network (again additively). We're able to work around it by loading the roadnetwork first, but would be nice if it could be fixed in the future. We're using Unity 2018.4.2f1 and the latest version of Easyroads released a week ago

    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3.ERModularBase.OQOOCDQCCC (System.Boolean& multTerrainResFlag)
    EasyRoads3Dv3.ERRoadNetwork..ctor ()

    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3.ERModularBase.ODQCCOQOQQ (System.Boolean& multTerrainResFlag)
    EasyRoads3Dv3Editor.OQQDDDQQDC.OnEnable ()
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi joe_ftg,

    What are the exact steps to reproduce this?

    Thanks,
    Raoul
     
  31. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    Biome Masks are fine, I've written a script that converts Veg' Masks to Biome Masks and the problems go away.
     
    raoul likes this.
  32. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    New question. Roundabouts. I'm getting a number of exceptions when I try to create roads from a roundabout. If I try to connect to a roundabout I just get the dreaded red light. Any idea what's happening here?


    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <567df3e0919241ba98db88bec4c6696f>:0)
    EasyRoads3Dv3Editor.OQQDDDQQDC.OQDCCODDDC (UnityEngine.Vector3 pos, EasyRoads3Dv3.ERModularBase baseScript, EasyRoads3Dv3Editor.OQQDDDQQDC eScr) (at <33c0626b4a53495a928d5aefcf46b8f8>:0)
    EasyRoads3Dv3Editor.OQQDDDQQDC.ODQDQOQQCO (UnityEngine.Vector3 pos, System.Boolean ODCODDOCCD, UnityEngine.Event cEvent, EasyRoads3Dv3.ERModularBase scr, System.Boolean dragStageFlag) (at <33c0626b4a53495a928d5aefcf46b8f8>:0)
    EasyRoads3Dv3Editor.OQQDDDQQDC.OnSceneGUI () (at <33c0626b4a53495a928d5aefcf46b8f8>:0)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
    UnityEditor.SceneView.CallOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:3292)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2539)
    UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2400)
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <567df3e0919241ba98db88bec4c6696f>:0)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <567df3e0919241ba98db88bec4c6696f>:0)
    UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:359)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:353)
    UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:329)
    UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect, System.Boolean floatingWindow, System.Boolean isBottomTab) (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:374)
    UnityEditor.DockArea.OldOnGUI () (at C:/buildslave/unity/build/Editor/Mono/GUI/DockArea.cs:341)
    UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize) (at C:/buildslave/unity/build/Modules/UIElements/IMGUIContainer.cs:281)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

    GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced.
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
     
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Is that still related to EasyRoads3D? Just in case, Biome masks are supported and can be added directly to the roads.

    Thanks,
    Raoul
     
  34. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    Yes and no. Yes - Veg Mask Lines should be used with ER and they don't work with Veg Masks. No - none of the tech involved is a responsibility of ER. But it might be worth noting this 'issue'.
     
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Yes, it is worth noting the issue between Vegetation Masks and Vegetation Mask Lines, thank you for sharing that info. But in what way should Veg Mask Lines be used with ER? EasyRoad3D supports both Vegetation Mask Lines and Biome Masks.

    Thanks,
    Raoul
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Roundabouts is not entirely stable at the moment but that is related to building / setting up the roundabout.

    If not, I just tested this with the provided roundabout prefab, both pulling out new roads and connecting existing roads works without errors. How can this be reproduced?

    Thanks,
    Raoul
     
  37. HeloiseL

    HeloiseL

    Joined:
    Apr 25, 2019
    Posts:
    4
    Hi Raoul,
    After getting easy roads 3D pro, the connection prefabs do not appear in the intersection tab. However they are present in project's folders. Is there a way to solve that issue so that I can use the intersection prefabs already present in the project?
    Thank you in advance !
     
  38. donkey0t

    donkey0t

    Joined:
    Oct 23, 2016
    Posts:
    71
    FYI If anyone needs a clunk conversation script from Vegetation Masks to Biome Masks you can grab it from here; https://pauliom.com/2020/02/11/convert-vegetation-studio-pros-vegetation-mask-to-biome-mask/
     
    raoul likes this.
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi HeloiseL,

    Are these Pro / demo package prefabs or HD Roads Add On prefabs? For HD Roads Add On prefabs, was EasyRoads3D Pro imported first? Can you try removing the prefabs from /Assets/EasyRoads3D/Resources/custom prefabs/ and then reimport the HD Roads package? Does that solve the problem?

    Thanks,
    Raoul
     
  40. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Raoul,

    I am getting an error as I iterate through roads in code.

    Code (CSharp):
    1.  
    2. foreach (ERRoad road in roads)
    3.         {
    4.             int lanes = road.GetLaneCount();  //error happens here
    5.  
    6.  
    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3.ERRoad.GetLaneCount () (at <a7d1335a4a7c4a82866879487b0913c3>:0)
    ER3D_Traffic.CreateRoadEntities () (at Assets/HBC/Scripts/ER3D_Traffic.cs:123)
    ER3D_Traffic.Start () (at Assets/HBC/Scripts/ER3D_Traffic.cs:54)

    I even had a check to see if the "road" object was null, but it still happens. When I wrap the line in a Try..Catch
    Code (CSharp):
    1.  
    2.             try
    3.             {
    4.                 lanes = road.GetLaneCount();
    5.             }
    6.             catch (System.Exception ex)
    7.             {
    8.                 Debug.Log(road.GetName() + " " + ex.Message);
    9.             }
    I get: "Object reference not set to an instance of an object"

    I have rebooted my machine and Unity multiple times, and still the issue persists. I am looking at what I believe is the correct road object in the Hierarchy and cannot see any differences between it and all the other roads that are not throwing an error.

    Any Ideas?
     
  41. raoul

    raoul

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

    So road is null in line 8? What does the roads array represent? Is this returned by ERRoadNetwork.GetRoads()?

    Or what is the error after wrapping it in Try Catch?

    Thanks,
    Raoul
     
  42. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Yes, the road array is from these two lines of:
    Code (CSharp):
    1. ERRoadNetwork roadNetwork = new ERRoadNetwork();
    2.         ERRoad[] roads = roadNetwork.GetRoads();
    The error in the try/catch is: "Object reference not set to an instance of an object"

    edit: The road is not null at any time.
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    So it is known for which road this happens?

    There is no known issue with GetLaneCount() in the current v3.3 alpha build. Is the assigned road type all setup including v3.3 road shape data with lane info? Looking at the code this could throw a NullReferenceException when the road type is not v3.3 ready. I will make sure that will throw a proper message. Other then that looking at your code all should be fine. It will only return the number of lanes set for the assigned road type.

    Thanks,
    Raoul
     
  44. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    FYI: This is with the alpha of v3.3, sorry I should have said that sooner.

    I'll try to replace the road and see if this goes away. I'll let you know what I find out.
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    I was referring to v3.3 alpha too, v3.3 road type changes specifically, AI lane data is v3.3.

    You can try replacing the road, but it would be interesting to know what the actual problem is if the ERRoad reference itself is not null. There is only a couple of lines of code in GetLaneCount(), road type related.

    Thanks,
    Raoul
     
  46. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    The odd thing is, when I selected this road in the Hierarchy it was not highlighted in the Game. I deleted it and THAT error is resolved... I BELIEVE.

    The next question I have is; Is there a way to run "Clear Lane Connections" and "Reset Lane Connections" in bulk, as opposed to selecting each connection, then pressing those buttons.
     
  47. PrimusThe3rd

    PrimusThe3rd

    Joined:
    Jul 3, 2017
    Posts:
    69
    Hi, sorry if it is too noob question, but here it is. :) How can I make transparent textures ..let's say if the roads are placed in the sky...riders will see through it (semi transparent). Regards, Primus
     
  48. raoul

    raoul

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

    Were the roads created manually in the Unity editor or through the scripting API? Perhaps the road was created but no markers were added so there is no actual road mesh? But that would not explain the NullReferenceException. Road types are added when the road is created.

    "General Settings > AI Traffic" includes a "Reset All Connections" button.Clear Lane Connections" can be added.

    I will also add options for this to the scripting API.

    Thanks,
    Raoul
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721

    Hi PrimusThe3rd,

    That is more material related. Either a shader can be used with control over transparency when the opacity level is the same for the full material. Otherwise the opacity level can be defined in the alpha channel of the texture and use Transparent for the rendering mode in the shader settings.

    Thanks,
    Raoul
    .
     
  50. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Hola.

    Voy a exponer unos problemas y unas dudas. Lo hago en Español y luego pongo la traducción al inglés. Me temo que cuando pongo el inglés no se me entiende muy bien y sé que el autor habla Español.

    Me dedico a hacer un juego de competición de coches. Un juego off-road. Los tramos de competición tienen, en ocasiones, hasta 40 km. de recorrido.

    Hasta ahora tenía ese recorrido en tramos de carretera de 1.5 km (aproximadamente) como máximo. Sin embargo, y debido a comportamientos extraños de las físicas de los colisionables de las ruedas, me han recomendado no hacer tramos superiores a 200-300 mts.

    Así que estoy volviendo a trocear las carreteras. Y me encuentro con lo siguiente.

    1- Una cosa que hay que evitar (según me han aconsejado) es que existan diferencias de pendiente demasiado grandes para que la malla no se vea afectada. Por lo tanto utilizo muy el botón "Distribute Y Evenly". El problema me surge ahora que he "cortado" las carreteras usando un I CONNECTOR. Distribuir Y ya no funciona bien ya que entre una y otra carretera se produce un "salto". La pregunta es: ¿hay forma de seleccionar dos módulos de carreteras para hacer esta operación? Y, en caso negativo... ¿cómo podría solucionarlo? Es imposible coger la última marca de la carretera 1 y la primera de la carretera 2 para ponerles una pendiente coherente ya que no permite variar el valor y de cada marca mientras exista el I Connector.

    En las imágenes se puede apreciar cómo el "conector" ha generado una irregularidad que anteriormente, cuando era una única carretera, no existía.

    Gracias

    EasyRoad está en la última versión.
    Unity 2019.2.20f1

    ******************************************************************************

    Hi.

    I will expose some problems and doubts. I do it in Spanish and then I put the English translation. I'm afraid that when I speak English I don't understand very well and I know that the author speaks Spanish.

    I dedicate myself to making a car racing game. An off-road game. The sections of competition sometimes have up to 40 km. travel.

    Until now I had that route in sections of road of 1.5 km (approximately) maximum. However, and due to strange behavior of the physical collision of the wheels, I have been recommended not to make stretches greater than 200-300 meters.

    So I'm cutting the roads again. And I find the following.

    1- One thing to avoid (as I have been advised) is that there are too large slope differences so that the mesh is not affected. Therefore I use the "Distribute And Evenly" button very much. The problem arises now that I have "cut" the roads using an I CONNECTOR. Distribute And it no longer works well since between one road and another there is a "jump". The question is: is there a way to select two road modules to do this operation? And, if not ... how could I solve it? It is impossible to take the last mark of the road 1 and the first of the road 2 to put a consistent slope since it does not allow to vary the value and of each brand while the I Connector exists.

    In the images you can see how the "connector" has generated an irregularity that previously, when it was a single road, did not exist.

    Thanks!!!

    ROAD1.png ROAD2.png

    EasyRoad update last version.
    Unity 2019.2.20f1