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. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    274
    Hi raoul,

    yes, it was just a part to show the problem. My actual code is more complex and dynamic ;)
     
    raoul likes this.
  2. bircastri

    bircastri

    Joined:
    Jun 19, 2019
    Posts:
    15
    I change my scene, I deactivate all wrong road object, I have activate RoadNetwork, now how you can see RoatNetwork object is activate and also the road is is long and straight, now I should do this 2 task:

    1 - I need to insert a curve in the straight, at any point is fine.
    2 - I need to insert a detour, which then through Cattura.JPG a barrier I will force the user to take. The secondary road must take me back to the motorway after having traveled a certain distance
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi bicastre,

    I can see the straight road from a distance, but the cam is zoomed out so the marker control points are not visible.

    On the previous page I mentioned the Introduction video and posted a timestamp where it shows how to add marker control points to define the shape. Below is the same the introduction video at 15:16, road markers are added to the selected road object using Shift + Click, the road shape adjusts to the marker positions.



    Additional to Shift + Click for adding marker control points, the I key can be used to insert marker control points for the selected road at the mouse position. If it is still not clear how to add a curve, could you than please give further details of what you did and what the results are.

    Regarding point 2. could you give more exact information what you want to do here? Do you need motorway type of exits? Built-in motorway exits will be part of v3.3.x. In the current v3.2 this can be done by importing the models into the system with the required exit road shape. The current additional demo package (FREE if you have a Pro license) includes two examples? Have you seen that, is that what you are looking for?

    Thanks,
    Raoul
     
  4. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi @raoul

    1. Is the current terrain heightmap bake to the roads done on the GPU ?
    2. Can this be modernized in a way where we get more interactive heightmap baking while editing the road like in other game engines, you move a control point and you get the terrain adjusted below this point and connected points ?

    Current workflow is not bad but it's far from optimal and hard to iterate !

    EDIT : i just remember i saw this a while ago:

    https://forum.unity.com/threads/adjust-terrain-along-a-spline.929658/
    https://github.com/Roland09/TerrainAlign

    Cheers !
     
    Last edited: Jun 8, 2022
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722

    Hi Vagabond_,

    The focus at the moment is on adding new road network related features.

    But it is on the list and internally we are experimenting with it. All good for basic roads and no vegetation. But road networks can be complex and terrain also includes vegetation which ideally should also be updated with this workflow. So for large projects, complex road networks, detailed terrain heightmaps, dense vegetation and also splatmap baking, more changes are needed for a fluent workflow using this concept.

    The current workflow is fast, covers the heightmap, vegetation and road shape baking in the terrain splatmap. And optionally shows a representation of how the final terrain will be adjusted to the road network.

    Thanks,
    Raoul
     
    Last edited: Jun 8, 2022
  6. MichaelRobson

    MichaelRobson

    Joined:
    Jun 24, 2021
    Posts:
    24
    Good afternoon,

    I've just had a chance to look at an updated version of the beta as I was very excited to see that junctions can now have side objects.

    However, when I tried it, I am getting visual errors and it doesn't look very good.

    Are these known issues or do you have any advice of what may have occurred to cause this?

    upload_2022-6-10_16-31-2.png

    upload_2022-6-10_16-32-7.png

    upload_2022-6-10_16-33-28.png
     
  7. MichaelRobson

    MichaelRobson

    Joined:
    Jun 24, 2021
    Posts:
    24
    Also, is there somewhere a racetrack type curb side object? I think there used to be one - the red and white type? Thank you.
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722

    Hi @MichaelRobson,

    Is this indeed related to the new option to have side objects continue on junctions? This feature can be turned off in the Side Object Manager or by temporarily deactivating the specific side object on one of the road objects. Does that generate the walls correctly?

    Thanks,
    Raoul
     
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    @MichaelRobson,

    There is a red white racetrack curb example in the free demo package it is used in the v3.1 demo scene.

    Thanks,
    Raoul
     
  10. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    687
    Raoul,

    I'm almost too embarased to ask, but if I have a road that is absolutely straight between two Connections, would removing all or most of the Markers on that Road segment between those two Connections make the road have fewer polygons or any other optimization advantage? (I'm building for VR, so EVERY SINGLE THING I can do to improve it I am doing)

    Thanks
     
  11. raoul

    raoul

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

    Indeed spline points / vertices are forced at marker positions. So removing markers will result in fewer polygons, but this is also affected by the "Resolution" settings.

    Thanks,
    Raoul
     
    JamesWjRose likes this.
  12. MichaelRobson

    MichaelRobson

    Joined:
    Jun 24, 2021
    Posts:
    24
    Good morning,

    Upgrading to Version v3.2.1f4 I get a lot of script errors.

    Any advice?

    upload_2022-6-14_11-47-55.png
     
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi @MichaelRobson,

    These errors point to scripts in /Assets/EasyRoads3D/Scripts/Traffic AI/

    These are v3.3 beta scripts. Importing v3.2.x in this project will raise these errors.

    Are you using v3.3 beta features? In that case you probably do not want to import the latest v3.2.1f4. Otherwise, removing the scripts in the specific folder, Traffic AI, will fix these errors.

    Thanks,
    Raoul
     
  14. MichaelRobson

    MichaelRobson

    Joined:
    Jun 24, 2021
    Posts:
    24
    Thank you that explains it!

    Can I make a request that the race track curbs are added as side objects? I'm having trouble exporting them from the demo project into my current build but I think it would be really useful to have moving forward. I think people would really benefit from being able to make race tracks out of the box.
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi @MichaelRobson,

    Do you mean as standard side object presets part of the main EasyRoads3D Pro package?

    These specific side object are mainly one of the examples of how the side object system can be created and used.

    In what way do you have issues exporting these presets from the demo package and importing them in your project?

    If you want I can prepare a package and send it to you.

    Thanks,
    Raoul
     
  16. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi

    i can't find info on how to remove Vegetation Studio Pro trees and grass under ER roads !
    Can some one give a quick tip on how to or point me to a tutorial !?

    Cheers !
     
  17. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Nvm, i finally found it !
     
    raoul likes this.
  18. Abdulmajeed01

    Abdulmajeed01

    Joined:
    Aug 11, 2020
    Posts:
    19
    Hi,
    This is a y-shape connection scaled up to 3,1,3.
    How to generate a road with higher width?
    When I try to connect a road to it, it does not show a green point but a red point.
    Thank you
     

    Attached Files:

    • ER.jpg
      ER.jpg
      File size:
      39.9 KB
      Views:
      207
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi Abdulmajeed01,

    This looks like an asset from the HD Roads Add On package.

    It is indeed possible to scale these assets in the project folder.

    The width of the involved road types can be increased accordingly in General Settings > Road Types. The 3rd tab from the right in the EasyRoads3D toolbar in the Inspector.

    Regarding the red point / handle, the crossing connections in the HD Roads Add On package have a setup of 3 nodes for connections. The number of nodes must match between connections and the road object. When that is not the case, the handle will appear in red. The image is zoomed zoomed out, is this a road type from the HD Roads Add On package?

    If not, in the same Road Types section there is an option "Sub Segments", a value of 2 makes this a 3 node road shape matching the Y connection.

    Thanks,
    Raoul
     
  20. Abdulmajeed01

    Abdulmajeed01

    Joined:
    Aug 11, 2020
    Posts:
    19
    Thank you
    This solved it.
     
    raoul likes this.
  21. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Raoul.
    Just for your interest. I find some weird behaviour, I think:
    Unity 2021v3.1f1
    EasyRoads3D v3.2.1f4
    EasyRoads3D Pro Add-On HDRoads
    EasyRoads3D DemoProject
    EasyRoads3D.v3.3.b6 - Unity 2019.3+
    EasyRoads3D.v3.3.b8t6 - Unity 2021.2
    VegetationStudioPro v1.49

    When I add Window/AwesomeTechologies/Add Vegetation Studio Pro to the scene:
    upload_2022-6-21_9-35-29.png
    Then I go back Road Network to edit mode to activate the Vegetation Studio in Terrain Management:
    upload_2022-6-21_9-37-38.png
    When I build the terrain again, a crossing element has disappears. The error messages doesn't say too much to me:
    Asertion failed on expresion: "IsFinite(DistancesAlongView)"

    Even activating the VegetationStudio Status in Terrain Management without the VS gameObject in the scene, the issue repeats.

    Regards,
    Joan
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi Joan,

    It seems the crossing is a v3.3 beta Flex Connector, is that correct?

    Activating Vegetation Studio support will refresh the road network.

    I cannot find any meaningfull information about the error "Assertion failed on expresion: "IsFinite(DistancesAlongView)". What is the full error messages inm the console? Are there references to EasyRoads3D?

    Looking at the blue marker handles, something has changed between image one an two.

    What happens when moving one of the blue road markers? markers just before the marker that is connected to the crossing? Does it rebuild the crossing or do you see errors in the console?

    I cannot see the relation with Vegetation Studio, but does the crossing come back after deactivating Vegetation Studio support?

    Thanks,
    Raoul
     
  23. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    274
    Hi @raoul ,
    I am thinking about selling my custom road shader I made with Easy Roads in mind. Do I need your approval or can I simply go ahead? Can I use the easy roads logo in my preview images? (just to make clear it's compatible with Easy Roads. Ideally you could send me a high res version)

    Thanks
     
    Last edited: Jun 21, 2022
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi @marcell123455,

    If it is your custom road shader, you certainly do not need our approval when no EasyRoads3D assets are included.

    And you can mention EasyRoads3D and use the EasyRoads3D logos as long as it is clear that the EasyRoads3D asset itself is not included. I will send a high res version of the logo.

    thanks,
    Raoul
     
    marcell123455 likes this.
  25. joanpescador

    joanpescador

    Joined:
    Dec 21, 2016
    Posts:
    122
    Hi Raoul.
    Yes

    That's the full error message. Nothing mencioning ER

    Yes. That's the thing. The crossing conection has disapeared.

    I can't test it now nut pretty sure the crossing is gone. At least, the meshes.

    No connexion with VS. The issue reproduce even without activating VS.

    I don't know but maybe something between v3.3.b6 and v3.2.1f4?
    The crossing was rebuid and is solved.
    This is just to warn you about the issue.

    Cheers,
    Joan
     
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi Joan,

    In what way is v3.2.1f4 involved?

    I am asking that because the Flex Connector is v3.3 beta, it does not exist in v3.2. So if v3.2 was imported after the Flex Connector was created, it could explain why the crossing disappeared.

    In that case it is indeed a matter of regenerating it after importing the v3.3 beta again.

    Anyway, good to know the issue is resolved.

    Thanks,
    Raoul
     
    joanpescador likes this.
  27. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi there,
    I'm looking for an API to "Build Terrains" to use it in Editor and Runtime Mode and any idea to
    Adjust Terrain along a Spline via a script. any help will be appreciated.
    upload_2022-6-23_15-56-25.png

    Best Regards
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi @UnityGISTech,

    The main EasyRoads3D Pro package includes a simple runtime scene in which a road object is created through the scripting API. This is also includes updating the terrain. The script is located in /Assets/EasyRoads3D/scripts/

    Because you mention both the Unity editor and runtime mode, what exactly are you looking for?

    To update the terrain at runtime for an already existing road network in the editor, the same constructor can be used.

    ERRoadNetwork roadNetwork = new ERRoadNetwork();

    This will create a reference to the existing road network. To update the terrain, the equivalent of "Build Terrain(s)" highlighted in your screenshot:

    roadNetwork.BuildRoadNetwork();

    So this is perhaps a starting point.

    Thanks,
    Raoul
     
  29. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Thanks for the quick answer.
    second question, i want to automatically make intersection between roads, is it possible to that via the scripts (in both Runtime and Editor).
    upload_2022-6-23_17-53-46.png

    note that each road generated separately via a script.

    Best Regards
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    That is possible, both at runtime and in the Unity editor.

    Here is a breakdown of the workflow:

    First a reference to the specific connection / intersection prefab in the resources folder is required.

    ERRoadNetwork class:

    public ERConnection[] LoadConnections ()
    public ERConnection GetConnectionPrefabByName (string name)

    After that the loaded connection prefab (sourceConnection here below) can be attached directly to the road

    ERRoad class

    public ERConnection AttachToEnd(ERConnection sourceConnection, int connectionIndex)
    public ERConnection AttachToStart(ERConnection sourceConnection, int connectionIndex)

    Or the connection prefab can be instantiated in the scene followed by connecting the road objects

    ERRoadNetwork class

    public ERConnection InstantiateConnection(ERConnection sourceConnection, string name, Vector3 position, Vector3 eulerRotation)


    Connect road objects to already existing crossing objects

    ERRoad class

    public bool ConnectToStart(ERConnection connectionObject, int connectionIndex)
    public bool ConnectToEnd(ERConnection connectionObject, int connectionIndex)

    The ERConnection class has the following method:

    public int FindNearestConnectionIndex(Vector3 position)

    This can be useful to find the nearest connection index of an intersection to a road marker by passing this marker position.

    Is this the information you are looking for?

    Also, it is very much recommended to work with road types also when creating road objects through the scripting API. Since your road network already exists in the editor it is recommended to setup road types manually in the editor. These road types can be used through the scripting API:

    public ERRoadType GetRoadTypeByName(string name)

    One of the advantages of this is that is easier to generate side objects which can already be activated for road types. They will be auto generated for each road object that is based on that road type.

    Thanks,
    Raoul
     
  31. youmandriver

    youmandriver

    Joined:
    Jun 9, 2018
    Posts:
    2
    Hi Raoul,

    I have a road texture issue, only on the Build, not on editor.
    It does not appear from the beginning of the road, after 1 km it begins, and getting worse with distance.
    Issue only on 1 of my levels, whereas I use the same road material in other levels without this problem.
    It have tried with and without lighting bake, no difference.
    Can you help please ?

    road.png
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi youmandriver,

    That is most likely due to floating point inaccuracies in the final build as a result of the project quality settings. The stretching effect will indeed get stronger further away from the start of the road.

    There are two solutions:

    1. Edit > Project Settings > Player > Other Settings > Optimization > Vertex Compression > Tex Coord 0. Switching this off should fix the problem.

    2. Insert I connectors at intervals at a distance just before the texture inaccuracies start to happen. Inserting I Connectors on longer single road objects will split the road in separate objects, reset the UV coordinates and is also better for performance for longer roads.

    Can you try this?

    Raoul
     
  33. youmandriver

    youmandriver

    Joined:
    Jun 9, 2018
    Posts:
    2
    Hi Raoul,

    Switching off Text Coord 0 optimization has solved the issue.

    Many thanks for your great support !
     
    raoul likes this.
  34. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi, I'm using EasyRoads3D quite extensively laterly and I have a suggestion to improve usability of the tool, maybe in a future relase: I think that it would be useful to pass with a keyboard shortcut from a selected marker of a street to the one imeeidately after or before.
    I mean: you select the marker clicking on it with the mouse, but when you need to pass to the following or to the previous one it would be nice to use the keyboard instead to move the camera, find the following or previous marker and click on it.
    Maybe it could be useful for others too.
    Thanks!!
     
    JamesWjRose likes this.
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi tomobiki,

    When the Scene View window has focus selecting the next / previous road marker can be done with the keypad + and - keys

    http://www.easyroads3d.com/v3/html/shortcuts.html

    Will that help or do you need this in another situation?

    Thanks,
    Raoul
     
    JamesWjRose likes this.
  36. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi Raoul, thanks: it's exactly what I was looking for; I didn't know the shortcut page: now I bookmarked it because it's very useful.
    Bye.
     
    raoul likes this.
  37. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi Raoul,
    I'm doing some tests with tunnels before use them in my main game, because I never used them and I don't want to mess things up in my project.

    So I'm using a test project but I've a problem when I BUILD the tunnel, because it generates a lot of artifacts in the terrain. I made a video that shows the problem.

    Could it depend on heightmap resolution? Thanks.

    The video is here:
     
  38. UnityGISTech

    UnityGISTech

    Joined:
    May 6, 2015
    Posts:
    193
    Hi there,
    Could you check your inbox please.
    Best Regards
     
    raoul likes this.
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi tomobiki,

    Tunnels are more advanced and complicated.

    Contrary to the concrete tunnel example, the rock tunnel example in your video has a setup where vertices attempt to snap to the terrain in forward direction.

    The tunnel position in the video is at a lower side of the mountain on the right. Is that interfering? What happens when moving the tunnel more to the left so it is well inside the terrain / mountain?

    Also, is this using the default tunnel side object settings? I am asking that because it is used together with the Primary road type.

    The setup of this side object is optimized for the less wide mountain road.

    Thanks,
    Raoul
     
  40. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi @raoul

    i have a suggestion. Please let me know if you'd consider implementing it !

    1. An option to re-bake splatmap only. Sometimes you only need to refresh the splatmap. Currently we have to get back to edit mode and bake it again. Cheers !

    upload_2022-7-3_9-50-48.png
     
    Willbkool_FPCS likes this.
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722

    Hi @Vagabond_,

    That can be added. How do you want to use this?

    The splatmap options can be set per road type and for each individual road object in Edit Mode.

    In Build Mode these settings are not available. So in what way is an update required when the road network is already in Build Mode as your screenshot shows? Do you mean you like to be able to change splatmap settings in Build mode which will require more than only a new "Update Splatmap" Button.

    Or is this more intended to get the original road shape back in the splatmap after for example manual changes to the splatmap through the terrain object Paint Texture options?

    Thanks,
    Raoul
     
  42. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hi raoul,

    i use gaia to paint the terrain but it removes the road splat data. Then i have to get back to edit mode and rebake only to update the road splat map. So a simple button to get original road splat map is good for now !

    Anyway, i also miss the option to add side objects to roads when it in build mode. Being able to add side object in edit mode only makes it a bit difficult because on many places with slopes, half the road is not visible and you should guess how it will look !

    So i would like to suggest if possible to allow users, to somehow be able to use parts of the systems while in Build mode, like adding side objects, may be also changing the splat map id as you mentioned (because i was thinking for this as well at some point ) etc...!

    Cheers !
     
  43. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722

    Hi @Vagabond_,

    Ok, so in that case adding only the "Update Splatmap Button" will work.

    The option to add side objects in Build Mode is already available. Road objects are selectable, side objects can be activated or deactivated.

    Thanks,
    Raoul
     
  44. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Thanks Raoul,

    yeh it's my bad, i didn't ever checked down in the inspector that there is the side objects panel !

    However there seems to be an issue with terrain when enable any side object like in the images.

    Any idea how to fix that ?

    Cheers !

    upload_2022-7-4_11-57-15.png

    upload_2022-7-4_11-57-25.png
     
  45. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    274
    Hi Vagabond.

    I simply solve this by running a gaia texture spawner with layer based collision mask instead of using the splatmap feature of easy roads. Works great for me!
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi @Vagabond_,

    What is the setup of this "Curb" side object? Especially the alignment settings.

    The Curb side object appears to be a flat side object, how is it positioned relative to the terrain? Does changing the Y position a little bit fix the issue.

    Because testing this with a flat side object positioned just a little bit above the terrain I cannot see a difference between activating it in Edit Mode or activating it in Build Mode.

    Thanks,
    Raoul
     
  47. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hey marcell123455 thanks. That actually works really nice so i can use it in some situations.
    However, i don't use Gaia all the time so a native solution would be nice to have !
     
  48. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,148
    Hey @raoul

    that actually happens with all the side objects

    upload_2022-7-4_17-50-5.png
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,722
    Hi @Vagabond_,

    In my previous post I mentioned that I tested this successfully with no issues. And I asked for more settings specific info.

    Side objects is a system, packages include provided presets and you can create your own presets. The results depend on the settings.

    Can you please give more information apart from sending images that show z-fighting type of issues :)

    1) If these are provided presets based on the original settings, which side objects are they so I can test?

    2) If these are your own side object presets, what are the settings? What type of side object? What is the final Y Position value? I mention "final" because this is customizable per road type and individual road object in the scene.

    3) The road itself also seems to have Z-fighting issues. The road in your second post today does not have z-fighting issues. What is different? Does this happen after changing side objects? Is the "Raise" value in Build Mode still 0.02 as visible in the first image you posted?

    Thanks,
    Raoul
     
  50. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    65
    Hi,
    when I build terrain around this railroad it happens that are generated these strange artifacts; but it happens only here, because where the railroad is straight this doesn't happen.
    I don't think that this depends by the resolution of the heightmap: could it be some parameter of the road that I have to change?
    Thanks a lot, like always.

    upload_2022-7-5_23-27-59.png

    These are the road parameters:

    upload_2022-7-5_23-29-5.png