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,622
    Hi econt,

    The max slider is indeed limited to 5 by default. Do you do coding? ERModularBase, the script attached to the main road network object, maxCornerRadius.

    Thanks,
    Raoul
     
  2. alexrau

    alexrau

    Joined:
    Mar 1, 2015
    Posts:
    80
    I love this asset but find that sometimes if I hit delete in the wrong way to delete a road instance that I want to rework it ends up deleting the road setup and I need to rebuild the road from memory. It's really frustrating because setting up the roads is a bit of trial and error for me and if I don't remember the settings it is a recreate. Maybe there could be a warning or such when you are deleting the road setup as opposed to specific road.
    Running the beta on 2019.4 LTS.
     
  3. econt

    econt

    Joined:
    Apr 8, 2019
    Posts:
    52
    Hi Raoul,

    how is it possible to edit the script - it is a dll?

    Thanks in advance!
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi alexrau,

    The road network object is selected in the hierarchy. The delete key will target that object, the full road network. Is that what you mean? This action should be intercepted though, you will be asked if you indeed want to delete the full road network.

    Deleting the selected road can be done in the Inspector, the "Delete Object" button in the main Road Settings at the top. Removing the selected marker(s) can be done with Shift + R.

    If a road or road marker was deleted by accident, Undo can be used.

    Please let me know if I misunderstood the situation.

    Thanks,
    Raoul
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi econt,

    I mentioned coding in my previous post, for example something like:

    Code (csharp):
    1. using UnityEngine;
    2. using EasyRoads3Dv3;
    3.  
    4. public class ERAPIFunctions : ScriptableObject {
    5.  
    6.     [MenuItem("EasyRoads3D/Set Max Corner Radius")]
    7.     public static void SetMaxCornerRadius()
    8.     {
    9.         ERModularBase scr = FindObjectOfType<ERModularBase>();
    10.         scr.maxCornerRadius = 10;
    11.     }
    12. }
    If you put this in a new script in the folder /Assets/EasyRoads3D/Editor/, a new menu item "EasyRoads3D > Set Max Corner Radius" will be added in the top Menu in the Unity edtor. It will update the max slider radius to 10 in this case.

    Thanks,
    Raoul
     
    Pazzaar likes this.
  6. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Hello mate, one question: How do you solve the cracks that appear on the road?
     

    Attached Files:

  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi Acatist,

    That is probably z-fighting with the terrain. Is the screenshot taken with the road network in Build Mode? Which material / shader do you use.

    The EasyRoads3D shaders have an Offset option that can be used to deal with this. Another way is the "Raise" option in Build Mode, what is the current value?

    Thanks,
    Raoul
     
  8. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Yes, I have already solved it. The value was at 0. I changed it to 0.01 and it's perfect.
     
    raoul likes this.
  9. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Another thing I want to ask you is: how to cut (divide) a road? I've been looking for the option for a while!
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    It is possible to cut a single road object into two road objects without losing the shape by inserting an I Connector. This option is available further below in the Marker Settings. Above this option there is also a "Split Road at Selected Marker" button. This will create two road objects without preserving the shape.

    Let me know if you meant something else.

    Thanks,
    Raoul
     
    hopeful likes this.
  11. isNewBird

    isNewBird

    Joined:
    Mar 27, 2019
    Posts:
    20
    hello

    What do I need to do to get the road data as AI data?

    I can't get the lanedata.Because he doesn't have Lanecontsetting
     
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi isNewBird,

    The current official version, v3.1 does not include lane info. The scripting API does provide access to center, left and right road data for AI purposes.

    The v3.3 alpha, available on our website, https://easyroads3d.com/v3alpha.php, includes and upgrade to the road type system where lane data can be set for each road type. This lane data is available through the scripting API provided that this is activated in General Settings > AI Traffic > Generate Lane Data

    Which version are you using and could you give exact info on your road network setup and what you mean with "Lanecontsetting"?

    Thanks,
    Raoul
     
  13. MasonWheeler

    MasonWheeler

    Joined:
    Apr 2, 2016
    Posts:
    210
    Could I get these? None of the roads in the demo scenes are showing properly because I'm on URP.
     
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi MasonWheeler,

    Yes, I can email the shaders that have already been made. Can you contact us, the email is in the _Readme file in the EasyRoads3D root directory.

    Thanks,
    Raoul
     
  15. greatowq01

    greatowq01

    Joined:
    Dec 16, 2018
    Posts:
    37
    I want to build roads and traffic system by drag and drog at runtime( likes what players can do in the famous game- cities skylines ), can EASYROAD help me do that?
     
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622

    Hello greatowq01,

    The tool can be used to create roads and crossings at runtime through the provided scripting API. But the UI / behaviour of how roads are added and edited is currently not provided. But the scripting API does give you the flexibility of how you want this to behave, marker control points to define the road shape can be added, inserted or removed, etc.

    Here is a recent example of runtime road creation by Andefob,
    https://forum.unity.com/threads/eas...-new-road-system.229327/page-178#post-6453087

    Thanks,
    Raoul
     
  17. Abdulmajeed01

    Abdulmajeed01

    Joined:
    Aug 11, 2020
    Posts:
    19
    Hello
    I added lampposts motorway as side object, can I make the space of each pair wider? or can I make it single lamppost instead of two?
    thanks
     
  18. raoul

    raoul

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

    Is this the lampposts side object from the demo package? This is a side object based on a prefab with two lamposts, one on the right and one on the left. So in this case the way to change the lamppost positions is to do this in the prefab itself. If you select the side object in the Side Object Manager and click the "Source Prefab" slot it will point to the asset location in the project folder.

    For a single side object the position can be adjusted using the global "X Position" control. This can be done in the Side Object Manager or the same "X Position" control in the main Side Object settings for individual roads.

    In v3.2 a single side object can be used for both the left and right side of the road. v3.2 is available in beta builds available in the Asset Store import and will soon be released.

    Thanks,
    Raoul
     
  19. whidzee

    whidzee

    Joined:
    Nov 20, 2012
    Posts:
    161
    Hello. I recently purchased EasyRoads3D pro and I am trying to learn the system.

    I cannot work out how to add side objects to the road. I can see the side object tool, but are there meant to be some included in the package? to be able to do bridges, barriers, walls etc?
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi whidzee,

    EasyRoads3D is a framework that can be used with your own assets, road types, road materials, side objects, etc. That is what most users do and why the main EasyRoads3D Pro package includes limited assets.

    However, there is an additional demo package available on the Unity Asset Store, https://assetstore.unity.com/packages/tools/terrain/easyroads3d-demo-project-105045 . Make sure to enter the page logged in with the same account used to get the Pro version, the download will be free. This package includes a demo scene with additional side objects and links to tutorials on our website explaining how roads and side objects in the scene were created, https://easyroads3d.com/tutorials.php.

    Regarding tutorials, v3.2 and the new v3.2 demo scene are almost ready, new tutorials, also videos will follow.

    The main new V3.2 feature is the option to auto generate side objects based on rules and the terrain profile. This works for bridges, barriers and retaining walls. The v3.2 beta package, including a simple demo scene, is part of the Asset Store import. In v3.1, side objects are either generated along the full road or / and can be activated activated per marker with additional offset options.

    If you have any specific side object related questions please let me know.

    Thanks,
    Raoul
     
  21. greatowq01

    greatowq01

    Joined:
    Dec 16, 2018
    Posts:
    37
    In my project, runtime-road-building is necessary. So, it cant remove all these ER script components from all road network game objects at runtime. Does these ER scripts kill performance?Is it necessary to run API FinalizeObjects() for better performance?
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi greatowq01,

    Have you tested this? The EasyRoads3D components do not use methods like Update() that are called every frame. Generating the roads however does require processing and can there for have an impact on performance when for example long roads with complex side objects are generated.

    Thanks,
    Raoul
     
  23. Meceka

    Meceka

    Joined:
    Dec 23, 2013
    Posts:
    420
    I accidentally tested that once (forgot to finalize before a build), for me it just increased the memory usage and load time of the scene.

    There is a lot of data on those scripts, they increase the size and complexity of the scene.
    But they shouldn't cost CPU time if you aren't calling Object.FindObjectsOfType or similar methods.

    And it shouldn't affect GPU at all.
     
  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi Meceka,

    Yes, there is data in these scripts. Especially terrain data can be significant when using high resolution heightmaps and dense vegetation. The data is needed to restore the terrain when necessary.

    Thanks,
    Raoul
     
  25. donbruno

    donbruno

    Joined:
    Apr 23, 2014
    Posts:
    8
    Hello raoul,

    I use easy Roads3d pro and I have Unity 2019.4.9f1...

    In my Projekt URP, any roads are still pink... I have try to upgrade Projekt Materials to UniversalRP Materials, but it doesn't work.

    Some Ideas?

    Greetings
    bruno
     
  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi Bruno,

    Which packages do you have imported?

    Upgrading materials to URP only works for Unity built-in shaders. For the standard road shader the URP Lit shader can be used. The demo package includes some custom shaders using specific EasyRoads3D features such as secondary UV coordinates and vertex colors. For v3.2 these shaders have been completed with full PBR options, also for URP and HDRP projects. These shaders will soon be available.

    If you want you can send us an email (theemail is in the Readme file in the EasyRoads3D root directory) I will send the URP shaders that are already prepared.

    Thanks,
    Raoul
     
  27. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Hi Raoul, I want to ask you: Why in a new project, when I put EasyRoad (without the demo project), I want to make a simple road but I can't put more than one point! I mean, I can't continue to lengthen this road because the points are not added! Should I activate any option?
     
  28. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi Acatist,

    Can you actually add one point? That would be an unknown situation. Do you see error messages in the console?

    What is a known situation is Shift + Click, to add road markers, not working at all. Full details regarding this can be found at the top on the Troubleshooting page in the manual. In short, it can happen in recent Unity versions and the reason most likely is that the Gizmos tab on the right above the Scene View window is not active. By default this tab is active.

    Thanks,
    Raoul
     
  29. Sk4tOoR

    Sk4tOoR

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

    I switched to newer version 3.2.b8. I'am facing a problem when creating a new RoadNetwork in a multiple scene setup.

    Code (CSharp):
    1. NullReferenceException: Object reference not set to an instance of an object
    2. EasyRoads3Dv3.ERModularRoad.ODCDOOQCQD (UnityEngine.Mesh m) (at <f8f947793d71411996d71f3e4c5e551e>:0)
    3. EasyRoads3Dv3Editor.OQDOQODCDO.OnEnable () (at <11cc78afe204437fbc14ddba7e7d4c8e>:0)
    This NullRef appears two times on creating. After add a side object there are more NullRefs like

    Code (CSharp):
    1. IndexOutOfRangeException: Index was outside the bounds of the array.
    2. EasyRoads3Dv3Editor.OQDOQODCDO.OnInspectorGUI () (at <11cc78afe204437fbc14ddba7e7d4c8e>:0)
    3. UnityEditor.UIElements.InspectorElement+<>c__DisplayClass58_0.<CreateIMGUIInspectorFromEditor>b__0 () (at <701f6580abad44cfb237a543dcd0d94b>:0)
    4. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    In the inspector there are parts of the menu missing, like 'Marker Settings'. Only the part 'Road Settings' is shown. The whole menu seems to be unusable.

    Creating a RoadNetwork in a single scene starts with 4 NullReferenceExceptions:

    Code (CSharp):
    1. UnassignedReferenceException: The variable infoTexture of ERModularBase has not been assigned.
    2. You probably need to assign the infoTexture variable of the ERModularBase script in the inspector.
    3. UnityEngine.Texture.get_width () (at <49f4e7e791cc4fffacd88f729e2b1e4c>:0)
    4. EasyRoads3Dv3Editor.OCQCCCOOCC.OnGUI () (at <11cc78afe204437fbc14ddba7e7d4c8e>:0)
    5. UnityEditor.HostView.InvokeOnGUI (UnityEngine.Rect onGUIPosition, UnityEngine.Rect viewRect) (at <701f6580abad44cfb237a543dcd0d94b>:0)
    6. UnityEditor.DockArea.DrawView (UnityEngine.Rect viewRect, UnityEngine.Rect dockAreaRect) (at <701f6580abad44cfb237a543dcd0d94b>:0)
    7. UnityEditor.DockArea.OldOnGUI () (at <701f6580abad44cfb237a543dcd0d94b>:0)
    8. UnityEngine.UIElements.IMGUIContainer.DoOnGUI (UnityEngine.Event evt, UnityEngine.Matrix4x4 parentTransform, UnityEngine.Rect clippingRect, System.Boolean isComputingLayout, UnityEngine.Rect layoutSize, System.Action onGUIHandler, System.Boolean canAffectFocus) (at <9c9fa79efe9e479a8cbe7a6f99f673d3>:0)
    9. UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
    Is there a way to fix these errors?
     
  30. raoul

    raoul

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

    The situation you posted is unknown so it is hard to give precise feedback that fixes the problem.

    One error points to an editor script which probably explains why the Inspector controls are not entirely visible. The last error points to a missing texture used for the most right toolbar tab. Is the package correctly imported? Can you recreate this in a new fresh project with a standard single scene setup?

    Also with regard to your multi scene setup, can you provide the exact steps how this situation can be reproduced or can you send us by email a project / scene setup so we can look at it?

    Also, you mention the latest v3.2 beta, is this v3.2 beta related or can the same situation be reproduced in a v3.1.9x project? Which v3.2.b8 package do you have imported? The one in the Asset Store import or the one from our website?

    Thanks,
    Raoul
     
  31. greatowq01

    greatowq01

    Joined:
    Dec 16, 2018
    Posts:
    37
    Thanks for your help
     
  32. greatowq01

    greatowq01

    Joined:
    Dec 16, 2018
    Posts:
    37
    Thanks for your help
     
  33. Acatist

    Acatist

    Joined:
    Jun 7, 2016
    Posts:
    45
    Hi Raoul, a question, how to blend the end of a road with the texture of the terrain?
     

    Attached Files:

    • 1.png
      1.png
      File size:
      3.9 MB
      Views:
      276
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi Acatis,

    This can be done by setting the "Fade In Distance" for the first marker or the "Fade Out Distance" for the last marker. these options are available further below in the Marker Settings in the Inspector.

    For this to work a shader like the ER Road Transparency shader is required, a shader that sets the opacity based on the vertex color alpha value. I belief the dirt track in the image is from the demo scene and does use this shader so that should work fine.

    Thanks,
    Raoul
     
  35. unity_8p6oRXXqiWbRTQ

    unity_8p6oRXXqiWbRTQ

    Joined:
    Dec 20, 2018
    Posts:
    19
    Hi all,

    Im looking to buy this asset and so far it looks good, however i want to make a post apokalyptic game, and for that i would need a Solution that can make 2 or 3 Similar Meshes, which would have the same vertext count and position on the connection side of the mesh turn into one spline with different variations depending on settings. For Example, you have one piece thats the normal road, one piece that has the same vertex on front and end, but is maybe broken in middle(needing a different mesh and material), and another one looking a little bit different for variation. I guess what i mean is it possible to insert custom road segments? Would it be possible with this asset to achieve that?

    Sorry for my bed English, im having trouble to describe my question.
     
  36. raoul

    raoul

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

    First you mention that the road mesh should have the same vertex count then you wrote that the front and end should shave the same vertices? So it is not entirely clear what this will look like.

    It seems there are two options:

    1) Same vertices for the full road. It is possible to assign vertex colors to road sections, this info can be used on the material to blend different road textures and change the look.

    2) It is possible to insert I Connectors. When inserting two I Connectors the road will be split in three sections. This will split the road in three objects that can all have their own material. And the front and end mesh section will always remain the same, the middle section can change.

    Please let me know if you meant something else.

    Thanks,
    Raoul
     
  37. unity_8p6oRXXqiWbRTQ

    unity_8p6oRXXqiWbRTQ

    Joined:
    Dec 20, 2018
    Posts:
    19
    I gues thats what i meant? What i basicaly want to do is to insert custom roadpieces(not connectores to another road) Which have another Vertex count and mesh, but would fit together as the ends off the mesh would stay the same. and some parts would have the same texture. BUt without breaking the way the road flows along the spline. Is this Possible?
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    It think you want to look into custom road shapes and connecting the different road shapes with I Connectors. Like for example the Swamp track in the demo package. Custom road shapes are built-in in v3.3 available in alpha versions. At the moment this can be done by extracting the shape from an imported mesh / Connection object. That is how the swamp track was done.

    Thanks,
    Raoul
     
  39. unity_8p6oRXXqiWbRTQ

    unity_8p6oRXXqiWbRTQ

    Joined:
    Dec 20, 2018
    Posts:
    19
    Alright guess i will give it a try then
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Ok, let me know if you need further details.

    Thanks,
    Raoul
     
  41. unity_8p6oRXXqiWbRTQ

    unity_8p6oRXXqiWbRTQ

    Joined:
    Dec 20, 2018
    Posts:
    19
    When is v3.3 releasing?
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
  43. greatowq01

    greatowq01

    Joined:
    Dec 16, 2018
    Posts:
    37
    Can ER build roads with half-round end(look at the image below) without half-round end prefab?
    upload_2020-11-21_12-53-37.png
     
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi greatowq01,

    Not at the moment. Things like this and built-in cull-de-sacs is on the list to add. At the moment this can indeed be done through a modelled piece imported into the system as a custom connection.

    Thanks,
    Raoul
     
  45. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    270
    Hi @raoul ,
    I bought this nice asset on sale yesterday, was experimenting with it, and have a small question. How do I change the scale of the guardian barriers for example. Or side object prefabs in general. Unfortunately my cars have a bit different worldscale, but I don´t want to change them, because this would change the carphysics and I like them as they are.

    thanks ;)
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    Hi marcell123455,

    Side objects like the example barriers in the demo project are based on the procedural side object type which uses a prefab in the project folder as a reference, look for "Source Object" in the Side Object Manager. In v3.1 it is a matter of scaling up this source prefab in the prohect folder. Note that afterwards the side object needs to be rebuild, the "Refresh" button next to the Source Object slot. When start and end sections are used, new offsets must be set as well. Press the "Open mesh Editor Window" button and make sure these offsets are at the same position relative to the mesh as before. You may want to look at this first before scaling up the prefab.

    In v3.2, available in betas in the /Beta Release/ folder, the side object can be scaled directly in the Side Object Manager near the top in the General Settings. V3.2 will soon be released.

    Thanks,
    Raoul
     
    marcell123455 likes this.
  47. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    270
    Hi @raoul, I guess I found a bug. Simple thing: I installed Easyroads, the hd addon pack and the included beta unitypackage. I added all the roadtypes to the project. Now when i want to remove roadtypes under manage roadtypes it does not remove them... don´t know why.. Is there a manual way to do this?

    And I have a question. The hole creation for tunnel Start/Endings does not really work well. There is always manual rework required. Maybe a option for the hole X Y size would help so that it would generate a bigger hole if set it correctly.

    Thanks ;)
     
    Last edited: Nov 25, 2020
  48. raoul

    raoul

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

    "Manage Project Road Types" is project related. When removed road types are still present in a scene they will be added to the project road types again so they can be used across scenes. That is how road types can be used across scenes. Does this relate to your situation? Do these removed road types still exist in the scene?

    Tunnel hole creation is "Experimental" as this is complex and results may depend on the terrains heightmapscale (size vs heightmap resolution). So if the results are always off on your end the first questions would be, which tunnel side object is involved and what are your terrain specs? And do you see a pattern of the position of terrain tris that are not removed?

    Thanks,
    Raoul
     
  49. marcell123455

    marcell123455

    Joined:
    Jun 18, 2014
    Posts:
    270
    No, there are no roads in the scene, when I try to remove the roadtype. I want to remove the roadtype generally from the project.
    The tunnel holes are mostly wrong when I place the road against the "holegrid". I would say diagonally.

    https://imgur.com/vQRVCMB
    https://imgur.com/CfcWlPW
     
  50. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,622
    The road type will also be added again when it still exists as a road type in the specific road network regardless whether a road of actually exists that is using that road type. Is that the case? Did you first remove it from the road network, "Remove Selected Road Type" near the bottom in the Road Type settings?

    Size 16384x16385, heightmap resolution 4097, the heightmapsscale in this case is about 4. The default heightmapscale of a Unity terrain at the moment is around 2 and even smaller in older Unity versions where it was around 1.

    Are you using the provided tunnel examples? They may not be optimal for this heightmapscale but I will do some tests with these settings.

    Thanks,
    Raoul.
     
    marcell123455 likes this.