Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

World Building EasyRoads3D v3 - the upcoming new road system

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

  1. Tactics_IT

    Tactics_IT

    Joined:
    Jul 29, 2010
    Posts:
    28
    Good evening Raoul.Since i updated to 6.8 i am unable to create functional custom crossings. I attempted to bring in a new crossing exactly how i have been in the past
    - open the "Custom Prefab Editor"
    -drag the model/ prefab into the Source Object
    - click "Build Connection Prefab"
    -add the connections one at a time (total of 4)
    crossingError_01.JPG
    - Next i click the third tab on the Road Network script.
    -i click the new intersection and add it to the scene. I am immediately presented with an error.
    crossingError_02.JPG
    - i have to then click on another non easyroads object and then back to easyroads. I now have the green nodes availible to me.
    -this is where the next error happen. I can drag new roads out from the green nodes, but all but one are upside down.
    crossingError_03.JPG
    We thought it might be an error in the model, but nothing we did fixed the issue.
    We then did the exact same thing using 6.7 and it worked flawless the first attempt.
    (picture of it in 6.7)
    crossingError_04.PNG

    I cannot continue on with the project using 6.8 (good thing i all ways backup before updating :rolleyes:)
     
  2. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    The crossing includes sidewalks which are not closed so it expects a road with sidewalks. The road does not have sidewalks.

    To solve this, select the crossing and click the green outer handles in the corner associated with this connection on both the left and right side. The sidewalks will close. Deselect the crossing, when you select the road marker the connection handle should be green and it should snap.

    Thanks,
    Raoul
     
  3. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    What exactly is the problem with this?

    These shortcuts indeed work similar as for ordinary Unity game objects. Yes, it will trigger the same mode for the main Road Network but this object is positioned at (0, 0, 0) so it is not very likely to interfere with the selected road marker or crossing prefab.

    Thanks,
    Raoul
     
  4. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721

    It is impossible to assign negative height values to the Unity terrain object, meaning, it cannot be deformed below its game objects Y position. Although it should not be possible to position markers below this Y value, the nature of spline curves can still cause the road to move below this Y position depending on the marker positions and the road curve. Red handles are displayed at these critical positions. It is recommended to check these areas in Build Mode and where necessary move markers / crossings slightly upwards.

    Optionally you can switch off the display of these red handles in General Settings > Scene Settings.

    Is the issue in your other post related to this? Because of the Offset shader the results are slightly different when zooming in/out, but when you for example use a standard shader it should clearly show when the road is below the terrain?

    Thanks.
    Raoul
     
  5. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    For example, the documentation says to press R for rotation. The key is actually E for rotation.
     
  6. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Exactly, as mentioned in the docs, always backup before importing a new beta ;)

    That said, does all this indeed work well in beta 6.7?

    The biggest change to the custom crossings system was made in 6.7. The changes in beta 6.8 are relatively small. For 6.7 we tested all the original custom prefabs in this new system and did not encounter issues.

    From what I see in the first screenshot, all looks good, the additional green handle is positioned inwards towards the center perpendicular to the connection. Is this also the case for the other connections?

    Anyway, I will check these models in 6.8 as well, hopefully I will run into the same issues.

    Thanks,
    Raoul
     
  7. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    It may be related. I don't know. Is this what you are talking about in this video? The roads are disappearing - going under ground.

    http://www.screencast.com/t/XC9cFnKAQ

    http://www.screencast.com/t/U4yfuVbeBk
     
  8. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Thank you for reporting this! Tthis is not correct it should say E. Try it in the scene. I will change that in the manual.

    Raoul
     
  9. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I see what you mean about not being able to connect because of the sidewalks. But here is an example where everything is w/o sidewalks and I still can't join.

    http://www.screencast.com/t/1VaTq9swcl
     
  10. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Yes, that is what I meant. You can prevent that by adding additional marker and gradually increase the distance. Although I am not sure if this is releveant for you since you use OSM data which usually results in the terrain heights being safely above the terrains Y value, another way to deal with this is flatten the terrain first at, for example, y = 100 and start sculpting the terrain from this height. This way there is always space to deform the terrain downards. This will also leave space for riverbeds which will need that.

    Thanks,
    Raoul
     
  11. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
  12. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Are these roads connected on the other end of the road? If so, to what type of connection? If not, can you give the exact steps to replicate this?

    Thanks,
    Raoul
     
  13. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    My terrain is the result of a heightmap generated my World/Terrain Composer. It isn't flat. It just looks that way because I have no satellite imagery for that area, so the images are just blank.
     
  14. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Yes, that is what I more or less wrote, I mentioned OSM, but I meant, you use real world data so your terrains are most likely above the terrains Y position.

    Thanks,
    Raoul
     
  15. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I am working of the OSM map. I have four roads that all end at the same point. I pull the four roads apart. I place in an x connection w/o sidewalks and try to connect the four roads. One connects, but the three others don't.

    In this video I deleted the road segment in between the two connections and I try to extend the one connection and connect to the other.

    http://www.screencast.com/t/kARtc1vnj3S
     
  16. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    In general the red dots should follow the road but when crossings are involved the direction of the red dots is sometimes wrong.I have to check that but I would say just have a look at that area near the crossing in general.

    Thanks,
    Raoul
     
  17. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    @raoul Thanks for all the help. I greatly appreciate it. I'm gonna take a break for the night and resume tomorrow.
     
  18. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Which beta are you using?

    Can you select both crossings and double check if all corner sidewalk handles are grey (disabled). In previous betas these handles are switched on when selecting the crossing in the hierarchy which is wrong. All appears the same, no actual sidewalks but the stored data is not correct. You can check that by selecting the crossing in the scene (not in the hierarchy), when the corner handles are green this is what may have happened.

    This issue is fixed in beta 6.8.

    If all this does look good perhaps you could send me the project (stripped down terrain and roads only if you want) if that is possible. All I see is a standard T-Crossing and an X-Crossing, both without sidewalks, that should connect just fine.

    How are you creating these crossings without sidewalks? Did you create new prefabs for this or are you doing this by using the default X and T crossing and disabling the sidewalks each time?

    Thanks,
    Raoul
     
  19. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    I was about to write the same :)

    Raoul
     
  20. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Actually, looking at the video again, initially the handle is green just like in one of the other videos you posted. It turns red when nearby. This happens when the road and crossing connection do match but the angle between the road and crossing is unrealistic. For example when you try to connect a road to a connection that will result in the road going through the crossing itself.

    Could you try that? Add an additional marker on the other end of the crossing and move back to that connection (if that makes sense)? If that indeed works (which shouldn't) then it would be very interesting to have a look at this, or I can send test builds outputting additional info.

    Thanks,
    Raoul
     
  21. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I think I understand what you meant. Here is a video.

    http://screencast.com/t/yF0oja8kCyU

    BTW I was using 6.7 Beta today. In the AM I am going to delete the road network. Upgrade to 6.8. Reimport the OSM data and start again with my new found knowledge.
     
  22. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Yes, that is what I meant, but the handle still turns red when nearby. regardless the angle. How often does this happen in this scene. Can you see a pattern?

    This type of issue can be debugged by preparing alpha builds outputting debug info. Or is it possible to send me a download link for this project?

    I am not sure if this is related but the white surfaces surrounding that specific road look just fine at the start of the road connected to the other crossing, when you are moving the marker over the other crossing these white surfaces stretch out a lot on the left, but it is difficult to see, and what is the big square white/grey surface in the middle? It looks like it is the white surface associated with the X crossing in the center but it is huge compared to the actual crossing.

    What is the size / heightmap resolution of your terrain(s)? And what are the Min Indent values in General Settings > Scene Settings?

    Thanks,
    Raoul
     
    Last edited: Aug 21, 2015
  23. Tactics_IT

    Tactics_IT

    Joined:
    Jul 29, 2010
    Posts:
    28
    one more thing i found out, if i drag the intersection the roads do not fallow it (i have included a stripped down texture less version of the intersection i have been using)

    This issue does not happen with the intersections I created in the previous version, but if i use those same models and create them in 6.8 the exact thing happens again.
     

    Attached Files:

  24. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi Matthew,

    Yes it is likely this will cause further issues if the connections doesn't attach well.

    Meanwhile I tested the custom prefabs part of the package. They all build well in 6.8 apart from the T crossing single lane/ dirt road prefab. It seems related to the generation of the white surfaces. I also noticed issues when the Minimum Indent value is reasonably high as a result of the terrain size/heightmap scale.

    Thank you for attaching the model. I will have a look it!

    Thanks,
    Raoul
     
  25. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    I think this has been resolved. What your model and the "T crossing single lane / dirt road" have in common is that at least one connection is flat, all connection vertices have the same Y value. This was not handled well in the new code.

    I will send you an update later today so you can try this. Meanwhile, to verify, you could try a model where all connections have for example a sidewalk. Or, just as a test, you could duplicate the model in your previous post and move the three middle vertices slightly upwards.

    Thanks,
    Raoul
     
  26. Tactics_IT

    Tactics_IT

    Joined:
    Jul 29, 2010
    Posts:
    28
    Thanks for the reply.
    I just tried creating one that included the curbs when assigning the road nodes. All but one of the roads worked when pulled out. I still got the error when adding it to the scene however, and the created roads don't follow the intersection when moved (most likely due to that error when adding it to the scene).

    Hopefully your patch you send later on will fix this. You can try the model change on your end with the FBX I included in that last .unitypackage and see if it fixes it for your testing.

    Thanks again.
    Matthew
     
  27. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    The fix solves the issue for both these two models without affecting the results for the other prefabs. Certainly for models like the one you attached you should already see if something is wrong after instantiating the prefab in the scene, the white surrounding surfaces do not look accurate.

    I will prepare a build and send it to you.

    Thanks,
    Raoul
     
  28. Tactics_IT

    Tactics_IT

    Joined:
    Jul 29, 2010
    Posts:
    28
    Excellent. Glad to hear the issue is fixed, looking forwards to the update. I will PM you a new email address that you don't have. The previous email address has been discontinued.
     
  29. Tactics_IT

    Tactics_IT

    Joined:
    Jul 29, 2010
    Posts:
    28
    Perfect!! The patch you sent fixes the issue i was having. Always glad to have someone that actually supports the product in a timely manner.
    Until my next issue :p have a good one
     
    hopeful likes this.
  30. raoul

    raoul

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

    Thanks,
    Raoul
     
  31. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    It happens often. I cannot find a pattern though.

    I took the day off to spend with my girlfriend. I will do my best to package things up for you tomorrow.[/QUOTE]

    Yes that is a big problem too. I wasn't worried about that right now as I figured it was user error. But it is a problem.



    If I am understanding Terrain Composer correctly, my heightmap is only 48x48. The min indent values is 36.70313.
     
  32. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Hi, just bought this yesterday and opening up the demo I can see the roads through the terrain. It is like the roads are drawing in front of terrain (where the view should be blocked by a hill) and even the trees. This is probably something super simple, maybe a layer or camera setting?

    Edit - This is EasyRoads3D v3 demo on Unity 5.1.1f1.
     
    Last edited: Aug 22, 2015
  33. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi Tinjaw,

    Since it is not possible to add detail points to the Unity terrain object, flattening the terrain must be done throught he available terrain points. That is why the Minimum Indent values are used.

    The Min Indent values are based on the terrains heightmapsscale (size vs heightmap resolution), 36 (as a result of the low heightmapscale) is very high and will indeed result in those big white surfaces. Furthermore, unless the terrain is almost flat, it will be hard to get good results with such a low heightmapscale. Unless you do not use the terrain deformation option and instead use detail terrain mesh overlays (matching the road shape) and snapping to the terrain object.

    I will do some tests with this kind of settings and see if I can recreate the issue, otherwise indeed a package or ideally a full project (stripped down to terrain and roads only if you want) would be very muc appreciated. On your end you may want to try a higher heightmapscale. For example, the default Unity terrain object uses a 513 heightmapscale, size 2000x2000.

    Thanks,
    Raoul
     
  34. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721

    Hi MIK3K,

    Is this indeed the v3 beta? Because what you describe sounds like the defautl v2 behaviour which uses a shader in Edit Mode that renders the roads on top of everything else. It is done to clearly visualize the road shape in hilly areas. This is only in Edit Mode and can be customized if you want. In Build Mode all should look normal.

    This shader is currently not used yet in the v3 beta so I wonder what this is. Which shader is used by the material attached to these roads?

    Thanks,
    Raoul
     
    MIK3K likes this.
  35. MIK3K

    MIK3K

    Joined:
    Sep 10, 2014
    Posts:
    144
    Oops, you are absolutely correct. I tried the free version of EasyRoads3D last week. The demo project does say v2.5.6 now that I look at it. I had version 3 in my head when I downloaded that v2 demo.

    Got a fresh v3 project and it looks great.

    I'm such a noob sometimes :/
     
  36. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Glad you sorted that out :), I thought perhaps you had v3 imported in a project with v2 already imported and materials got mixed up.

    Raoul
     
  37. zugsoft

    zugsoft

    Joined:
    Apr 23, 2014
    Posts:
    453
    hello, I bought you easyroad pro and I don't have the Menu, why?
    i use Unity 5.1.4

    I am making a Mobile game, and Terrain is not very powerfull on Mobile, I use directly a mesh instead of Terrain, I hope your EasyRoad product works great with mesh.
     
    Last edited: Aug 23, 2015
  38. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hello Menfou,

    The v2 menu (current asset store version) is located in GameObject > Create Other > EasyRoads3D

    The manual includes a Quick Getting Started section in the beginning with information like this.

    Also, this is the v3 beta thread, please send me an email or a PM if you like to try these betas.

    Thanks,
    Raoul
     
  39. Tinjaw

    Tinjaw

    Joined:
    Jan 9, 2014
    Posts:
    518
    I'm having an issue with roads not appearing on my terrain. I am wondering if there is some setting that I need to tweak to overcome this?

    http://screencast.com/t/7HxIkLh3z
     
  40. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi Tinjaw,

    Roads are created according the spline shape based on marker positions, depending of these marker positions and the nature of the terrain the roads can disappear below the terrain.

    But all this is Edit Mode related, the video you posted shows the road network in Edit Mode.

    Inspector middle (Mountan) tab > Build Terrains

    This will switch the road network to Build Mode, it will flatten the terrains according the road network. It is an essential part of the tool, it is mentioned in the manual and you will also see these steps in probably all demo videos.

    Addtionally to all this, your road network is based on OSM data, It is recommended to check the accuracy of this data especially in more hilly areas. Are markers positioned at important terrain height changes and do the roads generally follow the terrain contours? If not, the roads will cut probably the terrain unwantedly. Generally you would manually position markers at these terrain height changes.

    Alternatively, after selecting a road you will also see the option "Follow Terrain Contours" in the Inspector with additional controls. You may want to check that as well, it will adjust the road heights to the terrain heights..

    The other issue you posted here, the one with roads not connecting to crossings is fully resolved, is that correct?

    Thanks,

    Raou
     
    hopeful likes this.
  41. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Is it necessary to generate custom prefab meshes instead of using the original ones?
    It seems to remove tangents from the mesh and add vertex Colors.
     
  42. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Hi Carpre Denius,

    IT is not necessary but this is currently done to make sure the orientation is correct. When you drop a prefab in the scene Unity often auto applies rotation values. These rotation values are ignored when instantiating the object in the scene through code resulting in a wrong orientation.

    The code copies over all relevant Mesh info including vertex tangent and color info. I just checked and tangent info is actually updated when building the final road network and "Calculate Tangents" is toggled on. I could make this optional. Is that what you need?

    In what way is the vertex color info causing issues? I just checked, indeed when no color info is available it will assign info to avoid errors creating the mesh. This can be optimized further if this is indeed causing issues.

    Thanks,
    Raoul
     
  43. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Okay, it seems that the mesh is rotated, but the normals aren't.

    The vertex colors cause no issues. My materials are all to dark and I thought it was based on dark vertex colors.

    Edit: it seems that I have an old beta (6.6.1), but I can't find your email. Could you send it again? Sorry for the inconvenience...
     
  44. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Indeed in previous betas the normals do not look correct when the mesh is rotated. This needs some work regarding the original normals but in the lastest 6.8 beta you have the option "Recalculate Normals" which will fix this as well.

    In Unity 5 objects are rendered dark/black when using bumpmapping and no accurate tangent info is available. I just checked one of the custom prefabs part of the package and all looks fine after instantiating the prefab in the scene. What does this look like (in beta 6.1) after building the road network with "Calculate Road Tangents" toggle on? Is it still rendered dark?

    In any case, yes please always upgrade to the latest betas. I just resent the v3 beta email.

    Thanks,
    Raoul
     
  45. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    In 6.6.1 with "calculate road tangents" nothing chances. I will try it in 6.8 again, thank you.
     
  46. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    Are you using a bumped shader, if not than indeed it should not make a differences.

    The dark rendering can also be caused by the fact that the mesh is rotated while it still uses the same normals, the lighting is not correct. You can see that by rotating the prefab in the scene on the x/z axis.

    Thanks,
    Raoul
     
  47. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    Normals work now, I only have to remove vertex colors once now (I am using a shader with wetness and detail mask from vertex colors)

    If I create one bridge exit and one entrance and try to connect them, I get:
    NullReferenceException: Object reference not set to an instance of an object
    EasyRoads3Dv3Editor.OCCQQCDCQO.OCOOCDOQCQ ()
    EasyRoads3Dv3Editor.OCCQQCDCQO.OnSceneGUI ()

    If you create some more and try to connect them, the first street appears and the next street will remove the first one. Workaround: connect 2 connection prefabs, click on another object and back to easyroads, connect the next one. With that, both will stay.
     
  48. raoul

    raoul

    Joined:
    Jul 14, 2007
    Posts:
    6,721
    I will optimize this further and only add color info if already part of the source mesh.

    The example in the main demo scene using these bridge exit and entrance prefabs were made without any errors and without having to deselect the road network. I just tested this again:

    1. Add both an exit and entrance prefab in the scene
    2. Pull out a new road from the exit prefab and instantly connect it to the entrance prefab (both ways)

    The error message you posted does not appear.

    What are the exact steps to recreate this?

    Thanks,
    Raoul
     
  49. Carpe-Denius

    Carpe-Denius

    Joined:
    May 17, 2013
    Posts:
    842
    What you just did. empty scene, just one flat terrain.
    I did:
    - create road network
    - click on the intersection button
    - click on bridge entrance
    - shift-click on the terrain to create the entrance
    - click on bridge Exit
    - shift-click on the terrain to create the entrance
    - click and hold one of the green spheres
    - drag it to the other object

    After that, I get the error message I mentioned earlier, even if an empty project.
     
    Last edited: Aug 24, 2015
  50. kloogens

    kloogens

    Joined:
    Jul 1, 2015
    Posts:
    109
    Hey Raoul, is there any way to export the road networks side objects when you Export the Road Network Geometry?
    I made a tunnel side object and would like to construct a building to complement the entrance to the tunnel (side object).
    If I could export the side object with the road I could use a modeling program to make the building conform to the tunnel.

    Thanks

    Kloogens