Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    So I see with osm files that I need an extirely flat terrain that is totally centered (which Gaia does not do). I am trying to spawn residentials, Primary and Service roads with intersections when the osm file gets uploaded. How do I automatically add these during spawn time.
     
    Last edited: Jan 17, 2022
  2. raoul

    raoul

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

    Also when using the scale options, the road marker positions returned by the OSM file will snap to the terrain height at that position. An entirely flat terrain is not required.

    But, as mentioned last week, the results depend on the OSM file and your terrain unless the terrain is rather flat. That is why it is recommended to use matching terrain DEM data when working with OSM files.

    What you could test is assigning road types to the OSM residential, Primary and Service Roads with "Follow Terrain Contours" in the "Road Detail" section switched on. This will align the road objects with the terrain regardless the marker positions.

    I am not sure what you mean with the first part about needing a terrain that is totally centered?

    Intersections are currently not yest auto inserted because OSM data file can be very complex. X and T intersection support is implemented but not active yet by default because in these complex situations it will probably require more time fixing unwanted results than adding the intersections manually.

    Thanks,
    Raoul
     
  3. SickaGames1

    SickaGames1

    Joined:
    Jan 15, 2018
    Posts:
    1,270
    @raoul This is what I get when I import the beta into my current version. Anyway to get the shaders back? The current beta appears to not work with the Demo project to well.

    upload_2022-1-18_11-33-41.png
     
    Last edited: Jan 18, 2022
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hello @SickaGamer,

    The v3.3 beta package uses shaders for a standard Unity 3D project. It seems this is an URP or HDRP project. That is what will cause the pink materials. The v3.3 beta scripts work well in the demo package.

    It is a matter of either skipping the import of the shaders from the beta package. Or reimport the previous shaders for the specific render pipeline. These URP / HDRP material / shader packages are located in the "SRP Support Packages" folder of both the EasyRoads3D Pro and the demo package.

    Otherwise, which material is this? The beta package only includes one material, if there is a shader issue with this specific material, please try to reassign the "ER Road" shader to this material.

    Thanks,
    Raoul
     
  5. NotoMuteki

    NotoMuteki

    Joined:
    Feb 8, 2018
    Posts:
    42
    How to activate v3.3 sidewalk presets?
    I looked into Sidewalks tab in General Settings but couldn't find none of those.
    スクリーンショット 2022-01-19 025735.png
     
  6. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi,
    I have a doubt about tunnels: when I add tunnels in edit mode they are placed correctly by ER, but they don't "dig" the hole in the mountain, so the mountain continues in the tunnel entrance.
    What am I missing? Thanks!
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hi NotoMuteki,

    Is this your own scene or the beta demo scene? Currently sidewalk presets are scene specific. The demo scene in the new v3.3 beta 5 includes two sidewalk presets. Info can be found here: https://www.easyroads3d.com/v3beta.php

    Your screenshot shows the sidewalk options from the previous beta. Can you try the new beta 5?

    In the next update sidewalk presetsit will be possible to use the same sidewalk presets across scenes and projects.

    Thanks,
    Raoul
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hi @tomobiki,

    Are these your own tunnel side objects or one of the examples in the demo package?

    In general, currently holes can be auto generated in the terrain when the tunnel side object is marked as a tunnel object and auto generated based on the terrain profile, and when "Cut Holes" in the "Auto Generate" settings is active.

    The holes at the start and end will be created when switching to Build Mode through the middle mountain tab, the state where the terrain is adjusted to the road network. The results will depend on the terrain specification. The provided examples are optimized for terrain objects using the default settings, this is terrain size and heightmap resolution related.

    Thanks,
    Raoul
     
    tomobiki likes this.
  9. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    HI, thanks.
    Yes I am using the tunnel provided in the demo package.
    I've understood now, I'll make a test following your indications.

    Thanks!
     
    raoul likes this.
  10. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hello Raoul.

    Just getting this error when trying to "Store Mesh Assets in Project Folder" in build mode:

    EasyRoads3Dv3 Error: No valid scene name found, please contact us. Scene name: RS3
    UnityEngine.Debug:Log (object)
    EasyRoads3Dv3Editor.OOCQQDDDQO:OQQCDQOOCQ (EasyRoads3Dv3.ERModularBase)
    EasyRoads3Dv3Editor.ODQDODQODQ:OnInspectorGUI ()
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)

    Is really name related? How can I surround it?
    The idea is create prefabs of the roads to put it into addressables. Nothing else to edit anymore. Just willing the prefabs. Have to "Finalize" the RoadNetwork first? Later? I try both but keep getting the error.
    Also tried to did the prefabs mannually but the result didn't get the global position. Only (0, 0, 0). The funny thing is that the Connection Objects do have the global position in the transform but the Roads Objects do not.
    Summarizing. How can I have this (non RoadNetwork related) prefabs of roads section with its actual global position?
    Thanks,
    Joan
     
  11. raoul

    raoul

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

    That is known with regard to the "Store Mesh Assets in Project Folder" option, could you try making the scene name, RS3, a little bit longer? I belief at least 7 characters.

    Is the second part of your post related to this? It seems a different subject, what exactly is the problem here if you want to make a prefab from the full road network.

    Or do you want to create prefabs from indivisual road objects with the pivot point in the center of the road? This can be changed through the scripting API, the ERRoadNetwork class, CenterPivotPoints()

    Thanks,
    Raoul
     
  12. MichaelRobson

    MichaelRobson

    Joined:
    Jun 24, 2021
    Posts:
    24
    Good afternoon

    I am confused as to how better control side objects. I've watched the videos but I am having issues.

    I want greater control over sections of road but when I connect them they become one section and the side object rules are not what I desire. Is there a way to connect roads but in the hierarchy they remain as separate sections?

    upload_2022-1-19_12-27-4.png

    Also how to do side objects on flex connectors?

    upload_2022-1-19_12-27-43.png
     
  13. raoul

    raoul

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

    In the first image, is the wall on the right road object auto generated and should the wall not appear on the left road object?

    In that case you indeed want to connect both roads but keep them as separate objects in the hierarchy. To do that an I Connector can be attached to one of the two road objects and the second road object can connect to the other side of the I Connector. That way the road curve will be generated as if this is a single road object. The I Connector option is available further below in the marker settings after selecting one of these two roads. It can be attached to the start or end of a road object but it can also be inserted at any other marker. The road object will be split in two objects

    Currently side objects are roads only. Support on Flex Connectors and other connection types is being worked on in a way that optionally a side object will continue when the same side object is active on both sides like in the second image you posted.

    Thanks,
    Raoul
     
    MichaelRobson likes this.
  14. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Raoul. Thanks for reply.

    I'm willing to use prefabs from individual road objects as individuals gameObjects with its location in the scene without any relation with the RoadNetwork because I can't create all the roads I need in the same RoadNetwork. (Too many kilometres) So, I create differents scenes with its own road network. All the objects in this scenes are loaded as addressables in the persistent scene and now I need to do the same with road objects.
    As you can see at (458) I can do that with Conexion Object because it has a global scene position in the transform but, the transform of the Road Objects (459) are always (0,0,0).

    So, how can I have the scene global position of every RoadObject or how can I export the RoadObjects to used with no RoadNetwork? if is possible...

    I have changed the name of the scene to a longer one and "Store Mesh Assets in Project Folder" works fine. Seems however that it is not what I thought. I thought it would save gameObjects with its meshes but it seems that it only saves the meshes, so it doesn't work for me.

    Thanks,
     

    Attached Files:

  15. raoul

    raoul

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

    The road objectas are generated relative to (0,0,0). What do you mean with global position? And how do you want to use that?

    As mentioned in my previous post, if you want to create prefabs of the roads with the pivot point at the center of the mesh, than CenterPivotPoints() in the ERRoadNetwork class will do that. But since you want to create prefabs, I guess you want to store this position somewhere if that is not the actual prefab transform position.

    "Store Mesh Assets in Project Folder" does exactly that, it will store the mesh asset in the project folder which is required for Unity prefabs. The actual prefab can be created from the road object in the hierarchy.

    You could also try the Unity FBX Exporter if you want "prefabs" of all the individual road objects.

    Thanks,
    Raoul
     
  16. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hey @raoul

    you suggestion works in a way but not exactly correct. When i add all the tires to a prefab and create a side object based on it, is spawns them but child objects are not aligned... as i can understand only the prefab root is aligned... how to get all the children aligned as well ? ( This is in "All" mode ! )

    upload_2022-1-20_11-24-23.png

    When i try "Child Sequence" or "Random" it does that ( the image below ). I would like to set up the side object like in the first image but also get the children aligned as well !

    I really can't gen the objects aligned properly !
    Am i missing something ?

    upload_2022-1-20_11-26-34.png

    Also, the distance between objects is different for left and right side, see how the objects are overlapping here.. and i don't have per marker setting to adjust that !

    upload_2022-1-20_11-34-43.png
     
    Last edited: Jan 20, 2022
  17. CitrioN

    CitrioN

    Joined:
    Oct 6, 2016
    Posts:
    101
    Hello,
    I'm having trouble getting I Connectors working correctly with the runtime API.
    I want to connect two roads with an I Connector by first calling
    Code (CSharp):
    1. road1.InsertIConnector(markerIndex1, "I Connector", out ERConnection iConnector);
    and then trying to connect the second road with
    Code (CSharp):
    1. road2.ConnectToStart(iConnector, 1);
    The I Connector is correctly attached to the first road but it does not show the second road in the I Connector Inspector.
    It does however show up if I click the update button in the inspector. I can't figure out what the corresponding method for that button is to call it in code instead.
    This doesn't appear to update the roads correctly so they both align with the connector and make a smooth road.
    I was able to also manually update/fix this by moving the I Connector slightly like suggested in the docs.
    I tried calling
    Code (CSharp):
    1. iConnector.Refresh();
    and
    Code (CSharp):
    1. iConnector.SetPosition(iConnector.gameObject.transform.position + new Vector3(0, 0.01f, 0));
    but they did not seem to have any effect.

    Am I missing something or is there a suggested workflow to achieve what I'm trying to do?

    Thanks
     
  18. raoul

    raoul

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

    This is related to the situation you posted last week. Below is a link to my reply:

    https://forum.unity.com/threads/eas...-new-road-system.229327/page-205#post-7801848

    So it seems these child objects still have unbaked transform rotations in blender. In that case Unity will apply rotations to these objects when the prefab is dropped in the scene but since these child objects are instantiated separately in sequence or randomly they are instantiated with the original rotations. Unfortunately this information is not available through the Unity API. So to fix this, either bake the transform rotations in blender or prepare a new prefab in Unity and put each child under a new parent and apply this rotation correction to the child. Does that make sense?

    Regarding the alignment on the left and right in bends, in general when the "Distance between Objects" value is smaller then the bounds of the prefab, instances will overlap.

    So, by default the "Distance between Objects" value is used to spawn the objects, regardless whether this is the inside or the outside of the bend. It is possible to align instances on the left and right, "Synch Left Right" will do that. Which settings are you using here?

    In the first and last image it seems a prefab is used with 6 childs. I don't think you want to use that approach, it will be impossible to align the individual childs at equal distances in bends.

    Thanks,
    Raoul
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hi @CitrioN,

    I tested this and indeed road 2 is not updated. That is the main issue here, the I Connector is set correctly and internally road 2 is connected but road 2 is not refreshed. That is probably because an I Connector by default does not generate a mesh that will automatically update the attached road objects as well.

    I will check this and make sure that road 2 is actually refreshed after ConnectToStart() when this involves an I Connector .

    Meanwhile, can you try:

    road2.Refresh();

    After the line: road2.ConnectToStart(iConnector, 1);

    Thanks,
    Raoul
     
    Last edited: Jan 20, 2022
  20. CitrioN

    CitrioN

    Joined:
    Oct 6, 2016
    Posts:
    101
    Thank you very much for the quick reply and explanation.
    Looks like I was somewhat close to the solution with trying to refresh the connector.
    Just didn't try the road(s) :oops:
    Refreshing road2 with

    does connect and align them properly.
    Thanks for your help!
     
    raoul likes this.
  21. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Raoul.
    I'll try to explain myself better.

    If you see image attached (461) I just added an IConnector at this point and it have the transform position with its value relative to the scene. I can now save this connector as prefab and instanciate it later to this position even in a scene without RoadNetwork.

    Is there any way to do the same with road sections? Can those road sections be converted into an isolated gameObject?

    Thabks, Captura de pantalla (461)_LI.jpg
     
  22. raoul

    raoul

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

    So when you create a prefab of the IConnector (which I think is not really necessary in this case as it is only used as a data connector, no mesh involved), the prefab is stored with the transform position in the project folder?

    For road objects the transform position by default is (0,0,0), that will work in exactly the same way. The road mesh will be in the exact same position as in the original road network. What exactly is the problem that you are facing in your specific workflow with this?

    My previous posts includes info on how to change the pivot point position of road objects if you prefer to have this in the center of the road object. Dropping the road object from the hierarchy in the project folder will work similar as for the I Connector. This will now show the position at the center of the road.

    The other part that needs attention in your workflow, is mesh asset related if you want to use specific road objects in another scene. This was covered in my previous post of yesterday https://forum.unity.com/threads/eas...-new-road-system.229327/page-206#post-7822632 . "Store Mesh Assets in Project Folder" is required to actually store the mesh in the project folder which appears to work well now, but this should be done after CenterPivotPoints() if that is also what you did.

    Which exact part is not clear or not working well for you? Can you provide exact steps of what you have done so far and at which point the results are not as expected?

    Thanks,
    Raoul
     
  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    @joanpescador,

    Is the main purpose of your questions to manually move road objects from scene A to scene B?

    In that case, the easiest solution for that is, open both scenes in the hierarchy and drag the specific road objects from scene A to scene B. Only save scene B. No need to do anything else.

    Thanks,
    Raoul
     
  24. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Raoul. Thanks for your patience.
    Yes.

    I am trying to create a scene with 800 km. of road. Since neither Unity nor my computer could handle editing everything at the same time, I have divided all the objects, including the terrain, into 96 different projects with about 500 scenes each. All of these scenes are addressables. These addressables have a concrete name structure:
    name = transform.position.x + transform.position.y + transform.position.z
    When the game run, a vector3 list of all addressables is generated. Then, the scenes are simply downloaded and instantiated as additive according to their position and the position of the player:
    Captura de pantalla (463).png
    This way I can just call any amount of scenes even from other projects. It is hard to sinchronize the position of differents projects but I create some tools to do it.
    It works perfect for terrains and any other GO but without a position relative to the scene on the roads, I can't find a way to integrate them.
    I can create a prefab of each road section assigning the mesh manually after generate the meshes through "Store Meshes Assets in Project Folder", but I still don't know how to assign the values to the transform that correspond to its position in the scene. Perhaps CenterPivotPoints() could give those positions? I don't care if it's in the center pivot point of the object or any of its corners.
    I know it's a bit of a pretentious experiment but I want to keep trying.
    If I couldn't get the position of the road sections, is it possible to have an empty roadNetwork in a persistent scene and load the road sections with addressables?

    Thanks again,
    Joan
     
  25. raoul

    raoul

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

    If your project is not finalized yet, then it seems that CenterPivotPoints() will do what you are looking for. Can you do a quick test with this in a new project / scene just to test this workflow?

    A simple editor script for CenterPivotPoints():
    Code (csharp):
    1. // create a reference to the road network object in the scene
    2. ERRoadNetwork roadNetwork = new ERRoadNetwork();
    3. roadNetwork.CenterPivotPoints();
    Thanks,
    Raoul
     
    joanpescador likes this.
  26. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Cool!
    I'm gonna try.
    Thanks,
     
    raoul likes this.
  27. CitrioN

    CitrioN

    Joined:
    Oct 6, 2016
    Posts:
    101
    Getting the following error occasionally when trying to build a dynamic crossing at runtime with

    Code (CSharp):
    1. road.ConnectToEnd(connection, closestConnectionIndex, true);
    Code (CSharp):
    1. Failed extracting collision mesh because vertex at index 0 contains a non-finite value (488.739471, -nan(ind), 750.994751). Mesh asset path "" Mesh name "ER Road Mesh"
    2. UnityEngine.StackTraceUtility:ExtractStackTrace ()
    3. EasyRoads3Dv3.ERModularRoad:ODCQCDCQQO (bool,bool)
    4. EasyRoads3Dv3.ERCrossingPrefabs:OQCOOCOQDO (bool,EasyRoads3Dv3.ERModularRoad)
    5. EasyRoads3Dv3.ERCrossingPrefabs:OODCOOCQCD (UnityEngine.Vector3,UnityEngine.Vector3,int,EasyRoads3Dv3.ERModularRoad)
    6. EasyRoads3Dv3.ERModularRoad:ODOQOCDOQQ (System.Collections.Generic.List`1<EasyRoads3Dv3.ERMarkerExt>,single,bool,System.Collections.Generic.List`1<single>&,System.Collections.Generic.List`1<single>&,bool,System.Collections.Generic.List`1<single>&,System.Collections.Generic.List`1<single>&)
    7. EasyRoads3Dv3.ERModularRoad:ODCQCDCQQO (bool,bool)
    8. EasyRoads3Dv3.OQDDOOCQDD:OQQCQOQQCO (EasyRoads3Dv3.ERModularRoad,UnityEngine.Vector3,EasyRoads3Dv3.ERCrossingPrefabs,int,bool,bool,bool)
    9. EasyRoads3Dv3.ERRoad:ConnectToEndEx (EasyRoads3Dv3.ERConnection,int,bool)
    10. EasyRoads3Dv3.ERRoad:ConnectToEnd (EasyRoads3Dv3.ERConnection,int,bool)
    Any idea what could cause it and how I can potentially avoid it?
    My roads connected to the crossing may sometimes overlap or have an odd angle.
    Could this cause the error?
    If so what would be the workflow/code to get the roads more aligned or the crossing rotated in a way that the roads better align.

    Thanks,
    CitrioN
     
  28. raoul

    raoul

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

    The message is mesh data related so it is seems very specific to the shape of road objects in your scene.

    Since the road objects and connection objects seem to be generated through the scripting API, what is the source of the road data?

    Could it be that road objects are very short in a way that there is no space, or hardly any space after attaching them to connection objects? That could cause these errors. In early v3 beta versions this type of errors were thrown also when adding roads manually in the Unity editor. This was related to what is described above.

    I am not sure how roads overlap in your situation so it is hard to give feedback on getting the road objects better aligned. I assume this is related to road marker placement? Perhaps also near connection objects? When doing this manually, the code will take marker positions into account and they will be removed when within a specific range of a connection object. When using the scripting API, this sort of logic is probably something to take into account.

    Regarding the intial connection object alignment, are you instantiating connection objects directly in the scene or is AttachToStart () AttachToEnd() used to instantiate the connection object in the scene? Because that will align the connection object with the specific road object.

    Thanks,
    Raoul
     
  29. CitrioN

    CitrioN

    Joined:
    Oct 6, 2016
    Posts:
    101
    I'm calculating the road markers myself. Each road only has two markers at the moment and I connect them either with an I Connector or a dynamic crossing.

    This is a common situation I get where two roads partially overlap when trying to connect to the crossing. For X crossings it's sometimes worse. Roads are usually not short so I don't think that affects it in my case.

    Roads_Intersection_001a.png Roads_Intersection_001b.png

    I'm using AttachToStart() on the first road and ConnectToEnd() on the remaining roads.

    Thanks,
    CitrioN
     
  30. raoul

    raoul

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

    That is quite a sharp angle. Have you tried that manually to see if it is actually possible?

    What type of connection prefab is this? It is most likely impossible to get good results with the built-in connection options in v3.2 which requires road angles more above 60 degrees. The Flex Connector in the v3.3 beta can do sharper angles, but I would still experiment with this manually to see what is actually possible.

    One thing we have to take into account in these situations. When the road objects are almost laid out parallel near to each other and the terrain is not 100% flat it will be hard to adjust the terrain accurately unless a very small terrain heightmapscale is used. That is why there are angle limitations on connections even with the Flex Connector.

    Thanks,
    Raoul
     
  31. CitrioN

    CitrioN

    Joined:
    Oct 6, 2016
    Posts:
    101
    It doesn't work manually either.

    I have now added code to my generation algorithm that adds an additional marker if the angle between two adjacent roads connected to the same crossing is to sharp. This will correct the angle of the road to be above 60. While this somewhat works the resulting dynamic crossing object is still a bit squashed as you can see in the image below. I have tested this case manually and the resulting crossing object looks correct. However, I'm not sure how to get the same result for the generated roads and crossing. I have tried refreshing the crossing as well as the connected roads. None made a different in the resulting crossing mesh. I think if there is no obvious solution for this case I will wait for the flex connector and go with the result I currently get with the dynamic crossing for the time being.

    Roads_Intersection_002.png

    It's a regularly generated dynamic prefab for the road type I'm using.

    Thanks,
    CitrioN
     
  32. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
  33. raoul

    raoul

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

    The situation in your last image should not cause any issues. There are no known issues with the scripting API and instantiating connections / attaching roads so it is hard to give further feedback.

    Could you post a very simple example of your code that generates three roads and a connection object in between these roads with the end result like in your image?

    Thanks,
    Raoul
     
  34. raoul

    raoul

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

    Are you asking for Bing Maps support?

    Thanks,
    Raoul
     
  35. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    68
    Hi, Raoul!

    I'm on Unity 2020.3.11f1, ER3D v3.3.b2.

    My road is about 10km, splatted to several connected roads. I tried to add side objects (tessellated curb) for only chosen markers, but stuck.
    I see errors in console on any UI action. The only moment I can interact with the scene is after restart prior to select ER network.

    Sometime ago I met this problem several times. But it was related to re-connecting the roads. ER3D fire obfuscated errors blocking any Unity UI actions. I fighting with it for ~2 days and solved by deleting "phantom" roads several time and re-created part of the road.

    Now I'm finally confused because I can't see any way to restore ER network on this scene. Please, help.

    Do you have any idea what can I do with it?

    Top part of log:
    Code (CSharp):
    1. ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    2. Parameter name: index
    3.   at System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) [0x00029] in <695d1cc93cca45069c528c15c9fdd749>:0
    4.   at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <695d1cc93cca45069c528c15c9fdd749>:0
    5.   at System.Collections.Generic.List`1[T].set_Item (System.Int32 index, T value) [0x00009] in <695d1cc93cca45069c528c15c9fdd749>:0
    6.   at EasyRoads3Dv3.ERMesh.OCCQOOCOOQ (UnityEngine.GameObject go, EasyRoads3Dv3.SideObject so, EasyRoads3Dv3.ERModularBase scr, System.Collections.Generic.List`1[T] sVecs, System.Collections.Generic.List`1[T] sUv, System.Collections.Generic.List`1[T] sUv2, System.Collections.Generic.List`1[T] sColors, System.Collections.Generic.List`1[T] sNormals, System.Collections.Generic.List`1[T] sTangents, System.Collections.Generic.List`1[T] sTriangles, System.Collections.Generic.List`1[T] normalArray1, System.Collections.Generic.List`1[T] normalArray2,
    upload_2022-1-25_3-46-40.png
     

    Attached Files:

  36. NotoMuteki

    NotoMuteki

    Joined:
    Feb 8, 2018
    Posts:
    42
    Thank you. Now I started using b3.5 flex connectors with sidewalks.
    But It seems like this feature is a little bit unstable.
    I recorded some errors.




    And one more thing, when I toggled on Flex connector, connector segments become something like this:
    スクリーンショット 2022-01-25 155325.png
    But with these lane paths AI cars can't turn left or right.
    How can I fix these lane connections like the image below?
    スクリーンショット 2022-01-25 155518.png

    Unity: 2020.3.12f1
    EasyRoads3D.v3.3.b5 - Unity 2019.3+
     
  37. raoul

    raoul

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

    First of all, since you are using v3.3.b2, could you please update to the latest v3.3.b5? There are many improvments and bug fixes since b2.

    Regarding the error, it seems these are repetetive errors after each scene update. Playing the scene or a script change will reset the editor. So that can probably be used instead of having to restart Unity.

    The error itself points to side objects, a problem with the actual final side object mesh generation.

    Could you first backup your project, update the beta version and post back if the problem still persists.

    Thanks,
    Raoul
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi @NotoMuteki,

    Thank you very much for the detailed videos and the feedback. Since there is a lot happening and this is v3.3 beta, could you post this sort of more complex beta issues in a direct conversation. Because debugging this will probably involve back and forth conversations, causing noise here on the public forum.

    Sidewalks in v3.3 is still young and WIP, here on the forum it is mentioned several times this is complex. Instead of jumping straight into it, creating intersections with crosswalks in your scenes it is recommended to test this. And see if it already work well for your specific requirements...

    Regarding the videos, this looks like HD Roads Add On assets. It seems you created new X connection prefabs.

    First video:

    The old workflow is used, insert X connector, attch roads and turn it into a Flex Connector. This is a temporary workflow to upgrade built-in intersections to v3.3 Flex Connectors.

    The new workflow is drag and drop markers on other roads to auto insert Flex Connectors.

    I see in the first video that there seem to be an issue with the sidewalk on the road. I am not sure if the above is related but you may want to try that workflow.

    What happens when you move the road or one of the two connections? Does this second sidewalk remain at the same position? In that case this is probably related to a previous v3.3 beta issue where sidewalk references are not correct. to fix that, select the road and look in the hierarchy for sidewalk objects. Remove all objects and refresh the road network / move a road marker or the intersection or deactivate / activate the sidewalk, any action that will update the road. This will rebuild the sidewalk.

    1.55: after inserting a crosswalk the sidewalk triangulation is wrong. This can happen and will be improved. Usually moving the interscetion will update it. Also, since this is all user settings related, crosswalk types, size etc. at this moment when you see these issues you may want to first experiment with corner radius as well to get the optimal results. And set theseoptimal values for the specific road type before creating all the intersections.

    2.46, the left sidewalk is activated without selecting a preset. That should not be possible, I will make a note of this. But what happens in the scene and in the remaining of the first video is probably a result of that.

    Second video:

    - What happen at 0.15 is unknow. Can you constistently reproduce this on every intersections and in that case provide exact steps to reproduce this or otherwise could you send this scene, road network only if you want, so we can look at it.

    Third Video:

    - The focus is on the Road 2 connection, but sidewalks are activated for road 1 which is not visible at that point, it becomes visible near 0.35, the corner sidewalk is generated. Up to 1.25 several things happen, I am not sure if you are asking something here?

    Then crosswalks are activated, all seems to work well so far. Sidewalks are added for Road 2, all seems good.
    2.54: I am not sure what happens here. MainRoad_1x1 007 is selected. An error is thrown in the console. What was this error? Everything that happens after this is a result. The Flex Connector at the top is not updated.

    In general, it is hard to give exact feedback on this without being able to look at it. As mentioned above it would be very much appreciated if we can look at this scene on our end to see what causes these errors.

    Regarding your last question. Lane connections can be auto generated based on the rules for the road type and the rules set in General Settings > AI Traffic. What are these settings? Lane Connection can be set manually by dragging the rectangle at the start of a connection to the target handle at the eend of the lane connection.
    Is this a 3 lane road? Because the second image shows a setup for 3 lanes.

    Thanks,
    Raoul
     
  39. oleg_v

    oleg_v

    Joined:
    Nov 10, 2017
    Posts:
    68
    Thank you for answer!
    I found a way to deselect/select the road network (for Unity to start react UI again), then delete previously created side-objects in hierarchy. Next I disabled them in road side objects for problem road parts.
    Original cause was related to non-combined side-objects with disabled "Default active for all markers" checkbox. Created side-object was splitted to chunks in hierarchy.
    Changed side-object to combined and it solved the problem.

    BTW, I also changed road resolution, bumpyness and clicked "Apply to all markers". In some cases it lead to align of left or right indents to "terrain" not "road". And in case of align to "terrain", terrain became above the road.
    Is it possible to disable such auto switching of alignment? Because I was needed to manually check all markers on all roads to ensure of correct alignment.
    Align with "terrain" was never work for me, so it'll be good to know how to disable auto choose of alignment.

    I'll try to move to next beta later, because it'll require a lot of testing.
     
  40. raoul

    raoul

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

    Yes, the error causes the system to update the side object every frame because the process cannot complete. If you know what process causes it, which side object in this case, and disable it, than these repetetive errors should indeed disappear and the editor will not be locked anymore.

    The question still remains, what caused the error. I just tested the "Combine" option on a three marker road, the side object is inactive on the second marker so two side object sections are created. There are no errors, that is for both "Combine" Off and On.

    Regarding the second part which I assume is General Settings > Road Types related, this could also be fixed in the latest beta because what you say about Indent alignment changing sounds like a known issue that has already been fixed.

    These alignment options are not really road type related, more marker specific so this should not update after road type changes. Still assuming this is Road Type related? Otherwise which exact button did you click refering to "Apply to all markers"?

    Regarding updating, unless not many new v3.3 features are used, the current v3.3 beta 5 is a lot more stable then v3.3 beta 2.

    Thanks,
    Raoul
     
  41. NotoMuteki

    NotoMuteki

    Joined:
    Feb 8, 2018
    Posts:
    42
    Thank you so much for very detailed response.

    Agreed. Such as discord channel?

    I still can't make it out how to drop Flex Connector (not like changing normal intersection to flex)
    What kind of marker? Is there any tutorial or documentation for new v3.3b functions?

    Just now I've got the same thing happened and got the error.
    Code (CSharp):
    1. ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    2. Parameter name: index
    3. System.ThrowHelper.ThrowArgumentOutOfRangeException (System.ExceptionArgument argument, System.ExceptionResource resource) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    4. System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <695d1cc93cca45069c528c15c9fdd749>:0)
    5. System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <695d1cc93cca45069c528c15c9fdd749>:0)
    6. EasyRoads3Dv3.ERSideWalkVecs.BuildFlexSingle (EasyRoads3Dv3.ERModularBase baseScript, EasyRoads3Dv3.ERCrossingPrefabs prefabScript, EasyRoads3Dv3.ERConnectionSibling conn1, EasyRoads3Dv3.ERConnectionSibling conn2, System.Int32 index, System.Boolean conn1Priority, System.Collections.Generic.List`1[UnityEngine.Vector3]& verts, System.Collections.Generic.List`1[UnityEngine.Vector2]& uv1, System.Collections.Generic.List`1[UnityEngine.Vector2]& uv4, System.Collections.Generic.List`1[System.Collections.Generic.List`1[System.Int32]]& tris, System.Single turnSWAroundCornerThreshold, System.Collections.Generic.List`1[UnityEngine.Material]& mats, System.Collections.Generic.List`1[UnityEngine.Color]& colors) (at <dcf1432636784ffcbddabd905125b459>:0)
    7. EasyRoads3Dv3.ERSideWalkVecs.OQCQOCCCOQ (EasyRoads3Dv3.ERModularBase baseScript, EasyRoads3Dv3.ERCrossingPrefabs prefabScript, EasyRoads3Dv3.ERConnectionSibling conn1, EasyRoads3Dv3.ERConnectionSibling conn2, System.Int32 index, System.Int32 index2, System.Boolean conn1Priority, System.Single turnSWAroundCornerThreshold) (at <dcf1432636784ffcbddabd905125b459>:0)
    8. EasyRoads3Dv3.QDDDQODDQDQDQDD.OOOODDQOOC () (at <dcf1432636784ffcbddabd905125b459>:0)
    9. EasyRoads3Dv3.ERCrossings.OQCODDQQOC (EasyRoads3Dv3.QDQDOOQQDQODD sourceRoadType) (at <dcf1432636784ffcbddabd905125b459>:0)
    10. EasyRoads3Dv3Editor.QDDDOODDODQDQDD.OnGUI (EasyRoads3Dv3.ERCrossings cScr, EasyRoads3Dv3.ERModularBase baseScript) (at <06c5d424e45846f49c4eb867366e4e72>:0)
    11. EasyRoads3Dv3Editor.ODQQOQCDCD.OnInspectorGUI () (at <06c5d424e45846f49c4eb867366e4e72>:0)
    12. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <4161219cc34143e0a11c6faeaa303a62>:0)
    13. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    14.  
    スクリーンショット 2022-01-26 074252.png

    And I uploaded unitypackage which contains my scene.
    [link removed: do not publicly share third-party content]

    Dumb question but, isn't this related by Unity version difference?
    My Unity is 2020.3.12f1, and I installed "EasyRoads3D.v3.3.b5 - Unity 2019.3+.unitypackage"
    Is that really OK?
     
    Last edited by a moderator: Jan 26, 2022
  42. Notso

    Notso

    Joined:
    Oct 25, 2015
    Posts:
    44
    We spent some time, got the road system the way we want it. I select LOD groups and hit BUILD TERRAIN.
    It has now been 2:34:54 stuck on importing assets in the little dialogue box.
    Is this a normal amount of time to build a network? (I would say NO since we built it easier before checking that, we are preparing for the final build)
    Unity does not show as not responding and I can stil move around the scene. There are no error or warning messages in the console either...striking me as a bit weird but holding us upsince we need this before we can move on.

    Unity 2021.2.4f1
    Easy Roads Pro v3.3.b4

    EDIT...I take it back, I closed the project and reopened it and started again it does indeed throw this:
    ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index
    System.Collections.Generic.List`1[T].set_Item (System.Int32 index, T value) (at <00c558282d074245ab3496e2d108079b>:0)
    EasyRoads3Dv3.ODCODCCOCO.ODOODDDQQC (UnityEngine.GameObject road, UnityEngine.Mesh sourceMesh, System.Int32 LODCount, System.Int32 LODLevel, System.Int32 colCount, System.Collections.Generic.List`1[T] hardEdge, System.Collections.Generic.List`1[T] roadShapeMaterialIntCounts) (at <c6181cd2086a49d1a475999b8861b18c>:0)
    EasyRoads3Dv3.QDQDOOQQOOQDD.OQQCCCCCDQ (EasyRoads3Dv3.ERModularBase scr, System.Single& minx, System.Single& minz, System.Single& maxx, System.Single& maxz, System.Single splatmapScale) (at <c6181cd2086a49d1a475999b8861b18c>:0)
    EasyRoads3Dv3Editor.OOOCQQQQCC.OOCCQCCCCO (EasyRoads3Dv3.ERModularBase scr, EasyRoads3Dv3Editor.OQOCOODCQQ eScr) (at <ab2255dd6f45481782402d9977cee3b6>:0)
    EasyRoads3Dv3Editor.OQOCOODCQQ.OnInspectorGUI () (at <ab2255dd6f45481782402d9977cee3b6>:0)
    UnityEditor.UIElements.InspectorElement+<>c__DisplayClass59_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <4c65b26f0a3a417cae21ba5ceb4b25e2>:0)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr, Boolean&)
     
    Last edited: Jan 26, 2022
  43. raoul

    raoul

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

    I sent you a message, we can discuss more complex code related issues / questions here.

    The workflow for v3.3 is that new roads can be started from existing roads, a Flex Connector will be inserted and road markers can be moved over other roads or over a section of the same road, a blue handle will appear, when releaseing the mouse button a Flex Connector will be inserted.

    The first option is shown at 23:36 in the introduction tutorial below:



    General v3.3 beta info can be found here: https://easyroads3d.com/v3beta.php

    The error is indeed Flex Connector related, let's discuss this further in a direct conversation.

    The 2019.3+ package will work for Unity versions up to Unity 2021.2

    Thanks,
    Raoul
     
  44. raoul

    raoul

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

    The EDIT with the error message does explain why the process does not complete and it is indeed LOD Groups related.

    I do see you are using the v3.3 beta 4. Perhaps it is related to that. Are you perhaps using custom road shapes, the LOD system is not yet tested / optimized for that. We will check this today and see if we have issues with that. We will be preparing a new v3.3 alpha test build today which is also for Unity 2021.2+, I will send it to you too. It will include more debug info.

    This will probabably not help in your case, but v3.3 beta 5 is available. It is recommended to upgrade.

    Thanks,
    Raoul
     
  45. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Raoul.

    It's working.
    This is the workflow I follow:
    1 roadNetwork.CenterPivotPoints();
    2 Store Mesh Assets in Project Folder (can this be called from the api?)
    3 Finalize the roadNetwork.
    4 Save prefabs, etc.

    I guess I should save the AI traffic spline points before finalizing the road network. Can I create a Vector3 list of the spline points?
    I installed version 3.3 beta 5 but I didn't find any script about AI traffic. Could you give any advice on how to proceed?
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hi Joan,

    Glad to hear that works well for your situation.

    "Store Mesh Assets in Project Folder" is currently not part of the API, I will add that.

    Yes, be careful with "Finalize" if you need API access at runtime or otherwise get the required data first before using "Finalize".

    Do you only need the spline points at the center of the road? GetSplinePointsCenter() in the ERRoad class will return a Vector3 array with this data. But you also mention the v3.3 beta, do you want use the new AI traffic options in v3.3? In that case the spline point data will be very limited.

    The v3.3 beta includes an example runtime script that uses v3.3 lane data to move objects across the road network. This script can be used as a reference to get all road / lane data on both road objects as flex connectors.

    Also, the Finalize option will be further expanded for v3.3, optionally only cleaning up all data that is no longer required at runtime.

    Thanks,
    Raoul
     
    joanpescador likes this.
  47. big_3

    big_3

    Joined:
    Apr 20, 2016
    Posts:
    88
    Just a quick / dumb question. Maybe already asked 1000 times but I couldn't find anything.

    Is it possible to download the 3.3 beta from the Unity Asset Store?

    I'm sure there was a Beta download possible some time ago, but today I do not find it. :confused:

    Thanks
    Jus
     
  48. raoul

    raoul

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

    In the final beta stages the previous v3.2 beta was included in the Asset Store import, that is probably the beta you are referring at. That is what we do, when the beta is almost ready for release it will also be part of the Asset Store import, just as a final check for stability among a broader usage.

    It won't be too long before the v3.3 beta will also be available on the Asset Store.

    Thanks,
    Raoul
     
    PrimusThe3rd likes this.
  49. CitrioN

    CitrioN

    Joined:
    Oct 6, 2016
    Posts:
    101
    I can't reproduce that outcome with a new test scripts I wrote. Could this be related to which road connects to which connection of the crossing?

    While doing tests I believe that I came across a bug that is related to crossing prefabs.

    Whenever I try to get the correct connection prefab with the API call:
    Code (CSharp):
    1. GetConnectionPrefabByName(connectionPrefabName);
    it either returns null immediately or null when I call it a second time during the same play mode session.
    If the first time returns a valid prefab it will always fail the second time.

    I double checked this in a fresh project with only EasyRoads Pro imported and using the default road and Default T Crossing prefab.

    I can provide a short test script to easily test this if you would like.

    EasyRoads_CrossingPrefab_LoadingIssue.gif

    Thanks,
    CitrioN
     
  50. raoul

    raoul

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

    Are you randomly attaching roads to crossing connections in a way that a road possible is attached to a connection on the other side of the crossing? That is not what you want.

    In the ERConnection class: FindNearestConnectionIndex(Vector3 position)

    If you pass the marker position it will return the most logical connection index for this road object.

    Regarding the GetConnectionPrefabByName issue, can you show more code / steps to reproduce this? Are you perhaps connecting roads to ERConnection objects that are actually references to the prefab in the project folder?

    I am not sure what the gif animation does, what it represents?

    Thanks,
    Raoul