Search Unity

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. raoul

    raoul

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

    Yesterday I replied around midnight. I just had a look at possible situations. With removing the crossing, do you mean literally removing the crossing or disconnecting the road from it?

    Disconnecting the road will result in a marker position 5 units away from the crossing connection. This is done to visualize that the road and the crossing are no longer connected. Is this related?

    I cannot see any issues with the Cam Fly Over, the cams lookAt is according the direction of the road at any slider position. Tested with markers at: (500,0,0), (550, 0, 50), (500,0,100), (550, 0, 150) and both connected and disconnected to crossings. Can you give more details how to replicate this?

    Thanks,
    Raoul
     
  2. TriCoachSim

    TriCoachSim

    Joined:
    Mar 1, 2017
    Posts:
    22
    Hi Raoul,

    I took 2 screenshots with log and inspector values so that it is more understandable.

    First screenshot with the problem (when there is a connection)
    The 2 last samples (103.4988 and 108.4273) give the same 3D position.
    WithConnection.JPG


    Second screenshot without the problem (after "undo connection")
    UndoConnection.JPG


    And this is my code:
    Code (CSharp):
    1.        
    2.         Spline spline = ((Spline)target);
    3.  
    4.         ERRoadNetwork roadNetwork = new ERRoadNetwork();
    5.         if (roadNetwork != null)
    6.         {
    7.             foreach (GameObject gameObject in spline._splineRoads)
    8.             {
    9.                 ERRoad road = roadNetwork.GetRoadByGameObject(gameObject);
    10.                 if (road != null)
    11.                 {
    12.                     Debug.Log("Road name " + road.GetName());
    13.                     float roadLength = road.GetLength();
    14.                     Debug.Log("road.GetLength() : " + roadLength);
    15.                     int sampleCurveCount = Mathf.RoundToInt(roadLength / Spline._sampleLength);
    16.                     float localSampleLength = roadLength / (float)sampleCurveCount;
    17.                     int samplePointCount = sampleCurveCount + 1;
    18.  
    19.                     int currentElement = 0;
    20.                     for (int i = 0; i < samplePointCount; ++i)
    21.                     {
    22.                         Vector3 samplePosition = road.GetPosition(i * localSampleLength, ref currentElement);
    23.                         Debug.Log(" road.GetPosition( " + i * localSampleLength + ") : " + samplePosition);
    24.                         spline._samplePointList.Add(samplePosition);
    25.                     }
    26.                 }
    27.             }
    28.         }
     
  3. TriCoachSim

    TriCoachSim

    Joined:
    Mar 1, 2017
    Posts:
    22
    I forgot to mention that the problem happens only with 2 roads of my scene while I have about 20 roads with connections.

    Seems that happens only with roads created with "Add new Road" inspector command (but not all of this roads). While i have no problems with road created from Connections (Drag yellow rectangle of green handle)

    Edit :
    • I use road type with Resolution : 20 and Angle threshold : 5. But i tried with a Resolution:2 and Angle threshold : 50 and i still have the problem.
    • I also tried replacing the road by a new one created from connection (Drag yellow rectangle of green handle) and i still have the problem.
    • I switch the road with another road of my scene. And now the new road has also the problem, while the old road on a new place has no problem. So the problem must be related to the crossing. But if a replace my crossing prefab by Default T crossing i still have the problem...

    And this is the behavior of Cam Fly Over at 95% and 96%
    CamFlyOver_95.JPG
    CamFlyOver_96.JPG
     
    Last edited: Mar 14, 2017
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Is the last screenshot the road from your previous post?

    I tried replicating this using the same marker positions, resolution and Angle Threshold. Because the road is created using "Add New Road" and connected to crossings, it is hard to get exactly the same marker positions, but they are within 1 unit accurate. The Cam Fly over works well, also between 0.95 and 1.

    Since you mention this only happens on 2 roads, would it be possible to email me this scene so I can look at it?

    Thanks,
    Raoul
     
  5. TriCoachSim

    TriCoachSim

    Joined:
    Mar 1, 2017
    Posts:
    22
    Yes it's the same road, maybe with slightly different positions since I did some edit to try to understand the problem.

    But now after playing with "translate" on the crossing, Unity is freezing with repeated Assert log Assert1.JPG Assert2.JPG
    I remove the crossing and connected roads, disabled the RoadNetwork object, quit and launch Unity, but it's still freezing :-(

    I can send you my scene in this state, but not sure you can do anything
     
  6. TriCoachSim

    TriCoachSim

    Joined:
    Mar 1, 2017
    Posts:
    22
    Well, I managed to get my scene to work back. I re-added the roads and the crossing approximately at the sames places, and still have the problem.
    At what mail address can I send you my scene?
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    You can freely move crossings in the scene. When changing the position / rotation in the Inspector it is recommended to use the crossings Position / Rotation fields in the Inspector with the road network selected. However, you can also select the crossing in the hierarchy and move it, but connected road updates will be slower. What exactly did you do?

    You can send it to info@unityterraintools.com, that would be very much appreciated. Please send the full project (stripped to road network and bare terrain only if you want). or a Unity package from the scene including all dependencies.

    Thanks,
    Raoul
     
  8. TriCoachSim

    TriCoachSim

    Joined:
    Mar 1, 2017
    Posts:
    22
    I sent you an email with a package reproducing the problem.

    Concerning the translation, I moved the crossing in the scene using the "Position handle" but to a really overlapping situation between connected roads.
     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    The translation issue is actually quite easy to replicate. One road, two markers, and crossings attached at both ends. When moving one crossing to the extend that the road overlaps both crossings (angle of > 90 degrees with the crossing connection), it seems there is some recursive updating going on (it doesn't happen when there is overlap on only one crossing) causing Unity to crash. This is an unreleastic situation but it can indeed happen when quickly moving around crossings to change the road network. I will look into that.

    The initial issue is related to T-crossings with Activate Bending switched on. This feature was added in a later stage, it adjusts the road spline slightly and interpolates it on the T-crossing. As a result the initial spline curve data (used in the API and also on the Cam Fly Over) is no longer 100% accurate resulting in the small glitch at the end.

    The problem disappears after switching off Activate Bending in the General Settings of the crossing.This will be updated.

    Thank you very much for reporting this and sending the scene!

    Raoul
     
  10. TriCoachSim

    TriCoachSim

    Joined:
    Mar 1, 2017
    Posts:
    22
    Indeed, I didn't notice that the problem occurred only after T-Crossings.
    Thank you for your fast support and for providing a temporary solution.

    Mika
     
  11. raoul

    raoul

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

    Yesterday I looked into this further. Indeed there is a slight inaccuracy in the total length, road.GetLength() in your code, due to what I described in my previous post, T-crossings, and the road spline shape being interpolated on the T-crossing.This is fixed but I didn't yet test your code.

    What you can do as a test (or a temporary solution so you can keep the T-Crossing Activate Bending option switched on) is recalculate the total length using the spline data which is accurate: road.GetSplinePointsCenter() returning a Vector3[].

    That may very well resolve the issue with your last 2 samples returning the same position.

    Thanks,
    Raoul
     
    Last edited: Mar 15, 2017
  12. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    Hi @raoul , I'm starting to use EasyRoads3D v3 to create some city scenarios that are functional for a tower defense game, and I have a couple of questions regarding the asset:

    - is there any way to globally change the scale of all the prefabs? my project is using a 1:10 scale, so I have buildings that are 2 meters long representing 20 meter long buildings, your premade prefabs such as roads, side objects, etc, come in a bigger scale, all premade configurations such as road width, resolution, indents should be 1/10th of the original, and object prefabs such as guard rails are too big, so until now the only way I've found to correct this is to go road by road, prefab by prefab, and change all numbers to 1.10th, going for example to the guard rail .obj import settings and changing the scale factor to 0.0025 instead of 0.025, then having to redo all the work on the Mesh Editor Window to make it loop correctly, all this stuff for each and every object, road type etc. Is there any way we can do this automagically through your asset? globally change scale of all prefabs imported? would be a great addition to v3

    - another question: I need to put custom prefabs such as buildings at the sides of the roads, I need to put various different types of buildings on the sides, that follows the road shape, are randomly put but with some control, now, I know I can put side objects like palm trees at sides of the roads, my question is if I can extend this with an api or if there is some easier way to be able to put buildings at the sides of the roads, from a list of different prefabs that are previously constructed, and maybe through an API customize how the instances are distributed, like for example I want commercial buildings to be a 20% of the population on the right side, and 80% residential, etc. something like what is going on here:


    you have a perfectly made roads and spline system, if it could be extended to allow this sort of pseudo-procedural city generation features, it would be twice as incredible, cheers!
     
  13. raoul

    raoul

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

    1) Indeed the current presets and side object examples are based on 1m = 1 unity unit.

    A scale option for side objects is partially implemented but hidden, there are some issues to resolve. It is on the list :)

    For now it is indeed a matter of scaling the source prefabs and adjust the side objects accordingly, primarily defining new Start / End offsets if relevant.

    2) You can create source prefabs with your buildings added as a child. In the Side object settings you can define how child objects are handled: 1) Always instantiate all child prefabs, 2) Instantiate in sequence or 3) randomly. The random option is used on the Bootcamp fence example, you can have a look at that example. Does this what you need or are your buildings not the same size and should they all nicely connect? More on buildings will also follow later.

    Thanks,
    Raoul
     
  14. Antonio1992

    Antonio1992

    Joined:
    Jan 7, 2015
    Posts:
    2
    Hi Raoul,

    Is it possible with this plugin to set different road width on differents waypoints of the same road?

    Thanks!
     
  15. raoul

    raoul

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

    The road shape is defined by nodes. A standard road only has two nodes, one on the left and one on the right. The position of these nodes can be changed per waypoint/marker. Below is an older example of this for a custom road shape with more nodes.



    The N key toggles on/off the display of the node positions for the selected marker. You can select a node and reposition it both upwards as sideways, resulting in smooth shape changes.

    Is that what you need? Currently a new IConnector is added primarily to allow blending between different road types (asphalt / dirt), blend asymmetrical road textures or simply for road material changes. In the future this will be expanded with more advanced lane change options which also requires texture/uv control. If that is what you meant.

    Thanks,
    Raoul
     
  16. Antonio1992

    Antonio1992

    Joined:
    Jan 7, 2015
    Posts:
    2
  17. raoul

    raoul

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

    In the screenshot, the width increases in a linear straight line. Currently shape changes are smooth like in the screenshot I posted. Is that a problem? A linear or smooth option can be added here.

    The line marking in the center is different on the the wider part. Does the road texture stretch when the road gets wider, especially the line markings? If stretching on the line markings should not happen then indeed this is what I meant with more advanced IConnector options available in a later stage.

    This sort of thing can also be achieved using the custom prefab system, model the road change in a modelling app and import it into the system. It will act as a connector between te narrow road and the wider road.

    Thanks,
    Raoul
     
  18. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Hello Raoul,

    do you've got an estimate when this update may hit the asset store? I would like to fix the wrongly rotated connection as soon as possible and need to know if waiting for your update is an option for us.
     
  19. raoul

    raoul

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

    I am aiming at before the end of next week.

    I still have to implement updating scene instances after changes to a custom prefab source mesh. The reason why this was not done yet in general is because it is tricky. Snapping roads to connections is based on vertex indexes etc. When the geometry of a mesh changes it can get complicated to preserve the connection settings.

    I belief your situation was more related to rotation changes of the source mesh. This by itself should be fine regarding vertex indexes, but how will that affect connected roads? The connection angle with these exisiting roads will probably change.

    Thanks,
    Raoul
     
  20. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    thanks for the answers! I got it, for now I will scale stuff manually, but I'll hope you figure out some global scale option in the future, would be really helpful!

    what I need to do with buildings is to be able to at least give a source prefab to the side object manager, and then the road will instantiate this prefab along itself, the source prefab contains a "PlaceHolderBuilding" script, basically the idea is that a manager script can grab all gameobjects with the "PlaceHolderBuilding" script and then instantiate actual buildings on those places, depending on various factors like noise maps, poblation density etc, but what would be really good is if the distance between side object instances can be driven in a custom way, I have two problems with easyroads right now:

    1) the side objects can only be instantiated on a constant distance, or a random distance I think, would be cool if the distance can be controlled in a custom way through maybe a delegate (like, the delegate takes a float value which is the last instantiated side object position along the road, and returns another float value which is the next position along the road for the next side object, this way I can do my own calculations and return custom distances depending on building size or population on a heatmap, or whatever)

    2) side objects are converted to only one mesh (I suppose for performance reasons) and you lose the individuality of the positions, what I mean is that it would be cool if you put a checkbox to allow this behaviour or maybe, add another option on the "Object Type" setting for side objects configuration, currently we have Mesh Object, Shape Object, and Procedural Mesh Object,
    it would be great if you add "custom prefab object" option, where all side objects instantiated are just instances of the source prefab, which then can be grabbed and used for whatever reasons, and can contain scripts that do dynamic stuff on them.

    let me know if I've explained myself correctly, and thanks again for the quick answer, you've made an amazing asset!
     
  21. raoul

    raoul

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

    Yes, the instant scaling option will be useful. It will be added as one of the first things after v3 is released.

    Instantiating prefabs with your script components is by itself easy. Perhaps it is useful to check the scripting API, also with regard to the first part of your post. It gives access to the road spline data, the center and the left and right side of the roads. You can use that in any way you want, also for example to instantiate your prefabs exactly as you want.

    Other then that I can make notes of your requests. They are more time consuming to add and at this stage I really like to focus on getting v3 out, otherwise it will stay in beta forever.

    I think this is related to the "Combine" option (at the bottom) being switched on. If you switch that off each object will be an instance of the source prefab.

    Thank you for the feedback and glad to hear you like it.

    Raoul
     
    Last edited: Mar 16, 2017
  22. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    Amazing! didn't know I can access all that info through an API, I'll take a better look at the documentation.

    yeah this are too specific features for my project, I was asking just to know if there was some trick you could happen to know to workaround my needs, and the API thing probably is the answer.


    I've just tried the "Combine" Option for side objects, it's exactly what I was talking about! I don't know how I've missed that.. although it seems to be buggy, I'm using version "EasyRoads 3D v3.0 Alpha 8.3.2" and what happens is that when I unselect the Combine option, at a first glance it seems to generate all the individual instances, but when you click on them in the inspector, they change their position to the center of the road instead of the side where they were before, and then if you click on "Refresh Side Object" under the side object status options in the Road Network GO, it generates new side objects again instead of repositioning the original ones, I'm not sure if that's a bug or a feature, here's a picture: bug.jpg
     
  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    This was discussed on the previous page or two pages back.

    In 8.3, the side object instance editor script was updated. In the Inspector you will see the control "Locked". It will snap the side object to the center of the road. When you drag it, it will follow the spline curve. This is useful to fine tune, for example, bridge pillar positions. This "Locked" option should be disabled by default, it is in beta 8.5. In a future update all the side object settings, especially "X Position" and "Y Position" relative to the spline curve, will be preserved.

    "Refresh Side Object" will indeed rebuild the side object according the side object settings, just like when changing the road shape. So it is recommended to fine tune instances when all other work is done.

    Thanks,
    Raoul
     
  24. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    Hi raoul, me again, I've been testing the new crossings or "connection prefabs" feature, I have a couple of bugs to report, should I do that here or do you have some place to bring them to you?

    and some suggestions:
    -could you please decrease the minimum values for some float sliders in the editor, right now for example a road crossing width can be between 1 and 75, and as in my project I use a 1:10 scale, 1 unity meter is still big for some single lane roads, other parameter that has minimum values too high for me is corner radius.

    - I know the feature is on very early beta, but editing crossings is a bit counter intuitive and buggy, I've failed at trying to edit existing ones, and to edit new ones you have to create them on the general settings tab, then instantiate it with SHIFT+Click, it's not clear how the system knows what to instantiate, and how the instanced prefab is different from normally placed crossings, some times the "Save Changes" button appears, sometimes not, if you delete the "temp crossings..." game object, then each time you instantiate a newly created crossing, the console throws lots of errors of null object, also I can't recall what I did exactly but I had stack overflow errors trying to instantiate a crossing in the scene, I think you should encapsulate the dynamic connection prefabs creation and editing into a separate editor window to keep the concerns separate, because editing in the same scene you are working seems to bring bugs and errors.
    I know as it is in beta, the tool is not already idiot proof but doing some simple steps like dragging a dynamic connection prefab into the scene made my editor stack overflow and almost crashed.

    cheers!
     
  25. raoul

    raoul

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

    What you prefer, you can post here or you can email me. :)

    The Max value for the road width slider was increased to 75 upon request, he mentioned that chinese roads can be that wide. This is a though one.

    It seems the current Min Max slider values will work well with standard settings. Someone else recently asked to increase the sidewalk height to 10 because he wants to use this for a different purpose. As I don't want to make the Inspector options unnecessary complicated this was added in a way that the Max value can be set through editor code. Will that work for you?

    In what way does editing exisiting crossings fail? Can you provide steps you take and what goes wrong? It is a matter of selecting the prefab in the hierarchy (for which a direct link exists in the Inspector after selecting it from the road network). after that you can edit it in the Inspector.

    At the moment you have the option to create a new crossing or a new roundabout prefab. How is it not clear for the system what to instantiate? What is the exact problem here?

    How exactly are you doing this? A new dynamic prefab is indeed parented under "Temp Crossing Prefabs". That is how you can see that this is not a scene instance. After finishing creating the new prefab and pressing "Exit Prefab Editor", these objects are removed from the scene. This new prefab will now become available in the Crossings tab so you can quickly add instances of this new prefab in the scene.

    The "Save Changes" button only appears for source prefabs, newly created prefabs from General Settings or when you drop a source prefab from the assets folder in the scene to edit it. This option will not appear on scene instances although in the future it will probably be possible to update the source prefab this way, or create a new source prefab from a scene instance.

    I just tested the above steps. I do not get error messages. Doing literally what you mentioned, delete the "Temp Crossing Prefabs" does not results in errors either when creating an instance of this new prefab. Although in this case the latest changes are not visible because "Exit Prefab Editor" was not clicked.

    Is the general workflow still unclear / confusing? Perhaps the "Temp Crossing Prefabs" should be renamed in something like "New Source Prefab"? Or would all this feel better if there weren't errors (see below)?

    I think I was able to recreate this. Dragging the dynamic T-Crossing, Roundabout and your own dynamic prefabs in the scene for editing works fine. But the X Crossing prefab results in StackOverflowExceptions without further details, I will check that. Is that what was also happening on your end? In that case it seems this is more related to that specific prefab.

    Please let me know if you have more bug reports.

    Thank you for the feedback!

    Raoul
     
    Last edited: Mar 17, 2017
  26. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Yes, that's tricky. And I don't have a solution/answer that fits all needs. In my case I would happily live with existing roads having their connection angle rotated. Even if totally awkward and looking broken. At least I could keep the connection inside the road network.
    Fixing the awkward angled roads by rotating the connection to counter the effects would be less work then replacing all connections by hand (since they now hold additional prefabs, scripts and variables that we need for our gameplay logic).

    Another question:
    What may be causing gaps in procedurally created sideobject meshes? I made sure the original mesh's vertices are all merged and in one plane across the x-axis where I decided to make the cut.
    This is my setup:
    ER3D_SideObject_ProceduralMeshObject_Gaps_01.jpg
     
    Last edited: Mar 17, 2017
  27. raoul

    raoul

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

    Yes, in general, when you have a crossing with roads connected and you replace the prefab with a rotated version, it is expected that afterwards the road shape are slightly messed up and need some adjustments. I will look at this, and do some tests how this behaves after source mesh rotation changes.

    Regarding the procedural side object, it seems this is related to vertices being snapped to wrong indexes where segments connect. It looks like the upper geometry is extruded slightly, how much? Does extruding it more (as a test) solve this? Would it be possible to have a look at the source mesh?

    Thanks,
    Raoul
     
    Last edited: Mar 17, 2017
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    @Marco-Sperling

    Thank you for sending the fbx. With the same Start / End offset settings as in your screenshot, this appears to be working well in the upcoming update.
    quay.jpg

    If you want I can send an alpha build so you can try this on your end.

    Thanks,
    Raoul
     
    Last edited: Mar 17, 2017
  29. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    I will post here the bugs so if other community members have them they don't need to double post them,

    1) what I need is to decrease the Min Value in sliders, not to increase the Max Value, so instead of 1-75 range I would rather need 0.1-7.5 range, how can I achieve this through scripting?

    2) what I mean with the editing process not being clear, at least for me, is that all the other object types have well defined editors and sections, you can tell that you are editing a road globally because you go to general Tab, then select a road type and start making changes, the same for side objects, they have their own editor which doesn't involve having to drag a prefab into scene and having to recognize if this is an editing prefab or an instance prefab, the editing should be done in a safe environment just like when you edit the custom crossing prefabs or the mesh side objects, well, this is just a suggestion.

    2) BUG: Drag the X Crossing dynamic prefab into an scene without terrain, the scene Tab becomes dark for a moment, and starts throwing continuous errors, almost freezing unity:

    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3Editor.QDOQDSQQDQODD.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:2063)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1405)
    UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1242)
    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)



    3) BUG: when you drag the X crossing dynamic prefab into an scene WITH terrain, it throws stackoverflow errors, the T prefab doesn't throw them, this seems because the X one is not automatically parented to the Temp Crossings Prefabs gameobject, the T prefab on the other side it's parented.

    StackOverflowException
    UnityEngine.Mesh.GetAllocArrayFromChannel[Vector3] (InternalShaderChannel channel, InternalVertexChannelType format, Int32 dim) (at C:/buildslave/unity/build/Runtime/Export/Mesh.cs:53)
    UnityEngine.Mesh.GetAllocArrayFromChannel[Vector3] (InternalShaderChannel channel) (at C:/buildslave/unity/build/Runtime/Export/Mesh.cs:66)
    UnityEngine.Mesh.get_vertices () (at C:/buildslave/unity/build/Runtime/Export/Mesh.cs:100)
    EasyRoads3Dv3.OQOOODDQCO.OCDOCCODOC (EasyRoads3Dv3.ERCrossingPrefabs scr)
    EasyRoads3Dv3.ERCrossingPrefabs.OCOCCCDDCC (Boolean ignorePriority, EasyRoads3Dv3.ERModularRoad road)
    EasyRoads3Dv3.ERCrossingPrefabs.OCOCCCDDCC (Boolean ignorePriority, EasyRoads3Dv3.ERModularRoad road)

    StackOverflowException
    UnityEngine.GameObject.GetComponent[MeshFilter] () (at C:/buildslave/unity/build/artifacts/generated/common/runtime/GameObjectBindings.gen.cs:35)
    EasyRoads3Dv3.OQOOODDQCO.OCDOCCODOC (EasyRoads3Dv3.ERCrossingPrefabs scr)
    EasyRoads3Dv3.ERCrossingPrefabs.OCOCCCDDCC (Boolean ignorePriority, EasyRoads3Dv3.ERModularRoad road)
    EasyRoads3Dv3.ERCrossingPrefabs.OCOCCCDDCC (Boolean ignorePriority, EasyRoads3Dv3.ERModularRoad road)

    4) BUG: the custom connection prefab editor is buggy, but for these I did record a video with further explanations:

     
  30. raoul

    raoul

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

    I will partially answer but I have to leave in a minute, I will continue when I am back this afternoon.

    I wrote in my previous post that I can add that if that will work for you. So you can't at the moment. I will do that for the next 8.5 beta and let you know how to do it..

    We ourselves also prefer editor windows but other may find it complicated, something new to get used to while they are familiar with the concept of having game objects in the scene contrallable through Inspector options. In this case we chose for that because there is no real scene specific action involved.

    You are the first mentioning that you would prefer that. I will make a note of this and make it optional.

    Thank you for reporting that. A unity terrain object is required. In general, when you create a new road network and there is no terrain you will see a warning mentioning that. I will add that same code to the crossing editor scripts.


    I assume you still mean dragging that particular prefab from the assets folder for editing purposes? As already discussed, there is an issue with that particular prefab. That will be fixed.

    But the X Crossing does work well for scene instances, you can move them around wihout poblems, is that correct?

    The X crossing prefab uses the default settings. When you create a new dynamic prefab from General Settings > Crossing Connection Prefabs, it will look like thi X Crossing prefab. For now you can use these steps if you want to edit the default X Crossing crossing.





    Thank you very much for the video.

    Regarding the start. I have to provide some feedback for people who are unfamiliar with EasyRoads3D. Dragging a prefab in the scene like that is not standard workflow. First you create a new road network object, if there is no terrain you will get a warning in the console, perhaps it should be displayed in a dialog box?

    After that you can instantiate crossings quickly through the crossing tab, instead of having to find the crossings in the assets folder.

    At 6.00 the prefab is dropped in the Custom Prefab editor window. The black dots show vertices that are considered edge vertices, this is directly related to the setup of the mesh. When these black dots are inside the mesh more then one triangle strip away from the real outer edge, they will not cause issues.

    But they can cause issues if the respective vertices are part of triangles near at the outer edge which is the case in your video. It can interfere with the correct ordering of the "real" edge vertices. I have not seen the video further yet but I assume that connections are not correctly generated because of that.

    I really have to go now, I will watch further when I am back. Meanwhile, perhaps you can send me the source prefab so I can look at it?

    Thanks,
    Raol
     
  31. raoul

    raoul

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

    I just watched the full movie, I will repeat some comments made earlier with reference to parts in the video that have been covered already above.

    0.00 - 5:30: - this is all related to comments above about your specific 1:10 scaling relative to the standard Unity scaling and the current Min Max Inspector slider values not being ideal for that. This will be resolved by that option I mentioned to customize these Min Max values.

    Indeed either a unity terrain object should be present in the scene or a mesh terrain must be assigned to: General Settings > Scene Settings > Mesh Terrain

    6.23: Indeed, select vertices by creating a rectangle from top left to bottom right. This will be optimized to also support top right / bottom left selection.

    6.46: “so far everything works ok, in other occasions this part was buggy, the editor shows blue dots on in correct positions.”

    Blue dots represent the outer vertices for a selection of connection vertices. On the left you see the “Stage Rotation” option. The blue dots positions are currently not yet adjusted to possible stage rotation changes. Is that indeed when they appeared at wrong positions?

    7.10: “I’ve tried using this before and nothing happened, but the prefab somehow got corrupted and I had to do all again”

    It is hard to comment on this as it is not visible in the video what did not happen and how the prefab got corrupted. What exactly did not happen and how did the prefab get corrupted?

    7.13 – 7.25: Is this related to the above? “Bend Settings” currently is not active. This is related to a v3.x feature that will allow dynamic bending on custom connections. These controls were disabled but got enabled in the latest build due to other GUI.enabled changes.

    07.47- 8.08 You mention possible cache bugs. In this part you repeatedly select different materials from the dropdown. As far as I can see the target material slot updates accordingly. You put focus on this material slot two times, 7.59 and 8.06. What exactly is going wrong here?

    08.26: "It seems to be the center of the connection. It appears in a wrong Y position"

    That is right, these are handles that represent the center point of the connection. This a Vector2 what used to be a Vector3 for which y was previously set to 0, this bit was still in the code causding the blue dot to be displayed at (0,0). This is a visual bug that currently will happen on connections like the top and bottom connections in your video. It is fixed. But by itself this is harmless, it is only used as a visual reference in the editor window.

    08.43-8.59: This looks the same as in 07.47-8.08 mentioned above

    08.54: “See how the UV Editor didn’t open until I reselected a material from the list”.

    The UV editor is used to set uv coordinates, the material texture is used as a reference. The window will only open when the assigned material has a texture assigned. If no texture is assigned you will see a message in the console. I can see that message in your video “EastRoads3D Alert: No texture is assigned to the connection material”. To check whether a texture is assigned, Material.mainTexture is used. Does this explain why the window didn't open for that particular material, "1laneRampMat"?

    What I can see in your video that could be considered a glitch is that each time when you select a connection, “TwoLaneCustomRo...” is auto selected as the road type and “1laneRampMat” is selected as the material. Afterwards you select “road material Skyline TwoLane”. I would think it is preferred that the road type material (if a road type is selected) should auto update after selecting another material. That way, the next time you create a connection with that road type material, that same material is reselected automatically. I will double check the code if this is actually implemented and not working well.

    9:53 – 10.30: “the dots are too big, even trying to change the size from settings doesn’t help”

    That is directly related to your specific 01:10 scaling small scaling. The “Marker Handle Size” option is indeed related to road markers and the main crossing handles so you can optimize that based on how you generally navigate in scene view, zoomed in or zoomed out further.

    Scale options for other handles can be added as well. Also related to this is that these handles are all provisional, they will be replaced with custom handles.

    10:35: Red (Random) warnings: “The angle with the crossing is too sharp”. In my initial reply I mentioned possible issues with vertex ordering related to the black dots. After creating a connection or selecting an existing connection green handles are displayed perpendicular to the connection vertices. These green dots should be on the inside in the direction of the center. No green dots are visible in the video. This by itself could be related to your scaling as well. Can you check this by zooming out? Do you see the green dots and are they on the correct side of the connection?

    10.54: “How can I delete custom roads once and for all from the project...”

    Road types are stored both in the scene file as in the assets folder. To delete a road type from the project you can click “Manage Project Road Types” at the top in the Inspector. This will open a window with all the project road types.

    However, if you are using the same road type in another scene, it will be added once again to the project road types after deselecting that road network. This is to keep road types in synch and accessible across different scenes.

    11:00 “I don’t know what these red dots are”

    Unity stores terrain height data in decimals between 0..1. This makes it is impossible to flatten the terrain downwards below the terrains game object Y position. Red dots are displayed in critical areas near this position as a reference to double check whether everything looks alright in Build Mode.

    You can switch the display off in General Settings > Scene Settings > Display Critical Areas

    11.44: That looks indeed like another scaling issue and you resolved it in the way I was going to suggest :)

    13.00: “I’ve find out that is best if the pivot is on the center...”

    Indeed it is expected that the pivot point is somewhere inside the bounding box of the mesh, ideally near the center. This is also much more convenient when rotating it in scene view.

    14:34 “What’s the meaning for those red dots”

    See my comments at 11.00

    In the Inspector the value at 14.34 says ‘0.0981425. You could check the other Y values of surrounding markers. The nature of the spline curve is that when marker C is above marker B and markers A and B are at the same height, the curve between A and B will go slightly below the Marker A and B position. That is what most likely causes the red handles in these areas. A way to avoid terrain deformation issues related to all this, is to flatten the terrain first at for example height 10 before creating the real shape. That way there is always room to flatten the terrain downwards, also regarding creating river beds. You will not see any red dots unless you do something crazy, extreem height differences between markers.

    End of the movie -"...I’ve been able to do the custom crossings without major issues..."

    Indeed I cannot see major / critical bugs in your video. It actually is another example of how you can create a custom road network based on your own mesh prefabs.

    Thanks again for creating / posting the video, it always makes it easier to provide feedback.

    Raoul
     
    Last edited: Mar 18, 2017
  32. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    hi raoul, thanks for the extensive response, you covered all my doubts, and sorry for being annoying, half of my "bugs" were actually me using the asset wrongly at the end, probably the other half is because my rare scale needs, so I'll just wait for the next update so I can set the minValues and global sizes (handles, autosnap distances, etc etc) to fit best for different project scales, for now I can keep working with custom crossings.

    thanks again!
     
    raoul likes this.
  33. DesertRaven

    DesertRaven

    Joined:
    Jul 15, 2012
    Posts:
    137
    Hi Raul, I know you must be very busy with ER V3. I do have a feature request and want to see what you think of it.
    What I am really missing on the asset store is a decent looking spline based river tool. I saw one the other day in the Unreal asset store that I find inspiring. I immediately thought of EasyRoad.
    Please, when you have a minute to spare, look at this YouTube video, fast forward to 2:00
    . Let me know what you think.
     
    Astaelan1 and Artomiano like this.
  34. raoul

    raoul

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

    How are you?

    The river tool in the video seems to be river surface only.

    V3 does not have a dedicated river tool but it can be simulated using side objects. The main demo scene includes an example. It currently uses two side objects, one for creating the river bed in the terrain object and one for the river surface. The shape can be controlled per marker. The controls for this are perhaps not ideal if you compare it with the video but that is more a matter of optimizing the Scene View functionality, allow scaling etc. instead of having to move individual handles, etc. Although being able to move individual shape node handles gives you more freedom in the final shape.

    I am indeed very busy at the moment with small requests and getting v3 out. Improvements to this are planned for v3.x, it will be possible to create shape layers so both the river surface as the river bed can be done and controlled in the scene using one side object.

    You may want to give it a try and see if that can indeed form the base of what you are looking for?

    Thanks,
    Raoul
     
    Last edited: Mar 19, 2017
    DesertRaven likes this.
  35. OneManBandGames

    OneManBandGames

    Joined:
    Dec 7, 2014
    Posts:
    207
    Hi, ran into a little issue today where I suddenly could not use the EasyRoads Editor anymore, since the blue handle knobs for editing / extending the roads were missing. Also it was not possible to place additional new roads aynmore, etc.

    Turns out the issue was created from another Inspector tab (that I totally had forgotten about) being set to Debug mode in the background. This issue can then persist even after the "Debug" Inspector tab is being closed.


    Steps to reproduce:

    1. New empty Unity project (Unity 5.5.0f3)
    2. Import EasyRoads3D v3 Beta 8.4 package
    3. Open "scene main" scene that comes with the package
    4. Click on "Road Network" in the hierarchy, note how the blue handles on the road are visible in scene view
    5. Rightclick on the Inspector Tab and select "Add Tab > Inspector"
    6. Rightclick on the newly created Inspector Tab and select "Debug"

    From this point on the blue handles on the road disappear and the Road Network will show various issues when editing. These issues persist even when switching back to the first regular Inspector tab or closing the "Debug Mode" inspector tab. Only when the second created Inspector tab is switched back into normal mode it is possible to edit the road network again.

    I'm aware that it is unlikely that anyone would go through these steps as described above when using Easy Roads normally, but it seems there are more constellations where this can occur as long as a Debug Mode inspector tab is involved somewhere. I ran into this issue for example when loading an old scene with a debug mode inspector tab still being open in the background.

    This is barely a problem when you know where it comes from since you don't need the Debug Mode tab for Easy Roads, but I thought I report it anyway in case this can be fixed somehow from your side.
     
  36. raoul

    raoul

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

    Just in case, when you put the editor in debug mode indeed the editor scripts are no longer functional. That is normal Unity behaviour.

    Try setting the Inspector in Debug mode and select the unity terrain object. The same thing will happen.

    But indeed the Inspector status is something to check when the EasyRoads3D toolbar does not appear. The Inspector should be in "Normal" mode, not in "Debug" mode just like for example for the UNity terrain object.

    What do you mean with the second created Inspector tab? Or do you mean the Inspector panel in general?

    Do you mean, EasyRoads3D auto activating "Normal" Mode when the Inspector is in "Debug" Mode? I am not sure if that is possible.

    In any case, in the 6 years EasyRoads3D exists it has never been reported. I would think that those who play around with these sort of Unity editor settings, will be aware what the consequences are and what to do when the Inspector doesn't look as expected?

    I will add this debug mode situation and the toolbar not being displayed to the troubleshooting page.

    Or did you mean something else, issues afterwards as a result of this? I have not seen that happen, I use it a lot to check specific values etc.

    Thanks,
    Raoul
     
    Last edited: Mar 19, 2017
  37. OneManBandGames

    OneManBandGames

    Joined:
    Dec 7, 2014
    Posts:
    207
    Thanks for the quick reply! I think I did not express the issue clearly enough: I'm aware that editor scripts won't be executed properly when the Inspector is in debug mode, this is to be expected. Usually you would also never have a reason to use Debug mode on the Road Network game object.

    The problem that I was experiencing however was caused by ANOTHER Inspector being open in Debug mode that would cause the problems in the FIRST Inspector that still was in regular mode:



    As you can see in the image above, the Road Network has no blue handles to edit etc. although it is being viewed with a regular inspector in normal mode (red circle). The issue is caused by another Inspector tab that is open in Debug mode (red arrow). This Debug mode inspector needs not to be active, it just needs to be there somewhere in the background while working with Easy Roads.

    Now one could argue that you simply should use a single Inspector while using Easy Roads, but when you do that and close the second Debug mode inspector, the issue still remains:



    You can then even do things like reload the scene, create a new road network, reinstall the Easy Roads package etc. but the Road Network will not be editable again until you either restart Unity or open another (regular) Inspector tab.


    I hope this clarified the issue better: The problem is NOT "Easy Roads is not working when the inspector is in Debug mode", the problem is: "A second Inspector in Debug mode that was open once during working on Easy Roads can cause Easy Roads not to be working in a regular Inspector". ;)

    Again, for me it is no problem anymore, since I know what to look out for now, but other users could run into this issue accidentally when they are working with two Inspector tabs at the same time as I did. The more I play with this issue it seems to me that this might even be an Unity bug and not something you can fix on your side, but if this state is easy to detect from your side maybe you can find a fix for it.
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, you have two Inspector tabs open, and the other Inspector tab is in debug mode.

    I will see if I can recreate this but it does sound more related to Unity itself.

    I do indeed think this situation is not very likely to happen, two Inspector tabs open with one in debug mode. I will add this situation to the troubleshooting page as well.:)

    Thanks again,
    Raoul
     
    OneManBandGames and hopeful like this.
  39. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    That's a really nice tool. If we could change a river like that, this would be great.
     
    DesertRaven likes this.
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi tom-art,

    EasyRoads3D is a road tool so regarding the river material, this is not what the tool offers at the moment. For side objects you can set a target object. This can be a water prefab. That prefab will be used as the target.

    But regarding creating the river surface, most of what you see in the video can already be done. And additonal to that, creating the river bed in the terrain.

    The two things in the video that currently are not possible are:

    1) The global scaling of nodes per marker. That will indeed be useful in general, also for roads. As mentioned, you can already reposition nodes per marker which gives additional freedom in the shape. This way you can make a more irregular shape where, for example, the river only gets wider/narrower on the left or right side.

    2) The rotation option for more control. That is on the list, it is a little bit bezier curve related.

    Does this cover it? Or is there anything I missed?

    Thanks,
    Raoul
     
    Last edited: Mar 20, 2017
    DesertRaven likes this.
  41. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    3d roads already works with World Streamer, I been using for over a year, you just need to make sure you end your connections properly where the terrain tiles meet. and add to World Streamer game objects to Stream or what not. If someone is having issues with these two assets working ask the developer of World Streamer, as well.. He helps with this set up as many have asked for this on his forum as well in the last few years..

    https://forum-old.unity3d.com/threa...-create-big-world.325673/page-15#post-2931400
     
    Last edited: Mar 20, 2017
    raoul likes this.
  42. raoul

    raoul

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

    That is good to know :)

    The upcoming IConnector will be helpful here. You can use it to quickly split roads at the edges of terrain tiles.

    Thanks,
    Raoul
     
    Last edited: Mar 20, 2017
    recon0303 likes this.
  43. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    that will be super helpful./ do you have an ETA? we are about to make a new map for our up and coming game.
     
  44. Cleverlie

    Cleverlie

    Joined:
    Dec 23, 2013
    Posts:
    219
    Hi raoul, I just wanted to show you I've made great progress with a script that uses EasyRoads API and procedurally generates the buildings for a city, it will be able to take heightmaps for building density, type and other options.
    also wanted to ask if do you have any ETA to the 8.5 update?

    advances2.jpg
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    By itself it appears to be stable. Ideally some additional functionality could be added but that can be done later as well. So hopefully a new update will be available by the end of this week. It will include this particular functionality, simply connecting two roads.

    Do you use standard roads (1 vertex left and one vertex right) or roads based on custom prefabs?

    Thanks,
    Raoul
     
  46. raoul

    raoul

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

    Good to see you are making progress on that, looks great!

    As mentioned in my previous post, hopefully an update will be available at the end of this week. Lately there are many requests for small things though, so hopefully this target can be made or perhaps some things have to wait for the next update.

    Yesterday I added your request for flexible Min / Max values for the the road width sliders. Did you have issues with your specific scaling only with the Road Width slider or should the same be added for other sliders?

    Thanks,
    Raoul
     
  47. Artomiano

    Artomiano

    Joined:
    Dec 1, 2014
    Posts:
    200
    Hi raoul,

    Yes, my thoughts! As you said - this would not only be useful for sideobjects, like rivers, also for roads itself.

    I think this covers all mainly important points. ;)
     
    raoul likes this.
  48. recon0303

    recon0303

    Joined:
    Apr 20, 2014
    Posts:
    1,634
    I have did both ways, but mainly 1 vertex left and one right..
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Ok, it appears to be working fine for custom roads as well. But this might be switched off for custom roads in the next build if there are critical issues.

    Thanks,
    Raoul
     
  50. Astaelan1

    Astaelan1

    Joined:
    Sep 29, 2015
    Posts:
    192
    This is almost exactly what I was looking for, I mentioned it a page or two back now, but I was going to look at EasyRoad3D to make the river mesh... seeing that spline based system is ... exactly what I was after for rivers. This needs to be done for Unity... I could see EasyRoad3D hitting the mark for this as well.

    @DesertRaven
    Keep us (me) posted on your progress with this, I'm very interested in what you achieve in Unity for dynamic rivers.