Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,638
    Hey @raoul Think in the near future you can get easy roads to work with multi core processors. Its pretty laggy right now using it with Vegetation Studio Pro.

    But i dont know it used to run good with it. Maybe cause im now using .Net 4x?
    Do you use .Net 4x or 3x during development?
     
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hi OFFICIAL_bryanw,

    I am not sure now, the free version does not include the scripting API. What exactly do you want to do? Do you see the EasyRoads3D toolbar in the Inspector when selecting the main road network. object. In that case, the road network is not finalized otherwise it is.

    Thanks,
    Raoul
     
  3. raoul

    raoul

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

    It is .NET 3.5. What happens when you switch off Vegetation Studio when working on the road network? Contrary to removing standard Unity terrain vegetation which is done in Build Mode, for Vegetation Studio it is a continuous process. It is based on the Vegetation Studio mask line component.

    Thanks,
    Raoul
     
  4. Shadowing

    Shadowing

    Joined:
    Jan 29, 2015
    Posts:
    1,638
    Ya i'll have to test more later. There is a bug atm with this version of vegetation studio where switching vegetation studio off in the editor resets my area masks. So after that gets fixed i'll look more into it.
     
    raoul likes this.
  5. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    i have a work in Progress Project for you, pls use it for Learning Only.
    it have some bugs and i wait with further work on the new version but it should do what you near want, i think.

    you can create splines on road shape based, give it a direction and the Cars will maybe(because its full of bugs) follow it.
    TestDrive.jpg
     

    Attached Files:

    raoul and Mark_01 like this.
  6. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    685
    I am not the developer of this asset, however I have used the API for this asset to have traffic move along the roads. The full source code for this can be found here: https://github.com/Blissgig/Easy-Roads-3D-Traffic

    It is designed for Hover Cars, but it will give you enough info to see how it works so you can adjust it to your needs
     
    raoul and Mark_01 like this.
  7. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    jeah i used this as Fundament for my Package, i need later to add Traffic signs and roads with different speeds, this is why i created it new. but thx for reposting
     
  8. OFFICIAL_bryanw

    OFFICIAL_bryanw

    Joined:
    Jul 6, 2018
    Posts:
    36
    Do you know if there is an "easy" way to gain access to the mesh that defines the road surfaces? I'd like to recover the lanes of the road using the road mesh itself.
     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    @Noa3 and @JamesWjRose

    Initially the new lane data was only going to be supported on the new v3.2 Flex Connector in the first v3.2 beta. But upon request it is currently already being added to the current X and T crossing types too. I probably need a couple of days more and then it will be available.

    For example Min / Max Speed values can be set per road type and customized on crossings. If you guys like to see more options like this please let me know.

    Thanks
    Raoul
     
    hopeful and JamesWjRose like this.
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hi OFFICIAL_bryanw,

    I am not sure how you want to use this to recover lanes but you can get access to the mesh data through and editor script. For example:

    Selection.activeGameObject.GetComponent<MeshFilter>().sharedMesh

    Thanks,
    Raoul
     
  11. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    685
    Awesome, awesome. Cannot wait (but of course I will wait)
     
  12. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    for me is important to set the direction for driving, on the lane. for driving on the left or right side of the road.
     
    hopeful likes this.
  13. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,674
    That's a good one ... as not only are there regional differences, but also it's common in big cities to have multiple lanes all traveling one way (and no lanes going the other way). For any vehicle turning onto a one-way street, it would be good to know which direction to travel.
     
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hi Noa3,

    In the new lane info section in road types the lanes count can be set. Based on this number it will automatically set left / right lanes which are editable afterwards. Currently only right hand driving is supported, but left hand driving will be added as well if that is what you meant. It is only a matter of reversing lane / connector data.

    Thanks,
    Raoul
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hi hopeful,

    One way driving needs more attention. The lane count can be set to one, but what will be the logic here, in what direction will it be for a specific road? I don't think this can be automated so more controls must be added for this to swap the direction per road.

    Thanks,
    Raoul
     
  16. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,674
    I'm mostly familiar with one-way streets that used to be two-way, but due to traffic congestion in an urban area, two neighboring parallel streets were adjusted so that - say - the north one has all the lanes going east, and the south street has all the lanes going west.

    I've not been to NYC, but I gather from pictures that they can have 4-6 lanes all going the same direction, or something like that. In China that would probably be 12 lanes. ;)

    I'm not sure how the speed limit is set on the road, but maybe direction (one-way, two-way) is set at the same time? And I guess that is at the intersection, as the road markings would differ, and so would turns.
     
    JamesWjRose likes this.
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Automatically make the north road go east and the south road road go west may get complicated, and parallel roads going north / south? :) But it can at least be made in a way that opposite one way roads always go in the same direction. So if the direction is changed on one road section, all opposite sections at intersections will change accordingly.

    Yes, when I wrote that the lane count can be set to one that was only to say that a one lane road in a single direction is supported. Multiple lanes will be split automatically in left / right lanes but this can be changed manually. They can all point in the same direction.

    Min Max Speed can be set in the road type. Currently these same values will be copied to lane connectors on intersections which can then be manually adjusted per instance. Alternatively separate Min Max speed values for intersections can be added as well to road types, specifically used for intersection lane connectors. That is what I meant when I asked if there is anything additional you guys like to see added. It will be a continuous process and this will only be the first beta, more can be added later.

    Thanks,
    Raoul
     
    Last edited: Dec 13, 2018
    Mark_01 likes this.
  18. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    1.
    Maybe (i think its my own work?) adding an info, what can driving ont this road, like Light,Medium,Heavy Cars, Bicyles or Bus. and on the Train Rail can only a Train Drive xD

    2.
    Sideways maybe too for pedestrians/ bicylists? but i had read somwhere you will rework this too, so maybe wait for this is bether

    3. (same as 1, i dont know if i need to do this myshelf) Trafficlights and a Easy Posibility to set the timer and change the model
    if dont do this, i will make it myshelf later and maybe post it here
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    This is added to the list for future updates

    Yes, that is on the list, JamesWjRose suggested this as well in a conversation.

    That is on the list as well. Your further suggestions on this do make things more complicated :) once you start thinking about the implementation. This has to be thought out further. At this stage the focus is more to provide easy access to data required for traffic AI. So in this case that probably means, somehow link a specific road lane to a specific traffic light gameobject. Just like with the road system itself, this will be a continuous process, more options will be added.

    Thanks,
    Raoul
     
    Mark_01 likes this.
  20. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    685

    I live on 5th Ave in NYC and you are correct that we have 4 lanes going one way. Not just on 5th, but on most of the Avenues in Manhattan
     
  21. pandakeeper

    pandakeeper

    Joined:
    Apr 23, 2018
    Posts:
    3
    @raoul
    What does the error "EasyRoads3Dv3: A source prefab is still in the scene.Please Save / Delete this prefab first before continuing work on the road network itself." mean?
    It happens when I use the codes bellow to instantiate some connections , and then click the gameobject "Road Network",. At the same time, these connections are moved to be the children of "Temp Crossing Prefabs". However, not all kinds of custom connection I instantiated trigger this error and I cannot find the difference bettwen theirs.
    Code (CSharp):
    1. var net = new ERRoadNetwork();
    2. var s = new List<ERConnection>(net.LoadConnections());
    3. var so = s.Find(x => x.name == t.prefab.name);
    4. net.InstantiateConnection(so, t.prefab.name, Vector3.zero, Vector3.zero);
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Let's see after the first release how we can optimize this sort of things further :) But 4 lanes in the same direction is already possible.

    Thanks,
    Raoul
     
    Last edited: Dec 13, 2018
    JamesWjRose likes this.
  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hi pandakeeper,

    What you describe is the same as what happens when a "source" connection prefab is dropped in the scene from the project folder for editing. Source prefabs should not be used within a road network and they should be removed after editing, hence the warning. This will no longer be the case when this is updated to Unity 2018.3, where prefabs can be edited in the prefab editor window.

    So it seems that the instantiated prefab through the scripting API is not correctly marked as a "scene" object on your end.

    I just did a quick test on built in crossing types, this appears to work correctly, they are part of the road network afterwards.

    On which type of prefabs does this happen for you?

    Thanks,
    Raoul
     
  24. hopeful

    hopeful

    Joined:
    Nov 20, 2013
    Posts:
    5,674
    That would be four driving lanes and two lanes used for parking, right? I'm not quite sure how to count curbside parking ... I suppose it is a lane ...?
     
  25. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    685
    Actually I checked out the window and it's 3 lanes + two parking lanes. I would swear it's 4 + 2 (wrong!)
     
    hopeful likes this.
  26. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    685
    Raoul,

    What defines the number of lanes? ie: Is it the width of a connection? Or?
     
  27. pandakeeper

    pandakeeper

    Joined:
    Apr 23, 2018
    Posts:
    3
    Thanks for your reply. I have sent an e-mail with the connection to info@unityterraintools.com.
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hi JamesWjRose,

    The number of lanes can be defined per road type, they will be equally divided over the width, the exact position can be customized afterwards. I will include a quick video.

    Thanks,
    Raoul
     
    Mark_01 and JamesWjRose like this.
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hi pandakeeper,

    I received your email, thank you! You mentioned roundabouts. Indeed this was actually a problem with roundabouts in general in previous versions, the warning message appears when the prefab is selected in the hierarchy. It seems this was not updated for the scripting API which is not a problem at runtime, but it is in the Unity Editor. Thank you for reporting this!

    Raoul

    [Edit] This should be fixed in the next update
     
    Last edited: Dec 14, 2018
  30. Hen7

    Hen7

    Joined:
    Aug 6, 2018
    Posts:
    6
    Hello

    I have a road with very wide sidewalks, that I plan on putting slightly underground in order to have the terrain around blend into the sidewalk, creating hills on each side. However I can't get the indents any closer to the road where I want them to be (green X in screenshot), they are limited to start at the edge of the sidewalks (red X), any way to solve this?

    I managed to use sidewalks as side objects which worked great, however they're causing issues when trying to create crossroads.
     

    Attached Files:

    • ezr.jpg
      ezr.jpg
      File size:
      171.6 KB
      Views:
      622
  31. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hi Hen7,

    With regard to terrain deformation and roads, there must be enough terrain points available to flatten the terrain according the road shape. That is what the Min Indent value does. The same applies to sidewalks, generally you don't want to have the sidewalks float above the terrain or have the terrain break through the sidewalk. That is why the indent value starts at the edge of sidewalks when sidewalks are active.

    There is a way to override this and I can send details if you want, but it is not recommended hence why it is not an option in the settings.

    Thanks,
    Raoul
     
  32. Hen7

    Hen7

    Joined:
    Aug 6, 2018
    Posts:
    6
    Hey
    Thanks for the quick reply.
    Is there any other creative way to have a road that is lower than the ground?
    like what's going on in the pic attached (this was done using models, not a terrain.
     

    Attached Files:

    • ez2.JPG
      ez2.JPG
      File size:
      140.9 KB
      Views:
      593
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Do you mean, level sidewalks with the terrain height and have the road below the terrain? That requires custom terrain shaders / masks. The scene in the free demo package includes a prefab (the crossing in the residential "Under Construction" area) doing something similar to hide the terrain for the sewer manholes.

    Thanks,
    Raoul
     
  34. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    685
    Sounds great, l look forward to getting it.

    Have a great weekend
     
    raoul likes this.
  35. Hen7

    Hen7

    Joined:
    Aug 6, 2018
    Posts:
    6
    Slightly too much for me, I'll just create some terrain like models around the road that are higher, maybe using the side object system.
    I've encountered another issue though, I'm using the sidewalks that comes with the dynamic connection system, its good, but I can't find a way to "end them" at a certain marker, the best I got was using a I connector but the sidewalks end there with a missing face (yes they have an outer curb).
    PS - I know they can end at the next dynamic connection, but I don't want one, I want the sidewalks to end mid road.

    Thanks
     

    Attached Files:

    • ez3.JPG
      ez3.JPG
      File size:
      50.2 KB
      Views:
      593
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Ending the sidewalk at a marker like on crossings is not yet possible. The sidewalk system will get an upgrade in v3.2, this will be part of it.

    What is possible is insert an I Connector at the position where the sidewalk should stop. This will create two road sections. There will be an open gap like in your image, for now this can be leveled with the ground. This works by setting the y value of the sidewalk shape nodes to 0. The demo scene in the free additional package includes examples of this.

    Thanks,
    Raoul
     
  37. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    20
    Hello raoul,

    There is anyway to use easyroad on multiple scene ? On my project I split the world in many scene to improve editor performance, then I'm looking to have multiroad network at the same time (one for each small scene). It seems it is not handle by EasyRoad, did I miss something ?
     
  38. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    the easy road data itshelf getig stored in the scene, there it was created.
    if you create a raod, create a mesh from it, you can cut it in parts, and put the parts in multiple scenes if you want.

    i hope i could help you a bit.
     
    raoul and fmarianacci like this.
  39. fmarianacci

    fmarianacci

    Joined:
    Oct 15, 2018
    Posts:
    20
    Yes, my problem is more on merging multiple RoadNetwork than spliting them :)

    I found a way to merge the RoadNetwork of 2 scenes by moving the gameObject of the Roads & Connections of the fist RoadNetwork into the second RoadNetwork at runtime. But if I want a connection between 2 road network, it began to be harder...
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hi fmarianacci,

    Additional to Noa3's reply, it is possible to store the mesh assets in the project folder, "Store Mesh Assets in Project Folder" in the Build settings.

    Regarding building the road network when the world is already split in multiple scenes, have you tried storing the road network in for example Scene A and open both this scene and the scene you are working on?

    Your new post just came in. You could also create road networks per scene and at the end when you want to create a build, merge them all together by moving the road and connection prefab objects to a single road network similar to what you described. That way you can connect roads across scenes. Usually I Connectors are used on terrain edges to connect roads that cross multiple scenes. For your final builds you can then extract those objects needed per scene based on the terrain bounds of that scene. This sort of optimizations/options will probably be added as part of the tool at some point.

    Thanks,
    Raoul
     
    fmarianacci likes this.
  41. Ecocide

    Ecocide

    Joined:
    Aug 4, 2011
    Posts:
    293
    Hi Raoul,

    can you already tell when the new update that properly works with 2018.3 will be available? Or is it save to upgrade already?
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hi Ecocide,

    The only known issue is that saving edited source connection prefabs fails. A first update with improvements is scheduled for this week, including the first v3.2 beta. Editing source prefabs is already partially functional in the upcoming update. Another update will follow soon afterwards with a full fix for this.

    If you do not need the prefab editing options you may already want to upgrade. Please backup your project first, just in case.

    Thanks.
    Raoul
     
  43. Noa3

    Noa3

    Joined:
    May 29, 2012
    Posts:
    84
    i work with it in Unity 2018.3, for now i got no problems.
    only Bolt(Needed to be deleted and reimported) and CTS(after a editor restart all working fine) on the first try maked me trouble.
     
    raoul likes this.
  44. Freznosis

    Freznosis

    Joined:
    Jul 16, 2014
    Posts:
    298
    I apologize if this has been asked before, but do you know why in a Windows 64bit build the road textures look very stretched? The textures are repeatable and look fine in the Editor, but in any build on all platforms it looks like this.
     

    Attached Files:

  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hello CloudWeight,

    Does that happen on longer roads and does it start further away from the start? In that case it is probably related to UV floating point inaccuracies. It can be resolved by inserting I Connectors which can also be useful regarding LOD Groups. Crossings also break roads in shorter sections

    Or you can switch of compression for UV0 in Player Settings > Vertex Compression.

    Thanks,
    Raoul
     
  46. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    upload_2018-12-17_20-13-0.png
    Hi,Thank You for the update!In the future,can you please make it so the marker gets bigger as we zoom out. Having to zoom in just to select a marker is slowing down my workflow.I am working on a very big map.
     
  47. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    685
    Not the asset developer, however I have found a setting that affects how far away the point can be seen. I am away from my desktop/dev machine so I can't say exact, but it's there. (happy hunting)
     
  48. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    upload_2018-12-17_22-49-51.png
    upload_2018-12-17_22-50-27.png
    I have been getting a lot of these errors with the new update
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,715
    Hello TonismoGames ,

    The option James mentioned are in General Settings > Scene Settings

    Marker handle Size
    Marker Display Distance

    I am not sure about the error. There are no known v3.1.2 specific issues. When exactly are these thrown?

    Thanks,
    Raoul
     
  50. TonismoGames

    TonismoGames

    Joined:
    Jun 12, 2018
    Posts:
    111
    These are are thrown when I tried to move the marker,after I aligned the
    I got the error when trying to move the marker after using aligning. I ended up delete the easyroad folder and reimporting it.