Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hello Kopanz,

    Please use documented scripted API code

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

    In your case, for the ERRoadNetwork object the same constructor can be used in your code as for a new road network object, a reference will be created to the road network that is already in the scene (it is mentioned here http://www.easyroads3d.com/v3/html/ERRoadNetwork.html at the top):

    ERRoadNetwork roadNetwork = new ERRoadNetwork();

    Get all the road objects:

    ERRoad[] roadObjects = roadNetwork.GetRoadObjects();

    Thanks,
    Raoul
     
    kopanz likes this.
  2. kopanz

    kopanz

    Joined:
    Dec 6, 2016
    Posts:
    82
    Getting a existing reference with "new ERRoadNetwork()" is definitely not something I would expect. But if it works then fine :D

    Thank you
     
    raoul likes this.
  3. Copper_Kettle

    Copper_Kettle

    Joined:
    Aug 12, 2022
    Posts:
    2
    Hi Raoul,
    is there a way to duplicate two or more roads at once?
    i tried it but it duplicates only the last selected one.
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Copper_Kettle,

    The duplicate option is indeed road object specific. It was added upon request.

    How do you want to use duplicating multiple road objects? Given that road objects usually are unique it seems more efficient to create a new road object.

    Thanks,
    Raoul
     
  5. Copper_Kettle

    Copper_Kettle

    Joined:
    Aug 12, 2022
    Posts:
    2
    Hi Raoul,
    easyroads makes it quite simple and has awesome options to control the sideobjects.
    Thats why i didnt use it on the roads only but created fence type objects to draw my backyard fences or for road markers at the townsquare and stuff. it would be a nice timesaver if i could just duplicate them at once and move it all together.
     
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623

    Hi Copper_Kettle,

    Ok, I asked that because duplicating multiple road objects where also crossing connections are involved can become problematic.

    This is not relevant for side object type of objects like fences and walls. I will make a note to extent the "Duplicate Object" button when multiple objects are selected. This will probably be added in the release after the upcoming v3.2.2 release which is almost ready.

    Thanks,
    Raoul
     
  7. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    I haven't touched my road network for some time, and when I went back to it today, I noticed that some (all?) of my connectors have sharp corners. It appears to be due to the "Left Corner Curvature" and "Right Corner Curvature" both being set to 0.1. Is that the expected default setting? Or did something get corrupted? I'm using 3.3.b7.

    Simply changing that to 1.0 fixes the issue, but since I don't know how/when this was changed, if it even was, I'd like to find out if that is the correct way to fix it.

    Thanks.

    Sharp_Corners.jpg
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Colin,

    Is that perhaps related to the Curvature settings for the specific road type, and the Flex Connector now inheriting these settings? Have you checked these Curvature values for the specific road types in General Settings > Road Types

    Thanks,
    Raoul
     
  9. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    I think that was it. I've updated my road definitions now.

    I think I've got some sort of corruption in my network since I cannot refresh either the entire network or the scene instances of individual road types with Unity going into an infinite loop and requiring a force quit. I am going to write a script to go through the connectors and update the props one at a time (assuming I can access those props from script) to see if that corrects the issue. If it doesn't I will get in touch with a repro project via email.

    Thanks!
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Colin,

    Currently there are no known issues with "Refresh Road Network" or "Refresh Scene Instances" for road types ending up in an infinite loop in the latest v3.3 b7 beta . You started using the v3.3 betas from a very early, perhaps that is involved. You can always send your current scene by email, we will fix the problem and send an update so you can continue.

    Thanks,
    Raoul
     
  11. MichaelRobson

    MichaelRobson

    Joined:
    Jun 24, 2021
    Posts:
    24
    Hello

    I am currently mocking up a level just as a demo for something I am working on. I have a flex connector that has invisible collision as I try to exit it. None of my other connectors on the level have this.

    It is along the red lines shown in the below picture. Any ideas what may have caused this?

    upload_2022-8-15_16-37-49.png
     
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Michael,

    Do you mean the green wireframe?

    That is known and can happen in the v3.3 beta, it is harmless. A road network refresh should fix that and it should disappear anyway after switching to Build Mode, the final state where the terrain is updated as well. Is that indeed the case?

    Thanks,
    Raoul
     
  13. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    Can you remind me how to export the road network to share via email? I thought it was just copy and paste into a new empty scene with a default terrain added, but while it appears to work in the hierarchy view, in the scene view there are no roads or markers visible. Of course, that may be related to whatever corruption it is that I'm experiencing.
     
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623

    Hi Colin,

    I just replied to the email you also sent.

    The easiest way to move road networks across scenes, keeping the road network in the exact same state, is by loading both the original scene and the target scene in the hierarchy. Drag the road network object to the target scene and only save the target scene.

    The road network object will still be fully functional in the original scene as well.

    In my email reply I also mentioned side objects on connections introduced in v3.3 b7. There are no known issues with this with "Update Scene Instances" the way you describe, but it is perhaps something to check on your end because your scene uses side objects extensively. This new feature can be switched off for individual side objects in the Side Object Manager, “Generate On Connections” half way in the “General Settings” near the top.

    Thanks,
    Raoul
     
    colin_young likes this.
  15. MichaelRobson

    MichaelRobson

    Joined:
    Jun 24, 2021
    Posts:
    24
    Hello, sorry I wasn't clear.

    The screenshot just shows where my flex connector is. When the road has been build and I am going around the level there is an invisible collision along the red lines. This appears to be on or just beyond the extremities of the flex connector.

    Do you know why a flex connector may cause invisible collision? Maybe this is something that has not occurred before.
     
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Michael,

    Disabling the renderer component on the Flex Connector and attached road objects will show the wireframe of the mesh collider of that object. Do these mesh colliders match the actual objects?

    Also, what is the exact setup of this Flex Connector? Is the road object at the bottom left actually correctly attached? The shape of this section on the Flex Connector doesn't look quite right. If that road object is not attached than this might be involved as well, certainly when you are looking at this in Edit Mode.

    And there appears to be a second ERCrossingPrefabs component attached to the Flex Connector (causing the green sphere handles), this too is known for the v3.3 beta. This second component can be removed safely in the Inspector.

    Other than that, it is hard to give further feedback without seeing this. If you want you can email the project / scene so I can look at it.

    Thanks,
    Raoul
     
    Last edited: Aug 16, 2022
  17. windspiek

    windspiek

    Joined:
    Jun 17, 2018
    Posts:
    5
    Hey @raoul
    I started running into some issues with the splat map generation. It used to work fine, but now it doesn't update properly anymore.
    Currently I get this splatmap from building the terrain:
    upload_2022-8-17_15-29-51.png
    This is the error message:
    upload_2022-8-17_15-30-56.png

    Thanks.
    Leo
     
  18. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Leo,

    It is hard to give feedback with the current info.

    Did this use to work well in other projects / scenes or in this specific scene as well? Did anything change to the terrain object in this scene? Were perhaps terrain splatmap layers removed?

    If you want you can email the project or send a link in a private conversation so I can look at it.

    Thanks,
    Raoul
     
  19. windspiek

    windspiek

    Joined:
    Jun 17, 2018
    Posts:
    5
    Thanks for the response. The only thing I changed at one point was the control texture resolution. Before not working at all (except the small bits in the screenshot) the splat showed the road outline in the bottom left corner of the terrain as if it was scaled down.
    I just tried rebuilding the terrain in our other scenes and it works as excepted so it's just this scene.
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Windspiek,

    It appears to be related to terrain splatmap layers and perhaps layer indexes assigned to road objects.

    Changing the Control Texture Resolution can have unexpected results when this is done with the Road Network in Build Mode and when switching back to Edit Mode. This situation seems more related to switching to Build Mode? Is that correct?

    It is hard to give direct feedback on this as it is terrain object related. For example how many splatmap layers does the terrain have? One thing to test is, save the heightmap of the terrain, duplicate the scene and add a new terrain object to this scene, add the approriate number of splatmap layers and import the heightmap. Does that work?

    Another thing that may work, remove the terrain object from the scene and drop it back into the scene from the project folder.

    As mentioned in my previous post, it will be easier to give feedback if you send the scene, by email or in a private conversation, so I can look at it.

    Thanks,
    Raoul
     
  21. mw2357

    mw2357

    Joined:
    Jul 12, 2020
    Posts:
    12
    Hello,
    I bought EasyRoads 3D Pro to build a simple race track. For that, I would like to use the road type "Race track". This road type is not available in EasyRoads 3D, but in the demo scene, which I was able to download for free after the Pro purchase.
    However, my problem is: my project is quite large and uses lots of assets already. Therefore, it takes a lot of time for Unity to import the demo scene.. I think it would literally take days to import. This is a known problem of Unity with large assets. The Easy Roads 3D pro asset itself is small, so no problem to import it.
    What would be the best way to use the race track road type in easy roads 3D without importing the entire demo scene?
    I tried different things, but nothing worked:
    1. tried to deselect most of the stuff when importing the demo scene.. but I did not know what is important and what's not.
    2. Imported the demo scene in an empty Project (this is no problem), created a track and exported it as an fxb (or obj.?, I am not sure). However I had difficulties to import this in my project (I think materials were missing)
    3. Exported the race track road type from the empty project's road network and tried to import in the other project, but to be honest I wasn't sure how to do the import properly and my attempts failed :(

    So, what would be the best way to efficiently use the race track road type in my project? A detailed description would be highly appreciated because unfortunately I am a bit lost with this :(
    Thanks and best regards!
     
  22. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    Have you looked at https://www.easyroads3d.com/tutorials/so_import_export.php? It's a bit awkward IMHO, but does work. I'd also suggest importing the demo scene into a standalone project and exporting from there.
     
    raoul likes this.
  23. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623

    Hello mw2357,

    The EasyRoads3D Pro package is indeed kept small in size also for the reasons you describe.

    And, also mentioned by Colin, it is recommended to import the additional free Demo package in a new project as it is primarily intended for learning purposes and it does include quite a few additional assets that you may not want to use.

    Have you meanwhile looked at the link posted by Colin, https://www.easyroads3d.com/tutorials/so_import_export.php ?

    Near the top in General Settings > Road Types, there are Export and Import road types options. The same for side objects. This is for creating packages and use presets across different Unity projects.

    But it also matters what is more convenient for you. The road type itself is fairly basic regarding settings, it is easy to recreate and if you want to use the road material, than you could only export the material to a Unity package.

    Thanks,
    Raoul
     
  24. mw2357

    mw2357

    Joined:
    Jul 12, 2020
    Posts:
    12
    Hi, thank you both for your answers. I have tried the link and now checked again: I did the export as described from an empty project. In the main project, I do Assets - Import new Asset, select the package. While importing Unity gives the following error message: MissingFieldException: Field 'EasyRoads3Dv3.ERModularBase.OCOOCDCOCD' not found.
    Any idea what I am doing wrong?
     
  25. mw2357

    mw2357

    Joined:
    Jul 12, 2020
    Posts:
    12
    Sorry, that was just the last error message in the console. In case it's helpful, here are the others:

    Error: Could not load signature of EasyRoads3Dv3Editor.ODDCDDQDCO:ODCCOQOODQ due to: Could not resolve type with token 01000125 (from typeref, class/assembly EasyRoads3Dv3.OOQCQDQOQQ, EasyRoads3Dv3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null) assembly:EasyRoads3Dv3, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null type:EasyRoads3Dv3.OOQCQDQOQQ member:(null) signature:<none>

    Unloading broken assembly Assets/EasyRoads3D/Editor/EasyRoads3Dv3Editor.dll, this assembly can cause crashes in the runtime

    MissingFieldException: Field 'EasyRoads3Dv3.ERModularBase.OCOOCDCOCD' not found.
    UnityEditor.SceneHierarchy.OnRowGUICallback (System.Int32 instanceID, UnityEngine.Rect rect) (at <4a1b55d6b009421a9ad1d16b54b782d5>:0)
     
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi,

    That looks like a package import issue. Which Unity version do you use and which exact EasyRoads3D packages do you have imported and in which order?

    Does the error perhaps disappear after reopening the project?

    Thanks,
    Raoul
     
  27. mw2357

    mw2357

    Joined:
    Jul 12, 2020
    Posts:
    12
    I use Unity 2019.4.22f.

    I had EasyRoads3D Pro v3 imported from the Package Manager. In the left frame of the package manager (where all assets are listed), the version number says "v3.2.1f4", in the right frame (details of the asset), it says "Version 0.0.0 - June 01, 2022". I then have created a road network, then imported the previously exported race track road type and got the errrors.
    Reopening the editor does not make the error disappear. Tried to import again, but this is not possible ("all assets from this package are already in your project.")

    Tried exactly the same in a new empty project and same error, so doesn't seem to be related to my project.

    I now also tried to import the road type before importing EasyRoads3D, but also got an error:
    "Assembly 'Assets/EasyRoads3D/lib/EasyRoads3Dv3.dll' will not be loaded due to errors:
    Unable to resolve reference 'DelaunayER'. Is the assembly missing or incompatible with the current platform?
    Reference validation can be disabled in the Plugin Inspector."

    Best regards!
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi mw2357,

    Can you try reimporting the EasyRoads3D Pro package from the Asset Store?

    Or in a new project, import EasyRoads3D Pro from the Asset Store. Does this work well? After that import the package with the road type, but deselect the specific dll files so the original working script files do not get overwritten.

    Thanks,
    Raoul
     
  29. Enigma229

    Enigma229

    Joined:
    Aug 6, 2019
    Posts:
    135
    I'm using HDRP 10.3 (Unity 2020.3.13f1) and wanted to know how I can make puddles, oil stains (something to break up the tiling on an Easy Roads road?
     
  30. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Enigma229,

    Are you using your own materials?

    The package includes various road shaders with options to break texture tiling. These shaders are used on road types in the additional free demo package. HDRP versions of these are shaders are included.

    But that does not include puddles. Puddles could be added as decals through the side object system.

    Thanks,
    Raoul
     
  31. mw2357

    mw2357

    Joined:
    Jul 12, 2020
    Posts:
    12
    Hi Raoul, awesome, deselecting the dll when importing the road type package did the trick. Now it works fine and I can use the road type in my project.Thanks a lot for the support!

    Best regards!
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Glad to hear that!

    I think the issue was that dependencies are included in the generated package and that different EasyRoads3D versions are used in the project with the demo package and in the project where you want to import the presets package.

    That will result in a conflict with the editor scripts. Simply not importing the dll from the demo package will fix that.

    Thanks,
    Raoul
     
  33. colin_young

    colin_young

    Joined:
    Jun 1, 2017
    Posts:
    243
    Are there special instructions for creating materials, especially as it relates to crossings? I have created a custom material for my road, but the crossing appears much darker:

    Custom_Road_Material_-_Crossing_Issue.jpg
     
  34. Enigma229

    Enigma229

    Joined:
    Aug 6, 2019
    Posts:
    135
    Hi. Can you point to the shaders that help with tiling?

    I have the demo scene installed.
     
  35. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hello Colin,

    If this is the same material on both the road object and the crossing than both should look the same.

    Thanks,
    Raoul
     
    colin_young likes this.
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hello Enigma229,

    For example both the "ER Road Detail" and "ER Road Mask Blend" shaders. The last is used on the mountain road in the middle of the v3.2 demo scene.

    Thanks,
    Raoul
     
  37. Enigma229

    Enigma229

    Joined:
    Aug 6, 2019
    Posts:
    135
    Hi Raoul, a lot of materials are showing up as pink (even after installing the HDRP support package).
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Enigma229,

    Are the road network assets in the v3.2 demo scene pink?

    URP and HDRP support was added in v3.2. The assets in the older v3.1 demo scene are not updated, they will appear in pink. It is a matter of assigning one of the new road shaders to the involved materials If you want to use these assets.

    After importing an URP or HDRP package there will be a new SRP readme file with info in the EasyRoads3D root directory.

    Thanks,
    Raoul
     
  39. Enigma229

    Enigma229

    Joined:
    Aug 6, 2019
    Posts:
    135
    Yeah it's the Demo Scene v3.2+

    I've installed the demo HDRP package as well and still pink.

    Here is an example of one asset: upload_2022-8-23_11-0-56.png
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Enigma229,

    Your recent posts are road shader related. Which exact packages are imported in this project and in which order? Was the HDRP package imported last?

    In any case, this Dirt Sand material uses the shader "EasyRoads3D/ER Dirt Road Fade In - Out". Can you try assigning this shader manually, does that work? If not, do all road network assets look pink in the v3.2 scene?

    Thanks,
    Raoul
     
  41. Enigma229

    Enigma229

    Joined:
    Aug 6, 2019
    Posts:
    135
    Packages were installed in this order:
    -Easy Roads
    -HDRP Package
    -Easy Roads Demo
    -HDRP Package

    It also looks like everything in the demo scene is pink.
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Enigma,

    After importing the Demo package, did you import the "DEMO_HDRP_10_3_2" package?

    Because when everything is pink the v3.2 demo scene it seems the HDRP demo package was not imported.

    Have you meanwhile tried to manually assign the "EasyRoads3D/ER Dirt Road Fade In - Out" shader. If that did not work than that too makes it seem that this "DEMO_HDRP_10_3_2" package is not imported or was not the last package that was imported.

    Thanks,
    Raoul
     
  43. Enigma229

    Enigma229

    Joined:
    Aug 6, 2019
    Posts:
    135
    Yes I installed the DEMO_HDRP_10_3_2 package after installing the demo.

    I don't know why the demo scene is pink, if I create a new road in a new scene and assign that ER Dirt Road Fade In - Out it looks fine.
     
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hi Enigma229,

    So that means the URP shader versions are imported and that when assigning this same shader to the Dirt Sand material in the screenshot you posted these road objects also display well?

    In that case, this does appear to be a package import issue. Also because there are no known issues in general with URP projects and the demo package.

    Just as a test, what happens in a completely new project when only importing the demo package?

    Thanks,
    Raoul
     
  45. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    670
    Raoul,

    Is there a way to lift the entire Road Network an amount? eg: I need to lift my entire city by 20 so I can have tunnels below (not road tunnels, so nothing to do with ER3D network)
     
  46. raoul

    raoul

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

    The road network object position itself is locked to avoid unwanted position changes and ending up in a situation where the road objects no longer exactly align with the terrain.

    But it is possible to move / lift the entire road network by selecting the two child objects "Connection Objects" and "Road Objects". After position changes there will be a notification in the Inspector with a button "Apply Transform Changes". This will complete the changes, the road and connection objects will be recalculated accordingly.

    [EDIT] This may actually not work well since you are using the v3.3 Flex Connector. This is fixed in the upcoming v3.3 beta update.

    Thanks,
    Raoul
     
    Last edited: Aug 30, 2022
  47. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    670
    Thanks for the info. I'll look into ways to work around it.

    I hope life is treating you well.

    Peace,
    James
     
    raoul likes this.
  48. lsgheero

    lsgheero

    Joined:
    Mar 24, 2013
    Posts:
    60
    I did some searching and saw many users asking about doing it but nothing that really showed how specifically... Does anyone have a good example on how you can generate roads at runtime from OSM data. I am hoping to use this asset to be able to use it to create roads, etc on my scale planet earth. I already have OSM data that I use to recreate buildings and it will do roads as well but I can't get them to conform to the terrain and figure this asset should be able to help with that.
     
  49. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,623
    Hello lsgheero,

    The OSM import that is part of the tool currently does not yet include generation of intersections (although this can be activated for standard X and T crossings). That is also one of the reasons why this option is not yet available through the scripting API.

    But is seems you already created your own OSM parser and the scripting API can be used to generate road objects through code. The main EasyRoads3D package does include a small runtime scene example of this.

    Thanks,
    Raoul
     
    lsgheero likes this.
  50. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    270
    Hey raoul,

    I have a question. Right now I have one big work scene with multiple terrains and one er network gameobject. Now I want to split this big scene into smaller scenes to get better performance in the editor view. Would the easy roads network manager require any changes? Is there anything I would need to care about? Any potential restrictions you could think of related to easyroads?

    Thanks