Search Unity

  1. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

EasyRoads3D v3 - the upcoming new road system

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

  1. PeterB

    PeterB

    Joined:
    Nov 3, 2010
    Posts:
    365
    Many thanks, Raoul, for the VS instructions. Looking forward to your PM. The code handles zig zag roads up and downhill very elegantly due to the modified A* algorithm which uses anisotropic connection masks.
     
    raoul likes this.
  2. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    420
    I decided to use the script that is available in the Runtime Demo. But Is that possible to make that script simpler to just be used for train and not create road? Sorry I'm too noob around C#.

    Instead of using that runtime road please put a field to insert a specified road there.
     
    Last edited: Jan 4, 2020
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    What is relevent in the runtime script demo is the code in Update().

    Apart from creating the road network object all the code in Start() can be removed. It should look something like this.

    Code (csharp):
    1. void Start () {
    2.          // Create reference to the road network object in the scene
    3.         roadNetwork = new ERRoadNetwork();
    4.  
    5.          // get the "road"
    6.          road = roadNetwork.GetRoadByName("the rail road object name");
    7.  
    8.          // or
    9.          road = roadNetwork.GetRoadByGameObject(GameObject object);
    10. }
    This could be a starting point but moving a train on rails is slightly more complex.

    Thanks,
    Raoul
     
    Last edited: Jan 5, 2020
    Crossway likes this.
  4. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    420
    It's cool now I can create a nice train movements with the help of PlayMaker :)
    Just I get error on the line 9! Is that (GameObject object) correct?
     
  5. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Glad to hear that!

    GameObject object is the specific road gameobject that should be passed. Does that object already exist in your code? Otherwise it might be easier to use the GetRoadByName(string roadName) option

    Thanks,
    Raoul
     
    Crossway likes this.
  6. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    420
    It works as expected the only problem is that floating origin script can't transform train while it's moves all the game world (including all roads) but train still chose previous position of road to move on.
     
  7. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Isn't that related to the floating origin script that you are using? Can the spline points be translated accordingly?

    Thanks,
    Raoul
     
  8. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    420
    I use 2 more assets that use splines too and works without problem but this is the floating origin script I use.

    Code (CSharp):
    1. // FloatingOrigin.cs
    2. // Written by Peter Stirling
    3. // 11 November 2010
    4. // Uploaded to Unify Community Wiki on 11 November 2010
    5. // Updated to Unity 5.x particle system by Tony Lovell 14 January, 2016
    6. // fix to ensure ALL particles get moved by Tony Lovell 8 September, 2016
    7. // URL: http://wiki.unity3d.com/index.php/Floating_Origin
    8. using UnityEngine;
    9. using System.Collections;
    10.  
    11. [RequireComponent(typeof(Camera))]
    12. public class FloatingOrigin : MonoBehaviour
    13. {
    14.     public float threshold = 100.0f;
    15.     public float physicsThreshold = 1000.0f; // Set to zero to disable
    16.  
    17.     #if OLD_PHYSICS
    18.     public float defaultSleepVelocity = 0.14f;
    19.     public float defaultAngularVelocity = 0.14f;
    20.     #else
    21.     public float defaultSleepThreshold = 0.14f;
    22.     #endif
    23.  
    24.     ParticleSystem.Particle[] parts = null;
    25.  
    26.     void FixedUpdate()
    27.     {
    28.         Vector3 cameraPosition = gameObject.transform.position;
    29.  
    30.         cameraPosition.y = 0f;
    31.  
    32.  
    33.         if (cameraPosition.magnitude > threshold)
    34.         {
    35.             Object[] objects = FindObjectsOfType(typeof(Transform));
    36.             foreach(Object o in objects)
    37.             {
    38.                 Transform t = (Transform)o;
    39.                 if (t.parent == null)
    40.                 {
    41.                     t.position -= cameraPosition;
    42.                 }
    43.             }
    44.  
    45.             #if SUPPORT_OLD_PARTICLE_SYSTEM
    46.             // move active particles from old Unity particle system that are active in world space
    47.             objects = FindObjectsOfType(typeof(ParticleEmitter));
    48.             foreach (Object o in objects)
    49.             {
    50.             ParticleEmitter pe = (ParticleEmitter)o;
    51.  
    52.             // if the particle is not in world space, the logic above should have moved them already
    53.             if (!pe.useWorldSpace)
    54.             continue;
    55.  
    56.             Particle[] emitterParticles = pe.particles;
    57.             for(int i = 0; i < emitterParticles.Length; ++i)
    58.             {
    59.             emitterParticles[i].position -= cameraPosition;
    60.             }
    61.             pe.particles = emitterParticles;
    62.             }
    63.             #endif
    64.  
    65.             // new particles... very similar to old version above
    66.             objects = FindObjectsOfType(typeof(ParticleSystem));
    67.             foreach (UnityEngine.Object o in objects)
    68.             {
    69.                 ParticleSystem sys = (ParticleSystem)o;
    70.  
    71.                 if (sys.simulationSpace != ParticleSystemSimulationSpace.World)
    72.                     continue;
    73.  
    74.                 int particlesNeeded = sys.maxParticles;
    75.  
    76.                 if (particlesNeeded <= 0)
    77.                     continue;
    78.  
    79.                 bool wasPaused = sys.isPaused;
    80.                 bool wasPlaying = sys.isPlaying;
    81.  
    82.                 if (!wasPaused)
    83.                     sys.Pause ();
    84.  
    85.                 // ensure a sufficiently large array in which to store the particles
    86.                 if (parts == null || parts.Length < particlesNeeded) {
    87.                     parts = new ParticleSystem.Particle[particlesNeeded];
    88.                 }
    89.  
    90.                 // now get the particles
    91.                 int num = sys.GetParticles(parts);
    92.  
    93.                 for (int i = 0; i < num; i++) {
    94.                     parts[i].position -= cameraPosition;
    95.                 }
    96.  
    97.                 sys.SetParticles(parts, num);
    98.  
    99.                 if (wasPlaying)
    100.                     sys.Play ();
    101.             }
    102.  
    103.             if (physicsThreshold > 0f)
    104.             {
    105.                 float physicsThreshold2 = physicsThreshold * physicsThreshold; // simplify check on threshold
    106.                 objects = FindObjectsOfType(typeof(Rigidbody));
    107.                 foreach (UnityEngine.Object o in objects)
    108.                 {
    109.                     Rigidbody r = (Rigidbody)o;
    110.                     if (r.gameObject.transform.position.sqrMagnitude > physicsThreshold2)
    111.                     {
    112.                         #if OLD_PHYSICS
    113.                         r.sleepAngularVelocity = float.MaxValue;
    114.                         r.sleepVelocity = float.MaxValue;
    115.                         #else
    116.                         r.sleepThreshold = float.MaxValue;
    117.                         #endif
    118.                     }
    119.                     else
    120.                     {
    121.                         #if OLD_PHYSICS
    122.                         r.sleepAngularVelocity = defaultSleepVelocity;
    123.                         r.sleepVelocity = defaultAngularVelocity;
    124.                         #else
    125.                         r.sleepThreshold = defaultSleepThreshold;
    126.                         #endif
    127.                     }
    128.                 }
    129.             }
    130.         }
    131.     }
    132. }
    Also I remember before I had an issue that vegetation studio mask on the roads didn't work for me I think that may be related to same issue too.
     
    Last edited: Jan 5, 2020
  9. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    The returned points are the spline points based on the original position of the road. If you are moving the world at runtime, then the returned position based on the original spline points must be translated accordingly.

    Regarding Vegetation Studio, does that work inside the Unity Editor, not at runtime? The vegetation Studio components are added to the respective road objects./ If these roads move then the Vegetation Studio masks should move accordingly.

    Thanks,
    Raoul
     
  10. darshie1976

    darshie1976

    Joined:
    Jun 11, 2008
    Posts:
    929
    Hi, I have updated the assets and trying again, after putting it aside some time ago. Now I moved away from Gaia so I am using a different workflow for terrains; in one instance the street object was spawned below a 2x2 terrain array; although it did work when I tried the second time, reloading the scene. Seems that the tools are acting weird in some cases, and I can't pinpoint what is triggering that strange behavior.

    For example, added a connection on a motorway type road; and the whole thing got distorted as in the image; although when I used undo, Unity just froze. Had to kill Unity, wasting some time I spent working on the road. Seems that the undo to remove the connection did upset Unity

    junction to motorway.JPG

    Did you ever come across new videos and tutorials as you planned last year? Looking forward to see video tutorials, as other assets usually offer. Not sure why any of the youtubers that work with Unity are making any video about easyroads3d.

    Either it is very easy to use and I am a brick, or they are hidden and are not using "easyroads3d" anywhere. Thanks
     
    Last edited: Jan 6, 2020
  11. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hello darshie,

    There are no known issues related to Gaia. Whenever the road network object is selected to make changes the status of the terrain(s) is refreshed. The Unity terrain object is relevant here. As far as I know Gaia always results in a Unity terrain object. The second factor is that a terrain collider must be present.

    In the screenshot the primary Road T Crossing is used on the Motorway road. These two do not match. The motorway shape will gradually adjust to the T Crossing shape. That is where the "distorted" shape comes from.

    Regarding Unity freezing, how was can this be reproduced? In what way was the crossing added?

    Using the demo package project I added a motorway, then I selected one of the markers in the middle of the road and inserted the Primary Road T Crossing prefab like in your image. After that I did Ctrl+Z. The T Crossing was removed and the motorway reverted back in one road. Unity did not freeze. Can this be reproduced on your end?

    Our website includes a range of tutorials based on the demo project. There is one new video planned, but that is more a general introduction also covering FAQ's. There are some changes / new features in v3.2 and v3.3, that is when new videos will be done.

    Meanwhile, what is not not clear? Because I don't think what is in your post can be covered in a video tutorial.

    Thanks,
    Raoul
     
  12. Crossway

    Crossway

    Joined:
    May 24, 2016
    Posts:
    420
    I think I should use another method for train then. For now I have another problem with the performance. My PC is powerful but in big maps moving markers for long roads is too slow. I can't move a marker because of that. Even removing a maker takes around 8 seconds!
     
    Last edited: Jan 6, 2020
  13. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    How long is your railroad?

    The railroad can be cut in pieces by inserting I Connectors. This option is available further below in the marker section in the Inspector. This is better for performance.

    Thanks,
    Raoul
     
    hopeful likes this.
  14. darshie1976

    darshie1976

    Joined:
    Jun 11, 2008
    Posts:
    929
    Hi Raoul,

    I am sure there are no known issues with Gaia; although I can make a list of the 100% reproducible issues I have encountered, while working with Gaia, which push me to reconsider the usage of that package for my needs; but that is a topic that only marginally interest you, since I did not try Gaia with ERP recently, nor I am planning to spend time doing so.

    Back to the topic at hand; thanks for the clarification; so the road distort because the difference in width is compensated, I can live with that. Not sure how to make a junction for the motorway at this point though, if the effect is that; but I will experiment with small roads. Probably using a single lane road and moving it to a large angle instead of a T junction may act as exit/enter ramp.

    As far as Unity freezing, it happened only once so far; I did select a node on the motorway and created a junction there as per tutorials on the website; then I modified the road, trying to change the position of the junction and its width, and pressed multiple times CMD-Z on Windows, to the point where I was expecting to see the junction being removed, but it didn't happen. Instead Unity froze and I had to kill it. I will see if that happen again on the same exact map; I just moved on with the project but I should have a save with that scene in that state, so I can try to reproduce.

    As far as tutorials, I do remember them; I think you added some more on the website since when we spoke last time (was a year ago or so?); but I was looking forward to videos to be honest. Most of the videos you have on youtube are a minute or 2, with no commentary and show just how to do a specific action or a generic road. My questions are more related to a real workflow.

    I have other assets that have hours of tutorials showing all the details about how to use it in various situations; maybe I got spoiled :) But specifically, the issues I have is in how to deal with different road types.

    Got the road object in the scene, got the road going, placed nodes; all is fine there. Then I tried to add connections and mixing up different road types has proven to be complex, because I am not doing it right probably. Dragging nodes to create intersection works intermittently; some times nodes do get "red" becaue reasons; which I assume are due to the terrain shape; but honestly I would expect the package to solve the problem for me; so I just have to design the road network and leave the details about how things merge together to the logic of the package. A video showing how to make different connection, explaining what to do when things get red, would really be useful.

    Another source of confusion is road types. I think I did voice this issue in the past, which is fundamentally why there can't be a set of roads used as starting point (highway, city road, country road, track road and so on), and then via parameters you change the width, shoulder, textures and so on? I have imported the assets from the demo project, but I get in the road type category things like railroads, fences, even splines and other side objects (?), which is confusing.

    Same goes for side objects; some are there, if you import the demo project; but I would rather have a simple drop down with standard road types so I don't have to think about the details, and focus on the actual design.
    Bridges and galleries are another challenge too; I think I saw a tutorial but it was not really clear; all I would like to see is the package recognize when I am connecting areas where there is no ground below, and place a bridge on its own; letting me decide the details of the bridge.

    I understand that there are limitations to what the package can do; which is why I would rely on step by step videos to figure out how to correctly use the package. I understand that tutorials become obsolete, and that time is better spent working on updates and features; although an asset that is great but hard to use, is as useful as an asset with less features but with great tutorials. You know your priorities, I am just pointing out that other asset makers on the store do have a wide variety of tutorials that explain most of the asset in detail, and with those tutorials, I am up and running in a snap, which is my main objective to be honest.

    Hope I did express clearly my roadblocks; time is money for me, as such all the time I spend "learning" is not paid, and all the time spent "trying things to see what happen" is not productive for me, as it could be if I would just sit down, watch few tutorials and then have a solid base about how to use something.
     
    dsilverthorn likes this.
  15. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi darshie1976,

    In v3.1 connections are usually based on road types. New dynamic crossings prefabs can be created through General Settings > Crossing Connection Prefabs. After which road types can be assigned to the connections. New connection prefabs for a specific road type can also be generated directly through: General Settings > Road Types > Create New Connection Prefab.

    In your screenshot though, a motorway road type is used. Built-in Motorway on /off ramps are not yet supported. This will be available in v3.3. Meanwhile this can be done by importing a motorway exit road mesh model into the system.

    Multiple fast Ctrl+Z can indeed result in delay. The Unity Undo class is used for this which in this case can involve quite some operations. In my test I simply inserted a crossing and did Ctrl+Z, this is a process that is completed instantly.

    We have a survey on our website, improving documentation / video tutorials is part of it. It has one of the lowest ratings contrary to for example "more built-in crossing types". Based on that we make our schedule. But new narrated videos will be added for the new upcoming features.

    What is not clear regarding the workflow? is that covered by what I mention in this reply, preparing road type specific crossings? This is also covered in the first sections of the manual.

    Crossings and different road types is complex. The Flex Connector in v3.3 can handle different road types automatcially. In the current version the road type can be assigned to the specific crossing connection by selecting it in the hierarchy > Connection Settings

    Do you mean the middle green handle turns red? In that case the selected road does not match the connection. This can also be the case when sidewalks are involved.

    The seond tab from the right is called "Add New Road / Object". So this can be a road or an object like a fence. Both are based on the same system and use a similar workflow. We simply decided to include everything in one tool rather then create different tools and sell them separately.

    EasyRoads3D is a framework that can be used with your own assets. So for a new scene / project, road types need to be setup.

    The HD Roads Add-On is a ready-to-use package with different road types and crossings prefabs that work for all road types.

    We understand that videos can be useful, we do have videos although they are older but they are still relevant. New videos will made. Meanwhile we monitor what people ask for.

    We ourselves thought that the interface had become a bit overwhelming. This too is part of the survey, just like documentation / video tutorial, this has low priority among those who submitted the review. These survey results are used to set our schedule. If there is demand for more tutorials, please let yourself hear (to everyone) including what type of tutorials and what exactly is not clear. Our website also includes a fair amount of tutorial based on the demo package.

    Thanks,
    Raoul
     
    Last edited: Jan 6, 2020
    dsilverthorn likes this.
  16. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    476
    Hello gang,

    Some good news for your day; My example source code for traffic using DOTS is available here: https://github.com/Blissgig/Easy-Road-3D-ECS-Traffic

    There is also a testbed available, see the readme, and you only need to install Easy Roads from the Unity Store when you open that project.

    I have also removed a couple of unnecessary components to make the example easier.

    Raoul has been great in helping check this code out, and if you find any issues please let me know.
     
    hopeful, raoul and colin_young like this.
  17. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi James,

    Thank you very much for sharing your code!

    Just a note for those who want to try it out, the new traffic lane data options available in v3.3 is used, alpha builds are available on our website, https://easyroads3d.com/v3alpha.php

    Thanks,
    Raoul
     
    hopeful likes this.
  18. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    476
    The lane data is not available in the current release?
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    The current release on the asset store is v3.1.9f2. The new road shape and especially the lane data options used in your scripts is v3.3 alpha.

    Thanks,
    Raoul
     
    JamesWjRose likes this.
  20. JamesWjRose

    JamesWjRose

    Joined:
    Apr 13, 2017
    Posts:
    476
    Thanks for the info. I have updated the repository so that devs will know this.
     
    raoul likes this.
  21. darshie1976

    darshie1976

    Joined:
    Jun 11, 2008
    Posts:
    929
    Thanks, I tried that and the outcome is that in some case the junction on the new connection prefab was not performed, The road would remain disconnected. In other cases the disconnection would happen if I would modify another junction on the same road. I would also get null pointer exceptions for the nodes when trying to fix things.

    I could show you the workflow but honestly I spent 2 days trying to make a network for a 4x4 terrain and every time I would fix something, something else would break, so I just let it be for the time being and moved on a different aspect of the project. I will send you something once I find the patience to get back to it.

    Maybe there was too much going on; I rarely see unity locking up on my machine to be honest; with 32 GB of RAM you rarely get issues; I will give it a try again at one point.

    Totally understandable; probably most of the customers that use the asset are not bound to finish projects in time and deliver, to get the payment; as such they have the capability to spend more time trying things out and get the learning process done in that way. It is appropriate that you follow what the majority ask.

    I am just surprised that another road product that is not on sale anymore; had pretty good video tutorials from the start. I guess the users of that package were asking for videos as first thing.

    I tried to follow your tutorials and the short videos; all is fine as long as you have a single road or few roads; but inevitably, everything start to trigger issues of all sorts when the network start to grow. I tried a simple block setting for a city area on the map (6 roads across, intersecting with another set of 16 roads; so nothing too large), and when I tried to connect that network to another network that would act as motorway and primary extra-urban road, the issues would start.

    Can't point exactly to a specific thing, because as mentioned before, I spent 2 days constantly adding roads, getting issues, undo, reload the map and so on; everything works fine as long as the map is single terrain and on the small side; so the package works as expected for anything that follow your tutorials. The problem is that I don't make tutorials but open world maps, and as such; I need large road networks that spawn on multiple terrains and use multiple packages from different sources. Can't say what is wrong or what is upsetting easyroads3d, but the final result is that I can't get the road network completed.

    The middle green handle stay green most of the time; the issue is on the side connections. For example what is just fine after the connection, at one point break; I check the connection and the road is disconnected, and the side spheres showing the connection, goes red. The terrain is also deformed when modifying the road network; which probably modify the terrain below the junction and that cause the connection to break. I didn't spend much time troubleshooting to be honest; getting close to a deadline so can't afford to invest too much time in any non-primary task, but I will follow up on the topic as soon as I can

    I see; to me would make more sense to divide side objects from roads; since the list is quite large if you import the demo project, and most of the entry are not even roads. If the product was a path creator or a spline creator then yes; make sense to have roads, rivers, railways, fences and so on all together. They do not have to be sold as separate tools; the core is the spline structure and whatever goes on it can be anything. Just saying.

    Understandable; although it is made to make roads; as such; the main options and settings should be related to roads. Then if your highway has lights or not, barriers or not, fancy walls or not, reflectors or not, that is where the customization comes in; same for the road material, but a road is fundamentally the base element, and as such make sense to get at least starting elements that can be personalized with your own assets. I do the same with many other packages; but I always have a starting point to use as template, and then customize it.

    I thought that HD roads was only adding textures; which I do not need since I have my own. so that package add also road types and other side objects?

    The UI is not overwhelming except in some cases. I find some package being more efficient than others for example, when offering features and functionalities. For example I can only say great things about Vegetation Studio Pro; which is a heck of a package for complexity, but you can get everything done in few clicks, because the package desing is modular... You go as deep as you want, but you can get the whole purpose of the package (make vegetation and place objects), with few clicks and ignore the rest of the features until you want to dig deeper.

    I like the UI; I just like to have comprehensive videos that show actual real case scenarios of the usage of the packages. for some unknown reason, I can't find a single youtuber using this package for anything beside few example roads. Again, either I am slow and I don't get this package ins and outs, or I don't have the time and patience to get to know it. Not blaming you of course; if you sell, it means that things are fine.

    Thanks for your reply; I will give it a try again when I have time; for now I am doing everything using a mix of an old package asset and by hand. Not ideal, but I have no time sadly.
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi darshie1976,

    This was about creating new dynamic crossing prefabs based on road types in the project folder. In what way is the junction on the new connection prefab not performed? What type of roads are involkved, are sidewalks involved?

    The Unity Undo class is used fore this. Merging roads, splitting roads can involve a lot of data, markers, possibly side objects. Some process can take longer. And it seems that the Undo class doesn't like quick repetitive Undos in this case.

    I assume this involves two different road network sections, possibly involving different road types?

    Road network generation in Edit Mode is not affected by a single or multi terrain setup. The terrain setup is specifically relevant when switching to Build Mode.

    It is very hard to give feedback on this when no explicit issues are mentioned with detailed steps how to reproduce or at least some indication what goes wrong. Do you perhaps want to do things that are not supported? Road network generation can be a pretty complex thing. Or could you sent us an email with a link to a project that exposes issues?

    This sounds sidewalk related, the corner handles will turn red when a road is also connected to a crossing on the other end. The handles will turn red when sidewalks cannot be activated. Which crossings are involved when this happens?

    The terrain is only modified when switching to Build Mode, is that not what happens on your situation? There is no code that triggers terrain changes in Edit mode unless callbacks are used on road changes and in these callbacks the terrain is adjusted through the scripting API, but that is by user choice.

    Software development is a process. This is where this comes from, EasyRoads3D is primarily a road tool, started mainly to automate levelling the terrain. In v3 we have road types, in order to make things easier we added the option to auto activate side objects for road types. A new instance of that road type is created and the side objects are auto activated. The next idea was, let's also use this to create presets that do not involve roads. We use the same system, the "road type" is simply marked as "Side Object" that way no road mesh is generated. Now we can also auto generate single fences, walls, powerlines etc. So far users like this feature, it has never been reported as confusing. But we will take note of this and see if there is something we can do to improve this in an easy way, categorize it.


    I mentioned the HD Roads package as a ready-to-use package because I thought that was what you were looking for, no need to setup presets. You now mention that you do have your own materials. In that case this will have to be setup, it is fairly simple, General Settings > Road Types, new road type set the width and assign your material and create a new connection prefab. That is the basic setup. Then it depends on the quality you need.

    The HD Roads package for example also includes start / end decals for each road type. These are decals matching the road width and that can be assigned to road types. After attaching the road to a crossing a decal is randomly selected. It will be placed at the connection with the crossing for a seamless transition.

    The package also includes some side objects like dust strips.

    All ready-to-use

    Whether this package will be useful depends on what you want to create, what type of roads. Do you need sidewalks, what type of sidewalks? In this package sidewalks are static less customizable.

    That is good to hear. Now and then people ask for video tutorials, we ask what the problem is, we ask what type of tutorials they like to see not already covered by the tutorials on our website. They give details regarding the problem. We respond, provide details how to deal with the problem / situation, and we never hear what tutorials they like to see. We do intend to make more in-depth video tutorials when certain new features are ready, until then we like to focus on improving the tool. As mentioned there will be a new introduction video.

    Thanks,
    Raoul
     
    Last edited: Jan 8, 2020
  23. PrimusThe3rd

    PrimusThe3rd

    Joined:
    Jul 3, 2017
    Posts:
    35
    Hello, I'm using the latest version (v3.1.9.f2 release date: 12-12-2019). There is a problem with default settings for indent... (see attached sample). I can not set number lower than this...which deforms my terrain pretty too much. Thanks for the help. (I've generated a terrain with a new tool Terraworld)
    Best regards,P
     

    Attached Files:

  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hello PrimusThe3rd,

    The Indent values represent the distance from the road edges where the terrain will be leveled at the same height of the road.

    The limitation here is that the terrain heights are based on an heightmap, there are only so many terrain points available and it is impossible to add detail points.

    So EasyRoads3D must use a minimum distance based on the used terrain heightmap resolution and the terrain size to guarantee the best possible results. Otherwise the terrain will break through the road or the road will float above the terrain.

    The Indent value in the image is high though. It looks like either this is quite a large terrain or a small heightmap resolution is used. What are these terrain specs?

    Thanks,
    Raoul
     
  25. PrimusThe3rd

    PrimusThe3rd

    Joined:
    Jul 3, 2017
    Posts:
    35
    Many thanks...
    P
     

    Attached Files:

  26. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Thank you for the additional info.

    Based on that, the Default Indent should be lower. On our end size 2700x2700, heightmap 1025 results in 3.955078.

    Is this the only active terrain in the scene? What happens when entering a value of 1? Does this indeed not update the value?

    Thanks,
    Raoul
     
  27. PrimusThe3rd

    PrimusThe3rd

    Joined:
    Jul 3, 2017
    Posts:
    35
    Yes, there was indeed another terrain multiplied by 10x (so I deselect EasyRoads script for that terrain) and everything works now nicely... thanks. P
     
    raoul likes this.
  28. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    116
    raoul and Rowlan like this.
  29. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi combatsheep,

    Thank you very much for that! :)

    I went through it by translating it. It is a very good introduction, to get started with the tool.

    Here are a couple of points I noticed

    At some point it refers to the Demo Project package, mentioning that it needs to be purchased. That is not entirely the case. It is impossible to link an entirely free package to another package on the asset store, that is why it says $45, the price by itself. But it is a free upgrade after purchasing EasyRoads3D Pro. This is mentioned in the asset description. Just make sure to open the asset store page logged in with the account used to get EasyRoads3D Pro. Perhaps you could update that part?

    The terrain backup feature is not involved when switching between Edit and Build Mode where the terraiun is adjusted. It is an extra safety meaure just in case something unexpected happens with the terrain during this process.

    Raoul
     
    combatsheep likes this.
  30. combatsheep

    combatsheep

    Joined:
    Jan 30, 2015
    Posts:
    116
    Hi, Raoul.

    Thanks your advise!
    I will add them to the article.:)
     
    raoul likes this.
  31. JonaOneview

    JonaOneview

    Joined:
    Nov 3, 2019
    Posts:
    11
    Hi Raoul,
    EasyRoads3D is a great asset that has made my project way easier in more than one way, but I'm having problems setting up custom crossroad connections. I have prepared a lot of road types but when I create a new connection prefab and try to set up the road types it connects to I only see "No Road Types Available".

    I'm also wondering if there is an in depth guide on creating custom made connection prefabs with EasyRoads3D since later on I would also like to create crossroads with more than 4 connections, or Y shaped connections as well.
     
  32. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi JonaOneview,

    Glad to hear that!

    Regarding custom made connections, did you create new road types in General Settings > Road Types?

    In that case, what does the shape of the custom connection look like?

    In the current version the default road shape, the road shape also used on built-in dynamic connections and for newly created road types in General Settings > Road Types, has a 2 node shape. One vertex on the left and one vertex on the right.

    Auto inserting crossings when roads are snapped to crossings and other processes are primarily based on matching road types. To guarantee clean connections between roads and crossings, the road shape between the road and the connection must match.

    So this means that the road types dropdown after assigning a connection in the Custom Prefab Editor window will only show road types that match the shape of the current selection. Is that shape indeed not a two node setup?

    In that case a new road type for that specific shape can be created directly in the Custom Prefab Editor window, by pressing the "New Road Type" button below the road type dropdown. The new road type will automatically inherit the shape of the currently selected connection and this road type will be available for the next connection with the same shape.

    v3.3 will support custom road shapes also for built-in crossings, the shape can be defined through the new custom road shape editor options. That way built-in road types and road types based on imported models will be better in synch.

    Thanks,
    Raoul
     
  33. JonaOneview

    JonaOneview

    Joined:
    Nov 3, 2019
    Posts:
    11
    Thanks for the reply Raoul.
    Does this mean that currently there is no way to create custom road shapes that connect to crossings?
    I'n my projects I created a lot of new road presets with 1-4 lanes, with or without sidewalks and other side objects etc. My current problem is with trying to create new crossings that will match the new road widths. I created new crossing prefabs but when i try to match the connections to the road types I have available there are none.

    Here is the list of all the road types I've defined:
    upload_2020-1-15_13-40-58.png

    And here is the crossing prefab I'm trying to create with 2 lane road connections. Road type options in the crossing Custom Prefab Editor Window is the same.

    example1.png

    upload_2020-1-15_13-40-58.png example1.png
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Sorry, because you mentioned "Custom" it made me think you were importing your own models into the system using the Custom Prefab Editor window. Within EasyRoads3D this is refered to as "Custom Connections", like for example in the third tab from the left in the Inspector.

    The screenshot in your last post show this is actually related to built-in "Dynamic" crossings, in this case X and T crossings.

    It is strange these road types are not visible. What is your exact workflow? Before Unity 2018.3, both adding road types and creating new crossing prefabs was done through the road network object in the scene. Starting from Unity 2018.3 it is also possible to create road types from the project folder and crossing prefabs can be edited through the prefab system introduced in Unity 2018.3. In order to reproduce this, what are the exact steps you took?

    Other then that, a quick way to create new dynamic crossings based on your road types, is the "Create New Connection Prefab" button in General Settings > Road Types, below the material options near the bottom in the Main Settings. This will generate a new dynamic prefab based on the specific road type. This prefab can be edited afterwards like in your screenshot, the road types should be visible.

    Thanks,
    Raoul
     
  35. JonaOneview

    JonaOneview

    Joined:
    Nov 3, 2019
    Posts:
    11
    the "Create New Connection Prefab" button in General Settings > Road Types is grayed out for me.
    My workflow for creating road types was duplicating the existing default road through the Duplicate Road Type button in General Settings > Road Types and then changing the width and road material to create different amounts of lanes. Then I duplicated each of these with different set ups of side objects like with sidewalks, parallel parking perpendicular parking, or sidewalks with a type of parking, etc.

    To create the crossings I just duplicated the crossing prefabs themselves and gave them different names. Then I wanted to change each crossings connection types through the prefab system but couldn't, that's where I got stuck.
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Which of the mentioned workflows do you use? Are road types added in Scene View with the road network object selected through General Settings > Road Types?

    I have tested different workflows, but I cannot recreate the situation where the road type dropdown is empty. What I did notice is that there are errors when opening a prefab in the prefab editor while no road network object exists in the current scene. That will be fixed, but it will not result in the screenshot you posted. In all other situations the road type dropdown does show the available road types. This is in v3.1.9f2.

    "Create New Connection Prefab" will be greyed out in two situations:

    1) The selected road shape is a custom road shape created through the Custom Prefab Editor window and the road shape has more then two nodes, this is unsupported in v3.1 for dynamic crossings.

    2) The button was just pressed, a Connection Prefab was just created. This is only for safety, after deselecting and reselecting the road type the button will be active again.

    Otherwise, which version do you use? Do you perhaps have the v3.2 beta or v3.3alpha imported?

    Crossing prefabs do not work exactly the same as Unity prefabs, for example sidewalks can be active on one instance, not on another instance. Duplicating prefabs manually in the project folder is there for not recommended but this does not result in road types not being displayed. I just tested that.

    Thanks,
    Raoul
     
  37. JonaOneview

    JonaOneview

    Joined:
    Nov 3, 2019
    Posts:
    11
    Thanks for trying to help Raoul,
    I tried starting over to see if I can replicate the problem of road types not appearing but It seems to work now. I will just have to accept the work lost in the process of learning to use EasyRoads :)
    Sorry I couldn't help you pinpoint the problem.
     
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi JonaOneview,

    The work lost, do you mean the manual duplication of prefabs? It would be better to that through that specific "Create New Connection Prefab" button, all prefabs will have unique ID's and also,m the road type will be assigned automatically.

    So this button is no longer greyed out on your end? Because this workflow is easier, the prefab creation from "General Settings > Crossing Connection Prefabs" will be removed in the next update. So it is good to know if there are issues with that button being always disabled.

    Thanks,
    Raoul
     
  39. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,834
    Index was out of range. Must be non-negative and less than the size of the collection.
    Parameter name: index

    I am trying to generate a road at runtime and i am getting the following error, it doesnt seem to happen in the editor only at runtime.
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi Aiursrage2k,

    Does that happen at runtime in the final build or also in play mode inside the editor? Could you give a little bit more information about the scene / road network setup and the code used to generate the roads?

    Thanks,
    Raoul
     
    Last edited: Jan 17, 2020
  41. Aiursrage2k

    Aiursrage2k

    Joined:
    Nov 1, 2009
    Posts:
    4,834
    No I was trying to get it to work out of the editor at runtime, i figured out a way around that seems to work.
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Glad to hear you got that working. Meanwhile I tested various setups based on the provided runtime example, but no errors are thrown. Please let me know it turns out you still run into issues.

    Thanks,
    Raoul
     
  43. DJ_JW

    DJ_JW

    Joined:
    Apr 26, 2015
    Posts:
    21
    I have been trying to get sidewalks come up on my roads in v3.1.9.f2 and cannot seem to get them to appear.
    I have tried adding a connector with sidewalks and the sidewalks appear on the connector but the road never updates to have sidewalks.
    I am using the following:
    NM_Asphalt_No_Lines_Damaged
    Asphalt_Lines_Damaged_ER_OX_Sidewalks_v2 (and tried the original too)

    Is there something else I need to do besides just adding the connectors?
    Is there a way to have sidewalks without the connectors... eg.. a straight road with sidewalks either side.

    Thanks in advance :)
     
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi DJ_JW,

    These assets are part of the HD Roads Add On package. The crossings in this package are based on imported meshes where sidewalks are already part of the crossing prefab. Matching sidewalks are added as side walks in this package. The Path Left and Path Right side objects in the Props tab. That is also how a straight road with sidewalks and without connectors can be made.

    Thanks,
    Raoul
     
  45. DJ_JW

    DJ_JW

    Joined:
    Apr 26, 2015
    Posts:
    21
    Hi @raoul
    Thanks for the speedy response.
    I am looking at the Props under side objects and only see:
    Lamppost Motorway
    Lampposts
    Road Marker Left
    Road Marker Right
    Traffic Cone

    This is with a fresh install of ER 3.1.9.f2 and the HD Roads this morning off the Asset Store
    Do I need to do anything else? I have created a new Road Network as well just in case and still only see those props.

    Thanks in advance.
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi DJ_JW,

    These are side objects part of the demo project. It appears the HD Roads presets are not yet added.

    After importing the HD Roads package or when selecting a road network the first time after importing this package can you remember seeing a popup notification saying that new presets were detected and asking if they should be imported?

    In any case, there are two ways to add these presets manually:

    1) Open the HD Roads demo scene: /Assets/NatureManufacture Assets/HD Roads/Demo/Demo
    Select the road network object in the hierarchy and deselect it. This will add all used road types and side objects to the project log

    2) Follow the 3rd video on the asset store page, at the start it shows how the road types and side objects are imported using the HD Roads Presets asset. Note that this "HD Roads Presets" asset is now located in the folder /Assets/NatureManufacture Assets/HD Roads/. After that these presets can be added in the current scene through resp. Add Project Road types and Add Project Side Objects in the same list of buttons



    The sidewalk side objects should now be visible in the Props tab.

    Thanks,
    Raoul
     
  47. DJ_JW

    DJ_JW

    Joined:
    Apr 26, 2015
    Posts:
    21
    Hi @raoul
    Thanks so much for your help.
    Option 2 worked for me by importing with the Presets.

    For reference, option 1 didn't work. I opened the Demo scene from Assets/NatureManufacture Assets/HD Roads/Demo and it asked to upgrade to 3.1 and when saying yes it says "failed" close this scene without saving, reopen and try again. Doesn't matter how many times I tried it failed each time.
    Unity 2019.3(latest as of today)
    HDRP (latest as of today).

    I am happy with Option 2 shown in the video so that is good enough for me.
    Once again, thanks :)
     
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi DJ_JW,

    So you cannot open the HD Roads demo scene at all? I just tested it, it opens with any messages, there is no notification regarding upgrading to v3.1 and when checking the scene status it is indeed v3.1 ready.

    Glad to hear you got the presets imported well anyway, but perhaps the demo scene opens after a project restart? Or, just in case, it is recommended to first import the EasyRoads3D Pro package and after that the HD Roads Add On.

    Thanks,
    Raoul
     
  49. JonaOneview

    JonaOneview

    Joined:
    Nov 3, 2019
    Posts:
    11
    Hey Raoul I have another question.
    I want to create new connection types like a 3 way Y shaped crossing or even a crossing with 5 or more connections. Is this possible? Because I did not find the proper way to do this.
     
  50. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    5,214
    Hi JonaOneview,

    Flexible built-in connectors 3 way Y shaped or with 5+ connections is coming in v3.3. Alpha versions are available

    https://easyroads3d.com/v3alpha.php

    This can also be done in the current version by importing modeled versions into the system.

    Thanks,
    Raoul
     
unityunity