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.

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    133
    I'm still struggling everytime i need to reduce build size.
    I don't need to build roads in runtime, only in editor but i don't want all resource folder into my build.
    I can rename this folder but then i can't add road network...
    upload_2022-5-13_10-21-28.png
    i.e i need to switch back and forth for every build.
    Is there anything that can be done with it ?

    Another problem is road height. I'm drawing roads on top of google map texture and dirt track is below terrain level.
    upload_2022-5-13_13-57-38.png
    also i would like to add terrain a liitle bit under the road. how can i do that ?
    dynamic connections do not work with dirt tracks i need to place connections manually ?

    Thank you
     
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hi astanid,

    Switching back and forth, is this related to creating a build of the project? How often do you do a build in a way that is final?

    The described way is only required for that specific build. Or is this also for during testing, in that case, what is the exact problem with keeping all folders as they are?

    I have also mentioned duplicating scenes, but if you want the road network to remain editable after the work is done. Than the easiest way is to duplicate the project. And Finalize the road network and rename the resources folder in that project and use this project to do the final build.

    Updating the scene and the road network in the scene is done in the original project.

    As mentioned there will more options for the step regarding the Resources folder in v3.3, but finalize the road network, cleaning up data is another thing.

    The image is zoomed out, it seems the terrain breaks through the dirt track. Is this cause by the terrains LOD system? Does this disappear when zooming in? In that case, which shader is used? The EasyRoads3D shaders have an offset option to deal with this situation, it is visible further below in the Inspector for the specific material.

    Otherwise, what is the exact situations in the screenshot? What are the marker height positions and what is the terrain objects Y position? I am asking this because it is impossible to apply negative height values to the terrain, it cannot be adjusted to below the terrain game objects Y position. This and other terrain related situations / limitations are mentioned in the troubleshooting page in the manual.

    Or, since the issue is visible on the road edges, are the markers near this Y positions and is random tilting applied to this dirt track? This is visible in the "Road Smoothness" settings near the top in the "Main Settings".

    If this is relevant, it is recommended to flatten the terrain first higher above this terrain game objects Y position in general. That way it is also for example possible to add water objects later.

    Which version are you using at the moment, v3.2 or the v3.3 beta? Are these X and T crossings or v3.3 Flex Connectors? How do you place them manually?

    For X and T Connections, if these are dirt tracks from the demo package, dirt tracks specific prefabs can be created in the road type settings. Select this road type and press "Create New Connection Prefab" in the Material section.

    Thanks,
    Raoul
     
  3. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    133
    a lot. i need to test the scene on a device all the time to check performance.
    I place all road objects, then rename resource folder and finalize roads (if i don't do that i'll get like +400mb in build) build and test (repeat a few times to get results).
    Then for a new scene i have to rename resource folder back again (and it doesn't go that good - i loose connections, resources are not loaded etc) to create Easyroad object prefab

    i use 3.3 beta
    it's standart flat terrain (and i bake it into mesh once it's ready). no LODs (it's just a flat surface atm). Standart terrain shader
    upload_2022-5-13_16-6-4.png
    i've created new dirt road type with 5 width
    there's no auto connection
    upload_2022-5-13_16-8-24.png
    but i can place Dirty_Road_ER_X and connect to it manually
    upload_2022-5-13_16-15-53.png
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    If you do know it is +400mb, can you not take that into account for the final build? Or optimize the assets folder? You do have the demo package fully imported which is more intended for learning purposes. Unused road types and side objects can be removed from the scenes and from the project folder.

    I was more referring to the road shader regarding these offset options.

    If your terrain is flat at the default height matching the terrain game object in my previous post than everything related to that in my previous reply is relevant.

    Looking at the screenshot, the first thing to check would be the road smoothness settings, especially the tiling. But I would recommend to flatten the terrain at an higher level than the default 0 value. That way the terrain can be adjusted downwards as well.

    But if you intend to bake the terrain into a flat mesh, than you do want to go through all the road types you use and make sure the Road Smoothness options are all set to 0, if that is not already done.


    General Settings > Road Types

    connectionCreate.jpg


    "Dirty_Road_ER_X "is not an asset that is part of the demo package. Did you create it? It seems to be a similar prefab as what will be created through the "Create New Connection Prefab" button.

    But if you are using the v3.3 beta than you may want to use Flex Connectors for non 90 degree corners. Flex Connectors can be created automatically when no road object is selected, move over an existing road, press Shift + the left mouse button. When a blue handle appears you know that a Flex Connector can be created, move away from the road, this will create the new road object. And after releasing the left mouse button the Flex Connector will be inserted.

    And v3.2 dynamic X, T crossings can also be turned into a Flex Connector after road objects are attached to all connections. Select the connection and look in the Inspector for the Flex Connector checkbox.

    Thanks,
    Raoul
     
  5. unity_M-muNcbRh2xEOA

    unity_M-muNcbRh2xEOA

    Joined:
    May 26, 2019
    Posts:
    3
    Thank you for your help! It turned out that one of the terrains I created as background had only one texture assigned (Pebbles). After loading the same terrain texture layer pallete on every terrain everything works fine. It's time to add 5/5 review on asset store :)
     
    Last edited: May 13, 2022
    raoul likes this.
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Good to hear that was indeed causing the problem with the missing texture layers in the dropdown!

    Reviews are always very much appreciated :)

    Thanks,
    Raoul
     
  7. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    133
    yes, that was the reason. but with zero value it's still buggy
    upload_2022-5-13_18-41-37.png
    what setting should i use to rise it and rise terrain with it ?

    it's not available...
    upload_2022-5-13_18-38-5.png
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    This image is zoomed in. The terrain breaks through the road on the right. Over the exact distance red dots are visible:

    General Settings > Scene Settings > Display Critical Terrain Areas

    The red dots are related to this. It shows those areas that require attention. This shows what we are discussing regarding the terrains game object y position and the terrain object not accepting negative height values.

    Raising the markers in this section a little bit will probably fix it.

    But as mentioned before, please consider flattening your terrain a little bit higher to avoid this from happening. It can be done easily with the terrain tools.

    This a road type from the HD Roads Add On package. These road types use a 3 node setup. Built-in v3.2 X and T crossings are based on a 2 node setup. That is why the button is disabled.

    To fix this, this road type can be duplicated, just to keep the original road type as it is. Rename the duplicated road type and set "Sub Segment" in the "Main Settings" to 1. The specific button should now be enabled.

    Also, v3.3, including the Flex Connector, does support built-in custom road shape. Have you tried the last part in my previous message, the steps for inserting a Flex Connector?

    Thanks,
    Raoul
     
  9. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    133
    Thank you again. You are the most responsive author i know :)
    you mean make all the terrain like 0.05 height ?
    in fact there's a little mess from object types and materials. I do believe that renaming resources folder doesn't work good :(
    Some of the materials are not working for some reason. Where can i get list of shaders for them ? Built-in pipeline
    upload_2022-5-13_21-14-43.png
    And what is current best road type to create dirty/dusty road with intersections ?
    it worked, button appears. but i guess you mean there's in-built flex connector for dirty roads ?
    upload_2022-5-13_21-21-35.png upload_2022-5-13_21-22-15.png
    This is what i get. Looks like there's some object - but it's not seen?
     
    raoul likes this.
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Your terrain is currently flat is that correct? In that case:

    Terrain Object > Inspector > Second tab from the left > Set height > Height

    When this is set to, for example, 50, there will not be any issue with road objects not being able to adjust the terrain downwards. And it also gives you room for water objects.

    That is an older v3.1 material which is not upgraded to URP. It is already late here in Europe. I will check tomorrow what shader is used, but it is related to this road type:

    https://easyroads3d.com/tutorials/adjusting_road_shapes.php



    I belief the standard ERRoad Shader will work here, but is this the type of road shape that what you are after? The idea here is to create a swamp road crossing water. The texture is a grass and sand type of texture.

    It is hard to tell from a screenshot. Is this the HD Roads Add On dirt track road type?

    Have you looked at this road type and the various intersection styles in that package.

    Otherwise, the dirt track in the v3.2 demo scene is used with Flex Connectors, in the middle of the scene, near the beach and bridge.

    Thanks,
    Raoul
     
  11. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    133
    but my project is not URP :) I stayed on built in to have less problems, but...
    idea is to make some countryside maps. flat, with some dirty roads and buildings. Camera will be high above in game - i don't need that much close details, but intersections and Y coordinates are my pain...
    I used NM_Dirty style - what can i use instead ?

    upload_2022-5-14_10-16-41.png
    upload_2022-5-14_10-20-15.png
     

    Attached Files:

  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Ok, I didn't know you switched from URP to built-in.

    I just checked the Dirt Swamp road type, it indeed uses the ER Roads shader. The material appears correct in the project that is used to submit to the Asset Store.

    I see the Dirty_Road_ER_X prefab you mentioned in your post is actually part of this package. Do you have issues with this prefab or the other dirty prefabs? They all work well in the project here.

    Looking at the screenshots, another very simple solution for dirt tracks is to use a matching terrain texture, paint the terrain area with this texture where a crossing will be created. Start and end the dirt tracks in this area. Us a material with the "ER Dirt Road Fade In - Out" shader. And look in the marker section for the "Fade In Distance" resp "Fade Out Distance" option when the first or last marker is selected. This controls the blend level with the terrain for a smooth transition.

    Thanks,
    Raoul
     
  13. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    133
    angles are wrong. this prefab makes like 90 degrees connection and mu crossing is like real X with not 90 deg angles.
    i tried... but i can't make texture direction to look right... :(
     
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Try the Flex Connector with the road material in the v3.2 demo scene, this texture is symmetrical and will work well with the current version of the Flex Connector. Otherwise, in what way is that not what you are looking for?

    The terrain will not have tyre marks, that will not work well with terrain textures.

    It seems you might have gotten to the point where you want something specific. The Custom Connection system can be used to create your own connection prefabs and import them into the system.

    And otherwise there are quite a few websites with road textures, also free textures.

    Thanks,
    Raoul
     
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168

    @unity_M-muNcbRh2xEOA

    I didn't mention this in the previous reply and perhaps useful when you have a similar scene setup in the future.

    Another way to handle terrain objects that are not affected by the road network is by excluding them. That will also avoid the situation with populating the dropdown with available terrain textures.

    Select these specific terrain objects and look in the Inspector for the “ER Terrain” component. There is a checkbox “Exclude this terrain object”.

    Thanks,
    Raoul
     
  16. jmclaveria

    jmclaveria

    Joined:
    Oct 16, 2018
    Posts:
    17
    Hi Raoul,

    Is there a way to get the marker positions with their bezier control points through script?

    I can obtain spline iterated centers (GetSplinePointsCenter) and sides (GetSplinePointsLeftSide and GetSplinePointsRightSide). Marker positions can be obtained with GetMarkerPositions, but I can't find any reference to their control points.

    I'm working on trying to build a driving line for AI and the marker positions with their control points would help a lot to build the optimal path.

    Thanks in advance.
     
  17. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    580
    @jmclaveria The beta of version 3.3 has data points for traffic lanes and for the Connections.
     
    raoul likes this.
  18. jmclaveria

    jmclaveria

    Joined:
    Oct 16, 2018
    Posts:
    17
    Thanks for answering James!

    Actually I have v3.3.b4. Maybe I have to update?
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hi jmclaveria,

    There are four different control types. Only the Spline Controller uses control points which are the previous and next road marker. The Vector3 arrays returned by the functions in your posts represent the exact points on which the road geometry is based. So the best approach depends on what your road objects look like and what exactly you want to do.

    As James mentioned, v3.3 provides access to more road data. In v3.3 lane info can be set per road type. This will generate lane data, also on X and T Crossings, the v3.3 Flex Connector and also soon on custom connections based on your own models. The v3.3 beta includes runtime scripts that show how to access this data. These scripts are used to move objects on the road network in v3.3 beta scene.

    This should already work in v3.3.b4 but indeed it is recommended to always upgrade to the latest version, especially for beta releases.

    Thanks,
    Raoul
     
    jmclaveria likes this.
  20. jmclaveria

    jmclaveria

    Joined:
    Oct 16, 2018
    Posts:
    17
    Thank you very much Raoul, amazing helping as usual.
     
    raoul and JamesWjRose like this.
  21. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    133
    in the end i decided to stick to hand painting the roads for the most maps. i only had one 'road' on one scene as airstrip
    and a fence. It's finalized, all other easyroad prefabs are deleted, resource folder is renamed... but i got tons of easyroads textures into the build that are not used. it's like everything that i ever tried to apply in the project.
    Real mess :(
    How can i clean it up ? why all these textures are added into the build ? i really wish to have editor only version with no runtime support, but no problems either :(
     

    Attached Files:

  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hi astanid,

    This is all related to the same we already discussed :)

    Are you renaming the Resources folder now, and are you finalizing the road network for your final build. If you do not do that all these assets that are imported in your project will be included.

    The Majority of assets point to the HD Road package:

    /Assets/NatureManufacture Assets/HD Roads/

    You can remove this folder if you do not use it. Or for example remove the materials that you do not want to use.

    And, as mentioned before :), v3.3 will include that option to control how you want to handle Assets in the final build.

    Thanks,
    Raoul
     
  23. astanid

    astanid

    Joined:
    Apr 5, 2021
    Posts:
    133
    I used finalize in the scene that still uses EasyRoad - all scripts are deleted...
    QUOTE="raoul, post: 8133725, member: 1799"]And, as mentioned before :), v3.3 will include that option to control how you want to handle Assets in the final build.[/QUOTE]
    beta doesn't have this option at the moment ?
     
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hi astanid,

    Please try this proof of concept for your situation with all assets of all packages imported:

    1. Duplicate the project and open the duplicated project
    2. Finalize the Road Network
    3. Rename the Resources folder in /Assets/EasyRoads3D/
    4. Build the project

    I am missing step 3. in your post

    It is just these steps. How does that work?

    Thanks,
    Raoul
     
  25. Vagabond_

    Vagabond_

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

    i just updated to the latest update using Unity 2021.3.0f1 and i'm having this situation where viewport turns black when i select the road system and it just fixes as soon as i deselect it or i toggle off the viewport lights from the viewport top bar ! ( EDIT : this had fixed after restart though ! )

    upload_2022-5-18_9-48-25.png

    I also don't have the terrain height updated on a crossing even though it has the option enabled !

    upload_2022-5-18_9-51-1.png


    A couple of questions as well:

    1. Very often the control points for a road are disappearing. I try to select different roads and such and they just show up at some point. Why would be that ? ( EDIT : i just got it. This is happening when i have the crossing selected. So i can not just click on another road to show control points but rather have to click again on the crossing and all shows up. It's like the crossing selection is toggled on/off )
    2. When i have a road selected i just can not select another one that i want to adjust control points. How i should correctly select roads ?
    3. Isn't the crossing considered also a road in a way. If i want to bake terrain with a crossing only selected it throws this error. Can't i build terrains using crossings only ( that i would want to do just for testing how terrain height updates below a crossing ) !?

    upload_2022-5-18_9-55-1.png

    A couple of request:

    1. Also please add an option to cancel operation in this situation. I often click the Scene View Status by mistake button and i can't cancel !
    upload_2022-5-18_9-58-35.png

    2. It is awesome that you have the current control point height info in the viewport in the bottom left corner ( not sure though what this height is related to as the values for control points don't make much sense to me, what are these heights related to ? ) but this is shown only when you start moving a control point and you can not simply say what's the control point y offset compared to neighbor points. I would suggest adding a small info showing current y position in world space just a bit above on every control point which is close to some distance to the camera. This way i can easily decide how much to move a control point up/down to get a good slope !
     
    Last edited: May 18, 2022
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hey @Vagabond_,

    Which version of EasyRoads3D do you use?

    A situation of the viewport turning black in newer Unity versions has recently been debugged for the v3.3 beta. It was related to NaN values for road marker Indent controls. This is perhaps something you can check.

    Terrain deformation , your second image, is directly affected by this, so perhaps you indeed ran in the same situation.

    I can send an update for you to test if you are indeed using the v3.3 beta.


    1. Does that happen for a single road? How are control points disappearing? Do you mean visually? When do they come back? Do you have steps to reproduce this?

    2. Clicking a road marker of another road object should instantly deselect the currently selected road and select the new road. Also with regard to 1., is this something you recently started noticing in Unity 2021.3.0f1? I don't have this version here on this computer but I cannot see issues with this in Unity 2021.2.x and the Unity 2022.1 beta either.

    3. From a coding points view, a crossing connection is not the same as a road object. The specific option to build the selected roads only is road object specific. From your second image I can see why you are attempting to do this, but this feature is more intended for road objects, spline shapes to quickly test a specific road road object after making changes.

    When the road objects are selected that are attached to the crossing, the crossing will be within the bounding box and will be included as well. So that could be a workaround to test crossings.

    Being able to update the terrain for crossing connections only through the scripting API was recently requested. It is on the list, so it will probably also be added as an option in the editor itself.

    Do you mean the Dialog issues with selecting Yes No and the selected choice not being respected? This topic was brought up on the previous page, I could only reproduce it in the 2022.1 beta but it helped finding the cause. it is fixed. You will see that if I send the beta update if you are indeed using that?

    Otherwise I can also prepare a build of the next v3.2.1f4 release with similar fixes, just let me know what version you are using.

    Thanks,
    Raoul
     
  27. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,074
    Yeah, i meant the last asset store ER version (v3.2.1f3) from yesterday/today and Unity 2021.3.0f1 !
    I haven't tried 3.3 from you website yet !

    I currently get missing control points without the viewport turning black. Here you can see how the control points are missing on the left road. It's may be what you say regarding NANs, i'm not sure !

    EDIT : i had a connection from a crossing to the road. After i deleted it the markers are now shown ! What to say, the system i awesome but i often bump into issues !

    upload_2022-5-18_11-45-51.png


    Regarding selection issue, it's actually when i click on a crossing, i can't make any other selections until i click on the crossing again ! It's like clicking on it locks selection to it ! I have to click again on that same crossing and then i can select other road objects, otherwise i can't click on anything ! Btw it's the same for the yellow marker on the right. If i click on it, it locks selection. I have to click outside somewhere ( or btw on the crossing works as well ) and then i can select other road objects !



    The crossing is still not updating the terrain. How to make it work ? I don't have "Selected Roads Only" enabled. It's just a regular "Build Terrain(s)" operation !

    upload_2022-5-18_12-9-4.png


    I mean, to add a cancel button, because it happens that you sometimes don't want to return to edit mode and stay in build mode !

    EDIT : yeah i actually got confused ! it turns out actually that the choice is not respected !

    upload_2022-5-18_12-17-57.png
     
    Last edited: May 18, 2022
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    I see a connection in the middle, I see a short road section on the left, that is connected. I also see a yellow connection handle below this short road section with on one side a blue handle and on other side a green handle. This appears to be an I Connector? The green handle mean a road can be connected. The blue handle means a road is connected but it is not visible.

    Was the road with no markers connected to this I Connector? What is the exact situation here? All together, the road objects, position of connectors does not seem right. Do you see error message in the console?


    That is intended behaviour to avoid other possible issues and that is why road marker handles are not displayed in this state.

    When a connection is selected, click anywhere on the terrain to deselect it. After that all road handles and other connections are visible again and are selectable.

    I mentioned in my previous reply that this might be related to the situation with the black screen. See at the end, I will send an update.

    Something that you can check on your end meanwhile:

    General Settings > Scene Settings > Hide White Surfaces

    When this is toggled off you will see a representation of how the terrain will be updated. What do these white surfaces look like that surround this crossing? Are the white surfaces actually created / visible?

    And like mentioned above, what is this yellow I Connector doing on the bottom left. What is the status of that blue handle?

    I will prepare a v3.2.1f4 build for 2021.2+ so you can also test the dialog in the upcoming update. "No" will be respected.

    Thanks,
    Raoul
     
  29. Vagabond_

    Vagabond_

    Joined:
    Aug 26, 2014
    Posts:
    1,074
    Hmm, I just created a new crossing and everything works !
    Let's just pretend for now that everything works ok. I think i just have to get used to the workflow ! I'll practice a little more and will see how it goes. I guess if i have something bugged i can just delete that part and try to recreate it !

    I'll let you know when i'm sure about some issue and i can recreate it !

    Cheers !
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    There are indeed no known issues with connection prefabs and adjusting the terrain. And in your situation replacing the connection will indeed probably resolve it.

    I just wanted to double check this using the same fix for an issue in the v3.3 beta that also involved the black screen and a problem with the adjusting the terrain in some areas.

    But this fix will be part of the next v3.2 update anyway.

    Let me know if this happens again, I will prepare and send a build so you can already test that.

    Thanks,
    Raoul
     
    Vagabond_ likes this.
  31. unity_F6E38DB78B454B02C380

    unity_F6E38DB78B454B02C380

    Joined:
    Feb 8, 2022
    Posts:
    6
    Thank you @raoul. I really appreciate that you've answered many of my questions so far. Those help me a lot.

    Could you also show me how to make Side Object along with the Road. So far what I understand from the manual instruction, the SetSideObjectOffset method would attach the SideObject obj from a start position to an end position. But I don't understand what the SetSideObjectXPosition method do.

    Correct me if I'm wrong on anything. Also it would be great if you can show me from the start on how to do it. There is not much documentation on the manual instruction so I might not fully understand it.

    Again, thank you for your help !
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hello unity_F6E38DB78B454B02C380,

    By default side objects are generated over the full length of marker sections. The Offset option can be used to tweak the start / end position relative to these marker positions. Default Offset values can be set per side object in the Side Object Manager an for each individual side object section on a road object. SetSideObjectOffset() can be used to that by code through the API.

    SetSideObjectXPosition(SideObject obj, int markerIndex, float value) is the equivalent of the "X Position" control in the editor. It can be set per marker to move the side object sideways away / towards the road object. SideObject refers to the specific side object, the markerIndex is the marker for which the X Position will be updated and value is the new X position value.

    https://www.easyroads3d.com/tutorials/side_objects.php this page includes video tutorials side object related. All controls are covered

    Let me know if there is anything that is still not clear.

    Thanks,
    Raoul
     
  33. JasonMann

    JasonMann

    Joined:
    Oct 14, 2017
    Posts:
    8
    Hello @raoul,

    I posted here a few weeks ago. I'm working on mountain roads that are a bit steeper. Had some issues with the topology of my roads and sideobjects. While it's not perfect I was able to solve most of those issues by following your suggestions and playing around with the resolution of my topology and angle of the road markers. Now I am running into a new problem though. The terrain creation at my crossings is a bit...unexpected. Specifically the first point on both sides of the road. They go far into the distance and I'm not quite sure why. You can see it on pic 1 & 2. I know when declaring the crossing I need to declare the different crossing sections in a clockwise order. Pretty sure I didn't mess that one up. I also tried to raise and lower my terrain at the crossing, this also didn't work. I was wondering if it's maybe because the crossing is too tight and the two branching roads too close. But I get the same effect with a standard t crossing (where the road goes of in a 90 degree angle) so that also shouldn't be the problem.

    Is there anything I am missing? :D

    Also, while I'm asking questions. I plan to add a road that will be an old bob sledding route. To do this I will need a curved road (basically the shape of a tube or halfpipe) Atm I did this by making a road and adding two curved ramps on each side as a procedural side object (Pic 3). But it would be nice if I could have a custom shaped road (without having to do the side object trick). I think this would be possible by making a custom crossing and then simply pulling this shape out of one of the crossings as you did with the train tracks in one of your tutorial videos. But I was wondering, is there maybe a third option I don't know about? How would you solve/create this? It would be awesome if we could somehow create a road from a custom shape(mesh) instead of only the flat ones. Similar to how procedural side objects are created.

    As always thank you for your time & efforts!

    Best regards,
    Jason

    Pic_1.png Pic_2.png Pic_3.png
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hi @JasonMann,

    The next v3.2 update includes a built-in fix for these road width inaccuracies on very steep road angles.

    Please ignore the position of the first Surrounding positions on these transparent surfaces when the road object is connected to a crossing. These surfaces are an indication of how the terrain will be adjusted. This is fairly accurate apart from the points that you mention.

    Do you actually see inaccuracies after switching to Build Mode when the terrain shape is adjusted to the road network?

    General Settings > Scene Settings > Hide White Surfaces

    Switching this off will show a better / full representation of how the terrain will be adjusted, also on crossings.

    Custom road shapes in v3.2 can indeed be done by importing a model / connection object with the specific shape into the system. Connected road objects will inherit the shape.

    Custom road shapes are supported built-in in v3.3 which is available in beta releases on our website. The shape can be defined in General Settings > Road Types.

    I am not sure though if this would work well in your case with the curved ramps. The two curved ramps on the sides stop at the connection with the other road type.

    The v3.3 custom road shapes will continue on the v3.3 Flex Connector. So the results will be different.

    The situation in the 3rd image can be created using both side objects or the Custom Connection system.

    Thank,
    Raoul
     
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    @Vagabond_,

    I see I missed this question.

    This is the height difference between the road marker and the terrain at that position.

    It can be useful to quickly fine tune the road marker position relatively to the terrain in general. But also to make sure specific side objects like retaining walls are triggered that will be auto generated when the height difference with the terrain is in between certain values, like for example the Stepped Wall side object in the demo package.

    I will make a note of your suggestion to display the Y position of the selected road marker.

    Thanks,
    Raoul
     
    Vagabond_ likes this.
  36. JasonMann

    JasonMann

    Joined:
    Oct 14, 2017
    Posts:
    8
    Hello @raoul,

    In regards to the steep roads and the custom road shapes/ramps, thank you for the insight and tips, I will look into them and am looking forward to further versions of ER :) For now I can get everything done that is necessary.

    But In regards to the Terrain deformation after crossings I am having persistant issues. If it would only be the transparent surface in edit mode I could ignore it, but the terrain is actually forming along those first points in build mode as well. Even if I switch off terrain manipulation for that specific marker (the terrain is deforming a bit less, but it is still happening). I also tried the setting you showed me but that resulted in texture issues and the accompanied pink/purple unity material. Which then also doesn't go away anymore until I reload the scene. In the end I really don't mind the gizmos/indicators being weird, my problem is that the terrain deformation is just as weird in those spots.

    I made you a video to show you exactly what is happening. Sorry for the length, the laptop I recorded this on isn't the fastest...

     
  37. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168

    Hi @JasonMann,

    2.05 clearly shows that the terrain deformation will not be accurate.

    The specific dirt connection in the scene looks like a Custom Connection based on your own model imported into the system.

    Would it be possible to send this model to see if the issue can be recreated?

    Thanks,
    Raoul
     
  38. JasonMann

    JasonMann

    Joined:
    Oct 14, 2017
    Posts:
    8
    Hello @raoul ,

    yes, it is a custom prefab/model (Pic 3). But I don't think that is the problem, I am getting the same issue with your default T crossing (Pic 1 & 2).

    Two things I noticed:
    - The issue happens on terrains that were built using a heightmap in unitys "terrain tools" package. On a standard terrain the issue was not present (there the starting points of the terrain indicators were still a bit off, but they didn't dissapear far into the distance and the created terrain wasn't affected (Pic 4 & 5). There it basically works the way you described it should)
    -it affects the roads that are spawned after/below the crossing, not the roads where it was added from/ that are above the crossing.

    So maybe the terrain is the problem?

    I could still send you the model of my crossings prefab if you think it will help. Alternatively I could make you a new unity project with a scene containing a heightmap based terrain and a road + crossing with the described issues. I assume this would be more helpful in solving the issue than just sending the model?

    Best regards,
    Jason
    Pic 1.png Pic 2.png Pic 3.png Pic 4.png Pic 5.png
     
  39. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hello @JasonMann

    There are no known issues with terrains in general neither with built-in connections. Regardless how the terrain is created the end result is data in the the terrain heightmap. This is what EasyRoads3D adjusts.

    The only thing to try on our end is again these extreme angles in your scenes but now on connections. But a quick test does not show issues.

    I do not fully understand the situation described here?

    Perhaps it is indeed best to send a project / scene in which this happens, also with built-in connections. If you could email me this, it would be very much appreciated. The email is in the _Readme file in the EasyRoads3D root directory. Or you could also send a download link in a direct conversation here on the forum.


    Thanks,
    Raoul
     
  40. unity_F6E38DB78B454B02C380

    unity_F6E38DB78B454B02C380

    Joined:
    Feb 8, 2022
    Posts:
    6
    hello @raoul,

    Thanks for the help with the SideObject.

    I'm using the destroy() method in the scripting API to delete the road objects, however it only deletes the road, but the sideobject doesn't. As far as I know, there is not a destroy() method for the SideObject. How can I deletes both the road and sideObject in a same time ?

    Thank you for your help.
     
  41. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hello @unity_F6E38DB78B454B02C380

    Are side objects still visible after destroying the road object?

    Inside the Unity editor side objects are child objects of the road objects, destroying the road object will also remove side objects.

    Or is this related to creating / destroying road objects at runtime? I will check how this works, but have you tried to deactivate active side objects first on the specific road object, ERRoad class: ERSetSideObjectState(SideObject obj, bool flag) ?

    Thanks,
    Raoul
     
  42. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    62
    Hi Raoul,
    I have a small issue applying a material to a side object that represents a railway bridge. I think that the problem is about the UV tiling and you can see the situation in the enclosed picture.
    I'd like to add the mat_concrete_7 material to the side object, but I think that it applies like a single tile and of course the material effect is completely lost. I played a bit with the parameters of the UVs (I circled them in red), but nothing changed.
    Please, can you help me to understand what I'm missing?
    Thanks!!

    upload_2022-5-25_23-40-11.png
     
  43. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    247
  44. raoul

    raoul

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

    I assume this is related to auto generated side objects, bridges in this case? Because tweaking terrain deformation at the start / end of a bridge can be done for bridges activated on road markers. This is not yet possible for auto generated bridges. Since the terrain is below the road in these situations, smoothing the terrain exactly how you want should be fairly simple though.

    Thanks,
    Raoul
     
  45. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hi @tomobiki,

    Looking at the material in the project folder, is the material actually assigned to the object? Have you checked that in the Inspector after selecting the generated side object?

    Or, as a test, the material can be dropped from the project folder directly on the object. If that works well, have you was the side object refreshed in the scene after making changes in the Side Object Manager?

    The settings, a value for 1 for "UV Tiling" should generate UV coordinates.

    Thanks,
    Raoul
     
  46. marcell123455

    marcell123455

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

    Yes it's auto generated. The problem with doing this manually is that the terrain and so the manual smoothing gets reset every time the road network switches back from build to edit mode. Or is there a way to lock roads terrain adjustment?

    Thanks
     
  47. tomobiki

    tomobiki

    Joined:
    Sep 27, 2020
    Posts:
    62
    Hi,
    thanks, like always, for your fast reply.
    I think that I've done all the checks that you said in your mail.
    I made a video to show better the situation:


    In the video you can see that the material is assigned to the object and that if I change it and refresh it correctly updates the material.
    The only problem is the mapping of the material that looks like if the tiles are too large so that it's not visible the detail of the material on the mesh.

    In the photo enclosed it's visible the fact the is missing the detail of the assigne material

    upload_2022-5-26_11-51-32.png

    Thanks.
     
    Last edited: May 26, 2022
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168

    Hi @MarCell,

    Switching back to Edit Mod means that the road network is not ready yet. You probably want to do this type of quick manual adjustments at the very end.

    The problem with auto generated bridges is that the terrain below the bridge at the start / end can have any shape. How to automatically adjust it / smoothen it in a way that it will always have the desired result.

    Manually smoothing it using the terrain tools, should be quick and easy.

    Also, work is done on more bridge specific features, this also includes customizable start / end sections to cover the terrain at the start / end.

    Thanks,
    Raoul
     
    marcell123455 likes this.
  49. marcell123455

    marcell123455

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

    I have found a workarround. I use GAIA 2s stamper with smoothing and a collision mask. I placed cubes with the correct layer in my start and end bridge prefab. After I build the terrain, I run the stamper and the results can´t be better.
    A native integation of this would be cool though.

    thanks
     
    raoul likes this.
  50. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,168
    Hi @tomobiki,

    This is a Shape type of side object, the same as the pebbles floor (part of the demo package) that is also visible in the video and screenshots. The UVs of the pebbles ground mesh are correct.

    To isolate the issue to UV generation issues, what you could do on your end is export the mesh and check the UVs in a modeling app.

    It is hard to give further feedback by only watching the video. If you want you can email the project / scene so I can look at the side object setup and see the results. Or you could compare settings with a working Shape type of side object like the pebbles ground example.

    Thanks,
    Raoul
     
    Last edited: May 26, 2022
unityunity