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
    How far is the cam?

    This really is Unity behaviour, terrain LODs, z-fighting, etc. Which shaders do you use? The EasyRoads3D shaders use an offset. This offset is triggered by cam distance.

    Yes, "Resolution" stands for the distance between points, so lower resolution values result in more spline points. It is up to you how to use it. If you want higher resolution roads but smaller spline point arrays for AI then you could clean up the arrays returned by EasyRoads3D.

    Thanks,
    Raoul
     
  2. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197
    Hello,

    I have the problem when use vegeatation studio and easyroads 3d and activate / enable vegatation studio options in easyroads3d that the frass get away from roads and refresh all roads that it work and want build it stuck for hours at build the game / exe. and then getoften no error only unity crash and sometimes error with player.


    when not use easyroad3d vegatation studio option active / enabled then build work without problems.

    but then with touchbend collider or so at easyroads3d i look very bad .


    what could be the problem ?


    this is the error when easyroads3d and vegetation studio ooptions are enabled / activated:
    UnityEditor.BuildPlayerWindow+BuildMethodException: Build failed with errors.
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x001b9] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:162
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x00050] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:83
    UnityEditor.HostView:OnGUI()



    but without it works :/(




    Also is there a way change all selected roads to same road type or change all roads to same rtoad type atm only work one by one ?



    regards
     
    Last edited: Sep 14, 2018
  3. raoul

    raoul

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

    Can you explain further what you mean with this? The only thing EasyRoads3D does is, add a Vegetation Studio Vegetation Mask Line component to the road object in the hierarchy.

    And none of the posted errors point specifically to EasyRoads3D.

    This is at the moment a one by one task because this can get complicated when crossings are involved. This will be easier to deal with in v3.2 when crossings support more options for different road types.

    Thanks,
    Raoul
     
  4. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197

    ok thanks when 3.2 comes out ?

    yes i know that error is not related to eadyroads3d but when i not enable at easyroads3d the vegetation studio option then grass is at road and build works when enabled not. so its has something todo with it that a problem comes because of that function.

    regards


    regards
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Given the size of the 3.2 update, that is hard to tell. It will be released in betas. keep an eye on this thread...

    If you want to give it a go changing the road type on all roads (at your own risk if indeed different crossings are involved :)) you can use the scripting API for this:

    ERRoadNetwork class:

    public ERRoadType GetRoadTypeByName(string name)
    public ERRoad[] GetRoads()

    ERRoad class:
    public void SetRoadType(ERRoadType roadType)

    You probably want to backup your project / scene first.

    I can't really comment on the problem involving Vegetation Studio. The error is unknown, neither does it point to EasyRoads. To debug this further on your end and check if EasyRoads3D is or is not involved here, you can duplicate the scene as a test. In the duplicated scene build the road network and finalize it. All that remains are ordinary Unity game objects, no EasyRoads3D components involved. Do you still get the errors. In that case, can you email a project so we can look at it. Please do not post it here.

    Thanks,
    Raoul
     
  6. RonnyDance

    RonnyDance

    Joined:
    Aug 17, 2015
    Posts:
    557
    I own Easyroads a long time now but wasn't able to use it.
    Is it also possible to draw pathways by holding down the mouse or is everything created through mouse click generation? (Spline Generation etc.)
    Is this feature planned in the feature?

    Best regards
    Ronny
     
  7. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197
    ok thanks i will test some things.

    also is there a good solution for traffic at easyroads3d roads ? to auto generate path etc for traffic ?


    regards
     
  8. raoul

    raoul

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

    Something similar was asked earlier this week. This is on the list to add and code exists but it needs to be optimized further. The current implementation either adds too many control points or not accurately especially in hilly areas.

    Thanks,
    Raoul
     
  9. raoul

    raoul

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

    Traffic system questions are asked frequently here on the forum. Several people are working on that, github projects exists.

    Another v3.2 feature will be support for lane info per road type and connecting roads / lanes on crossings. Once that is all functional we will look into this further.

    Thanks,
    Raoul
     
    hopeful likes this.
  10. 40detectives

    40detectives

    Joined:
    Apr 9, 2016
    Posts:
    74
    Hi @raoul wanted to ask you for this file for a while:

    <ProjectFolder>\Assets\EasyRoads3D\Resources\ERSideObjectsLog.prefab


    I use Git with my project, and I've been wondering if this file is recommended to be tracked by the CVS? I've been searching on the forum but didn't get to a real conclusion if I should register its changes or with my unity scene saved is enough.
     
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Hi 40detectives,

    That is where all road type and side object data is stored so road types and side objects created in scene A can be used in scene B.

    It can always be rebuild by selecting / deselecting an up to date road network in a scene.

    Thanks,
    Raoul
     
    40detectives likes this.
  12. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    haven't been able to get vegetation studio line mask to work with easy roads.
    When I click on a road object in the Hierarchy i noticed it doesn't show the Vegetation Mask line for the road.

    I noticed the width was only set to 2 on the vegetation line mask but I maxed all the width settings out and no change.

     
  13. raoul

    raoul

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

    In general:

    The only requirement fo support for Vegetation Studio, is that "Active" is toggled on in General Settings > Terrain management > Vegetation Studio. This option is available when the Vegetation Studio package is imported.

    Here you can also set global perimeters per object type. This can be customized per road type in General Settings > Road Types. Make sure to press "Update Scene Instances" for each road type after changes.

    You wrote that the Vegetation Mask line component is not visible for the selected road in the hierarchy. But you also wrote that you noticed that the width was only set to 2? What exactly is the situation here, how can the width be set to 2 if the component is not visible?

    Additionally, the Vegetation Mask Line Component is a Vegetation Studio component. Values will be set according the EasyRoads3D settings. Changing values manually in the component is a Vegetation Studio only process.

    Thanks,
    Raoul
     
  14. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Ya thats what the issue was I just have to go to each road type and hit update instances. Now its masking.
    I guess thats cause i added vegetation studio into my scene after I created the roads.

    Also its showing the vegetation studio line mask points in scene view now as well.
     
  15. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    I noticed there isn't enough points added for vegetation studio when going around a curve so the grass is a bit uneven.

     
  16. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197
    I still have this problem:

    I tried make first not snap terrain and faltten terrain then snap to terrain etc all variations but always looks similar and when change the height after build terrain its to much over the terrain then car stuck or fall down because road to height to fix this problem :(

    how can fix problems like this ?

    terrain heigtmap set to max 4096









    regards
     
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Unless you want a perfectly manicured grass edge relative to the road I cannot clearly see the problem, but the density of Vegetation Studio nodes can be added as a control.

    Thanks,
    Raoul
     
  18. raoul

    raoul

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

    It is hard to make sense of the screenshots, it seems you have several road objects on top of each other. That won't work with regard to terrain deformation. Deforming the terrain according one road will mess the terrain deformation for the other road. Crossing prefabs need to be used between roads, not only to connect roads, also for flattening the terrain correctly.

    What exactly are you asking? What is the exact problem area?

    The troubleshooting page in the manual covers all possible situations that can result in the terrain breaking through the road or the road float above the terrain.

    Thanks,
    Raoul
     
  19. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,259
    Still making a lot of way with EasyRoads for my project, so far smooth sailing!

    There are a couple of things I'd like to request for v3.2, if possible:
    • Option to hide the mesh renderer for road types (some of my roads have the same texture as the splat texture they apply). I could use an invisible material for now, but this is not ideal ;)
    • Public function in the ERModularBase class to regenerate the side objects, I've tried many of the available functions, but the only way is to move a node slightly. I'm extracting all the side objects from the road network (essentially unparenting them), so they can be prepared for content streaming. I'd like the ability to regenerate them so this process can be repeated.
    • Access to the function behind the "Build Terrain(s)" button so it can be automated.
    The latter two would be a huge help, as EasyRoads is currrently the only aspect in the pipeline that still needs manual involvement.
     
  20. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Option to hide the mesh renderer for road types (some of my roads have the same texture as the splat texture they apply). I could use an invisible material for now, but this is not ideal ;)

    I think that sounds like what I was talking about a few days back maybe.
     
  21. raoul

    raoul

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

    How exactly should that work in your situation, hiding the road temporarily or permanently? If permanently, then it seems the object is not required at all in the final build.

    Do you mean after you made changes to the hierarchy? Unparenting them from road objects can cause issues when still using EasyRoads3D functions. At the moment each active side object has a refresh option. Does that not work for you?

    Do you mean this:

    // create reference to the existing road network in the scene
    ERRoadNetwork roadNetwork = new ERRoadNetwork()
    roadNetwork.BuildRoadNetwork();

    Thanks,
    Raoul
     
  22. StaggartCreations

    StaggartCreations

    Joined:
    Feb 18, 2015
    Posts:
    2,259
    I'd only like to hide it, while retaining the nodes and the mesh collider. The road would still exist, but just be invisible.

    I realize it's a little hacky and perhaps an edge-case, but without streaming, all the sideobjects create thousands of objects which take too long to load at once.

    Being able to access the refresh/regenerate functionality from script means this action can be automated along with other processes I have. At point in the process, the road building functionality is okay to be "broken" since it's only temporary. After regenerating the side objects (by moving a node), the road is back to it's original state. This is the part I'd like to automate.

    Thanks, I'll have to try this one!
     
  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Perhaps this is more something that could be added as an option to the scripting API?

    A rebuild option for side objects can be added to the scripting API as well. But no guarantees this will work after manually changing the hierarchy, unparenting roads / side objects etc.

    I understand why you want to move roads roads for streaming purposes, but I am not sure why it is necessary to rebuild side objects after that? Side objects are parented to the road. When moving the road object in the hierarchy why can the side the side objects not move with the roads?

    Thanks,
    Raoul
     
  24. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197


    Thanks yes i already read the manual and tried all. but not work

    That terrain not deformet right as you see and at some places like at 1 screen road is higher as terrain at 1 higher set but you see at some angles throug the road.

    Also the problem not at screenshot to fix this problems that road need to set higher as terrain for example 2 float over terrain but then road is much to high :( also with 0.02 as set easyroads3d its to high and looks bad left and right how to fix and that terrain not through road ?

    here it only one road

    both screenshots:






    here also right the terrain only one road at that place :



    regards
     
  25. raoul

    raoul

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

    You added the same images once again?

    I see several roads on top of each other, what are you trying to do here? How can the terrain be flattened accurately with that setup? I would clean up that scene and try with one road only. The terrain on the right on the first and last screenshot looks strange. But I doubt that is a direct result of the EasyRoads3D terrain deformation on a single road. The tool does not do terrain deformation that looks irregular like that.

    The second image looks like z-fighting to me, dealing with that is covered on the Troubleshooting page. The "Raise" option or one of the EasyRoads3D shaders that use an Offset.

    I don't know what happened in the third screenshot. If this is a single straight road, terrain deformation should be just fine. There are no known issues like this and no one else have posted images like that in this thread. The only way to provide more feedback is by looking at. If you want you can email this project / scene, please do not post a link here on the forum.

    What do the white surfaces look like in both situations? General Settings > Scene Settings > Hide White Surfaces

    Thanks,
    Raoul
     
    Last edited: Sep 19, 2018
  26. pandakeeper

    pandakeeper

    Joined:
    Apr 23, 2018
    Posts:
    3
    @raoul,
    I had some problems when connecting two intersections. If two intersections are close enough, the road between them cannot be attached to the connection. What should I do to avoid this problem?
    problem1.png
    figure 1. put two intersections and drag the handle of the connection to the other
    problem3.PNG problem2.png
    figure 2. translate one of connected intersections, the road would be broken
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735

    Hi pandakeeper,

    This sort of situations do need special attention. A setup like this will result in parallel roads at least near the crossing. It could be that the terrains heightmaps scale cannot handle that. If the roads are at slightly different height this can result in situations like in the screenhots posted above by GamePyro. The terrain breaking through the road or the road floating above the terrain.

    As for the problem, the connections are that close that they are withing the range used to actually pull out roads and perform specific processes. In your situation it could happen that snapping to the next crossing is triggered too fast. I will check this.

    But to solve this issue, you can place the second crossing a little bit further, snap the road and afterwards move the crossing back to the original position.

    Edit: I see this indeed actually happens when moving the crossing. But at a point that there is hardly any road segment between the two crossings. I will see if this can be optimized.

    Thanks,
    Raoul
     
    Last edited: Sep 19, 2018
  28. Sk4tOoR

    Sk4tOoR

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

    sorry but i found nothing related to my problem.

    I created a Road Network and now i decided to move my terrain. Is there any way to move my Road Network so it will fit with the moved Terrain. The Road Network isn't finalized yet.

    Thanking you in anticipation
     
  29. raoul

    raoul

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

    It is not possible to move the road network in the Inspector because that can cause issues in a later state when the road network is moved accidentally. It will be a pain to get it back at the right position if the previous position wasn't at (0,0,0).

    Instead you can use this in an editor script:

    // create reference to the existing road network in the scene
    ERRoadNetwork roadNetwork = new ERRoadNetwork()
    roadNetwork.Translate(Vector3 positionChange);

    You may want to backup the scene first just in case, because the change is permanent. Reloading the scene without saving it first will also put the road network back in the previous state if necessary.

    Thanks,
    Raoul
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    @pandakeeper, This appears to happen when the distance between the two markers is smaller then the resolution value for that road in the main Road Settings in the Inspector. For now you can try to set "Resolution" to a small value in these situations.

    Thanks,
    Raoul
     
  31. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374
    Hi, raoul.

    A simple question, but I do not remember how I solved in other occasions.

    As you can see in the attached image, I have only 2 nodes per mark and I would like to have at least 8 to create grooves on the road.

    But ... I do not remember how it is done and I can not find it in the manual. :(

    Can you guide me?
    Thank you. NODES.png
     
  32. raoul

    raoul

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

    This can be done by setting "Sub Segments" i the main Road Settings to 8. The downside is that roads can no longer connect to built-in crossings. "Sub Segments" will be disabled for roads already attached to crossings. v3.2 will have new road shape options in "General Settings > Road Types" for this supported by built-in crossings.

    Thanks,
    Raoul
     
    Barritico likes this.
  33. Barritico

    Barritico

    Joined:
    Jun 9, 2017
    Posts:
    374

    Thanks!!!!
     
  34. nbd

    nbd

    Joined:
    Aug 18, 2014
    Posts:
    34
    Raoul,

    I am having the following problem with a connection prefab. After dragging the connection node and creating a road, the texture on one side of the connection prefab road is getting darkened. Can you please assist. I am attaching the image. Also, after dragging the connection node, the new road is rotating until the node is dropped to terrain. Please help.

    Thanks.
     

    Attached Files:

    Last edited: Sep 20, 2018
  35. raoul

    raoul

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


    That is an asset from the previous beta package before v3 was released. These assets are no longer part of the package because there are some unwrapping and texture issues with them. This beta package itself is however indeed still available as a resource.

    Is the prefab in the scene the original prefab? I just looked at it in a new Unity 2018 project.

    cRoundabout.jpg

    There doesn't seem to be anything wrong with the road in the screenshot. I am not sure what is involved here and what you mean with the new road is rotated? Is this specific to this connection prefab or does this happen for all connection prefabs?

    In general when dragging out a new road from a connection the new road will be visualized as a straight road until you stop dragging the second marker and release the mouse button. At that moment the creation of the new road is completed and will also fully snap to the crossing connection.

    Thanks,
    Raoul
     
    Last edited: Sep 20, 2018
  36. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    I'm only using two points and two points and I have terrain popping up through the road.
    I flatten the terrain with the terrain flatten tool and I used the built terrain too on easy roads for the road as well.



    Is there a special tool or something I'm suppose to use to put decal on a road?
    Right now just trying to drag the prefab from easy roads pro tools on to the road and i get this issue.

     
    Last edited: Sep 21, 2018
  37. raoul

    raoul

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

    Two parallel tracks, are all markers of both roads at exactly the same height?

    If not, what is the heightmap scale of the terrain and the distance between the two tracks? Just as a test, what happens when you move the other road a little bit away near that spot?

    Thanks,
    Raoul
     
  38. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,648
    Ahh i fixed it by setting the tilting settings on smoothness to 0 to 0
    It fixed that triangle decal issue as well
     
    raoul likes this.
  39. Sk4tOoR

    Sk4tOoR

    Joined:
    Sep 19, 2018
    Posts:
    14
    Hi again,

    i came up to another issue. Is it able to disable auto-connect roads to each other with Connections, when moving one road on another. I need this in my workflow because i'm trying to achieve more complex junctions that are looking like highway-exits.

    AutoConnection.png
    Here is an example of the feature i want to prevent.

    Thank you, have a nice weekend!
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Yes, indeed you want to avoid random bumpiness and tilting as well in these situations.

    I missed your edit in the previous post, is that resolved as well?

    Thanks,
    Raoul
     
  41. raoul

    raoul

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

    The blue circle only acts as an indication that for the involved roads auto snapping and inserting a crossing is an option. But it will only be triggered after releasing the mouse button. You can simply move the marker away and place the marker outside the other road and then insert your crossing. Or am I missing something here?

    Thanks,
    Raoul
     
  42. Sk4tOoR

    Sk4tOoR

    Joined:
    Sep 19, 2018
    Posts:
    14
    Hey,

    Sorry for my bad explanation. It is exactly my intention to place a marker under another road without creating a crossing but still connecting them seamless.
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,735
    Generally that is not the recommended workflow, it will easily result in terrain deformation issues also seen in various images on this page. By using connection prefabs roads and crossings always aligned correctly for this.

    This snapping feature can be made optional though. Another way to deal with this in the current version, when indeed no crossings prefabs are involved for these road types, is by temporarily setting Sub Segments to for example 2. That way no matching connection prefabs will be found when moving one road on top of the other. The roads will not snap.

    Thanks,
    Raoul
     
  44. GamePyro-com

    GamePyro-com

    Joined:
    Jul 28, 2018
    Posts:
    197
    Hello

    thanks tried all as in manual
    i try all in new project again.

    also is there a way to make lampposts and road markers and othe side object destructible ?

    like for example in gta and nfs.

    that they fall when hit / crash in them / collision.

    i tried with facturing and destroyit but the lamppost and road markers destructipn / facturing work but the stand still there because only if deactivate all lamppost or all roadmarkers only the destruction is visible.

    i can make screenshots if needed.


    regards
     
  45. nbd

    nbd

    Joined:
    Aug 18, 2014
    Posts:
    34
    Raoul,

    In regarding the problem, When I view the model from your beta asset in UV editor, I don't see any connecting lines between UVs. But on the model that I created, I see a outline connecting all the UVs. Any ideas as to why? Also, please let me know if that is not sufficient detail. I will include some snap shots. Thanks,
     
  46. raoul

    raoul

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

    The Lampposts in the demo package are based on a source prefab in the project folder. You can see that in the side object manager. To make them destructible you need a lamppost prefab or scripts that will make them destructible. This is not part of the tool. In that case you probably also want to switch off the "combine" option at the bottom in the side object manager.

    Thanks,
    Raoul
     
  47. raoul

    raoul

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

    In the screenshot you posted the UVs seem to be fine.

    I am not sure what you mean with the outline connecting all the UVs? After opening the UV editor all nodes are displayed with vertical lines to clearly visualize the position. Selecting a node for positioning highlights that node in the editor itself as a reference which node is selected. Nodes are not connected in the UV Editor. Or do you mean they are not connected in the editor itself? That is perhaps because these are older prefabs.

    As mentioned in my previous posts these are older v3 beta package assets. You can rebuild them from scratch by using the source prefabs in the EasyRoads3D models folder. Did you try that?

    Thanks,
    Raoul
     
  48. nbd

    nbd

    Joined:
    Aug 18, 2014
    Posts:
    34
    Raoul, I am talking about the custom roundabout prefab in front view in UV editor. for the one from your beta, I don't see the UV dots connected with lines(this is only in front view). But I do see that with my custom. The previous screen shot I posted was that of an experimental asset based on the custom roundabout. I exported the model to blender(via FBX) and made some changes and then imported in back into unity. The texture problem is probably because of this difference?
     
  49. nbd

    nbd

    Joined:
    Aug 18, 2014
    Posts:
    34
    Raoul, I am talking about the custom roundabout prefab in front view in UV editor. for the one from your beta, I don't see the UV dots connected with lines(this is only in front view). But I do see that with my custom. The previous screen shot I posted was that of an experimental asset based on the custom roundabout. I exported the model to blender(via FBX) and made some changes and then imported in back into unity. The texture problem is probably because of this difference?

    posted again with original for context.
     
  50. nbd

    nbd

    Joined:
    Aug 18, 2014
    Posts:
    34
    screen shot of front view of original prefab. The UVs are connected for the modified prefab
     

    Attached Files: