Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. amynox

    amynox

    Joined:
    Oct 23, 2016
    Posts:
    178
    Hi Raoul,

    i'm experiencing a bug with EasyRoad when i want to add new Road, the first marker is correctly placed but when i try to place a SECOND marker i'm getting this error :




    This error is happening in every road type... I'm using latest version of ER on store.

    Any help please ?
     
  2. raoul

    raoul

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

    Adding a second marker is a very standard action. No issues are known with this.

    Can you give exact details about the situation, which packages do you have imported and how are you creating the roads?

    Earlier today you posted another question with a screenshot of a road. What is the history of that road? Is this related to the same scene, same project? What has changed meanwhile?

    You can also email us the scene so we can look at it.

    Thanks,
    Raoul
     
  3. SalihMucahit

    SalihMucahit

    Joined:
    Apr 23, 2014
    Posts:
    1
    Hi Raoul,
    How can i make sharp L turns?
    Like this:


    Only like this I can:
     
  4. raoul

    raoul

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

    Please have a look in the Marker Settings in the Inspector.

    near the top there is "Control Type". The default is "Splice Controller", one of the other options is "Circular". Experiment a little bit with how this works. With this Control Type you can do something like:

    EasyRoads3D-Circular.jpg

    Thanks,
    Raoul
     
    hopeful likes this.
  5. ksam2

    ksam2

    Joined:
    Apr 28, 2012
    Posts:
    1,079

    I'll check it soon thanks. For now I mentioned there is an option to backup/restore terrains but is there a way to backup/restore all terrains tiles from script? I need to do some change to my terrain to keep changes when exit/enter game.
     
  6. raoul

    raoul

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

    This sounds like road creation at runtime is involved here. What is the exact situation?

    The Backup / Restore option within the tool is for additional safety inside the Unity editor. When using RestoreRoadNetwork() in the ERRoadNetwork class, all terrains will be restored, but is that required at runtime? Adding/Preserving terrain changes at runtime when exit/enter the game is not something EasyRoads3D can do.

    Thanks,
    Raoul
     
  7. Sk4tOoR

    Sk4tOoR

    Joined:
    Sep 19, 2018
    Posts:
    14
    Hey Raoul,

    I got a bug today, on buildung terrain(s). It shows the following NullRefException:


    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3.QDQDOOQQOOQDD.ODDCCCCODQ (EasyRoads3Dv3.ERModularBase scr, System.Single& minx, System.Single& minz, System.Single& maxx, System.Single& maxz, System.Single splatmapScale) (at <09379814fcfe4ab39f2a80cfa2ac588a>:0)
    EasyRoads3Dv3Editor.OQOCCQCCOC.OQCQODDCOO (EasyRoads3Dv3.ERModularBase scr, EasyRoads3Dv3Editor.ODCCQDCOOO eScr) (at <5205e3830edb4393aef8789e366ce867>:0)
    EasyRoads3Dv3Editor.ODCCQDCOOO.OnInspectorGUI () (at <5205e3830edb4393aef8789e366ce867>:0)
    UnityEditor.InspectorWindow.DoOnInspectorGUI (System.Boolean rebuildOptimizedGUIBlock, UnityEditor.Editor editor, System.Boolean wasVisible, UnityEngine.Rect& contentRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1625)


    Any idea about that? I hope there is a way to save my RoadNetwork and I don't have to rebuild
    it :(
     
  8. econt

    econt

    Joined:
    Apr 8, 2019
    Posts:
    52
    Hi Raoul,

    thank you for the information. - Yes I was looking for a junction prefab to be generated by the API.

    I have a new question: I want to use a sidewalk prefab and scale it bigger. From the size it is (1m) to 4m. - How is the best way to do it?

    Thanks in advance!
     
  9. raoul

    raoul

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

    First of all, you should be to save the scene, road network. It is a matter of finding out what triggered the error.

    So this happens when pressing "Build Terrain(s)"? And you are using the current v3.1.9.f5 version or the v3.2 beta version?

    There are no known issues with switchinbg to Build Mode, pressing "Build Terrain(s)", so more info is needed.

    Did this work before? If so, what has changed meanwhile? Can you isolate the issue by switching of build options like "Update Heightmap", "Remove Trees"? Or by only updating a single terrain if the scene has a multi terrain setup.

    If you want you can also email the scene to us so we can look at it. The email is in the _Readme file in the EasyRoads3D root directory.

    Thanks,
    Raoul
     
  10. raoul

    raoul

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

    Sidewalk settings in v3.1 are part of the crossing prefab. After selecting the crossing in the hierarchy the crossing settings will be visible with near the bottom "Corner / Sidewalk Settings", here the of the sidewalk can be set, including the width and height.

    But I assume this is related to general sidewalk width settings. In that case this can be donbe by opening the specific prefab in the prefab editor ("Open Prefab") and follow the same steps here. This way it is not necessary to update all instances of this prefab individually.

    The prefabs are located in /Assets/EasyRoads3D/Resources/dynamic prefabs/

    Thanks,
    Raoul
     
  11. Sk4tOoR

    Sk4tOoR

    Joined:
    Sep 19, 2018
    Posts:
    14
    Thanks for the fast reply :)

    I'am using version v3.1. Yes, it occurs when pressing the button "Buil Terrain(s)". It is a multiple scene setup, so i selected all terrains. Disabling all build options dosen't fix the issue.

    I'll try to finalize the RoadNetwork without building terrains...
     
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Finalizing will remove all script components. Please make sure to backup the scene first.

    Have you tried building a single terrain tile only, does that work? A specific terrain tile can be selected quickly through Ctrl + Alt + Click on that terrain, it should become the selected terrain in the "Target Terrain" dropdown.

    Thanks,
    Raoul
     
  13. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    I'm running into some difficulties with my code trying to extract lanes (I'm building a graph of connected lanes that I will use for vehicle AI navigation). So far I've been successful so long as I don't have any I-Connectors, and I think the issue I'm running into there is a misunderstanding of left/right, LHT/RHT and ConnectedTo. So I'd like to clarify my understanding. The image represents the 4 possible configurations of a lane and connector junction (I'm only concerned with RHT traffic right now, the big circle in the middle of each is meant to represent the connector):
    1. lane start is connected
    2. lane end is connected
    3. lane end is connected
    4. lane end is connected
    EasyRoads3d Lane Configuration.png
    So far may assumption has been:
    1. lane A direction is Left and B is Right - I'm pretty confident about this one
    2. lane A direction is Left and B is Right?
    3. lane A direction is Right and B is Left? - If #1 is correct, then this must also be true, I think.
    4. lane A direction is Right and B is Left?
    Is that summary correct? The problem I'm having is in order to transit an I-Connector (for non-zero length connectors) I need to fake the lane by taking the last lane point of the incoming lane and the first lane point of the outgoing lane. And right now I don't seem to be able to get it correct. I always seem to be grabbing the wrong lane (left vs right) and/or the wrong end.

    I'm really hoping that in the final 3.3 there will be both lanes in the I-Connectors and a simplified interface to lanes (i.e. have lane objects with methods like
    ERLane[] ERLane.GetConnectedLanesAtEnd()
    ).

    Thanks for any enlightenment you can offer.
     
    Last edited: Oct 22, 2020
  14. raoul

    raoul

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

    The image is not visible so it is not entirely clear what the situation is.

    But yes, this is v3.3 alpha related and indeed there are no AI options yet for I Connectors.I will have a look at this next week and see how this can be added. Standard situations involving for example two 1x1 lane roads with similar road widths should not be a problem. But it will be more complicated for road types with different lane counts.

    Thanks,
    Raoul
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    I can see the image now.

    For RHT (right hand traffic) that is correct apart from 4 I think, shouldn't that be, lane start (the start of the road object) is connected to the I Connector?

    Yes

    Yes, this is the same as 1 but in this case the I Connector is the End connection of road 2 while the I Connector is the Start connection for road 1.

    That is the type of information that is relevant to get the connector lane info once you reach the "end" of the lane. I write "end" because for right hand traffic this is actually the end when the vehicle is on the right lane, but the "end" will be the start of the road object when the vehicle is on the left lane. So in that case the Start Connection will have the info for the next road object.

    Yes

    The way the image is drawn that is correct. The road situation is the same as road 3.

    Referring to the additional notes in 2. the difference from an AI point of view is that the I Connector is the Start connection of road 4 and the End connection of road 3.

    Hope that helps, otherwise let me know.

    Thanks,
    Raoul
     
  16. Andefob

    Andefob

    Joined:
    Sep 17, 2018
    Posts:
    99
    Hi again! 3.2 has been working nicely so far. After doing some non-ER related stuff, I decided to have a go with the side objects next.

    I couldn't find any way to change side object x position (by marker) by scripting. If that is not supported, it would be nice to get that at some point. (And if that is done, why not the rotation control, too.) And Start/End Level Distance for "No terrain deformation" would still be a nice and hopefully not that complex addition, I hope it still is somewhere in your apparently very long TODO list :).

    One quick question: I noticed that by pressing R when a marker is selected in editor, I can change the width of the road at that point. Is that done using the same data that can be edited by SetRoadShapeNodes by scripting, too?

    As a reference, in case you or someone else is interested to see what I am up to, here is the latest demo of my track editor, road building from 0:50 to 3:20:
     
    raoul likes this.
  17. raoul

    raoul

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

    I will make notes for both side object X Position and Start/End Level Distance control through the scripting API. The To Do list, is pretty long :)

    Yes, in the latest release the scale tool (R key) can be used to scale the road per marker. That is indeed updating the same data as SetRoadShapeNodes by scripting.

    The video looks very good, great work!

    Thanks,
    Raoul
     
  18. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    Hi

    The EasyRoads3D Demo Project include a bikeway?

    Thanks
     
  19. raoul

    raoul

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

    There is no bikeway in the demo package. Is this material related? What type of bikeway are you looking for?

    Thanks,
    Raoul
     
  20. claudius_I

    claudius_I

    Joined:
    May 28, 2017
    Posts:
    254
    Hi, it's like this

    Thanks
     

    Attached Files:

  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    claudius_I likes this.
  22. pfschouten

    pfschouten

    Joined:
    Sep 29, 2020
    Posts:
    1
    How can I access the URP Shaders for the demo assets?
    And when is V3.3 coming out, that highway exit ramp looks amazing! :D
     
  23. raoul

    raoul

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

    The current demo package does not have URP materials. Most side object assets use the Unity standard shader, so these assets should be upgradable within the Unity editor.

    The new v3.2 demo package, which will hopefully be available within a month, will include URP and HDRP materials. These are also based on shaders used in the v3.1 demo package. I can email the URP shaders as they are at the moment.

    The focus at the moment is on releasing v3.2 after that new v3.3 betas will follow, also with built-in motorway exit ramps. The v3.2 demo will include two examples as prefabs.

    Thanks,
    Raoul
     
  24. Andefob

    Andefob

    Joined:
    Sep 17, 2018
    Posts:
    99
    Hi again! Another day, another problem!

    I started experimenting with side objects and scripting and unfortunately, bumped into problems quite soon. I added an empty Road Network with default road types and side objects to my base scene (which will get loaded incrementally).

    When I try to set side object active for a road (road network returns a non-null side object by name), I will get the exception below:

    Code (CSharp):
    1. ERRoadType roadType = network.GetRoadTypeByName("Default Road"); // Returns non-null
    2. var road = network.CreateRoad("Road 1", roadType); // Returns non-null
    3. var sideObject = network.GetSideObjectByName("Bridge Simple"); // Returns non-null
    4. road.SideObjectSetActive(sideObject, true);  // Causes the exception below
    at System.ThrowHelper.ThrowArgumentOutOfRangeException () [0x00000] in <9577ac7a62ef43179789031239ba8798>:0 \r\n
    at System.Collections.Generic.List`1[T].get_Item (System.Int32 index) [0x00009] in <9577ac7a62ef43179789031239ba8798>:0 \r\n
    at EasyRoads3Dv3.OQODODQDOD.OQDQQQCQQQ (UnityEngine.GameObject go, EasyRoads3Dv3.SideObject so, EasyRoads3Dv3.ERModularRoad roadScr, EasyRoads3Dv3.ERSORoadExt soData, System.Boolean mirrored, System.Boolean isChild) [0x00012] in <f8f947793d71411996d71f3e4c5e551e>:0 \r\n
    at EasyRoads3Dv3.OQODODQDOD.ODCCCQDODO (EasyRoads3Dv3.ERModularBase scr, EasyRoads3Dv3.ERModularRoad roadScr, EasyRoads3Dv3.SideObject so, System.Boolean isParent) [0x0076f] in <f8f947793d71411996d71f3e4c5e551e>:0 \r\n
    at EasyRoads3Dv3.ERModularRoad.OCCCQODDCD (EasyRoads3Dv3.SideObject obj, System.Boolean flag) [0x00077] in <f8f947793d71411996d71f3e4c5e551e>:0 \r\n
    at EasyRoads3Dv3.ERRoad.SideObjectSetActive (EasyRoads3Dv3.SideObject obj, System.Boolean value) [0x0000f] in <f8f947793d71411996d71f3e4c5e551e>:0 \r\n

    If I still go ahead and try to set a non-null side object active for a marker in a road with road.SideObjectMarkerSetActive(bridgeSideObject, markerIndex, true), it looks like that call never returns and Unity starts taking more and more memory until I either kill it or let it eventually run out of memory and crash.

    Any idea what I might be doing wrong or what to do to make this work or how to debug this further? I am using the latest beta and haven't tested the same things with any other version. If I just don't do any of the above calls, all the other things work as before.

    I tried this both with a road without a road type being set and with one in which a road type was given in constructor ("Default Road"). (Trying to set road type after creating the road caused a null pointer exception.)

    Best regards,
    Ande
     
  25. raoul

    raoul

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

    I think I mentioned this before, side objects are not fully implemented in the scripting API. It is being expanded upon requests. And if this is v3.2 beta than that could be involved too. Is "Auto Generate" activated? This has not been tested through the scripting API.

    In your example "Bridge Simple" is used, bridges are more complex side objects. Is the problem related to this specific side object or do you get the same error for other more standard side objects like lampposts?

    Thanks,
    Raoul
     
  26. Andefob

    Andefob

    Joined:
    Sep 17, 2018
    Posts:
    99
    Ah ok, so object types make a difference. Bridge was the first feature I tried to do so I started with that. But I now tested it with some more object types and at least some work. It always causes the same index out of bounds error with road.SideObjectSetActive but that is in fact not a big problem as it seemed that setting the value to a marker by road.SideObjectMarkerSetActive might still work. Modifying offset worked, too (when it did not hang).

    So at least Lampposts, Bridge 01 Pillar and Curb Stone Left and Wall CC seem to work but e.g. Fence Chain Link, Wall Country Side and Bridge Simple hang. It is a bit tedious to test this as when it hangs, Unity needs to be killed and restarted...

    Do I dare ask if there is any hope of getting support for Bridge Simple and the rest any time soon? Auto-generate is not necessary for me and as far as I know, it was not activated for the objects I tested with.

    Thanks,
    Ande
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Using v3.2 beta 8 I tested the following inside the Unity editor:

    Code (csharp):
    1. [MenuItem("EasyRoads3D/Side Objects/Activate Side Object")]
    2.     public static void ActivateMarkerSO()
    3.     {
    4.         ERRoadNetwork roadNetwork = new ERRoadNetwork();
    5.         ERRoad road = EREditor.GetSelectedRoad();
    6.  
    7.         if (road != null)
    8.         {
    9.             SideObject so = roadNetwork.GetSideObjectByName("Bridge Simple");
    10.             road.SideObjectSetActive(so, true);
    11.             road.SideObjectMarkerSetActive(so, 2, true);
    12.         }
    13.     }
    The bridge section was created on the section associated with marker index 2. The same for "Wall Country Side".

    Could you provide steps and code that reproduces the problem?

    Thanks,
    Raoul
     
  28. Andefob

    Andefob

    Joined:
    Sep 17, 2018
    Posts:
    99
    My code is quite close to that. The main difference is that I am also creating road via scripting. Because of that, I tried what will happen if I have a road already in the scene.

    So, I added a default road with a few markers to the scene and tried in loading instead of my usual code, running this:

    Code (CSharp):
    1.              
    2.                     var network = new ERRoadNetwork();
    3.                     var roads = network.GetRoads();    // Returns array of 1 road
    4.                     m_road = roads[0];
    5.                     {
    6.                         SideObject so = network.GetSideObjectByName("Bridge 01 Pillar");
    7.                         m_road.SideObjectSetActive(so, true); // No exceptions this time as when road created by network.CreateRoad()
    8.                         m_road.SideObjectMarkerSetActive(so, 2, true);
    9.                     }
    10.  
    11.                     {
    12.                         SideObject so = network.GetSideObjectByName("Bridge Simple");
    13.                         m_road.SideObjectSetActive(so, true); // Now this already hangs! Exception if a newly created Road
    14.                         m_road.SideObjectMarkerSetActive(so, 2, true);
    15.                     }
    16.                 }
    17.  
    So as mentioned in the comments, this time SideObjectSetActive did work for Bridge 01 Pillar but for Bridge Simple, it already hangs there. So having the road already in the scene has some difference but does not really make the situation better. I wonder what the difference is compared to your case. Could it matter what the road type is? Or is there some kind of extra initialization that could be tried if it is something similar to what was happening with the terrain splat textures? I never built the road so maybe that can affect, too.
     
  29. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    190
    I have problems with Vegetation Studio Pro and EasyRoads3D. They say, the integration should be easy and nearly automatic, but unfortunately it doesn't work for me. Under GeneralSettings->Terrain Management the settings for VegetationStudio are displayed, but no mask is generated. Masks work when I place them manually, but I want to use them with easy roads. I have made a video that shows how I proceed. What am I doing wrong or is it a bug?


     
  30. raoul

    raoul

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

    I just tested this again now also creating the road through code, the "Primary Road" road type fro, the demo package was used. The side object is created. But what I do notice is that after activating the "Bridge Simple"" side object for the road itself, it is also instantly visible on all markers. This should not happen because "Default active state for each marker" is toggled off for this side object. I will look into this but this can be fixed meanwhile be switching it off through code.

    So I am still not able to reproduce your situation. In my previous post I mentioned that the latest v3.2 beta 8 version is used. Is that what you are using?

    Thanks,
    Raoul
     
  31. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    [UPDATE] 0:26, the "Active" checkbox is unchecked. Is that the problem?


    Hi Diego_Graphics,

    Something is wrong in your scene, at 0:50 the video shows the road type settings, below the Terrain Splatmap settings you should see Vegetation Studio options which are missing in your video.

    The same options should be visible for individual road objects near the bottom also below the Terrain Splatmap options. Can you see the options here? If so can you toggle between the "Vegetation Mask Line" and "Biome Mask Area" options. Does that create the repective VS component?

    Have you tried "Reset All Road Objects an Road Types" in "General Settings > Terrain Management > Vegetation Studio".

    If all this fails, which version of EasyRoads3D are you using?

    Thanks,
    Raoul
     
    Last edited: Oct 27, 2020
  32. Andefob

    Andefob

    Joined:
    Sep 17, 2018
    Posts:
    99
    I have the latest beta from this week, b8 I believe yes.

    This is getting weirder now, but maybe the reason is closer to be found. I made a test level and test script which I attached to one dummy game object in the scene. When I hit run, the game hangs on SideObjectSetActive IF the longRoad parameter was true, and works if it was false. So it seems the marker positions matter and maybe the code needs to be run in game mode. See the code below, can you repro that?

    Code (CSharp):
    1.  
    2. using EasyRoads3Dv3;
    3. using UnityEngine;
    4.  
    5. public class RoadTestScript : MonoBehaviour
    6. {
    7.     void Start()
    8.     {
    9.         TestNewRoad();
    10.     }
    11.  
    12.     public bool longRoad = true;
    13.  
    14.     private void TestNewRoad()
    15.     {
    16.         ERRoadNetwork network = new ERRoadNetwork();
    17.         ERRoad road = network.CreateRoad("New road");
    18.  
    19.         if (longRoad)
    20.         {
    21.             road.AddMarker(new Vector3(-50, 80, 20));
    22.             road.AddMarker(new Vector3(0, 80, 30));
    23.             road.AddMarker(new Vector3(50, 80, 40));
    24.             road.AddMarker(new Vector3(150, 80, 50));
    25.         }
    26.         else
    27.         {
    28.             road.AddMarker(new Vector3(0, 80, 20));
    29.             road.AddMarker(new Vector3(0, 80, 30));
    30.             road.AddMarker(new Vector3(0, 80, 40));
    31.             road.AddMarker(new Vector3(0, 80, 50));
    32.         }
    33.  
    34.         TestRoad(network, road);
    35.     }
    36.  
    37.     private void TestRoad(ERRoadNetwork network, ERRoad road)
    38.     {
    39.         SideObject so = network.GetSideObjectByName("Bridge Simple");
    40.         if (so == null)
    41.             return;
    42.         road.SideObjectSetActive(so, true); // THIS HANGS if longRoad was true, works if longRoad was false
    43.         //road.SideObjectMarkerSetActive(so, 1, true);
    44.     }
    45. }
    Some more info: If I comment out the line that hangs but try to add bridge on scene view using editor tools while the game is still running, I can activate Bridge Simple for that road but when I try to activate bridge for a marker, Unity will hang the same way as if it was done by script.
     
    Last edited: Oct 27, 2020
  33. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    190
    Oh damn, I had tomatoes on my eyes. Yes that was the problem, now everything seems to work. Thanks for your super fast support!
     
    raoul likes this.
  34. raoul

    raoul

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

    Yes, this can be recreated. It appears to be related to the pillar object that is assigned as the connection object for this bridge side object. Strange that this only happens when the road is created through the API at runtime and then apparantly the shape of the road is involved as well. I will look into this. Meanwhile removing this connection object appears to solve it.

    Thanks,
    Raoul
     
  35. Andefob

    Andefob

    Joined:
    Sep 17, 2018
    Posts:
    99
    Ok great! I was actually planning to get rid of that automatic pillar generation anyway - too bad I didn't test with that already. That probably explains why "Fence Chain Link" and "Wall Country Side" are not working, either.

    Thanks,
    Ande
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ik will test these side objects as well in your script.

    Thanks,
    Raoul
     
  37. valentinwinkelmann

    valentinwinkelmann

    Joined:
    Nov 3, 2014
    Posts:
    190
    Is there a way to add variation to the sideobjects? i create a fence as an EasyRoad object. But the simple tiling of the mesh is very monotonous ( see screenshot ). Can I somehow define 3 or 4 meshes with variation that are chosen randomly?
    upload_2020-10-28_13-28-33.png
     
  38. raoul

    raoul

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

    That currently depends on the type of side object.

    For the Shape type of side object all variations can be added to a prefab. The "Prefab Childs" dropdown below the "Source Object" slot will be enabled with the options: "All", "Child Sequence", "Random". The Bootcamp fence in the demo package uses this.

    For procedural side objects this is on the list to be implemented in v3.2. It will work in a similar way.

    Thanks,
    Raoul
     
  39. Andefob

    Andefob

    Joined:
    Sep 17, 2018
    Posts:
    99
    I managed to get some bridges working when I removed the connection object but that exposed some other problems that could be related. In case it is of any help with your debugging efforts, I put the callstack below. That happened when I just added two markers to a freshly created road which was not supposed to have any side objects active.

    The road type was my custom road type which has a few side objects but none of which is on by default or have connection objects. If I don't use any road type, then the exception does not happen and I can still use side objects. It is a bit unclear for me now whether I need to use road types at all and whether it is ok to set side objects for markers if the road itself does not have side objects set up and SideObjectSetActive has not been called for it.

    Quitting, reason: Exception: 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 <9577ac7a62ef43179789031239ba8798>:0)
    System.ThrowHelper.ThrowArgumentOutOfRangeException () (at <9577ac7a62ef43179789031239ba8798>:0)
    System.Collections.Generic.List`1[T].get_Item (System.Int32 index) (at <9577ac7a62ef43179789031239ba8798>:0)
    EasyRoads3Dv3.OQODODQDOD.OQDQQQCQQQ (UnityEngine.GameObject go, EasyRoads3Dv3.SideObject so, EasyRoads3Dv3.ERModularRoad roadScr, EasyRoads3Dv3.ERSORoadExt soData, System.Boolean mirrored, System.Boolean isChild) (at <f8f947793d71411996d71f3e4c5e551e>:0)
    EasyRoads3Dv3.OQODODQDOD.ODCCCQDODO (EasyRoads3Dv3.ERModularBase scr, EasyRoads3Dv3.ERModularRoad roadScr, EasyRoads3Dv3.SideObject so, System.Boolean isParent) (at <f8f947793d71411996d71f3e4c5e551e>:0)
    EasyRoads3Dv3.OQODODQDOD.ODQOCDOCDD (EasyRoads3Dv3.ERModularBase scr, EasyRoads3Dv3.ERModularRoad roadScr, System.Boolean isSideObjectFlag) (at <f8f947793d71411996d71f3e4c5e551e>:0)
    EasyRoads3Dv3.ERModularBase.UpdateSideObjectsInScene () (at <f8f947793d71411996d71f3e4c5e551e>:0)
    EasyRoads3Dv3.ERRoad.Refresh () (at <f8f947793d71411996d71f3e4c5e551e>:0)
    EasyRoads3Dv3.ERRoad.AddMarker (UnityEngine.Vector3 pos) (at <f8f947793d71411996d71f3e4c5e551e>:0)
     
  40. raoul

    raoul

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

    Sometimes issues can be resolved by the error only. What is especially imported is what caused this situation which is not always clear from the error.

    With errors, the best and easiest way to resolve them is email a project / package in which the problem can be replicated. This is cerianly the case for stable offivial versions. For beta versions, like what you asre using errors are sometimes more easy to reproduce but even then exact steps or code examples, will hekp a lot. When we find an issue with Unity, they also always ask for this sort of info.

    Thanks,
    Raoul
     
  41. hakankaraduman

    hakankaraduman

    Joined:
    Aug 27, 2012
    Posts:
    354
    Hello Raoul,

    I was testing osm and it doesn't create crossings automatically, is there any plan soon to improve on that?

    Thanks
     
  42. raoul

    raoul

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

    That is correct, the reason for that is that real world situations can be quite complex. Currently built-in are X crossings, T Crossings and roundabouts (which need to be manually setrup regarding the number of connections).

    So standard city blocks is not a problem, code is actually implemented for that but not active to avoid issues with more complex situations.

    The crossing options will be further expanded in v3.3 with the Flex Connector (already available in the alpha builds) and built-in motorway exit / entrance ramps. That is also when auto creating crossings for OSM will be further implemented.

    Thanks,
    Raoul
     
    hakankaraduman likes this.
  43. TrueProger

    TrueProger

    Joined:
    May 26, 2017
    Posts:
    40
    Hey. I started to get such errors when building roads, how can I fix it? version of roads 3.1.9.f4
    Also now it is not possible to customize your presets for ready-made meshes. Cannot create connection points in the editor.
     

    Attached Files:

  44. raoul

    raoul

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

    Are the errors in the first two images related to the third image, the custom connection system to import your own models? If not and if this is road related, what are the marker positions of these roads?

    One thing I notice in the third image is that there are no dots visible on the edges of the lower element. Would it be possible to send us this model so we can test it?

    Thanks,
    Raoul
     
  45. TrueProger

    TrueProger

    Joined:
    May 26, 2017
    Posts:
    40
    I seem to have solved the first problem, made an update of all roads. The error is gone. But not the fact that she will not appear again.
    I am concerned about something else. The importer of its models is constantly breaking and the editor for creating new ready-made presets does not work properly. And this is not the first time this asset has failed. Now I can't even create a new preset to create presets. There is a constant error now. Upgrading to newer versions does not solve the problem! The only option is to delete the entire asset and create everything from scratch. Where to send the model? I will not post here for free access.
     
  46. raoul

    raoul

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

    It is not clear what you mean with "the importer of its models", "ready-made presets" and "create a new preset to create presets"?

    Is this still all related to the Custom Prefab Editor window, the third image in your previous post? In that case, yes please send the prefab/your model to us so we can test it. You can Start a Conversation by clicking on my profile name or email us, the email is in the _Readme file in the EasyRoads3D root directory /Assets/EasyRoads3D/

    Thanks,
    Raoul
     
  47. econt

    econt

    Joined:
    Apr 8, 2019
    Posts:
    52
    Hi Raoul,

    how can I switch the Side-Walk of a Junction (Dynamic Prefab) on with the API?

    upload_2020-11-3_11-43-27.png

    Thanks in advance!
     
  48. raoul

    raoul

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

    That is currently only possibe in the Unity editor, not through the API. Sidewalks will get an upgrade in v3.3, more API options is part of that upgrade.

    But, looking at the image, this appears to be related to HD Roads package assets. In this package the sidewalks on the roads are done using the side object system and the sidewalks on crossings are part of the crossing prefabs in the propject folder.

    Is this related to runtime road creation? You could add this yourself by creating a new prefab with the sidewalks only. And instantiate and add these prefabs as a child to the crossing prefab in your code.

    Thanks,
    Raoul
     
  49. econt

    econt

    Joined:
    Apr 8, 2019
    Posts:
    52
    Thanks for the answer. - Yes it was related to runtime road creation.
     
  50. econt

    econt

    Joined:
    Apr 8, 2019
    Posts:
    52
    Hi Raoul,

    I want to make a junction with a radius of 8. But the menu ends with a maximum radius of 5. - How can I do a junction with a radius of 8?

    Thanks in advance!

    upload_2020-11-4_15-38-40.png