Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    thank you!
    the road material.. yes, it's a 'custom material' to handle the correct physics..
    I'll check the distance settings in the build
    I just made a test, not yet in final build! ;)
     
  2. unity_Z2EvxablmT_wSw

    unity_Z2EvxablmT_wSw

    Joined:
    Dec 12, 2017
    Posts:
    8
    Hey Raoul,

    Is there any chance that Easyroads is messing around with coordinates of the terrains?
    Because I am having an issue with unity grass, which only seem to occur when I have a road in my scene too.
    This problem popped up every now and then but it usually disappeared somehow so I didnt pay too much attention.
    But now I cant get rid of it and I hope you know more about this.

    I am drawing grass on the terrain, and it is looking fine in editor mode, but when I change to playmode, it gets misplaced somehow with a few units, seems like the coordinates are messed up on the terrain.

    I dont know if it has anything to do with Easyroads, but I tought it was worth a shot.

     
    Last edited: Jan 23, 2018
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hey unity_Z2EvxablmT_wSw,

    Is this related to grass in general or near roads?

    EasyRoads3D updates the terrain heightmap according the road network shape and it will remove trees and detail vegetation near roads. But this already happens when switching the road network from Edit to Build Mode.

    It doesn't do anything to the terrain when switcing Unity editor to play mode unless you use the runtime scripting API. And then only what is described above, it doesn't reposition grass detail.

    Thanks,
    Raoul
     
    Last edited: Jan 23, 2018
  4. unity_Z2EvxablmT_wSw

    unity_Z2EvxablmT_wSw

    Joined:
    Dec 12, 2017
    Posts:
    8
    It is grass in general, on the whole terrain. Thank you for your input anyway, it doesnt seem to be related to Easyroads.
     
  5. Mxill

    Mxill

    Joined:
    Jul 25, 2017
    Posts:
    61
    Hey mate I cannot find the save road network to project "button".
     
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, that seems indeed related to something else. I hope you can figure out what is causing that!

    Thanks for the update,
    Raoul
     
  7. raoul

    raoul

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

    There is no button for that. What exactly should it do? Create a Prefab in the project folder so it can be used in other scenes? In that case, prefabs require the mesh asset to be physically present in the project folder. In build mode there is this button in the Inspector "Store Mesh Assets in Assets Folder". You can now create a prefab from the road network. It is recommended to do this once the road network is entirely build if this is what you need.

    Let me know if you are looking for something else.

    Thanks,
    Raoul
     
  8. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    Hello again, Raoul. I'm here to bother you again. :p

    First, here's a picture before I describe my problem.
    weirdsurfaces.jpg

    You can probably see the obvious issue with the white surfaces. This is my test scene. What I've done to get to this is create some roads and built the road network with the API and then -seeing that the terrain was unaffected- selected the road network in the hierarchy and clicked the "Terrain" button upon which the road network is reverted to edit mode.

    The white surfaces aren't the only problem. If I move a node the road remain unaffected and an ArgumentOutOfRangeException is thrown. Except if I move the IConnector on one of the ends of the road then that will make the road conform to where the nodes are and the white surfaces fall into their correct shapes, but the road remains unresponsive when moving the other nodes again after that. I tried "jiggling"* the IConnectors in code, but it doesn't help. Building the road network via the editor interface when the white surfaces look like this does affect the terrain, but in an undesirable way.

    What the roads with this issue have in common is mainly that they are created by splitting a longer road into smaller pieces with the InsertIConnector function. The first part -which was the original road- works as expected, but the road that is returned has this problem.

    There are some exceptions though. A few of the roads made with the InsertIConnector function work as expected, but I don't know what makes them different.

    Regardless, I need to make this work entirely in code. I only have the luxury of "jiggling" IConnectors in the test scene which I made specifically to show the results of our code.

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[UnityEngine.Vector2].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    EasyRoads3Dv3.ERIConnector.OCCCQQODDD (EasyRoads3Dv3.ERModularRoad sourceRoad)
    EasyRoads3Dv3.ERModularRoad.OCDOOCOCDD (System.Collections.Generic.List`1 markersExt, Single faceDist, Boolean ignorePrefabAlignment, System.Collections.Generic.List`1& tValues, System.Collections.Generic.List`1& markerDistances, Boolean forceAutoRotate, System.Collections.Generic.List`1& rotationArray)
    EasyRoads3Dv3.ERModularRoad.OCCCQQODDD (Boolean ignorePrefabAlignment, Boolean forceAutoRotate)
    EasyRoads3Dv3Editor.OQCDDOCCDD.OCOQDODOQO (UnityEngine.Vector3& hitPos, Boolean OQCQDCCDQQ, UnityEngine.Event cEvent, EasyRoads3Dv3.ERModularBase scr)
    EasyRoads3Dv3Editor.OQCDDOCCDD.ODCDOCOCQD (Vector3 pos, Boolean OQCQDCCDQQ, UnityEngine.Event cEvent, EasyRoads3Dv3.ERModularBase scr, Boolean dragStageFlag)
    EasyRoads3Dv3Editor.OQCDDOCCDD.OnSceneGUI ()
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
    Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
    System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
    UnityEditor.SceneView.CallOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:2055)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1391)
    UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1224)
    System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

    ArgumentException: Getting control 62's position in a group with only 62 controls when doing Repaint
    Aborting
    UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:665)
    UnityEngine.GUILayoutUtility.DoGetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:410)
    UnityEngine.GUILayoutUtility.GetRect (Single minWidth, Single maxWidth, Single minHeight, Single maxHeight, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:399)
    UnityEditor.EditorGUILayout.GetControlRect (Boolean hasLabel, Single height, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:7320)
    UnityEditor.EditorGUILayout.Popup (System.String label, Int32 selectedIndex, System.String[] displayedOptions, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6197)
    UnityEditor.EditorGUILayout.Popup (System.String label, Int32 selectedIndex, System.String[] displayedOptions, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:6191)
    EasyRoads3Dv3Editor.OQCDDOCCDD.OnInspectorGUI ()
    UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1235)
    UnityEditor.DockArea:OnGUI()

    Does any of this give you an idea about what the problem might be?

    *jiggling:
    pos.y += 1f;
    pos.y -= 1f;

    EDIT: Maybe it has something to do with why the following crashes?
    road.SetMarkerPositions(road.GetMarkerPositions());

    ArgumentOutOfRangeException: Argument is out of range.
    Parameter name: index
    System.Collections.Generic.List`1[UnityEngine.Vector2].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    EasyRoads3Dv3.ERIConnector.OCCCQQODDD (EasyRoads3Dv3.ERModularRoad sourceRoad)
    EasyRoads3Dv3.ERModularRoad.OCDOOCOCDD (System.Collections.Generic.List`1 markersExt, Single faceDist, Boolean ignorePrefabAlignment, System.Collections.Generic.List`1& tValues, System.Collections.Generic.List`1& markerDistances, Boolean forceAutoRotate, System.Collections.Generic.List`1& rotationArray)
    EasyRoads3Dv3.ERModularRoad.OCCCQQODDD (Boolean ignorePrefabAlignment, Boolean forceAutoRotate)
    EasyRoads3Dv3.ERRoad.Refresh ()
    EasyRoads3Dv3.ERRoad.SetMarkerPositions (UnityEngine.Vector3[] vecs)
    SGDTileTest+Tests.<LoadTerrain>m__3B(EasyRoads3Dv3.ERRoad road) (at Assets/SGDTileTest.cs:674)
    System.Collections.Generic.List`1[EasyRoads3Dv3.ERRoad].ForEach(System.Action`1 action) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:361)
    SGDTileTest+Tests.LoadTerrain (System.String aFileName, SGDData sgdData, Int32 anX, Int32 aY, System.Collections.Generic.List`1 aRoadList, System.Collections.Generic.List`1 aConnectionList) (at Assets/SGDTileTest.cs:678)


    Edit 2: The roads that don't work can be made to work by disconnecting them from the IConnector and reconnecting them. I'll try doing that in code now.
     
    Last edited: Jan 24, 2018
  9. raoul

    raoul

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

    Is the white surfaces issue related to what we discussed over email, the road being created through the scripting API while no terrain info is available yet?

    Are the nodes moved through the Scripting API or manually in Scene View? Which version are you using, the latest 3.0 build?

    Code (csharp):
    1. [MenuItem( "EasyRoads3D/I Connector Test" )]
    2.     public static void   IConnectorTest()
    3.     {
    4.         ERRoadNetwork network = new ERRoadNetwork();
    5.         List<Vector3> markers = new List<Vector3>();
    6.         for (int i = 0; i < 10; i++)
    7.         {
    8.             markers.Add(new Vector3(500,0,500) + Vector3.right * 40.0f * i);
    9.         }
    10.         ERRoadType roadType = network.GetRoadTypeByName("Default Road");
    11.  
    12.         var road = network.CreateRoad("Highway", roadType, markers.ToArray());
    13.  
    14.         road.InsertIConnector(7);
    15.         road.InsertIConnector(5);
    16.         road.InsertIConnector(3);
    17.  
    18.     }
    19.  

    This runs without issues on my end. Three I Connectors are inserted at marekr indexes 7, 5 and 3, all road sections are selectable in Scene view and respond to marker changes.

    The Road Network refresh option we discussed over email is added to the scripting API and will be part of the next build available later this week. Let me know if you need it urgently.

    Thanks,
    Raoul
     
  10. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    No, there should be terrain available. In the test scene I don't delete the lowest tile level either, so there should always be some terrain available.

    I think the issue that you found when you tested the sample code I sent wasn't that there was no terrain data, but that there was two terrains of which one had terrain data and the other didn't. I have no idea why there is an extra terrain that is empty. I never create any terrain that I don't destroy and I only create one at a time. Unless, destroying the game object isn't enough and I should destroy the terrain component separately as well...

    What does happen is that not every road has terrain data right under them. The roads are either inside or cross over/into the terrain. The roads are then split with an IConnector on the borders of the terrain tile. Only the sections which are inside the terrain tile are kept. The others are destroyed, which means that the IConnectors are then only attached to a single road. Another result of that is that where a road crosses between terrain tiles there will be two separate IConnectors that overlap.

    The nodes are first assigned with the API and are not moved after that. When I do move them I do it in the Scene View. I have made the test scene specifically to test the result of the road creation process and I try to figure out where the problem is by doing things that I know that I can't do in code or won't have the same effect in the code.

    My code is more like this:

    road = road.InsertIConnector(3);
    road = road.InsertIConnector(5);
    road = road.InsertIConnector(7);
    But in most cases there will only be one split.

    Thank you! Is there a way to see what terrains the Road Network is currently aware of? That could be the key to finding if there are any ghost terrains hanging around.

    Also, what does the refresh function on the ERRoad refresh? I tested it to no effect.
     
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Yes, your test code resulted in two terrains, one without terrain data.

    Have you tried the code in my previous post? Can you recreate the issue using that code?

    The reaso why in my code I Connec tors are inserted backwards is that the same "road" can be used for each insert.

    In your code "road" will reference the newly created road after inserting the I Connector. I am sure you are aware of that but could that be a reason why something is not working as expected?

    Do the same issues happen with roads with only one split? What do I have to do to recreate that?

    You can see that by selecting the terrain objects, it will have the component "ER Terrain" attached.

    Do you perhaps have overlapping terrains or they all nicely tile?

    It simply rebuilds the road. But it can fail if there are issues.

    You are indeed using the latest builds, is that correct? I Connectors are relatively new, there were issues in the last betas in certain situations.

    Thanks,
    Raoul
     
  12. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    Do you have any ideas as to how I can exorcise the ghost terrain? From what I can tell it shouldn't exist.

    Ah, sorry, I forgot to answer that part. Yes, I use the released 3.0.

    I could try to do the splits in reverse order, but I don't think it will help since most roads are only split once anyway. All the ones in the test scene are only split once.

    I don't know if splitting the "split-off" rather than the "original" is the reason for the unexpected behaviour, because I don't know the internal workings of EasyRoads. The reason I was doing it that way was because that's the only way to do it when inserting the splits forwards rather than backwards.

    Hot damn! That's an issue I've forgotten to report, because I haven't seen terrains without ERTerrain act differently than other terrains until now. The last terrain created always lacks the ERTerrain!

    In my test scene the code creates four terrains and the last one is always without the ERTerrain component. This is the first time I've noticed that it is also the only one where the terrain hasn't been affected. It's not unique to that one terrain. It's always the last one created. That must be why in my actual code the terrain is always unchanged.

    At what point are terrains given an ERTerrain component? I figured it would happen no later than when you build the road network. But I made this code and it always says that there is no ERTerrain component:

    roadNetwork.BuildRoadNetwork(false, false, false);
    ERTerrain ert = terrain.gameObject.GetComponent<ERTerrain>();
    if(ert == null)
    Debug.LogError("No ERTerrain.");​

    From what I can tell the ERTerrain component isn't added to a terrain until another terrain has been created. Should I manually add the ERTerrain component before building the road network to ensure that the road network is aware of the terrain? I'm going to try that now. (EDIT: It had no effect.)

    The last terrain is the one shown in my screenshot that has really weird white surfaces. I thought that happened to all terrains, because many roads had white surfaces that was angled upwards like that, thought not as much. However, I now think that happens to the roads on the other terrains for a different reason. It's probably because I've altered the terrain's Y-position. I've lowered the terrain's Y-position to -4, so the roads think that the terrain is 4 metres above them. I'm going to have to set the terrains' Y-position to 0 during generation. The reason the terrains are lowered like that is because the terrain heightmap can't go lower than 0, so we have to lower the terrain to allow for depths below water level.
     
    Last edited: Jan 25, 2018
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    From what I can remember you sent a test project in which BuildRoadNetwork() failed with errors. It turned out that there were two terrains in the scene with one of them not having a TerrainData component assigned. In the newer versions this is checked. If there is no TerrainData component, it will be ignored.

    I had a look, in theory your code should work well, if the passed marker index does not exist it should throw a proper warning.

    Terrains are collected in the road network constructor. I can also see ERRoadNetwork.GetTerrainData() which I belief is not documented yet. It can be used to update the terrain info.

    There is no logic like that in the code. It would also mean that a single terrain scene will always fail, which is not the case. Manually adding the ERTerrain component is not recommended.

    After changing the terrains Y position a road or road network refresh is required.

    Hope this helps narrowing down the issue. Otherwise perhaps you can send me again a test project. You have a complex setup, usually it makes it easier to find the problem.

    Thanks,
    Raoul
     
    Last edited: Jan 25, 2018
  14. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    That's great! GetTerrainData() works. So if this already existed, then what was the refresh function you were adding in the next build going to do?

    I change the terrain's position before I create the roads though. Refreshing the roads do nothing. Is this what the road network refresh function was going to do?
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    What we discussed last week was the situation where you already had your road network created through the scripting API before adding terrains. In this scenario the road network refresh is required.

    But from the recent conversation it seems this is actually not your workflow :)

    There is not need for the road network refresh if the terrains are already there at the correct position before creating the road network.

    It seems the problem was related to initially not all terrains being collected.

    Or do you still have problems with this?

    Thanks,
    Raoul
     
  16. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50

    No, it's true. The road network exists before the terrains are created. But GetTerrainData() updates the road network so that it knows about the terrains.

    The road network is now aware of the new terrains' existence, but the white surfaces still behave weirdly, as if the roads think they are 4 metres below the ground. That's despite that I've now changed the terrain's Y-position to be 0. If the refresh function could solve this then I will still look forward to it.
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, so GetTerrainData() only solved the missing ERTerrain() component.

    Can you do a test, after creating the road network through API, select the road network. I assume it didn't exist yet? If it did, then deselect > reselect it. And then try General Settings > Scene Settings > Refresh Road Network

    Does that update the white surfaces? The API implementation available in the upcoming update does the same thing.

    Thanks,
    Raoul
     
  18. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    It works! This function will be a great help! :D

    An exception though, it only works on the roads that don't have mechanical issues. The roads that give me ArgumentOutOfRangeExceptions when I move a node are still unaffected. But that's a separate issue. I will have to do more testing to figure out what that is about.
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, glad to hear that!

    Yes, it will refresh each road so it doesn't solve that other issue after inserting the I Connector through the scripting API.

    Do you have more info on that? How can that be recreated?

    When I try what you posted
    Code (csharp):
    1. road = road.InsertIConnector(3);
    2. road = road.InsertIConnector(5);
    3. road = road.InsertIConnector(7);
    The menioned index warning is raised for the third line which is logical, the initial road only had 10 markers. No errors are thrown.

    Thanks,
    Raoul
     
  20. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    That was only a simplification. I basically copied yours and rewrote it with no consideration for context. I have a variable that keeps track of the number of nodes that have been cut off and subtract that from the index, so that code should work as intended. The code is more like this:

    Code (csharp):
    1. road = road.InsertIConnector(3 - 0);
    2. road = road.InsertIConnector(5 - 3);
    3. road = road.InsertIConnector(7 - 5);




    I'm going to have to do more tests, and perhaps try to extract a barebones version of the code so that I can send you a sample. I'm at a loss for what to test right now though. I'm not going to try to split the road in reverse order, because the problematic roads are only split once anyway.

    The exception contents that I pasted into my first post about this (inside the spoilers) didn't give you any clues?

    EDIT: Here's something you could try! Make a road and split it in two with an IConnector, then remove the first section, but leave the IConnector behind. You should have a road now that has about the same situation as the roads that don't work for me. If you remove the second part instead then it might still work fine, so make sure that it is the first part that you remove. Edit2: It must probably be done with the API.
     
    Last edited: Jan 25, 2018
  21. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    Here's a code that causes the error! :D

    Code (CSharp):
    1. Vector3[] nodes = new Vector3[7] { new Vector3(300f, 47f, 7300f),
    2. new Vector3(350f, 47f, 7310f),
    3. new Vector3(370f, 47f, 7320f),
    4. new Vector3(420f, 47f, 7290f),
    5. new Vector3(450f, 47f, 7280f),
    6. new Vector3(510f, 47f, 7300f),
    7. new Vector3(550f, 47f, 7310f)};
    8. ERRoad road11 = roadNetwork.CreateRoad("test_1", roadNetwork.GetRoadTypeByName("Default Road"), nodes);
    9. ERConnection conn1;
    10. ERRoad road12 = road11.InsertIConnector(3, "test_1_split", out conn1);
    11. road12.Destroy();
    12.  
    13. ERRoad road21 = roadNetwork.CreateRoad("test_2", roadNetwork.GetRoadTypeByName("Default Road"), nodes);
    14. ERConnection conn2;
    15. ERRoad road22 = road21.InsertIConnector(3, "test_2_split", out conn2);
    16. road21.Destroy();
    Moving a node in "test_1" works, but moving a node in "test_2_2" doesn't work. I hope this helps you find the issue!
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Yes, I was able to recreate this. It happens when the first road is removed. This is fixed.

    The code in your last post also runs without issues. It results in two roads with two I Connectors at the same spot. Both roads are responsive. This will be in the next update.

    Thank you very much!
    Raoul
     
    NordstroemSAAB likes this.
  23. NordstroemSAAB

    NordstroemSAAB

    Joined:
    Aug 3, 2017
    Posts:
    50
    Thank you! With this I think all my issues have been solved. At least until I start working with crossings, but we're still at the demo stage of the project and my project leader don't think that level of quality is necessary yet.

    Do you have an expected release date for the next update?
     
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    The asset store versions will be uploaded today. The website version will be available tomorrow.

    One of the things that will follow is more API examples also including crossings.

    Thanks,
    Raoul
     
    hopeful likes this.
  25. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    Question#1:
    did osm import to create the streetshape work?
    i tryd to load the files from map-ity and get a error

    Code (CSharp):
    1. ArgumentOutOfRangeException: Argument is out of range.
    2. Parameter name: index
    3. System.Collections.Generic.List`1[EasyRoads3Dv3.QDQDOOQQDQODD].get_Item (Int32 index) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Collections.Generic/List.cs:633)
    4. EasyRoads3Dv3Editor.OCDCCCQCOD.Extract (System.String path)
    5. EasyRoads3Dv3Editor.OCDQCOOQQD.OCCCCCDCDC (EasyRoads3Dv3.ERModularBase scr, EasyRoads3Dv3Editor.ODCCCOOOOD eScr)
    6. EasyRoads3Dv3Editor.ODCCCOOOOD.OnInspectorGUI ()
    7. UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1317)
    8. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

    or if i download a osm file from openstreetmap exporter and try to export, no street will be generated.

    can someone confirm this problem? and how i can fix this?




    Question #2:

    i want to make a Scene Tilted map(World streamer) and have the world split in houndrets of scenes, this should load on need the roads.

    what is the best soulution to build seamles over the scenes, over a very long distance(houndreds of kilometers) the streets?

    my idea was first to create in the player scene a huge streetnet and build it to a mesh, than split in the scenes. but the problem is, my ram run out and the solution is in chase of little changes not rly handy.
    i hope you understand what i mean
     

    Attached Files:

    Last edited: Jan 27, 2018
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi Noa3,
    Yes, importing OSM data, www.openstreetmap.org, should work well. You mentioned map-ity, what data are you importing? Can you send the osm file so we can test it?

    What you can do is insert I Connectors on terrain tile edges. I Connectors can be used to join two different road segments preserving the road shape. Is the road network huge in terms of many, many roads or is it the huge scene that is causing the RAM issues? If it is the huge scene then you can have one scene with the road network and load additional scene with terrain tiles while working on these areas. Otherwise you could store terrain tile specific roads and crossings in separate scenes and use an editor script that will move the respective objects to these scenes and restore them in the road network when working on that area.

    Thanks,
    Raoul
     
    Last edited: Jan 27, 2018
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    v3.0.1 is now availale from our website

    Apart from some small fixes, this update includes a new scale tool, requested a while ago.

    riverScale.jpg

    It works similar ast the default Unity scale tool and can be used to scale the size of Shape type of side objects simultaneously per marker. It can be used to quickly change the width for, for example, river objects. Both the riverbed and river surface are scaled simultaneously.

    For full shape control, river scaling per node is still possible and activated by pressing the B key, rivers & streams: http://unityterraintools.com/tutorials/rivers.php

    The demo project has been updated as well with an example.

    river.jpg

    Also added to the demo project is the retaining wall side object on the coastal road (from the video).

    coastalwall.jpg

    As always, please backup your project first before importing the update!

    The asset store updates were submitted yesterday and are pending approval by the asset store team.

    Next are further scene view workflow optimizations

    Thanks,
    Raoul
     
    Quique-Martinez, blitzvb and hopeful like this.
  28. serberusno1

    serberusno1

    Joined:
    Jan 28, 2017
    Posts:
    84
    Works with Gaia?
     
  29. raoul

    raoul

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

    Yes it does. Apart from the heightmap, the terrain in the demo package was made with Gaia.

    Thanks,
    Raoul
     
    Mark_01 likes this.
  30. Discord

    Discord

    Joined:
    Mar 19, 2009
    Posts:
    1,008
    Any idea why the scale tool might not show up for my roads? I can move them just fine, but not scale them. All I see in the docs is (Transform Tools > Scale) but I'm not seeing that anywhere.
     
  31. raoul

    raoul

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

    The new scale tool mentioned above in the 3.0.1 build is specifically for shape type of side objects, like the riverbed and river surface in the images above. Both objects will scale simultaneously.

    This scale tool could easily be added to roads as well because the concept is the same. But, apart from perhaps dirt tracks, I am not sure if this will look good. When globably scaling a road per marker, the texture including lines etc. will scale too. How would you want to use this?

    Road shapes/widths can be changed per shape node per marker. That way the size of lines can be preserved when using custom road shapes.

    Where did you see this in the docs? Or is this the Unity docs? Because, this is not mentioned yet in the docs. It is mentioned in the new river tutorial.

    Thanks,
    Raoul
     
  32. mikko_to

    mikko_to

    Joined:
    Oct 14, 2013
    Posts:
    21
    Hi Raoul,

    Might be that I'm just missing something, but I cannot find "Generate Waypoints" in 3.0 version. Previously that button was along with Duplicate Object and Export Object functions and the Scene workflow tutorial on your website states the same. Is it moved somewhere?
     
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi mikko-to,

    The create waypoints option is indeed removed in the latest versions. Meanwhile there is the scripting API, it gives access to the road data.

    If you want I can send you an editor script that will do the same as the previous "Generate Waypoints" option.

    Thanks,
    Raoul
     
  34. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    531
    Hi,

    I've been having some trouble here with selecting and editing marker properties in the inspector.

    What I see happening is this: I have a marker selected and change my selection to another one. I then try to change the cornering mode or side object parameters, but the changes apply to the previously selected marker, not the current one.

    I can work around this issue by clicking 'select object on hierarchy' then switching back to scene mode in the inspector panel. That seems to update the selection properly, but needless to say, it isn't an ideal workflow.

    I've looked around all day, but couldn't find any mention of an issue like this. I'm hoping it's something I'm doing wrong or an issue with my setup (I'm on version 3.0.1).

    Does anyone know anything about this?

    Thanks in advance for any advice!

    Cheers
     
  35. raoul

    raoul

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

    That doesn't sound as standard behaviour. Does this happen on all road objects or this specific road object? Can you recreate this? Or would it be possible to have a look at this?

    The issue itself sounds like something that used to happen in older betas between two very short marker sections. Is that the case?

    Thanks,
    Raoul
     
    Last edited: Jan 30, 2018
  36. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    531

    Hi, Thanks for the quick reply!

    It does seem to happen with all roads. It's happening constantly here so I can definitely recreate it. I'll give it a shot in a fresh project to make sure, and try to grab some footage while I'm at it.

    As for the short marker sections, unfortunately that doesn't seem to be the case. It's happening for any marker pair, as far as I can tell (I'd have to check to see how it behaves exactly across different road objects).

    I'll post anything new I find about it.

    Cheers
     
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    That will be very helpful!

    I just double checked this by changing marker specific Indent / Surrounding values and by activating/deactivating side objects on these markers. I cannot see anything going wrong.

    Thanks,
    Raoul
     
  38. HarvesteR

    HarvesteR

    Joined:
    May 22, 2009
    Posts:
    531
    Hi,

    I've just done a test in a fresh project, version 3.0.1 and the most recent demo package. It happens the same way as before. I've shot a gif to illustrate the problem:



    (image link if you can't see the embedded one) https://imgur.com/LSw7Xkd

    In the video I first select a node, and change its control type property. It behaves as expected. I then select another node, and you can see that changing the same property still modifies the previous node.

    I then force the selection to change by hitting 'Select in Hierarchy' and switching back to scene mode, and now it's the correct node that gets modified. I then switch back to the first node, and you can see that the inspector changes are still modifying the node I had selected before.

    Hope this helps in finding the source of the problem!

    Cheers
     
    Last edited: Jan 30, 2018
  39. Discord

    Discord

    Joined:
    Mar 19, 2009
    Posts:
    1,008
    Apologies, I said roads but I meant rivers. I'm trying to follow the river tutorial, but I'm unable to figure out how to scale the side objects.
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Yes, indeed the changes are done on the previously selected marker. It looks like a serialization issue. I have not seen that before. I just sent a PM to debug this on your end.

    Thanks,
    Raoul
     
    Last edited: Jan 30, 2018
  41. raoul

    raoul

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

    Are you looking at this in the new demo project or in your own project with v3.0.1 imported?

    When selecting a marker of the river object, the scale gizmo will appear after selecting the scale tab (R key) in the toolbar just like when scale ordinary unity game objects. This is triggered on objects with shape type of side objects active, like the river side object.

    Is that what you are doing using v3.0.1?

    Thanks,
    Raoul
     
  42. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    hello again @raoul
    I have a question: is not yet possible subdivide the road from left to right? to have the center more higher than the sides for example?
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    hello ghiboz,

    Do you need to have this work with crossings? If not, then it is fairly easy to do that, I can send some code.

    It can also be done using the custom prefab system based on your own crossing models. The road can have any shape you want.

    It will be fully available once the dynamic crossings system supports this, this is being worked on at the moment.

    Thanks,
    Raoul
     
    blitzvb likes this.
  44. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    at the moment no, it's ok with one road :)
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, I will send you some code today :)

    Thanks,
    Raoul
     
  46. jlocke

    jlocke

    Joined:
    Dec 16, 2017
    Posts:
    62
    May I ask to share the code .. we got similar requirement . thanks
     
    ghiboz likes this.
  47. raoul

    raoul

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

    Ok, I will post a link here.

    Thanks,
    Raoul
     
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    @ghiboz and @jlocke

    Here is a small editor script example for creating custom road shapes from code.

    Please drop it in /Assets/EasyRoads3D/Editor/

    It will add a new menu item at the top: EasyRoads3D > Custom road Shape

    Run this after selecting a road object.

    The shape is hardcoded and can be adapted to any shape.

    As mentioned, this will turn the road shape in a custom roads shape which is not yet supported by the built-in crossing system. To have this work with crossings at this moment, you can create custom road shapes from imported crossing models.

    Hope this helps

    Thanks,
    Raoul
     

    Attached Files:

    Last edited: Feb 1, 2018
    jlocke and blitzvb like this.
  49. ghiboz

    ghiboz

    Joined:
    Sep 7, 2012
    Posts:
    465
    it works! thanks, but seems that the normals of the subdivisions are still the same, all up
     
  50. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Yes, the normals are calculated using Mesh.RecalculateNormals()

    In theory you can create any shape you want using that code. What sort of road shape do you need?

    Thanks,
    Raoul