Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hello Barritico,

    This is more material related. Currently no wet / snow materials are part of the package but any material can be used so you do not rely on what is part of the package.

    Thanks,
    Raoul
     
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Please give more info about the Vegetation Studio status in the project, is it active on the roads, are these "Vegetation Mask Line" components added to the road objects? What does your road network look like? Would it be possible to look at this, can you send an email or a PM with a download link?

    Thanks,
    Raoul
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    v3.1.1 is now available both on our web site and on the asset store

    This is a small update with a fix for manually changed road types being reset to the road type associated with a crossing after a full road network refresh through General Settings > Scene Settings > Refresh Road Network.

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

    Thanks,
    Raoul
     
    Noa3 likes this.
  4. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    663
    Raoul,

    I am having an odd problem, and it may not be an issue with your asset, but since it is happening with your asset I thought I'd ask.

    I am working on adding adding "Road & Traffic" (https://assetstore.unity.com/packages/templates/systems/road-traffic-system-21626) as Side Objects. The asset is a Transform with a script. I made these as a prefab and then created Side Objects. I have 3 Road Types, so I check off the new Side Objects and add them, and I can see the objects as children to some of the roads, if I uncheck and recheck I sometimes see them on some roads. If I close and open Unity the objects are gone (usually one of the three Road Types is missing the objects)

    I deleted the "Library" folder and reopened Unity to see if clearing that cache would resolve the problem. Nope.

    Any thoughts?

    EDIT 1: I just changed the Prefab to a simple cube and these SEEMS, so far, to be staying. Odd. (see, told you it might have nothing to do with your asset) Back to more tests, I will report back whatever I find. At very least I want you to know about this in case it's happening to other users/other assets.

    EDIT 2: Added the script to my temp prefab, kept the cube on the prefab. So far everything is staying as it should

    EDIT 3: This will be of some good news to you, not so much for me. Properties on the script are not being saved. (sometimes) So it seems to be something to do with the other asset.

    Have a great weekend and don't worry about this
     
    Last edited: Jul 13, 2018
    hopeful likes this.
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617

    Hi James,

    I did some quick testing. When adding side objects to Road types in General Settings > Road Types and pressing “Update Scene Instances”, the side objects get activated on all roads of that type. I repeated this a couple of times. Indeed this seems to be stable.

    Also, after the side objects are added, they act as ordinary unity game objects available in the hierarchy, the same way as when adding prefabs manually to the scene. They should still be there after saving the scene and reopening it.

    Hope you can figure out what is interfering here on your end. It is hard to comment on the other assets involved here Please let me know if you feel this is actually EasyRoads3D related.

    Thanks,
    Raoul
     
  6. Marcos-Elias

    Marcos-Elias

    Joined:
    Nov 1, 2014
    Posts:
    158
    I don’t know if this is the case, hope that it helps!
    I got many problems with my own traffic system where instantiated prefabs lose their properties altered by my editor script. It seems a problem related to Unity on how editor scripts change prefabs instances in the scene, where values are not saved or marked as changed automatically (maybe we need to use some api to mark that).

    What I did was this: after setting up all my traffic waypoints I select them all and go to GameObject - Break Prefab Instance.

    Now all links and properties are saved. To save (in my script) the scene must me marked as dirty, I do it by disabling and then enabling again something. So it saves and everything works next time it is opened.

    Since you are having a similar problem, maybe it could get fixed by doing this too.
     
    raoul and JamesWjRose like this.
  7. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    663
    Marco,

    Thank you very much. It is a VERY good thought. I have stepped away from that asset and I am back working with the spline points provided by the ER3D asset as a way to have autonomous traffic navigate around my game. It seems to be going better now, and when I get it working I will share it here.
     
    raoul, IsDon and Marcos-Elias like this.
  8. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    663
    Raoul,
    I think Marco likely hit the answer, the other asset was not saving it's data (sometimes. wtf?! why sometimes?!) But anyway, I am back using the splines provided by your asset as a navigation method, and I think I have it working well. Once done i'd be happy to share the code if you are okay with that.
     
    raoul, hopeful and Marcos-Elias like this.
  9. raoul

    raoul

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

    Please feel free to post any code you want to share. Currently road type are being updated with the option to provide lane info. It will also be possible to connect lanes on crossings. V3.2 will have many updates all related to crossings and road types which will be introduced step by step in betas. Let me know if you want early access to test versions.

    Thanks,
    Raoul
     
    JamesWjRose likes this.
  10. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    663
    Raoul,

    Great to hear about lanes, however this version I am making is only using the center points and having a prefab that has a transform that follows the center line, a child of this transform is the actual car that is offset to the right. The code I am working on allows for a range for this distance (aka Lanes) This is, at least, a nice starting point and by using your asset my project does not need other components, saving memory (yay)

    Thanks again for your asset
     
  11. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    663
  12. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,136
    Hello Raoul,

    I'm stuck on an issue with crossings I can't figure out the cause of. I currently have 3 road types, when I place a Default X Crossing, only two of my road types are available in the connection settings. The differences between the roads is just the width and material.

    In some cases, for the available road types, existing roads fail to connect to a crossing. Though, this behaviour is fairly inconsistent.


    Any suggestion on how to resolve this? I'm using v3.1 in Unity 2018.2
     
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hello StaggartCreations,

    In v3.0 roads that are not connected yet to a crossing auto inherited the crossing connection settings. Green handles instead of the red handles in the screenshot above.

    This has changed in V3.1 to allow road type changes also after the road is connected to a crossing. In v3.0 the road type dropdown was disabled after the road is connected to a crossing. Now it is enabled showing the road types that match the connection. So depending on the available road types and sidewalk status not all road types will be listed in the dropdown.

    The second question is related to this. In your screenshot, the crossing has sidewalks, the road has no sidewalks. It seems the same road type is involved. Please select the crossing, and disable sidewalks on that side of the corner by pressing the green corner handle at that side, it will turn grey. After that you should be able to enable to switch the sidewalks back on if necessary.

    This workflow is temporarily. In v3.2 sidewalks will no longer be part of crossings. Instead you will be able to define how sidewalks should be positioned on specific road types. Based on that info, sidewalks will be generated automatically on roads and crossings regardless the involved road type. If a sidewalk is active on a crossing it will be activated on the road and vice versa.

    Thanks,
    Raoul
     
  14. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,136
    Thank you for the detailed explanation! After matching the sidewalks between the road and crossing, I can make the connection.

    I'm still not entirely clear as to why my "Main" road type fails to connect to any (new/disconnected) crossings. I assume this is because it is not available in the "Select Road Type" dropdown. What is the criteria for a road to become available there? I've created a new road type for testing, which does show up. Coincidentally, changing the width of my Main road and updating the scene instances has no effect on the width, so could it be that this specific road type is somehow broken?
     
  15. StonedLover

    StonedLover

    Joined:
    Apr 16, 2014
    Posts:
    47
    With unity 2018.1.0f2 I get errors when creating a road:

    GUI Error: You are pushing more GUIClips than you are popping. Make sure they are balanced)
    UnityEditor.SceneView:FrameLastActiveSceneView()


    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3Editor.ODCQQODQQO.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:2594)
    UnityEditor.SceneView.HandleSelectionAndOnSceneGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1907)
    UnityEditor.SceneView.OnGUI () (at C:/buildslave/unity/build/Editor/Mono/SceneView/SceneView.cs:1744)
    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.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:291)
    UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:284)
    UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:251)
    UnityEditor.SceneView:FrameLastActiveSceneView()
     
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hi StaggartCreations,

    What is the exact situation here?

    If the road is not yet connected to a crossing, like described in your post, and "Main" was selected as the road type when creating the road, then "Main" should still be selected as the road type for that road and selected in the road type dropdown. Is that the case?

    If this road does not update to road type width changes in General Settings > Road Types, then it seems indeed that the road type for this road is currently not set to "Main".

    Thanks,
    Raoul
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hi StonedLover,

    Does this involve a specific road type and at which exact step is this error thrown?

    Thanks,
    Raoul
     
  18. GOLDY00

    GOLDY00

    Joined:
    Mar 16, 2013
    Posts:
    139
    Hi all I was wondering can someone please make a step by step video on how to put ripple strips on I need a video please on step as I’m a visual learner not text please again thanks
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hi GOLDY00,

    The HD Roads package includes various "Lane marking" side objects. The HD Roads video shows how this can be used.

    Starting at 1.59, a road is selected, In the Inspector the side objects section is visible


    Do you want to add your own ripple strips? What type of strips are they? Do you for example have a mesh ready for this and do you want to use this within the system?

    Thanks,
    Raoul
     
  20. GOLDY00

    GOLDY00

    Joined:
    Mar 16, 2013
    Posts:
    139
    I just want to use the one you have in the demo project I just need them for corners of my race track but I really need a step by step video on how to do it I don’t understand how too
     
  21. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hello GOLDY00,

    Line Markings and what you mentioned, ripple strips, are added as side objects.

    Side Objects are managed (added, deleted, edited) in the Side Object Manager in the Inspector. The 2nd tab from the right.

    toolbar.jpg

    so_tab.jpg

    The video above in my previous reply shows how aside objects are added to a road. Is that clear?

    Are you referring to the curbs in the demo package?

    They are added the same way. They are located in the "Misc" tab, "Curb Stone Left", "Curb Stone Right".

    In the Side Object manager there is an option "Default active state for each marker".

    This is switched on for all the side objects in the video above. For the Curb Stone side objects this is switched off because you want this side object only active on a selection of markers.

    So the missing part in the previous video is controlling side objects per marker, this case the active state.



    The above video is provisional, the Inspector controls are not entirely up to date, but it does show how this works.

    At 0.42 a marker is selected, in the Inspector we scroll downwards to the Marker Side Object Settings. The "Active" state is switched on for the selected side object in the "Selected Side Object" dropdown. In this case the concrete barriers on the left and right of the road.

    Please let us know if you need further details.

    Thanks,
    Raol
     
  22. scorpionfeast

    scorpionfeast

    Joined:
    Dec 5, 2014
    Posts:
    18
    Hi,
    for me just these road types are displaying after importing demo project. And no side objects... Can you help?
     

    Attached Files:

  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hello ImranKhalil,

    These road types look like the older road types part of the beta package before v3.0 was officially released.

    Which package did you import? Which version of Unity do you use?

    Thanks,
    Raoul
     
  24. scorpionfeast

    scorpionfeast

    Joined:
    Dec 5, 2014
    Posts:
    18
    I am using unity 2017.4.1 and i had just downloaded the demo package from store! its the latest! it has the demo scene which includes different roads and ridges. but in new scene when i create road network, just these roads are placed and no side objects!
     
  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hello ImranKhalil,

    The demo package is primarily intended to get familiar with the tool which involves working with the road network in the demo scene. Did you do that? Because selecting / deselecting this road network will trigger updating the project file with available road types and side objects.

    This data is not available in the package after the import because that will mean that importing an update at a later stage will possibly overwrite changed settings, newly added road types and / or side objects.

    We get this question more often and will make some changes so these road types and side objects will be available without first having to use the demo scene.

    If the road types are available, and the side objects not, can you double check this in the Side Object Manager, 2nd tab from the right. If the list is empty, can you press "Add Project Side Objects", does it show a list of available side objects?

    Thanks,
    Raoul
     
  26. scorpionfeast

    scorpionfeast

    Joined:
    Dec 5, 2014
    Posts:
    18
    Ok, I got the side ojects and Roads, but when i created rail, there is no rail creation... Can you check?
     

    Attached Files:

  27. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    663
    re: NavMesh

    Ok gang,

    I have spent about 18 hours attempting to make NavMesh work on only ER3D roads. I have even made a scene with only a Terrain and a single ER3D road. I set the Terrain to "Not Walkable" (in the Navigation window, Object tab) and the Road to "Walkable". Thing is, the road never becomes Nav-Blue. If I enable the terrain to be walkable I can see the blue and I have an Agent move in the scene.

    I've got a nasty headache and I am just SURE the answer is going to be something silly/stupid.

    So... anyone?
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hello ImranKhalil,

    Is this related to the Guard Rail side objects?

    Some side objects are generally used along the full track whereas other side objects are only used on some marker sections.

    Have a look in the Side Object Manager Tab and select the guard rail side object from the Barriers tab. "Default active state for each marker" in General Settings is switched off for this side object. That's why no guard rail is instantly build. You can switch this on if you prefer that.

    With the current status please select a road marker, scroll downwards to the Marker Side Object Settings below the Main marker settings, Make sure the guard rail is selected in the dropdown and switch on "Active". This can be done per marker or for all selected markers.

    Thanks,
    Raoul
     
  29. raoul

    raoul

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

    Is this actually working?

    Without being too familiar with Navmesh, I just had a look and indeed the roads do not become Nav-Blue. After moving markers a little bit up above the terrain, the terrain below the road was actually white, unwalkable.

    Then I thought about the road shader using an offset to handle z-fighting. The blue of the navmesh on the road was visible after changing the road shader.

    Is this related to what happens on your end?

    Thanks,
    Raoul
     
    hopeful likes this.
  30. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    663
    Raoul,

    Earlier I had seen a post on this thread about changing the material, and I had done that. I have a Standard shader with only an Albedo color (light grey) and like I say within my original post there are two objects set in the Navigation Window, the Terrain and one of your roads. I have a "cop" with a simple script that tells it to go to another Empty Object (TargetToGoTo) and when I bake the navigation it is not including the road. As you can see from the image below the road only had the shader color. If I enable the Terrain as Walkable, then the Cop moves, but only because of the terrain, it is having no effect on the road. This is why I assumed it was not about the Shader. (But I tested it a few hours ago, and again just now just in case)

    The reason for this method is so that autos (in my case cops chasing the player) only choose the road.

    https://imgur.com/a/vaaRRJN

    EDIT: I looked at the project you sent me a week ago (in ref to Traffic AI) and changed the Material on one of the roads and then I COULD see the Nav-Blue. ??!! WTF? Oh goodness. How very strange. I'm still looking into it, but I thought I would share new info as I get it
     
    Last edited: Jul 25, 2018
    raoul likes this.
  31. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,136
    Yes, the road I wanted to connect was set as the "Main" road type. I'm not sure why, this this road type seemed to be broken.

    Fortunately, I'm in the midst of a large landscape revision, so I'm starting from scratch with my road network anyway. I made a new "Main" road type, this one does show up in the dropdown menu for crossings, so no harm done at this point ;)
     
  32. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,136
    Another quick question about dynamic crossing prefabs. I have created one as outlined here



    Though, in my case there is no interface visible to modify or save the prefab.

    Also, is there any way to manage sidewalk presets? For instance, there is one I'd like to remove. But there also seems to be no way to save changes to an existing preset (eg, adding an outer curb).
     
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hi StaggartCreations,

    I now see what you mean! The curren t built-in road type system only supports road types with one segment. These are the road types that will be listed in the crossing connections dropdown. Did the previous Main road type perhaps used more Sub Segments?

    Anyway, glad to hear you got it working now. V3.2 will support custom, more complex road shapes for built-in crossings.

    Thanks,
    Raoul
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    What is the exact status of this dynamic connection prefab? How was it created?

    Through: "General Settings > Crossing / Connection Prefabs" and Shift + click in the scene?

    Or through the new v3.1 option "Create New Connection Prefab" in the Road Type settings?

    And where is it located in the hierarchy? Is it a child of "Temp Crossing Prefabs". This is where source prefabs should be that are being created / edited, connection prefabs that are not part of the actual road network.

    I will double check both. Can you remove it from the scene and drop it in the scene again from the project folder?

    Sidewalk Preset options are limited at the moment to creating new presets. This too will have an upgrade in v3.2. Sidewalk presets will be manageable in a separate section in General Settings with more options.

    Thanks,
    Raoul
     
  35. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,136
    Thanks for the quick reply, Raoul!

    I created the prefab through the general settings GUI.

    If I drag in the prefab from the "dynamic prefabs" folder (which gets parented under the temp object), the options do appear! I was under the impression these prefabs worked much like Unity prefabs, where changes can be applied from instances.

    As a point of feedback, if possible, I would suggest to also show the "Refresh scene instances" button next to the prefab editing actions. This currently only shows when the prefab is selected in the project window.

    Will create some more crossing prefabs now that I have the hang of it, thanks again ;)
     
  36. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,136
    Not sure if this is specific to my project, but I ran into an issue with updating dynamic prefabs. Whenever I hit "Refresh scene instances", the settings are copied to all custom dynamic crossings, from whichever I refresh last.

    https://gyazo.com/48f880cdd617d565f3be65322f1e7512

    I have three crossing lined up here, these are not replaced, when I select them they still show the correct prefab type.

    Saving prefabs also doesn't appear to work for me. I'll save the changes (exiting the prefab editor also gives me an additional save prompt). But after dragging in the prefab again, or adding it through the crossings menu shows that none of the changes were saved.

    Any idea what could be the cause of these issues?
     
  37. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    663
    Re: NavMesh

    Good news, I got it working. I downloaded the updated NavMesh scripts from https://github.com/Unity-Technologies/NavMeshComponents I added the "NavMeshSurface" script to the "Road Network" parent node. I then created a Layer Tag called "HBC Roads" (name it whatever, of course) Then I added all Easy Roads and Connections to that Layer. Then back on the NavMeshSurface script I selected the "Include Layers" drop down and selected "Nothing", then reselected the drop down again and selected the "HBC Roads" and then pressed the "Bake" button. This sets ONLY the roads as navigable by the NavMesh.

    Odd thing is, on a testbed with just a terrain and a road object I set the values in the Navigation window (set the Terrain to NotWalkable, and the Road to Walkable) and that worked fine. As Raoul mentioned, in this example I had to change the Road's material to see the Nav-Mesh-Blue.

    Hope this helps others.
     
    MLipscomb, IsDon and hopeful like this.
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hi StaggartCreations,

    Both ways I mentioned are generated from General Settings, one from the Road Types section, the other from the "Create New Connection Prefab" section.

    But I think your further info already explained why the "Save" options initially did not display when looking at this from a scene instance.

    The scene instances cannot be compared with ordinary unity prefabs, this was already the case in v3.0 (flexible shapes resulting in different meshes), this has become more strict in v3.1, quick Inspector options to switch between T and X Crossings (also resulting in different meshes)..

    So, although the source prefab is the same, they can be used in a different way, updating the source prefab would change all scene instances in a similar way. That's why this is not done automatically, only if this is requested. This actually needs to be thought out further but making it available was requested, that is why this option is a little bit hidden at the moment.

    Thanks,
    Raoul
     
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    I just did a quick test, dropped a dynamic connection prefab in the scene that has no active sidewalks, activated sidewalks, saved the prefab. New instances of this prefab do have sidewalks activated. The changes saved well.

    Could you give more info? What exactly is changed on your end and how? What are the exact steps for a repro?

    Thanks,
    Raoul
     
  40. aleksejfongrozni

    aleksejfongrozni

    Joined:
    Dec 25, 2015
    Posts:
    6
    Hi Raoul,

    I would like to ask you whether there is a possibility of keeping a road network in reserve (as a kind of prefab) thus allowing me to edit it some time after finalizing road network? (as it happens I have to edit it as the new objects/content becomes available, after balancing the map and QA pass etc.)

    So far I've duplicated Road Network, made it hidden (as a reserve) and after finalizing the active one used to just make hidden one visible and edit. It became rather clumsy and saving RN as a prefab so far failed to be utilized (errors etc.)
     
  41. davidlannan

    davidlannan

    Joined:
    Jul 11, 2013
    Posts:
    48
    Hi Raoul,
    I have been trying to use the script API to build roads and intersections, and not having much luck doing so. The main issue is that I have roads that meet at a point, and I am uncertain how to generate a crossing/intersection at that point where the roads will correctly join.
    Ive been using the InstantiateConnection method, but I really dont understand how the roads should join to the newly created connection.
    https://gyazo.com/61046f5ee7207c17de615e24ecbee73b
    Here are four roads meeting at one point and an intersection, but none of them are correctly joined. Any help in using the scripting would be greatly appreciated. Using V3.1.1 Pro.
    Cheers.
    David Lannan
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hi aleksejfongrozni,

    We always duplicate the scene. The full road network can be put back in place by opening both scenes in the hierarchy and dropping the road network object from one scene to the other. Will that work?

    Saving the full road network in a prefab will have complications, Unity prefabs require the mesh assets to be physically present in the project folder while Unity by default stores generated meshes in the scene file. In Build Mode there is an option "Store mesh assets in project folder". Storing the full road network as a prefab has not been thoroughly tested.

    Thanks,
    Raoul
     
  43. aleksejfongrozni

    aleksejfongrozni

    Joined:
    Dec 25, 2015
    Posts:
    6
    Ha, great way to do it (two scenes). Thanks a lot, that will do just great. :)
     
    raoul likes this.
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617

    Hi davidlannan,

    What code is used to connect roads with crossings?

    For connection prefabs already instantiated, this can be used:

    ERRoad.ConnectToEnd(ERConnection connectionObject, int connectionIndex)
    ERRoad.ConnectToStart(ERConnection connectionObject, int connectionIndex)

    Or is finding the correct index the problem?

    Connection indexes are:
    0: front
    1: back
    2: left
    3: right

    There are some improvements on the list here, like getting the world position for each connection center.

    Thanks,
    Raoul
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    For large scenes you could also remove all other assets from the backup scene and only keep the road network object.

    Thanks,
    Raoul
     
  46. davidlannan

    davidlannan

    Joined:
    Jul 11, 2013
    Posts:
    48
    Hi Raoul,
    The problem has been making a road connect to a intersection look correct for the central position of the intersection. I was wondering if there might be a "connect Road Ends to intersection" type solution.
    How are the indexes oriented? Where does 0:front relate to in terms of the intersection? 0:front is 0 forward orientation?
    I might try and use the connection points and see if that works better. Its a little tricky because the incoming data is not really in a similar format.

    Thanks for the tips.
    Cheers,
    David
     
  47. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hi David,

    This sounds as:

    ERRoad.ConnectToEnd(ERConnection connectionObject, int connectionIndex)

    Or is it perhaps the naming? ConnectToEnd refers to connect the passed connection to the end of the road. Or did you mean something else?

    Yes, 0:front is 0 forward orientation

    Which incoming data is not in a similar format?

    Thanks,
    Raoul
     
  48. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    663
    If it helps, I too often create a backup of a scene (Save As...) in case I need to get back to some data or previous state.
     
  49. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,136
    I've exported the EasyRoads folder and all related materials to a new 2018.2 project. The same steps, where I toggle the sidewalks and save the prefab has no effect for me. One crossing in particular will always revert to what looks like the default X-crossing. I test this by making a change, saving and exiting the prefab editor, then dragging the dynamic prefab back into the scene.

    Furthermore, whenever I hit "Refresh scene instances", the settings for this prefab are copied to all crossing instances in the scene, despite being different prefabs.

    I can replicate the same results in a fresh project. Where I have created two road types: Wide and Narrow, as well as two dynamic crossing through the General Settings UI.

    If I drag in Crossing A, and set it's connections to be of the road type Wide, I'll save it, exit the prefab editor. When I drag this prefab back into the scene, or add it as a new connection it appears to be reverted.

    Thanks again Raoul, if you need any more information feel free to poke me!
     
  50. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,617
    Hi StaggartCreations,

    How was the EasyRoads3D folder exported to a new 2018.2 project? What is the history of this project, is this an older v3.0 beta project? Does this also happen in a new project with a fresh v3.1.1 import?

    Thanks,
    Raoul